Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30185/album_mod/modules Modified Files: album_cat_sort.php album_comment.php album_memberlist.php album_personal.php album_personal_random.php album_thumbnail.php Log Message: database schema upgrade for mx_smartor 3.0 and FAP 1.5.0 plus some files Index: album_personal.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_personal.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_personal.php 23 Dec 2008 06:59:33 -0000 1.5 --- album_personal.php 18 Mar 2013 03:41:25 -0000 1.6 *************** *** 28,31 **** --- 28,39 ---- } + // ------------------------------------------------------------------------ + // This file is only included in the album.php and album_cat.php, it should be stored in the album_mod folder + // ------------------------------------------------------------------------ + + // ------------------------------------------------------------------------ + // $album_user_id, $cat_id and $moderators_list are as default set in album.php and in album_cat.php files in the main folder. + // ------------------------------------------------------------------------ + // ------------------------------------ // Check the request *************** *** 228,232 **** // Count Pics // ------------------------------------ - $sql = "SELECT COUNT(pic_id) AS count FROM ". ALBUM_TABLE ." --- 236,239 ---- *************** *** 246,250 **** // Build up // ------------------------------------ - if ($total_pics > 0) { --- 253,256 ---- *************** *** 276,280 **** // Thumbnails table // -------------------------------- - for ($i = 0; $i < count($picrow); $i += $album_config['cols_per_page']) { --- 282,285 ---- *************** *** 287,291 **** break; } - $template->assign_block_vars('picrow.piccol', array( 'U_PIC' => ($album_config['fullpic_popup']) ? mx_append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=". $picrow[$j]['pic_id'])) : mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=". $picrow[$j]['pic_id'])), --- 292,295 ---- *************** *** 295,302 **** ); $image_rating = ImageRating($picrow[$j]['rating']); $template->assign_block_vars('picrow.pic_detail', array( ! 'TITLE' => $picrow[$j]['pic_title'],album_create_date 'TIME' => album_create_date($board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone']), --- 299,326 ---- ); + // -------------------------------- + // Prepare variables + // -------------------------------- + $pic_user_id = $userdata['user_id']; + $pic_user_ip = $userdata['session_ip']; + + switch (PORTAL_BACKEND) + { + case 'internal': + case 'phpbb2': + $pic_user_id = $userdata['user_id']; + $pic_user_ip = $userdata['session_ip']; + break; + case 'phpbb3': + $pic_user_id = $mx_user->data['user_id']; + $pic_user_ip = album_encode_ip($mx_user->data['session_ip']); + break; + } + $image_rating = ImageRating($picrow[$j]['rating']); $template->assign_block_vars('picrow.pic_detail', array( ! 'TITLE' => $picrow[$j]['pic_title'], ! 'TIME' => album_create_date($board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone']), *************** *** 313,317 **** 'LOCK' => ($userdata['user_level'] == ADMIN) ? '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_modcp&mode=". (($picrow[$j]['pic_lock'] == 0) ? 'lock' : 'unlock') ."&pic_id=". $picrow[$j]['pic_id'])) .'">'. (($picrow[$j]['pic_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.domaintools.com/' . decode_ip2($picrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($picrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); --- 337,341 ---- 'LOCK' => ($userdata['user_level'] == ADMIN) ? '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_modcp&mode=". (($picrow[$j]['pic_lock'] == 0) ? 'lock' : 'unlock') ."&pic_id=". $picrow[$j]['pic_id'])) .'">'. (($picrow[$j]['pic_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.domaintools.com/' . album_decode_ip($picrow[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($picrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); Index: album_personal_random.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_personal_random.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_personal_random.php 3 Mar 2011 14:28:40 -0000 1.4 --- album_personal_random.php 18 Mar 2013 03:41:25 -0000 1.5 *************** *** 190,194 **** // Count Pics // ------------------------------------ - $sql = "SELECT COUNT(pic_id) AS count FROM ". ALBUM_TABLE ." --- 190,193 ---- *************** *** 208,212 **** // Build up // ------------------------------------ - if ($total_pics > 0) { --- 207,210 ---- *************** *** 238,242 **** // Thumbnails table // -------------------------------- - for ($i = 0; $i < count($picrow); $i += $album_config['cols_per_page']) { --- 236,239 ---- *************** *** 249,258 **** break; } ! $avatar_number = rand(1,$j); ! $upic = ($album_config['fullpic_popup']) ? mx_append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=". $picrow[$avatar_number]['pic_id'])) : mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=". $picrow[$j]['pic_id'])); ! $thumnail = mx_append_sid('album.' . $phpEx . "?smartor_mode=album_thumbnail&pic_id=". $picrow[$avatar_number]['pic_id'], TRUE); ! $pic_id = $picrow[$avatar_number]['pic_id']; ! ! } } --- 246,254 ---- break; } ! $avatar_number = rand(0, $j); ! $upic = ($album_config['fullpic_popup']) ? mx_append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=". $picrow[$avatar_number]['pic_id'])) : mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=". $picrow[$j]['pic_id'])); ! $thumnail = mx_append_sid('album.' . $phpEx . "?smartor_mode=album_thumbnail&pic_id=". $picrow[$avatar_number]['pic_id'], TRUE); ! $pic_id = $picrow[$avatar_number]['pic_id']; ! } } *************** *** 280,284 **** $thispic = '0'; } ! elseif ($cat_id != PERSONAL_GALLERY) { $sql = "SELECT p.*, c.* --- 276,281 ---- $thispic = '0'; } ! ! if ($cat_id != PERSONAL_GALLERY) { $sql = "SELECT p.*, c.* Index: album_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_comment.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** album_comment.php 23 Dec 2008 06:59:33 -0000 1.7 --- album_comment.php 18 Mar 2013 03:41:25 -0000 1.8 *************** *** 308,312 **** 'POSTER' => $poster, 'TIME' => album_create_date($board_config['default_dateformat'], $commentrow[$i]['comment_time'], $board_config['board_timezone']), ! 'IP' => ($userdata['user_level'] == ADMIN) ? '-----------------------------------<br />' . $lang['IP_Address'] . ': <a href="http://whois.domaintools.com/' . decode_ip2($commentrow[$i]['comment_user_ip']) . '" target="_blank">' . decode_ip2($commentrow[$i]['comment_user_ip']) .'</a><br />' : '', 'TEXT' => nl2br($commentrow[$i]['comment_text']), --- 308,312 ---- 'POSTER' => $poster, 'TIME' => album_create_date($board_config['default_dateformat'], $commentrow[$i]['comment_time'], $board_config['board_timezone']), ! 'IP' => ($userdata['user_level'] == ADMIN) ? '-----------------------------------<br />' . $lang['IP_Address'] . ': <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 />' : '', 'TEXT' => nl2br($commentrow[$i]['comment_text']), Index: album_cat_sort.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_cat_sort.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** album_cat_sort.php 9 Aug 2011 04:32:19 -0000 1.7 --- album_cat_sort.php 18 Mar 2013 03:41:25 -0000 1.8 *************** *** 483,487 **** 'LOCK' => ($auth_data['moderator']) ? '<a href="'. mx_append_sid("album_modcp.$phpEx?mode=". (($picrow[$j]['pic_lock'] == 0) ? 'lock' : 'unlock') ."&pic_id=". $picrow[$j]['pic_id']) .'">'. (($picrow[$j]['pic_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.domaintools.com/' . decode_ip2($picrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($picrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); --- 483,487 ---- 'LOCK' => ($auth_data['moderator']) ? '<a href="'. mx_append_sid("album_modcp.$phpEx?mode=". (($picrow[$j]['pic_lock'] == 0) ? 'lock' : 'unlock') ."&pic_id=". $picrow[$j]['pic_id']) .'">'. (($picrow[$j]['pic_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.domaintools.com/' . album_decode_ip($picrow[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($picrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); Index: album_memberlist.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_memberlist.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_memberlist.php 23 Dec 2008 06:59:33 -0000 1.5 --- album_memberlist.php 18 Mar 2013 03:41:25 -0000 1.6 *************** *** 271,275 **** 'MOVE' => ($userdata['user_level'] == ADMIN) ? '<a href="'. mx_append_sid(album_append_uid("album_modcp.$phpEx?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 />' : '' ) ); --- 271,275 ---- 'MOVE' => ($userdata['user_level'] == ADMIN) ? '<a href="'. mx_append_sid(album_append_uid("album_modcp.$phpEx?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_thumbnail.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_thumbnail.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** album_thumbnail.php 8 Nov 2011 07:17:16 -0000 1.10 --- album_thumbnail.php 18 Mar 2013 03:41:25 -0000 1.11 *************** *** 50,54 **** // ------------------------------------ // Get this pic info and current category info ! // ------------------------------------ $sql = "SELECT p.*, c.* FROM " . ALBUM_TABLE . " AS p, " . ALBUM_CAT_TABLE . " AS c --- 50,54 ---- // ------------------------------------ // Get this pic info and current category info ! // ------------------------------------ $sql = "SELECT p.*, c.* FROM " . ALBUM_TABLE . " AS p, " . ALBUM_CAT_TABLE . " AS c *************** *** 76,80 **** } } ! @define('ALBUM_NOPIC_PATH', $module_root_path . 'album_mod/'); // Mighty Gorgon: this code is reserved for generating extra thumbnail size on the fly... --- 76,80 ---- } } ! //@define('ALBUM_NOPIC_PATH', $module_root_path . 'album_mod/'); // Mighty Gorgon: this code is reserved for generating extra thumbnail size on the fly... *************** *** 107,115 **** $pic_size = @getimagesize($pic_fullpath); //$pic_size = get_full_image_info($pic_fullpath); if($pic_size == false) { $pic_fullpath = $pic_nopic_fullpath; ! $pic_size = @getimagesize($pic_fullpath); } /* --- 107,116 ---- $pic_size = @getimagesize($pic_fullpath); //$pic_size = get_full_image_info($pic_fullpath); + //mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist'] . ': ' . $pic_fullpath); if($pic_size == false) { $pic_fullpath = $pic_nopic_fullpath; ! $pic_size = getimagesize($pic_fullpath); } /* *************** *** 126,130 **** $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if( empty($thispic) || !file_exists($pic_fullpath) ) { mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist'] . ': ' . $pic_fullpath); --- 127,131 ---- $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if( empty($thispic) || !@file_exists($pic_fullpath) ) { mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist'] . ': ' . $pic_fullpath); |