Update of /cvsroot/mxbb/mx_smartor In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25079 Modified Files: Tag: core28x Smartor_album.pak album.php album_lists.php db_install.php db_upgrade.php welcome.php Log Message: Index: album_lists.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_lists.php,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** album_lists.php 9 Aug 2007 13:16:52 -0000 1.21 --- album_lists.php 15 Jan 2008 10:56:07 -0000 1.21.2.1 *************** *** 13,22 **** die("Hacking attempt"); } - else - { - define( 'MXBB_MODULE', true ); - $is_block = TRUE; - } $phpEx = substr(strrchr(__FILE__, '.'), 1); --- 13,17 ---- *************** *** 182,186 **** $template->assign_block_vars('recent_pics_block.recent_pics.recent_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $recentrow[$j]['pic_id'], TRUE)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $recentrow[$j]['pic_id'], TRUE)), 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $recentrow[$j]['pic_id'], TRUE)), 'PIC_PREVIEW' => $pic_preview, --- 177,181 ---- $template->assign_block_vars('recent_pics_block.recent_pics.recent_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $recentrow[$j]['pic_id'], true)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $recentrow[$j]['pic_id'], false)), 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $recentrow[$j]['pic_id'], TRUE)), 'PIC_PREVIEW' => $pic_preview, *************** *** 304,308 **** $template->assign_block_vars('most_pics_block.most_pics.most_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $mostrow[$j]['pic_id'], TRUE)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $mostrow[$j]['pic_id'], TRUE)), 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $mostrow[$j]['pic_id'], TRUE)), 'PIC_PREVIEW' => $pic_preview, --- 299,303 ---- $template->assign_block_vars('most_pics_block.most_pics.most_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $mostrow[$j]['pic_id'], true)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $mostrow[$j]['pic_id'], false)), 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $mostrow[$j]['pic_id'], TRUE)), 'PIC_PREVIEW' => $pic_preview, *************** *** 365,475 **** if ($allowed_cat != '') { - /* - $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, SUM( c.comment_id) AS comments - FROM ". ALBUM_TABLE ." AS p, ". ALBUM_COMMENT_TABLE ." AS c, ". USERS_TABLE ." AS u, ". ALBUM_CAT_TABLE ." AS ct , ". ALBUM_RATE_TABLE ." AS r - WHERE p.pic_user_id = u.user_id - AND p.pic_cat_id = ct.cat_id - AND p.pic_id = r.rate_pic_id - AND p.pic_id = c.comment_pic_id - AND p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 ) - GROUP BY p.pic_id - ORDER BY rating DESC - LIMIT ". $album_sp_config['img_cols'] * $album_sp_config['img_rows']; - */ - $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments - FROM ". ALBUM_TABLE ." AS p - LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id - LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id - LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id - LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id - WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 ) - GROUP BY p.pic_id - ORDER BY rating DESC - LIMIT ". $album_sp_config['img_cols'] * $album_sp_config['img_rows']; - if( !($result = $db->sql_query($sql)) ) - { - mx_message_die(GENERAL_ERROR, 'Could not query highest rated pics information', '', __LINE__, __FILE__, $sql); - } ! $highestrow = array(); ! while( $row = $db->sql_fetchrow($result) ) ! { ! $highestrow[] = $row; ! } $template->assign_block_vars('highest_pics_block', array()); ! if (count($highestrow) > 0) ! { ! for ($i = 0; $i < count($highestrow); $i += $album_sp_config['img_cols']) ! { ! $template->assign_block_vars('highest_pics_block.highest_pics', array()); ! for ($j = $i; $j < ($i + $album_sp_config['img_cols']); $j++) ! { ! if( $j >= count($highestrow) ) ! { ! break; ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = ''; ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\''. append_sid(this_fap_addonurl("smartor_mode=album_picm&pic_id=" . $highestrow[$j]['pic_id'])) . '\',\'' . addslashes($highestrow[$j]['pic_title']) . '\', ' . $album_sp_config['midthumb_width'] . ', ' . $album_sp_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! $template->assign_block_vars('highest_pics_block.highest_pics.highest_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $highestrow[$j]['pic_id'], TRUE)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $highestrow[$j]['pic_id'], TRUE)), ! 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $highestrow[$j]['pic_id'], TRUE)), ! 'PIC_PREVIEW' => $pic_preview, ! 'DESC' => $highestrow[$j]['pic_desc'] ! ) ! ); ! if( ($highestrow[$j]['user_id'] == ALBUM_GUEST) or ($highestrow[$j]['username'] == '') ) ! { ! $highest_poster = ($highestrow[$j]['pic_username'] == '') ? $lang['Guest'] : $highestrow[$j]['pic_username']; ! } ! else ! { ! $highest_poster = '<a href="'. append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $highestrow[$j]['user_id']) .'">'. $highestrow[$j]['username'] .'</a>'; ! } ! ! $rating_image = ImageRating($highestrow[$j]['rating']); ! ! $template->assign_block_vars('highest_pics_block.highest_pics.highest_detail', array( ! 'H_TITLE' => $highestrow[$j]['pic_title'], ! 'H_POSTER' => $highest_poster, ! 'H_TIME' => create_date($board_config['default_dateformat'], $highestrow[$j]['pic_time'], $board_config['board_timezone']), ! 'H_VIEW' => $highestrow[$j]['pic_view_count'], ! 'H_RATING' => ($album_config['rate'] == 1) ? ( $lang['Rating'] . ': ' . $rating_image . ', ') : '', ! 'H_COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $highestrow[$j]['pic_id'], TRUE)) . '">' . $lang['Comments'] . '</a>: ' . $highestrow[$j]['comments'] . '<br />') : '' ! // 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($highestrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($highestrow[$j]['pic_user_ip']) .'</a><br />' : '' ! ) ! ); ! } ! } ! } ! else ! { ! // ! // No Pics Found ! // ! $template->assign_block_vars('highest_pics_block.no_pics', array()); ! } ! } else ! { ! // ! // No Cats Found ! // ! $template->assign_block_vars('highest_pics_block.no_pics', array()); ! } } --- 360,459 ---- if ($allowed_cat != '') { ! $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments ! FROM ". ALBUM_TABLE ." AS p ! LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id ! LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id ! LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id ! LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id ! WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 ) ! GROUP BY p.pic_id ! ORDER BY rating DESC ! LIMIT ". $album_sp_config['img_cols'] * $album_sp_config['img_rows']; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not query highest rated pics information', '', __LINE__, __FILE__, $sql); ! } ! $highestrow = array(); ! ! while( $row = $db->sql_fetchrow($result) ) ! { ! $highestrow[] = $row; ! } $template->assign_block_vars('highest_pics_block', array()); ! if (count($highestrow) > 0) ! { ! for ($i = 0; $i < count($highestrow); $i += $album_sp_config['img_cols']) ! { ! $template->assign_block_vars('highest_pics_block.highest_pics', array()); ! for ($j = $i; $j < ($i + $album_sp_config['img_cols']); $j++) ! { ! if( $j >= count($highestrow) ) ! { ! break; ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = ''; ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\''. append_sid(this_fap_addonurl("smartor_mode=album_picm&pic_id=" . $highestrow[$j]['pic_id'])) . '\',\'' . addslashes($highestrow[$j]['pic_title']) . '\', ' . $album_sp_config['midthumb_width'] . ', ' . $album_sp_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! $template->assign_block_vars('highest_pics_block.highest_pics.highest_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $highestrow[$j]['pic_id'], true)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $highestrow[$j]['pic_id'], false)), ! 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $highestrow[$j]['pic_id'], TRUE)), ! 'PIC_PREVIEW' => $pic_preview, ! 'DESC' => $highestrow[$j]['pic_desc'] ! ) ! ); ! if( ($highestrow[$j]['user_id'] == ALBUM_GUEST) or ($highestrow[$j]['username'] == '') ) ! { ! $highest_poster = ($highestrow[$j]['pic_username'] == '') ? $lang['Guest'] : $highestrow[$j]['pic_username']; ! } ! else ! { ! $highest_poster = '<a href="'. append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $highestrow[$j]['user_id']) .'">'. $highestrow[$j]['username'] .'</a>'; ! } ! ! $rating_image = ImageRating($highestrow[$j]['rating']); ! ! $template->assign_block_vars('highest_pics_block.highest_pics.highest_detail', array( ! 'H_TITLE' => $highestrow[$j]['pic_title'], ! 'H_POSTER' => $highest_poster, ! 'H_TIME' => create_date($board_config['default_dateformat'], $highestrow[$j]['pic_time'], $board_config['board_timezone']), ! 'H_VIEW' => $highestrow[$j]['pic_view_count'], ! 'H_RATING' => ($album_config['rate'] == 1) ? ( $lang['Rating'] . ': ' . $rating_image . ', ') : '', ! 'H_COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $highestrow[$j]['pic_id'], TRUE)) . '">' . $lang['Comments'] . '</a>: ' . $highestrow[$j]['comments'] . '<br />') : '' ! // 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($highestrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($highestrow[$j]['pic_user_ip']) .'</a><br />' : '' ! ) ! ); ! } ! } ! } ! else ! { ! // ! // No Pics Found ! // ! $template->assign_block_vars('highest_pics_block.no_pics', array()); ! } ! } else ! { ! // ! // No Cats Found ! // ! $template->assign_block_vars('highest_pics_block.no_pics', array()); ! } } *************** *** 543,547 **** $template->assign_block_vars('random_pics_block.rand_pics.rand_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $randrow[$j]['pic_id'], TRUE)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $randrow[$j]['pic_id'], TRUE)), 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $randrow[$j]['pic_id'], TRUE)), 'PIC_PREVIEW' => $pic_preview, --- 527,531 ---- $template->assign_block_vars('random_pics_block.rand_pics.rand_col', array( ! 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid(this_fap_toplisturl("smartor_mode=album_pic&pic_id=". $randrow[$j]['pic_id'], true)) : append_sid(this_fap_toplisturl("smartor_mode=album_showpage&pic_id=". $randrow[$j]['pic_id'], false)), 'THUMBNAIL' => append_sid(this_fap_toplisturl("smartor_mode=album_thumbnail&pic_id=". $randrow[$j]['pic_id'], TRUE)), 'PIC_PREVIEW' => $pic_preview, Index: Smartor_album.pak =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/Smartor_album.pak,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** Smartor_album.pak 5 Oct 2007 11:12:50 -0000 1.10.2.1 --- Smartor_album.pak 15 Jan 2008 10:56:06 -0000 1.10.2.2 *************** *** 1,26 **** ! module=+:61=+:Smartor album=+:modules/mx_smartor/=+:Smartor web photo album=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:61=+:71=+:Smartor_album=+:Smartor web photo album=+:album.php=+: ! parameter=+:71=+:130=+:base_album=+:Text=+:=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Smartor_album=+:Demo block=+:71=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:61=+:72=+:Smartor_album_list=+:Smartor album toplists=+:album_lists.php=+: ! parameter=+:72=+:136=+:num_of_rows=+:Number=+:2=+:=+:0=+:0 ! parameter=+:72=+:135=+:num_of_cols=+:Number=+:1=+:=+:0=+:0 ! parameter=+:72=+:133=+:display_top_ranked=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:72=+:134=+:display_latest_posts=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:72=+:132=+:display_random_posts=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:72=+:131=+:display_most_posts=+:Boolean=+:TRUE=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Smartor_toplist=+:Demo block=+:72=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:61=+:102=+:Smartor_welcome=+:Smartor album welcome=+:welcome.php=+: ! parameter=+:102=+:216=+:Welcome_Msg=+:Text=+:Have a nice day !=+:=+:0=+:0 ! parameter=+:102=+:217=+:Register_Msg=+:Text=+:Not a member? %sClick here and Register Now!%s=+:=+:0=+:0 ! parameter=+:102=+:218=+:View_JumpTo=+:Boolean=+:FALSE=+:=+:0=+:0 ! parameter=+:102=+:219=+:Vertical_Layout=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:102=+:221=+:View_PostCount=+:Boolean=+:TRUE=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Smartor_welcome=+:Demo block=+:102=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 ! function=+:0=+:0=+:0=+:endoflist=+:0=+:0 \ No newline at end of file --- 1,26 ---- ! module=+:56=+:Smartor album=+:modules/mx_smartor/=+:Smartor web photo album=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:56=+:52=+:Smartor_album=+:Full Album Pack - Main=+:album.php=+: ! parameter=+:52=+:148=+:base_album=+:Text=+:=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Smartor_album=+:Demo block=+:52=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:56=+:53=+:Smartor_album_list=+:Smartor Album TopLists=+:album_lists.php=+: ! parameter=+:53=+:98=+:num_of_rows=+:Number=+:2=+:=+:0=+:0 ! parameter=+:53=+:97=+:num_of_cols=+:Number=+:1=+:=+:0=+:0 ! parameter=+:53=+:96=+:display_latest_posts=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:53=+:94=+:display_random_posts=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:53=+:95=+:display_top_ranked=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:53=+:93=+:display_most_posts=+:Boolean=+:TRUE=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Smartor_album_list=+:Demo block=+:53=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:56=+:92=+:Smartor_welcome=+:Smartor album welcome=+:welcome.php=+: ! parameter=+:92=+:215=+:Welcome_Msg=+:Text=+:Have a nice day !=+:=+:0=+:0 ! parameter=+:92=+:216=+:Register_Msg=+:Text=+:Not a member? %sClick here and Register Now!%s=+:=+:0=+:0 ! parameter=+:92=+:217=+:View_JumpTo=+:Boolean=+:FALSE=+:=+:0=+:0 ! parameter=+:92=+:218=+:Vertical_Layout=+:Boolean=+:TRUE=+:=+:0=+:0 ! parameter=+:92=+:219=+:View_PostCount=+:Boolean=+:TRUE=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Smartor_welcome=+:Demo block=+:92=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 ! function=+:0=+:0=+:0=+:endoflist=+:0=+:0 |