|
From: FlorinCB <ory...@us...> - 2008-09-12 05:18:33
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9295/mx_smartor/album_mod/modules Modified Files: album_comment.php album_showpage.php Log Message: function get_username_string() Index: album_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_comment.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_comment.php 29 Aug 2008 05:58:23 -0000 1.5 --- album_comment.php 12 Sep 2008 05:17:57 -0000 1.6 *************** *** 249,260 **** $limit_sql = ($start == 0) ? $comments_per_page : $start .','. $comments_per_page; ! $sql = "SELECT c.*, u.user_id, u.username FROM ". ALBUM_COMMENT_TABLE ." AS c - LEFT JOIN ". USERS_TABLE ." AS u ON c.comment_user_id = u.user_id WHERE c.comment_pic_id = '$pic_id' ! ORDER BY c.comment_id $sort_order ! LIMIT $limit_sql"; ! if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not obtain comments information from the database', '', __LINE__, __FILE__, $sql); --- 249,258 ---- $limit_sql = ($start == 0) ? $comments_per_page : $start .','. $comments_per_page; ! $sql = "SELECT c.*, c.comment_username as username, c.comment_user_id as user_id FROM ". ALBUM_COMMENT_TABLE ." AS c WHERE c.comment_pic_id = '$pic_id' ! ORDER BY c.comment_id $sort_order"; ! if(!$result = $db->sql_querylimit($sql, $limit_sql)) { mx_message_die(GENERAL_ERROR, 'Could not obtain comments information from the database', '', __LINE__, __FILE__, $sql); *************** *** 281,291 **** if ($commentrow[$i]['comment_edit_count'] > 0) { ! $sql = "SELECT c.comment_id, c.comment_edit_user_id, u.user_id, u.username FROM ". ALBUM_COMMENT_TABLE ." AS c ! LEFT JOIN ". USERS_TABLE ." AS u ON c.comment_edit_user_id = u.user_id ! WHERE c.comment_id = '".$commentrow[$i]['comment_id']."' ! LIMIT 1"; ! if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not obtain last edit information from the database', '', __LINE__, __FILE__, $sql); --- 279,287 ---- if ($commentrow[$i]['comment_edit_count'] > 0) { ! $sql = "SELECT c.*, c.comment_username as username, c.comment_edit_user_id as user_id FROM ". ALBUM_COMMENT_TABLE ." AS c ! WHERE c.comment_id = '".$commentrow[$i]['comment_id']"'"; ! if( !$result = $db->sql_querylimit($sql, 1) ) { mx_message_die(GENERAL_ERROR, 'Could not obtain last edit information from the database', '', __LINE__, __FILE__, $sql); *************** *** 302,305 **** --- 298,306 ---- $edit_info = ''; } + + // Smilies + $commentrow[$i]['comment_text'] = $mx_bbcode->smilies_pass($commentrow[$i]['comment_text']); + $commentrow[$i]['comment_text'] = $mx_bbcode->make_clickable($commentrow[$i]['comment_text']); + $commentrow[$i]['comment_text'] = nl2br($commentrow[$i]['comment_text']); $template->assign_block_vars('commentrow', array( *************** *** 487,494 **** $comment_time = time(); ! $comment_user_id = $userdata['user_id']; ! $comment_user_ip = $userdata['session_ip']; // -------------------------------- // Get $comment_id --- 488,507 ---- $comment_time = time(); ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! case 'phpbb2': ! ! $comment_user_id= $userdata['user_id']; ! $comment_user_ip = $userdata['session_ip']; ! break; + case 'phpbb3': + $comment_user_id= $mx_user->data['user_id']; + $comment_user_ip = music_encode_ip($mx_user->data['session_ip']); + break; + } // -------------------------------- // Get $comment_id Index: album_showpage.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_showpage.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** album_showpage.php 29 Aug 2008 05:58:24 -0000 1.6 --- album_showpage.php 12 Sep 2008 05:17:58 -0000 1.7 *************** *** 767,774 **** $limit_sql = ($start == 0) ? $comments_per_page : $start .','. $comments_per_page; ! $sql = "SELECT c.*, u.* ! FROM ". ALBUM_COMMENT_TABLE ." AS c, ". USERS_TABLE ." AS u ! WHERE c.comment_user_id = u.user_id ! AND c.comment_pic_id = '$pic_id' ORDER BY c.comment_id $sort_order"; --- 767,773 ---- $limit_sql = ($start == 0) ? $comments_per_page : $start .','. $comments_per_page; ! $sql = "SELECT c.*, c.comment_username as username, c.comment_user_id as user_id ! FROM ". ALBUM_COMMENT_TABLE ." AS c ! WHERE c.comment_pic_id = '$pic_id' ORDER BY c.comment_id $sort_order"; *************** *** 810,816 **** if ($commentrow[$i]['comment_edit_count'] > 0) { ! $sql = "SELECT c.comment_id, c.comment_edit_user_id, u.* FROM ". ALBUM_COMMENT_TABLE ." AS c - LEFT JOIN ". USERS_TABLE ." AS u ON c.comment_edit_user_id = u.user_id WHERE c.comment_id = '".$commentrow[$i]['comment_id']."' LIMIT 1"; --- 809,814 ---- if ($commentrow[$i]['comment_edit_count'] > 0) { ! $sql = "SELECT c.*, c.comment_username as username, c.comment_edit_user_id as user_id FROM ". ALBUM_COMMENT_TABLE ." AS c WHERE c.comment_id = '".$commentrow[$i]['comment_id']."' LIMIT 1"; *************** *** 1308,1316 **** // Prepare variables // -------------------------------- switch (PORTAL_BACKEND) { case 'internal': ! ! $comment_time = time(); $comment_user_id = $mx_user->data['user_id']; $comment_user_ip = $mx_user->data['session_ip'];; --- 1306,1314 ---- // Prepare variables // -------------------------------- + $comment_time = time(); switch (PORTAL_BACKEND) { case 'internal': ! $comment_user_id = $mx_user->data['user_id']; $comment_user_ip = $mx_user->data['session_ip'];; *************** *** 1319,1323 **** case 'phpbb2': - $comment_time = time(); $comment_user_id = $userdata['user_id']; $comment_user_ip = $userdata['session_ip']; --- 1317,1320 ---- *************** *** 1325,1329 **** case 'phpbb3': ! $comment_time = time(); $comment_user_id = $mx_user->data['user_id']; $comment_user_ip = album_encode_ip($mx_user->data['session_ip']); --- 1322,1326 ---- case 'phpbb3': ! $comment_user_id = $mx_user->data['user_id']; $comment_user_ip = album_encode_ip($mx_user->data['session_ip']); *************** *** 1364,1368 **** // Fix by OryNider for smartor 2.0 Beta 2 // If user only rated, but didn't enter a comment... only update rating ! if ( $comment_text != '' ) { $sql = "INSERT INTO " . ALBUM_COMMENT_TABLE ." (comment_id, comment_pic_id, comment_cat_id, comment_user_id, comment_username, comment_user_ip, comment_time, comment_text) --- 1361,1365 ---- // Fix by OryNider for smartor 2.0 Beta 2 // If user only rated, but didn't enter a comment... only update rating ! if ($comment_text) { $sql = "INSERT INTO " . ALBUM_COMMENT_TABLE ." (comment_id, comment_pic_id, comment_cat_id, comment_user_id, comment_username, comment_user_ip, comment_time, comment_text) |