|
From: Jon O. <jon...@us...> - 2007-04-28 19:58:03
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes
In directory sc8-pr-cvs16:/tmp/cvs-serv24835
Modified Files:
functions.php functions_pafiledb.php
Log Message:
fixes
Index: functions.php
===================================================================
RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** functions.php 25 Aug 2006 14:18:48 -0000 1.32
--- functions.php 28 Apr 2007 19:57:57 -0000 1.33
***************
*** 988,991 ****
--- 988,992 ----
default:
+ /* Bug 50
$sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username
FROM " . PA_FILES_TABLE . " AS f, " . PA_CATEGORY_TABLE . " AS cat
***************
*** 995,998 ****
--- 996,1007 ----
AND f.file_id = '" . $item_id . "'
GROUP BY f.file_id ";
+ */
+ $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username
+ FROM " . PA_FILES_TABLE . " AS f
+ LEFT JOIN " . PA_CATEGORY_TABLE . " AS cat ON cat.cat_id = f.file_catid
+ LEFT JOIN " . PA_VOTES_TABLE . " AS r ON f.file_id = r.votes_file
+ LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id
+ WHERE f.file_id = '" . $item_id . "'
+ GROUP BY f.file_id ";
break;
}
Index: functions_pafiledb.php
===================================================================
RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** functions_pafiledb.php 14 Sep 2006 20:08:49 -0000 1.44
--- functions_pafiledb.php 28 Apr 2007 19:57:58 -0000 1.45
***************
*** 145,149 ****
$this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id'] = $cat_rowset[$i]['comments_forum_id'] < 1 ? ( intval($pafiledb_config['comments_forum_id']) ) : ( intval($cat_rowset[$i]['comments_forum_id']) ); // phpBB target forum (only used for phpBB comments)
! if (!$this->comments[$cat_rowset[$i]['cat_id']]['internal_comments'] && intval($this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']) < 1)
{
mx_message_die(GENERAL_ERROR, 'Init Failure, phpBB comments with no target forum_id :( <br> Category: ' . $cat_rowset[$i]['cat_name'] . ' Forum_id: ' . $this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']);
--- 145,149 ----
$this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id'] = $cat_rowset[$i]['comments_forum_id'] < 1 ? ( intval($pafiledb_config['comments_forum_id']) ) : ( intval($cat_rowset[$i]['comments_forum_id']) ); // phpBB target forum (only used for phpBB comments)
! if ($this->comments[$cat_rowset[$i]['cat_id']]['activated'] && !$this->comments[$cat_rowset[$i]['cat_id']]['internal_comments'] && intval($this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']) < 1)
{
mx_message_die(GENERAL_ERROR, 'Init Failure, phpBB comments with no target forum_id :( <br> Category: ' . $cat_rowset[$i]['cat_name'] . ' Forum_id: ' . $this->comments[$cat_rowset[$i]['cat_id']]['comments_forum_id']);
|