|
From: FlorinCB <ory...@us...> - 2008-08-29 05:59:00
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10881/album_mod/modules Modified Files: album_allpics.php album_cat.php album_cat_sort.php album_comment.php album_comment_edit.php album_hotornot.php album_modcp.php album_otf.php album_page.php album_rate.php album_search.php album_showpage.php album_upload.php Log Message: Upgrade Index: album_hotornot.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_hotornot.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_hotornot.php 13 Mar 2008 08:35:54 -0000 1.3 --- album_hotornot.php 29 Aug 2008 05:58:24 -0000 1.4 *************** *** 161,165 **** else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thispic['user_id']) .'">'. $thispic['username'] .'</a>'; } --- 161,165 ---- else { ! $poster = album_get_profile_url('full', $thispic['user_id'], $thispic['username'], false); } Index: album_showpage.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_showpage.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_showpage.php 13 Jul 2008 19:39:29 -0000 1.5 --- album_showpage.php 29 Aug 2008 05:58:24 -0000 1.6 *************** *** 16,64 **** } - if ( $mode == 'smilies' ) - { - include_once($phpbb_root_path . 'includes/functions_post.'.$phpEx); - - smartor_generate_smilies('window', PAGE_POSTING); - exit; - } - - include_once($phpbb_root_path . 'includes/functions_validate.'.$phpEx); - - - // - // Get general album information - // - if ( !defined('ALBUM_MOD_PATH') ) - { - define('ALBUM_MOD_PATH', 'album_mod/'); - } - if (!isset($album_root_path) || empty($album_root_path)) - { - $album_root_path = $module_root_path . ALBUM_MOD_PATH . ''; - } ! if ( defined('IS_PHPBBXS') ) ! { ! include_once($phpbb_root_path . 'includes/functions_color_groups.' . $phpEx); ! include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); ! ! if ( isset($_POST['message']) ) ! { ! $_POST['comment'] = $_POST['message']; ! } ! } ! else ! { ! if ($album_config['album_bbcode'] == 1) ! { ! include_once($album_root_path . 'includes/album_bbcode.' . $phpEx); ! } ! } ! ! if( !function_exists('smilies_pass')) { ! include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); } --- 16,24 ---- } ! if ($album_config['album_bbcode'] == 1) { ! include_once($album_root_path . 'includes/album_bbcode.' . $phpEx); } *************** *** 74,87 **** if( isset($_GET['mode']) && $_GET['mode'] == 'smilies' ) { ! if ( defined('IS_PHPBBXS') ) ! { ! generate_smilies('window', PAGE_ALBUM_PICTURE); ! exit; ! } ! else ! { ! generate_smilies_album('window', PAGE_ALBUM_PICTURE); ! exit; ! } } --- 34,39 ---- if( isset($_GET['mode']) && $_GET['mode'] == 'smilies' ) { ! generate_smilies_album('window', PAGE_ALBUM_PICTURE); ! exit; } *************** *** 605,609 **** // ------------------------------------ ! $sql = "SELECT p.*, u.user_id, u.username, u.user_rank, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(c.comment_id) AS comments_count FROM ". ALBUM_TABLE ." AS p LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id --- 557,561 ---- // ------------------------------------ ! $sql = "SELECT p.*, u.*, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(c.comment_id) AS comments_count FROM ". ALBUM_TABLE ." AS p LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id *************** *** 623,627 **** $total_comments = $thispic['comments_count']; ! $comments_per_page = $board_config['posts_per_page']; if( empty($thispic) ) --- 575,592 ---- $total_comments = $thispic['comments_count']; ! ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! $comments_per_page = 5; ! ! break; ! ! case 'phpbb2': ! case 'phpbb3': ! $comments_per_page = $board_config['posts_per_page']; ! ! break; ! } if( empty($thispic) ) *************** *** 751,758 **** WHERE comment_pic_id = $pic_id AND comment_id < $comment_id"; ! if( !$result = $db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain comments information from the database', '', __LINE__, __FILE__, $sql); } --- 716,723 ---- WHERE comment_pic_id = $pic_id AND comment_id < $comment_id"; ! if( !$result = $db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, "Could not obtain comments information from the database", "", __LINE__, __FILE__, $sql); } *************** *** 775,779 **** case 'ASC': $sort_order = 'ASC'; ! break; default: $sort_order = 'DESC'; --- 740,744 ---- case 'ASC': $sort_order = 'ASC'; ! break; default: $sort_order = 'DESC'; *************** *** 786,790 **** case 'ASC': $sort_order = 'ASC'; ! break; default: $sort_order = 'DESC'; --- 751,755 ---- case 'ASC': $sort_order = 'ASC'; ! break; default: $sort_order = 'DESC'; *************** *** 802,817 **** $limit_sql = ($start == 0) ? $comments_per_page : $start .','. $comments_per_page; ! $sql = "SELECT c.*, u.user_id, u.username, u.user_regdate, u.user_posts, u.user_allowavatar, u.user_rank, u.user_avatar, u.user_avatar_type, u.user_email, u.user_icq, u.user_website, u.user_from, u.user_aim, u.user_yim, u.user_msnm ! 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); } ! $commentrow = array(); --- 767,781 ---- $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"; ! if( !$result = $db->sql_query_limit($sql, $limit_sql) ) { mx_message_die(GENERAL_ERROR, 'Could not obtain comments information from the database', '', __LINE__, __FILE__, $sql); } ! $commentrow = array(); *************** *** 823,838 **** for ($i = 0; $i < count($commentrow); $i++) { ! if( ($commentrow[$i]['user_id'] == ALBUM_GUEST) or ($commentrow[$i]['username'] == '') ) ! { ! $poster = ($commentrow[$i]['comment_username'] == '') ? $lang['Guest'] : $commentrow[$i]['comment_username']; ! } ! else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.php?mode=viewprofile&". POST_USERS_URL .'='. $commentrow[$i]['user_id']) .'">'. $commentrow[$i]['username'] .'</a>'; ! } 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 --- 787,814 ---- for ($i = 0; $i < count($commentrow); $i++) { ! ! $poster = album_get_profile_url('full', $commentrow[$i]['user_id'], $commentrow[$i]['username'], false); ! ! switch (PORTAL_BACKEND) { ! case 'internal': ! ! $user_allowavatar = false; ! break; ! ! case 'phpbb2': ! ! $user_allowavatar = $commentrow[$i]['user_allowavatar']; ! break; ! ! case 'phpbb3': ! ! $user_allowavatar = ($board_config['allow_avatar_upload'] && file_exists($phpbb_root_path . $board_config['avatar_path']) && @is_writable($phpbb_root_path . $board_config['avatar_path']) && $phpbb_auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; ! break; ! } 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 *************** *** 849,853 **** $edit_info = ($commentrow[$i]['comment_edit_count'] == 1) ? $lang['Edited_time_total'] : $lang['Edited_times_total']; ! $edit_info = '<br /><br />» '. sprintf($edit_info, $lastedit_row['username'], create_date2($board_config['default_dateformat'], $commentrow[$i]['comment_edit_time'], $board_config['board_timezone']), $commentrow[$i]['comment_edit_count']) .'<br />'; } else --- 825,829 ---- $edit_info = ($commentrow[$i]['comment_edit_count'] == 1) ? $lang['Edited_time_total'] : $lang['Edited_times_total']; ! $edit_info = '<br /><br />» '. sprintf($edit_info, $lastedit_row['username'], album_create_date($board_config['default_dateformat'], $commentrow[$i]['comment_edit_time'], $board_config['board_timezone']), $commentrow[$i]['comment_edit_count']) .'<br />'; } else *************** *** 858,932 **** // Smilies $commentrow[$i]['comment_text'] = $mx_bbcode->smilies_pass($commentrow[$i]['comment_text']); ! $commentrow[$i]['comment_text'] = make_clickable($commentrow[$i]['comment_text']); $commentrow[$i]['comment_text'] = nl2br($commentrow[$i]['comment_text']); //email, profile, pm links ! $email_uri = ( $board_config['board_email_form'] ) ? mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $commentrow[$i]['user_id']) : 'mailto:' . $commentrow[$i]['user_email']; ! $profile_url = mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $commentrow[$i]['user_id'] ); ! $pm_url = mx_append_sid($phpbb_root_path ."privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $commentrow[$i]['user_id']); //avatar $poster_avatar = ''; ! if ( $commentrow[$i]['user_avatar_type'] && $commentrow[$i]['user_id'] != ANONYMOUS && $commentrow[$i]['user_allowavatar'] ) { switch( $commentrow[$i]['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: ! $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $phpbb_root_path .$board_config['avatar_path'] . '/' . $commentrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; ! break; case USER_AVATAR_REMOTE: $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' .$commentrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; ! break; case USER_AVATAR_GALLERY: $poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $phpbb_root_path .$board_config['avatar_gallery_path'] . '/' . $commentrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; ! break; } } ! //rank & rank image ! $sql = "SELECT * ! FROM " . RANKS_TABLE . " ! ORDER BY rank_special, rank_min"; ! if ( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql); ! } ! ! $ranksrow = array(); ! while ( $row = $db->sql_fetchrow($result) ) { ! $ranksrow[] = $row; ! } ! $db->sql_freeresult($result); $poster_rank = ''; $rank_image = ''; ! if ($commentrow[$i]['user_id'] == ANONYMOUS) ! { ! $poster_rank = $lang['Guest']; ! } ! else if ( $commentrow[$i]['user_rank'] ) ! { ! for($j = 0; $j < count($ranksrow); $j++) { ! if ( $commentrow[$i]['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] ) { ! $poster_rank = $ranksrow[$j]['rank_title']; ! $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $phpbb_root_path .$ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : ''; } } ! } ! else ! { ! for($j = 0; $j < count($ranksrow); $j++) { ! if ( $commentrow[$i]['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] ) { ! $poster_rank = $ranksrow[$j]['rank_title']; ! $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $phpbb_root_path . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : ''; } } } ! // // Handle anon users posting with usernames --- 834,935 ---- // 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']); //email, profile, pm links ! $profile_url = album_get_profile_url('profile', $commentrow[$i]['comment_user_id'], false, false); ! $email_uri = ( $board_config['board_email_form'] ) ? mx_append_sid($profile_url ."&mode=email") : 'mailto:' . $commentrow[$i]['user_email']; ! ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $pm_url = mx_append_sid($phpbb_root_path ."privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $commentrow[$i]['user_id']); ! break; ! ! case 'phpbb3': ! $pm_url = mx_append_sid($phpbb_root_path ."ucp.$phpEx?i=pm&mode=compose&u=" . $commentrow[$i]['user_id']); ! break; ! } ! //avatar $poster_avatar = ''; ! if ( $commentrow[$i]['user_avatar_type'] && $commentrow[$i]['user_id'] != ANONYMOUS && $user_allowavatar ) { switch( $commentrow[$i]['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: ! $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $phpbb_root_path . $board_config['avatar_path'] . '/' . $commentrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; ! break; case USER_AVATAR_REMOTE: $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' .$commentrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; ! break; case USER_AVATAR_GALLERY: $poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $phpbb_root_path .$board_config['avatar_gallery_path'] . '/' . $commentrow[$i]['user_avatar'] . '" alt="" border="0" />' : ''; ! break; } } ! switch (PORTAL_BACKEND) { ! case 'internal': ! ! $ranksrow = ''; ! break; ! ! case 'phpbb2': ! case 'phpbb3': ! ! //rank & rank image ! $sql = "SELECT * ! FROM " . RANKS_TABLE . " ! ORDER BY rank_special, rank_min"; ! if ( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql); ! } ! $ranksrow = array(); ! ! while ( $row = $db->sql_fetchrow($result) ) ! { ! $ranksrow[] = $row; ! } ! $db->sql_freeresult($result); ! break; ! } $poster_rank = ''; $rank_image = ''; ! if (PORTAL_BACKEND !== 'internal') ! { ! if ($commentrow[$i]['user_id'] == ANONYMOUS) { ! $poster_rank = $lang['Guest']; ! } ! else if ( $commentrow[$i]['user_rank'] ) ! { ! for($j = 0; $j < count($ranksrow); $j++) { ! if ( $commentrow[$i]['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] ) ! { ! $poster_rank = $ranksrow[$j]['rank_title']; ! $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $phpbb_root_path .$ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : ''; ! } } } ! else { ! for($j = 0; $j < count($ranksrow); $j++) { ! if ( $commentrow[$i]['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] ) ! { ! $poster_rank = $ranksrow[$j]['rank_title']; ! $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $phpbb_root_path . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : ''; ! } } } } ! // // Handle anon users posting with usernames *************** *** 941,950 **** 'ID' => $commentrow[$i]['comment_id'], 'POSTER_NAME' => $poster, ! 'TIME' => create_date2($board_config['default_dateformat'], $commentrow[$i]['comment_time'], $board_config['board_timezone']), ! 'IP' => ($userdata['user_level'] == ADMIN) ? 'http://whois.domaintools.com/' . decode_ip2($commentrow[$i]['comment_user_ip']) . '" target="_blank">' . decode_ip2($commentrow[$i]['comment_user_ip']) .'</a><br />' : '', //users mesangers, website, email ! 'PROFILE_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . $phpbb_root_path .$profile_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>' : '', ! 'PM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . $phpbb_root_path .$pm_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>' : '', 'AIM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_aim'] ) ? '<a href="aim:goim?screenname=' . $commentrow[$i]['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '' : '', 'YIM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $commentrow[$i]['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '' : '', --- 944,953 ---- 'ID' => $commentrow[$i]['comment_id'], 'POSTER_NAME' => $poster, ! 'TIME' => album_create_date($board_config['default_dateformat'], $commentrow[$i]['comment_time'], $board_config['board_timezone']), ! 'IP' => ($userdata['user_level'] == ADMIN) ? '<a href="http://whois.domaintools.com/' . album_decode_ip($commentrow[$i]['comment_user_ip']) . '" target="_blank">' . album_decode_ip($commentrow[$i]['comment_user_ip']) .'</a><br />' : '', //users mesangers, website, email ! 'PROFILE_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . $profile_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>' : '', ! 'PM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . $pm_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>' : '', 'AIM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_aim'] ) ? '<a href="aim:goim?screenname=' . $commentrow[$i]['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '' : '', 'YIM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $commentrow[$i]['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '' : '', *************** *** 957,965 **** 'POSTER_RANK' => $poster_rank, 'POSTER_RANK_IMGAGE' => $phpbb_root_path .$rank_image, ! 'POSTER_JOINED' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . create_date2($lang['DATE_FORMAT'], $commentrow[$i]['user_regdate'], $board_config['board_timezone']) : '', 'POSTER_POSTS' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $commentrow[$i]['user_posts'] : '', 'POSTER_FROM' => ( $commentrow[$i]['user_from'] && $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $commentrow[$i]['user_from'] : '', 'TEXT' => $commentrow[$i]['comment_text'], 'EDIT_INFO' => $edit_info, --- 960,969 ---- 'POSTER_RANK' => $poster_rank, 'POSTER_RANK_IMGAGE' => $phpbb_root_path .$rank_image, ! 'POSTER_JOINED' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . album_create_date($lang['DATE_FORMAT'], $commentrow[$i]['user_regdate'], $board_config['board_timezone']) : '', 'POSTER_POSTS' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $commentrow[$i]['user_posts'] : '', 'POSTER_FROM' => ( $commentrow[$i]['user_from'] && $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $commentrow[$i]['user_from'] : '', + 'TEXT' => $commentrow[$i]['comment_text'], 'EDIT_INFO' => $edit_info, *************** *** 979,985 **** ) ); $template->assign_block_vars('coment_switcharo_bottom', array()); } ! // // Start output of page --- 983,990 ---- ) ); + $template->assign_block_vars('coment_switcharo_bottom', array()); } ! // // Start output of page *************** *** 1002,1006 **** else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thispic['user_id']) .'">'. $thispic['username'] .'</a>'; } --- 1007,1011 ---- else { ! $poster = album_get_profile_url('full', $thispic['user_id'], $thispic['username'], false); } *************** *** 1018,1054 **** } ! $image_rating = ImageRating($thispic['rating']); ! ! //begin shows smilies ! $max_smilies = 20; ! ! $sql = 'SELECT emoticon, code, smile_url ! FROM ' . SMILIES_TABLE . ' ! GROUP BY smile_url ! ORDER BY smilies_id LIMIT ' . $max_smilies; ! ! if (!$result = $db->sql_query($sql)) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't retrieve smilies list", '', __LINE__, __FILE__, $sql); ! } ! $smilies_count = $db->sql_numrows($result); ! $smilies_data = $db->sql_fetchrowset($result); ! ! if ($auth_data['comment'] == 1) ! { ! for ($i = 1; $i < $smilies_count+1; $i++) ! { ! $template->assign_block_vars('switch_comment_post.smilies', array( ! 'CODE' => $smilies_data[$i - 1]['code'], ! 'URL' => $phpbb_root_path . $board_config['smilies_path'] . '/' . $smilies_data[$i - 1]['smile_url'], ! 'DESC' => $smilies_data[$i - 1]['emoticon'] ! )); ! if ( is_integer($i / 5) ) ! { ! $template->assign_block_vars('switch_comment_post.smilies.new_col', array()); ! } ! } ! } // -------------------------------- --- 1023,1031 ---- } ! $image_rating = ImageRating($thispic['rating']); ! ! album_comment_sql_smilies($auth_data['comment']); ! // -------------------------------- *************** *** 1200,1204 **** 'POSTER' => $poster, ! 'PIC_TIME' => create_date2($board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone']), 'PIC_VIEW' => $thispic['pic_view_count'], 'PIC_COMMENTS' => $total_comments, --- 1177,1181 ---- 'POSTER' => $poster, ! 'PIC_TIME' => album_create_date($board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone']), 'PIC_VIEW' => $thispic['pic_view_count'], 'PIC_COMMENTS' => $total_comments, *************** *** 1331,1340 **** // Prepare variables // -------------------------------- ! $comment_time = time(); ! $comment_user_id = $userdata['user_id']; ! $comment_user_ip = $userdata['session_ip']; ! // -------------------------------- // Get $comment_id --- 1308,1334 ---- // 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'];; + break; + + case 'phpbb2': ! $comment_time = time(); ! $comment_user_id = $userdata['user_id']; ! $comment_user_ip = $userdata['session_ip']; ! break; + case 'phpbb3': + $comment_time = time(); + $comment_user_id = $mx_user->data['user_id']; + $comment_user_ip = album_encode_ip($mx_user->data['session_ip']); + break; + } + // -------------------------------- // Get $comment_id *************** *** 1376,1380 **** if( !$result = $db->sql_query($sql) ) { ! message_die(GENERAL_ERROR, 'Could not insert new entry', '', __LINE__, __FILE__, $sql); } } --- 1370,1374 ---- if( !$result = $db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not insert new entry', '', __LINE__, __FILE__, $sql); } } *************** *** 1389,1394 **** } ! $rate_user_id = $userdata['user_id']; ! $rate_user_ip = $userdata['session_ip']; $sql = "INSERT INTO ". ALBUM_RATE_TABLE ." (rate_pic_id, rate_user_id, rate_user_ip, rate_point) --- 1383,1406 ---- } ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! $rate_user_id = $mx_user->data['user_id']; ! $rate_user_ip = $mx_user->data['session_ip'];; ! break; ! ! case 'phpbb2': ! ! $rate_user_id = $userdata['user_id']; ! $rate_user_ip = $userdata['session_ip']; ! break; ! ! case 'phpbb3': ! ! $rate_user_id = $mx_user->data['user_id']; ! $rate_user_ip = album_encode_ip($mx_user->data['session_ip']); ! break; ! } $sql = "INSERT INTO ". ALBUM_RATE_TABLE ." (rate_pic_id, rate_user_id, rate_user_ip, rate_point) Index: album_allpics.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_allpics.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_allpics.php 27 Mar 2008 14:31:06 -0000 1.3 --- album_allpics.php 29 Aug 2008 05:58:23 -0000 1.4 *************** *** 24,45 **** } - $phpEx = substr(strrchr(__FILE__, '.'), 1); - include_once($mx_root_path . 'common.'.$phpEx); - - include($phpbb_root_path . 'includes/functions_validate.'.$phpEx); - - // Start session management - $mx_user->init($user_ip, PAGE_INDEX); - // End session management - - define('ALBUM_MOD_PATH', 'album_mod/'); - - // Get general album information - if (!isset($album_root_path) || empty($album_root_path)) - { - $album_root_path = $module_root_path . ALBUM_MOD_PATH . ''; - } - - include_once($album_root_path . 'album_common.'.$phpEx); if (isset ($_POST['mode'])) --- 24,27 ---- *************** *** 461,465 **** 'U_PIC_CAT' => $image_cat_url, ! 'TIME' => create_date2($board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $picrow[$j]['pic_view_count'], --- 443,447 ---- 'U_PIC_CAT' => $image_cat_url, ! 'TIME' => album_create_date($board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $picrow[$j]['pic_view_count'], *************** *** 479,483 **** 'MOVE' => ($userdata['user_level'] == ADMIN) ? '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_modcp" . '&mode=move&pic_id=' . $picrow[$j]['pic_id'])) . '">' . $lang['Move'] . '</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . decode_ip2($picrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($picrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); --- 461,465 ---- 'MOVE' => ($userdata['user_level'] == ADMIN) ? '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_modcp" . '&mode=move&pic_id=' . $picrow[$j]['pic_id'])) . '">' . $lang['Move'] . '</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . album_decode_ip($picrow[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($picrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); Index: album_comment_edit.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_comment_edit.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_comment_edit.php 13 Mar 2008 08:35:54 -0000 1.3 --- album_comment_edit.php 29 Aug 2008 05:58:24 -0000 1.4 *************** *** 202,206 **** else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thispic['user_id']) .'">'. $thispic['username'] .'</a>'; } --- 202,206 ---- else { ! $poster = album_get_profile_url('full', $thispic['user_id'], $thispic['username'], false); } *************** *** 223,255 **** $image_rating = ImageRating($thispic['rating']); ! //begin shows smilies ! $max_smilies = 20; ! ! $sql = 'SELECT emoticon, code, smile_url ! FROM ' . SMILIES_TABLE . ' ! GROUP BY smile_url ! ORDER BY smilies_id LIMIT ' . $max_smilies; ! ! if (!$result = $db->sql_query($sql)) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't retrieve smilies list", '', __LINE__, __FILE__, $sql); ! } ! $smilies_count = $db->sql_numrows($result); ! $smilies_data = $db->sql_fetchrowset($result); - - for ($i = 1; $i < $smilies_count+1; $i++) - { - $template->assign_block_vars('switch_comment_post.smilies', array( - 'CODE' => $smilies_data[$i - 1]['code'], - 'URL' => $phpbb_root_path . $board_config['smilies_path'] . '/' . $smilies_data[$i - 1]['smile_url'], - 'DESC' => $smilies_data[$i - 1]['emoticon'] - )); - - if ( is_integer($i / 5) ) - $template->assign_block_vars('switch_comment_post.smilies.new_col', array()); - - } - $template->assign_vars(array( 'CAT_TITLE' => $thiscat['cat_title'], --- 223,229 ---- $image_rating = ImageRating($thispic['rating']); ! ! album_comment_sql_smilies(true); $template->assign_vars(array( 'CAT_TITLE' => $thiscat['cat_title'], *************** *** 262,266 **** 'PIC_DESC' => nl2br($thispic['pic_desc']), 'POSTER' => $poster, ! 'PIC_TIME' => create_date($board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone']), 'PIC_VIEW' => $thispic['pic_view_count'], 'PIC_COMMENTS' => $total_comments, --- 236,240 ---- 'PIC_DESC' => nl2br($thispic['pic_desc']), 'POSTER' => $poster, ! 'PIC_TIME' => album_create_date($board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone']), 'PIC_VIEW' => $thispic['pic_view_count'], 'PIC_COMMENTS' => $total_comments, Index: album_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_cat.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_cat.php 27 Mar 2008 14:31:07 -0000 1.4 --- album_cat.php 29 Aug 2008 05:58:23 -0000 1.5 *************** *** 241,248 **** if ($thiscat['cat_moderator_groups'] != '') { // Get the namelist of moderator usergroups ! $sql = "SELECT group_id, group_name, group_type, group_single_user FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> 1 AND group_type <> ". GROUP_HIDDEN ." AND group_id IN (". $thiscat['cat_moderator_groups'] .") --- 241,260 ---- if ($thiscat['cat_moderator_groups'] != '') { + switch (PORTAL_BACKEND) + { + case 'internal': + case 'phpbb2': + $sql_where = 'group_single_user <> " . true . "'; + break; + + case 'phpbb3': + $sql_where = 'group_id <> " . true . "'; + break; + } + // Get the namelist of moderator usergroups ! $sql = "SELECT * FROM " . GROUPS_TABLE . " ! WHERE " . $sql_where . " AND group_type <> ". GROUP_HIDDEN ." AND group_id IN (". $thiscat['cat_moderator_groups'] .") Index: album_modcp.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_modcp.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_modcp.php 10 Jul 2008 22:23:51 -0000 1.4 --- album_modcp.php 29 Aug 2008 05:58:24 -0000 1.5 *************** *** 344,348 **** else { ! $pic_poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $picrow[$i]['user_id']) .'">'. $picrow[$i]['username'] .'</a>'; } --- 344,348 ---- else { ! $pic_poster = album_get_profile_url('full', $picrow[$j]['user_id'], $picrow[$j]['username'], false); } Index: album_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_upload.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_upload.php 13 Mar 2008 08:35:59 -0000 1.3 --- album_upload.php 29 Aug 2008 05:58:24 -0000 1.4 *************** *** 342,349 **** // $page_title = $lang['Album']; ! if ( !$is_block ) ! { ! include($mx_root_path . 'includes/page_header.'.$phpEx); ! } --- 342,350 ---- // $page_title = $lang['Album']; ! ! if ( !$is_block ) ! { ! include($mx_root_path . 'includes/page_header.'.$phpEx); ! } *************** *** 480,486 **** if ( !$is_block ) ! { ! include($mx_root_path . 'includes/page_tail.'.$phpEx); ! } } --- 481,487 ---- if ( !$is_block ) ! { ! include($mx_root_path . 'includes/page_tail.'.$phpEx); ! } } Index: album_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_search.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_search.php 13 Mar 2008 08:35:58 -0000 1.3 --- album_search.php 29 Aug 2008 05:58:24 -0000 1.4 *************** *** 188,192 **** $template->assign_block_vars('switch_search_results.search_results', array( 'L_USERNAME' => $row['pic_username'], ! 'U_PROFILE' => mx_append_sid($phpbb_root_path . 'profile.' . $phpEx . '?mode=viewprofile&u=' . $row['pic_user_id']), 'L_CAT' => ($row['cat_user_id'] != ALBUM_PUBLIC_GALLERY ) ? $lang['Users_Personal_Galleries'] : $row['cat_title'], --- 188,192 ---- $template->assign_block_vars('switch_search_results.search_results', array( 'L_USERNAME' => $row['pic_username'], ! 'U_PROFILE' => mx_append_sid(album_get_profile_url('profile', $row['pic_user_id'], false, false)), 'L_CAT' => ($row['cat_user_id'] != ALBUM_PUBLIC_GALLERY ) ? $lang['Users_Personal_Galleries'] : $row['cat_title'], Index: album_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_comment.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_comment.php 27 Mar 2008 14:31:09 -0000 1.4 --- album_comment.php 29 Aug 2008 05:58:23 -0000 1.5 *************** *** 15,19 **** } - include($phpbb_root_path . 'includes/functions_validate.'.$phpEx); // ------------------------------------ --- 15,18 ---- *************** *** 277,281 **** else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $commentrow[$i]['user_id']) .'">'. $commentrow[$i]['username'] .'</a>'; } --- 276,280 ---- else { ! $poster = album_get_profile_url('full', $commentrow[$i]['user_id'], $commentrow[$i]['username'], false); } *************** *** 349,353 **** else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thispic['user_id']) .'">'. $thispic['username'] .'</a>'; } --- 348,352 ---- else { ! $poster = album_get_profile_url('full', $thispic['user_id'], $thispic['username'], false); } Index: album_page.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_page.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_page.php 13 Mar 2008 08:35:56 -0000 1.3 --- album_page.php 29 Aug 2008 05:58:24 -0000 1.4 *************** *** 215,219 **** else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thispic['user_id']) .'">'. $thispic['username'] .'</a>'; } --- 215,219 ---- else { ! $poster = album_get_profile_url('full', $thispic['user_id'], $thispic['username'], false); } Index: album_rate.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_rate.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_rate.php 13 Mar 2008 08:35:57 -0000 1.3 --- album_rate.php 29 Aug 2008 05:58:24 -0000 1.4 *************** *** 197,201 **** else { ! $poster = '<a href="'. mx_append_sid($phpbb_root_path ."profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thispic['user_id']) .'">'. $thispic['username'] .'</a>'; } --- 197,201 ---- else { ! $poster = album_get_profile_url('full', $thispic['user_id'], $thispic['username'], false); } Index: album_otf.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_otf.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** album_otf.php 13 Mar 2008 08:35:56 -0000 1.3 --- album_otf.php 29 Aug 2008 05:58:24 -0000 1.4 *************** *** 21,77 **** } - if( !$is_block) - { - if( empty($mx_root_path)) - { - $module_root_path = '../'; - $mx_root_path = $module_root_path . '../../'; - } - } - - - $phpEx = substr(strrchr(__FILE__, '.'), 1); - include_once($mx_root_path . 'common.'.$phpEx); - - include($phpbb_root_path . 'includes/functions_validate.'.$phpEx); - - // Start session management - // $mx_user->init($user_ip, PAGE_INDEX); - - /* - if ( !$userdata['session_logged_in'] ) - { - mx_redirect(mx_append_sid($mx_root_path . "login.php?redirect=" . this_smartor_mxurl("smartor_mode=album_otf"), true)); - } - */ - - /* - if ( !($userdata['user_level'] == ADMIN) ) - { - mx_message_die(GENERAL_MESSAGE, $lang['Not_admin']); - } - */ - // End session management - - define('ALBUM_MOD_PATH', 'album_mod/'); - - // Get general album information - if (!isset($album_root_path) || empty($album_root_path)) - { - $album_root_path = $module_root_path . ALBUM_MOD_PATH . ''; - } - - include_once($album_root_path . 'album_common.'.$phpEx); - // ********************************************************************** // Read admin language definition // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { ! include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); } else { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); } --- 21,34 ---- } // ********************************************************************** // Read admin language definition // ********************************************************************** ! if ( !file_exists($album_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) ) { ! include($album_root_path . 'language/lang_english/lang_admin.' . $phpEx); } else { ! include($album_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); } Index: album_cat_sort.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_cat_sort.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_cat_sort.php 27 Mar 2008 14:31:07 -0000 1.4 --- album_cat_sort.php 29 Aug 2008 05:58:23 -0000 1.5 *************** *** 47,51 **** else { ! message_die(GENERAL_ERROR, 'No categories specified'); } // --- 47,51 ---- else { ! mx_message_die(GENERAL_ERROR, 'No categories specified'); } // *************** *** 119,123 **** if( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } --- 119,123 ---- if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } *************** *** 148,152 **** { $return_url = this_smartor_mxurl('smartor_mode=album_cat&cat_id=$cat_id&sort_method=$sort_method&sort_order=$sort_order&initial=all'); ! message_die(GENERAL_MESSAGE, $lang['Category_empty'] . '<meta http-equiv="refresh" content="3; url='. $return_url .'">' ); } --- 148,152 ---- { $return_url = this_smartor_mxurl('smartor_mode=album_cat&cat_id=$cat_id&sort_method=$sort_method&sort_order=$sort_order&initial=all'); ! mx_message_die(GENERAL_MESSAGE, $lang['Category_empty'] . '<meta http-equiv="refresh" content="3; url='. $return_url .'">' ); } *************** *** 163,167 **** else { ! message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } --- 163,167 ---- else { ! mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } *************** *** 212,219 **** if ($thiscat['cat_moderator_groups'] != '') { // Get the namelist of moderator usergroups ! $sql = "SELECT group_id, group_name, group_type, group_single_user FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> 1 AND group_type <> ". GROUP_HIDDEN ." AND group_id IN (". $thiscat['cat_moderator_groups'] .") --- 212,231 ---- if ($thiscat['cat_moderator_groups'] != '') { + switch (PORTAL_BACKEND) + { + case 'internal': + case 'phpbb2': + $sql_where = 'group_single_user <> " . true . "'; + break; + + case 'phpbb3': + $sql_where = 'group_id <> " . true . "'; + break; + } + // Get the namelist of moderator usergroups ! $sql = "SELECT * FROM " . GROUPS_TABLE . " ! WHERE " . $sql_where . " AND group_type <> ". GROUP_HIDDEN ." AND group_id IN (". $thiscat['cat_moderator_groups'] .") *************** *** 221,225 **** if ( !$result = $db->sql_query($sql) ) { ! message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } --- 233,237 ---- if ( !$result = $db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } *************** *** 390,394 **** if( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query pics information', '', __LINE__, __FILE__, $sql); } --- 402,406 ---- if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query pics information', '', __LINE__, __FILE__, $sql); } *************** *** 449,453 **** else { ! $pic_poster = '<a href="'. mx_append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $picrow[$j]['user_id']) .'">'. $picrow[$j]['username'] .'</a>'; } --- 461,465 ---- else { ! $pic_poster = album_get_profile_url('full', $picrow[$j]['user_id'], $picrow[$j]['username'], false); } |