|
From: OryNider <ory...@us...> - 2007-07-04 15:49:39
|
Update of /cvsroot/mxbb/mx_smartor/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29767/includes Modified Files: album_pic_nuffed.php album_showpage.php Log Message: Many bugs fixed by me and Mighty Gorgon himself ... Index: album_pic_nuffed.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_pic_nuffed.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** album_pic_nuffed.php 7 Jun 2007 20:13:34 -0000 1.1 --- album_pic_nuffed.php 4 Jul 2007 15:49:32 -0000 1.2 *************** *** 26,45 **** } if( $module_root_path = '' ) { $module_root_path = '../'; $mx_root_path = $module_root_path . '../../'; - } ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! include_once($mx_root_path . 'common.'.$phpEx); ! // ! // Start session management ! // ! $mx_user->init($user_ip, PAGE_INDEX); ! // ! // End session management ! // define('ALBUM_MOD_PATH', 'album_mod/'); --- 26,48 ---- } + $phpEx = substr(strrchr(__FILE__, '.'), 1); + + /* if( $module_root_path = '' ) { $module_root_path = '../'; $mx_root_path = $module_root_path . '../../'; ! include_once($mx_root_path . 'common.'.$phpEx); ! // ! // Start session management ! // ! $mx_user->init($user_ip, PAGE_INDEX); ! // ! // End session management ! // ! } ! */ define('ALBUM_MOD_PATH', 'album_mod/'); *************** *** 51,57 **** } ! include_once($album_root_path . 'album_common.'.$phpEx); ! include_once($album_root_path . 'album_image_class.'.$phpEx); ! // ------------------------------------ --- 54,59 ---- } ! include($album_root_path . 'album_common.' . $phpEx); ! require($album_root_path . 'album_image_class.' . $phpEx); // ------------------------------------ *************** *** 90,95 **** $album_user_id = $thispic['cat_user_id']; - $pic_filetype = strtolower(substr($thispic['pic_filename'], strlen($thispic['pic_filename']) - 4, 4)); $pic_filename = $thispic['pic_filename']; $pic_title = $thispic['pic_title']; $pic_thumbnail = $thispic['pic_thumbnail']; --- 92,99 ---- $album_user_id = $thispic['cat_user_id']; $pic_filename = $thispic['pic_filename']; + $file_part = explode('.', strtolower($pic_filename)); + $pic_filetype = $file_part[sizeof($file_part) - 1]; + $pic_title = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1); $pic_title = $thispic['pic_title']; $pic_thumbnail = $thispic['pic_thumbnail']; *************** *** 158,162 **** /* header('Content-type: image/jpeg'); ! header('Content-Disposition: filename=' . $pic_title_reg . $pic_filetype); readfile($images['no_thumbnail']); exit; --- 162,166 ---- /* header('Content-type: image/jpeg'); ! header('Content-Disposition: filename=' . $pic_title_reg . '.' . $pic_filetype); readfile($images['no_thumbnail']); exit; *************** *** 179,183 **** //Apply sepia filter (best to resize before this) ! ($nuff_http['nuff_sepia'] == true) ? $Image->Sepia() : false ; //Apply grayscale filter (best to resize before this) --- 183,187 ---- //Apply sepia filter (best to resize before this) ! ($nuff_http['nuff_sepia'] == true) ? $Image->Sepia() : false; //Apply grayscale filter (best to resize before this) *************** *** 230,234 **** //WatermarkPos(File, Pos, Size, Transition) ! if( ($pic_filetype != '.gif') && ($album_config['use_watermark'] == true) && ($userdata['user_level'] != ADMIN) && ( (!$userdata['session_logged_in']) || ($album_config['wut_users'] == 1)) ) { --- 234,238 ---- //WatermarkPos(File, Pos, Size, Transition) ! if( ($pic_filetype != 'gif') && ($album_config['use_watermark'] == true) && ($userdata['user_level'] != ADMIN) && ( (!$userdata['session_logged_in']) || ($album_config['wut_users'] == 1)) ) { Index: album_showpage.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_showpage.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** album_showpage.php 7 Jun 2007 20:13:30 -0000 1.9 --- album_showpage.php 4 Jul 2007 15:49:32 -0000 1.10 *************** *** 92,112 **** // ------------------------------------ ! if( isset($HTTP_GET_VARS['pic_id']) ) ! { ! $pic_id = intval($HTTP_GET_VARS['pic_id']); ! } ! else if( isset($HTTP_POST_VARS['pic_id']) ) { ! $pic_id = intval($HTTP_POST_VARS['pic_id']); } else { ! if( isset($HTTP_GET_VARS['comment_id']) ) ! { ! $comment_id = intval($HTTP_GET_VARS['comment_id']); ! } ! else if( isset($HTTP_POST_VARS['comment_id']) ) { ! $comment_id = intval($HTTP_POST_VARS['comment_id']); } else --- 92,105 ---- // ------------------------------------ ! if( isset($_GET['pic_id']) || isset($_POST['pic_id']) ) { ! $pic_id = ( isset($_GET['pic_id']) ) ? intval($_GET['pic_id']) : intval($_POST['pic_id']); } else { ! if( isset($_GET['comment_id']) || isset($_POST['comment_id']) ) { ! $pic_id = ( isset($_GET['pic_id']) ) ? intval($_GET['pic_id']) : intval($_POST['pic_id']); ! $comment_id = (isset($_GET['comment_id'])) ? intval($_GET['comment_id']) : intval($_POST['comment_id']); } else *************** *** 117,143 **** // Midthumb & Full Pic ! if ($album_sp_config['midthumb_use'] == 1) { ! if( isset($HTTP_GET_VARS['full']) ) ! { ! $picm = TRUE; ! } ! else if( isset($HTTP_POST_VARS['full']) ) { ! $picm = TRUE; } else { ! $picm = FALSE; } ! $full_size_param = '&full=false'; } else { ! $picm = FALSE; ! $full_size_param = '&full=true'; } // ------------------------------------ // TEMPLATE ASSIGNEMENT --- 110,153 ---- // Midthumb & Full Pic ! if( isset($_GET['full']) || isset($_POST['full']) ) { ! $picm = false; ! $full_size_param = '&full=true'; ! } ! else ! { ! if ($album_config['midthumb_use'] == 1) { ! $picm = true; ! $full_size_param = ''; } else { ! $picm = false; ! $full_size_param = '&full=true'; } + } ! if( isset($_GET['sort_method']) || isset($_POST['sort_method']) ) ! { ! $sort_method = (isset($_GET['sort_method'])) ? $_GET['sort_method'] : $_POST['sort_method']; ! $sort_method = ( ($sort_method == 'comments') || ($sort_method == 'rating') )? $album_config['sort_method'] : $sort_method; } else { ! $sort_method = $album_config['sort_method']; } + if( isset($_GET['sort_order']) || isset($_POST['sort_order']) ) + { + $sort_order = (isset($_GET['sort_order'])) ? $_GET['sort_order'] : $_POST['sort_order']; + } + else + { + $sort_order = $album_config['sort_order']; + } + + $sort_append = '&sort_method=' . $sort_method . '&sort_order=' . $sort_order; + // ------------------------------------ // TEMPLATE ASSIGNEMENT *************** *** 147,151 **** $gen_simple_header = true; $show_template = 'album_slideshow_body.tpl'; ! $nuffimage_pic = ( $picm == false ) ? 'album_pic.' : 'album_picm.'; $nuffimage_vars = ''; } --- 157,161 ---- $gen_simple_header = true; $show_template = 'album_slideshow_body.tpl'; ! $nuffimage_pic = ( $picm == false ) ? 'album_pic' : 'album_picm'; $nuffimage_vars = ''; } *************** *** 159,163 **** $show_template = 'album_pic_nuffed_body.tpl'; $nuffimage_vars = '&nuffimage=true'; ! $nuffimage_pic = 'album_pic_nuffed.'; $nuff_http_full_string = $nuff_http['full_string']; $template->assign_block_vars('disable_pic_nuffed', array( --- 169,173 ---- $show_template = 'album_pic_nuffed_body.tpl'; $nuffimage_vars = '&nuffimage=true'; ! $nuffimage_pic = 'album_pic_nuffed'; $nuff_http_full_string = $nuff_http['full_string']; $template->assign_block_vars('disable_pic_nuffed', array( *************** *** 171,218 **** $show_template = 'album_showpage_body.tpl'; $nuffimage_vars = ''; ! $nuffimage_pic = ( $picm == false ) ? 'album_pic.' : 'album_picm.'; $nuff_http_full_string = ''; } } // ------------------------------------ ! // PREVIOUS & NEXT // ------------------------------------ - if( isset($_GET['mode']) ) - { - //if( ($_GET['mode'] == 'next') && ($no_next_pic == false) ) - if($_GET['mode'] == 'next') - { - //$pic_id = $next_pic_id[0]; - $sql_where = 'AND n.pic_id > c.pic_id'; - $sql_order = 'ORDER BY n.pic_id ASC LIMIT 1'; - - } ! //if( ($_GET['mode'] == 'prev') && ($no_prev_pic == false) ) ! if($_GET['mode'] == 'prev') ! { ! //$pic_id = $prev_pic_id[0]; ! $sql_where = 'AND n.pic_id < c.pic_id'; ! $sql_order = 'ORDER BY n.pic_id DESC LIMIT 1'; ! } ! ! $sql = "SELECT n.pic_id, n.pic_cat_id, n.pic_user_id, n.pic_time ! FROM ". ALBUM_TABLE ." as n, ". ALBUM_TABLE ." AS c ! WHERE c.pic_id = $pic_id ! $sql_where ! AND n.pic_cat_id = c.pic_cat_id ! $sql_order"; ! } ! else ! { ! $sql = "SELECT pic_id, pic_cat_id, pic_user_id, pic_time ! FROM ". ALBUM_TABLE ." ! WHERE pic_id = $pic_id"; ! } if( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } --- 181,201 ---- $show_template = 'album_showpage_body.tpl'; $nuffimage_vars = ''; ! $nuffimage_pic = ( $picm == false ) ? 'album_pic' : 'album_picm'; $nuff_http_full_string = ''; } } + // ------------------------------------ ! // PREVIOUS / NEXT / PICS NAV // ------------------------------------ ! $sql = "SELECT pic_id, pic_cat_id, pic_user_id, pic_time ! FROM ". ALBUM_TABLE ." ! WHERE pic_id = $pic_id"; if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } *************** *** 231,258 **** $db->sql_freeresult($result); ! if( isset($_GET['mode']) ) ! { ! if ( ($_GET['mode'] == 'next') || ($_GET['mode'] == 'prev') ) ! { ! $pic_id = $pic_id_tmp; ! } ! } ! ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav', array( ! 'L_PICS_NAV' => $lang['Pics_Nav'], ! 'L_PICS_NAV_NEXT' => $lang['Pics_Nav_Next'], ! 'L_PICS_NAV_PREV' => $lang['Pics_Nav_Prev'], ! ) ! ); ! } ! // NEXT ! $sql = "SELECT a.* FROM " . ALBUM_TABLE . " AS a ! WHERE a.pic_id > " . $pic_id_tmp . " ! AND a.pic_cat_id = " . $pic_cat_id_tmp . " AND a.pic_approval = 1 ! ORDER BY pic_id ASC LIMIT 2"; if( !($result = $db->sql_query($sql)) ) --- 214,223 ---- $db->sql_freeresult($result); ! $sql_order = 'ORDER BY a.' . $sort_method . ' ' . $sort_order; ! $sql = "SELECT * FROM " . ALBUM_TABLE . " AS a ! WHERE a.pic_cat_id = " . $pic_cat_id_tmp . " AND a.pic_approval = 1 ! " . $sql_order; if( !($result = $db->sql_query($sql)) ) *************** *** 261,528 **** } ! //$row = $db->sql_fetchrow($result); ! $next_pic_count = $db->sql_numrows($result); ! $next_pic_rows = $db->sql_fetchrowset($result); $db->sql_freeresult($result); ! if ($next_pic_count == 0) { ! $no_next_pic = true; ! $sql = "SELECT a.* ! FROM " . ALBUM_TABLE . " AS a ! WHERE a.pic_cat_id = " . $pic_cat_id_tmp . " ! AND a.pic_approval = 1 ! ORDER BY pic_id ASC LIMIT 1"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } ! $row = $db->sql_fetchrow($result); ! $first_pic_id = $row['pic_id']; ! $db->sql_freeresult($result); } else { ! $no_next_pic = false; ! if ( $album_config['invert_nav_arrows'] == 0 ) ! { ! for($i = $next_pic_count - 1; $i >= 0; $i--) ! { ! $next_pic_id[$i] = $next_pic_rows[$i]['pic_id']; ! $thumbnail_file = append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $next_pic_id[$i])); ! if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) ! { ! $pic_filename = $next_pic_rows[$i]['pic_filename']; ! $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); ! $pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $next_pic_rows[$i]['pic_thumbnail']; ! //$pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $next_pic_rows[$i]['pic_thumbnail']; ! $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if ( file_exists($pic_thumbnail_fullpath) ) ! { ! $thumbnail_file = $pic_thumbnail_fullpath; ! } ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = append_sid(this_smartor_mxurl("smartor_mode=album_picm&pic_id=" . $next_pic_rows[$i]['pic_id'])); ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\''. append_sid(this_smartor_mxurl("smartor_mode=album_picm&pic_id=" . $next_pic_rows[$i]['pic_id'])) . '\',\'' . addslashes($next_pic_rows[$i]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav.next', array( ! 'U_PICS_THUMB' => $thumbnail_file, ! 'U_PICS_LINK' => append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $next_pic_id[$i] . $full_size_param . $nuffimage_vars)), ! 'PIC_PREVIEW' => $pic_preview, ! ) ! ); ! } ! } ! } ! else { ! for($i = 0; $i < $next_pic_count; $i++) { ! $next_pic_id[$i] = $next_pic_rows[$i]['pic_id']; ! $thumbnail_file = append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $next_pic_id[$i])); ! if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) ! { ! $pic_filename = $next_pic_rows[$i]['pic_filename']; ! $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); ! $pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $next_pic_rows[$i]['pic_thumbnail']; ! //$pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $next_pic_rows[$i]['pic_thumbnail']; ! $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if ( file_exists($pic_thumbnail_fullpath) ) ! { ! $thumbnail_file = $pic_thumbnail_fullpath; ! } ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = ''; ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\''. append_sid(this_smartor_mxurl("smartor_mode=album_picm&pic_id=" . $next_pic_rows[$i]['pic_id'])) . '\',\'' . addslashes($next_pic_rows[$i]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav.prev', array( ! 'U_PICS_THUMB' => $thumbnail_file, ! 'U_PICS_LINK' => append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $next_pic_id[$i] . $full_size_param . $nuffimage_vars)), ! 'PIC_PREVIEW' => $pic_preview, ! ) ! ); ! } } } } ! //PREV ! $sql = "SELECT a.* ! FROM " . ALBUM_TABLE . " AS a ! WHERE a.pic_id < " . $pic_id_tmp . " ! AND a.pic_cat_id = " . $pic_cat_id_tmp . " ! AND a.pic_approval = 1 ! ORDER BY pic_id DESC LIMIT 2"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } ! //$row = $db->sql_fetchrow($result); ! $prev_pic_count = $db->sql_numrows($result); ! $prev_pic_rows = $db->sql_fetchrowset($result); ! $db->sql_freeresult($result); ! ! if ($prev_pic_count == 0) { ! $no_prev_pic = true; - $sql = "SELECT a.* - FROM " . ALBUM_TABLE . " AS a - WHERE a.pic_cat_id = " . $pic_cat_id_tmp . " - AND a.pic_approval = 1 - ORDER BY pic_id DESC LIMIT 1"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } - - $row = $db->sql_fetchrow($result); - $last_pic_id = $row['pic_id']; - $db->sql_freeresult($result); } ! else { ! $no_prev_pic = false; ! if ( $album_config['invert_nav_arrows'] == 0 ) { ! for($i = 0; $i < $prev_pic_count; $i++) ! { ! $prev_pic_id[$i] = $prev_pic_rows[$i]['pic_id']; ! $thumbnail_file = append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $prev_pic_id[$i])); ! if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) ! { ! $pic_filename = $prev_pic_rows[$i]['pic_filename']; ! $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); ! $pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $prev_pic_rows[$i]['pic_thumbnail']; ! //$pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $prev_pic_rows[$i]['pic_thumbnail']; ! $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if ( file_exists($pic_thumbnail_fullpath) ) ! { ! $thumbnail_file = $pic_thumbnail_fullpath; ! } ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = ''; ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\''. append_sid(this_smartor_mxurl("smartor_mode=album_picm&pic_id=" . $prev_pic_rows[$i]['pic_id'])) . '\',\'' . addslashes($prev_pic_rows[$i]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav.prev', array( ! 'U_PICS_THUMB' => $thumbnail_file, ! 'U_PICS_LINK' => append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $prev_pic_id[$i] . $full_size_param . $nuffimage_vars)), ! 'PIC_PREVIEW' => $pic_preview, ! ) ! ); ! } ! } } else { ! for($i = $prev_pic_count - 1; $i >= 0; $i--) ! { ! $prev_pic_id[$i] = $prev_pic_rows[$i]['pic_id']; ! $thumbnail_file = append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $prev_pic_id[$i])); ! if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) ! { ! $pic_filename = $prev_pic_rows[$i]['pic_filename']; ! $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); ! $pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $prev_pic_rows[$i]['pic_thumbnail']; ! //$pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $prev_pic_rows[$i]['pic_thumbnail']; ! $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if ( file_exists($pic_thumbnail_fullpath) ) ! { ! $thumbnail_file = $pic_thumbnail_fullpath; ! } ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = ''; ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\''. append_sid(this_smartor_mxurl("smartor_mode=album_picm&pic_id=" . $prev_pic_rows[$i]['pic_id'])) . '\',\'' . addslashes($prev_pic_rows[$i]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav.next', array( ! 'U_PICS_THUMB' => $thumbnail_file, ! 'U_PICS_LINK' => append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $prev_pic_id[$i] . $full_size_param . $nuffimage_vars)), ! 'PIC_PREVIEW' => $pic_preview, ! ) ! ); ! } ! } } } ! ! // ------------------------------------ ! // IMAGES ARRAY ! // SLIDESHOW SCRIPTS ! // ------------------------------------ ! if ( $album_config['slideshow_script'] == 1 ) { ! $template->assign_block_vars('switch_slideshow_scripts', array()); ! ! $pic_link = ( $picm == false ) ? 'album_pic' : 'album_picm'; ! ! $sql = "SELECT * ! FROM " . ALBUM_TABLE . " AS a ! WHERE a.pic_cat_id = " . $pic_cat_id_tmp . " ! AND a.pic_approval = 1 ! ORDER BY pic_id ASC"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } ! $total_pic_count = $db->sql_numrows($result); ! $total_pic_rows = $db->sql_fetchrowset($result); ! $db->sql_freeresult($result); - $pic_list = ''; - $tit_list = ''; - $des_list = ''; ! for($i = 0; $i < $total_pic_count; $i++) { ! $pic_list .= 'Pic[' . $i . '] = \'' . append_sid(this_smartor_mxurl("smartor_mode=" . $pic_link . '&pic_id=' . $total_pic_rows[$i]['pic_id']), true) . '\'; ' . "\n"; ! $tit_list .= 'Tit[' . $i . '] = \'' . $total_pic_rows[$i]['pic_title'] . '\'; ' . "\n"; ! $des_list .= 'Des[' . $i . '] = \'' . $total_pic_rows[$i]['pic_desc'] . '\'; ' . "\n"; ! /* ! $pic_list .= 'Pic[' . $i . '] = \'' . ALBUM_UPLOAD_PATH . $total_pic_rows[$i]['pic_filename'] . '\'; ' . "\n"; ! */ } - - $template->assign_vars(array( - 'PIC_LIST' => $pic_list, - 'TIT_LIST' => $tit_list, - 'DES_LIST' => $des_list, - ) - ); } --- 226,447 ---- } ! $total_pic_count = $db->sql_numrows($result); ! $total_pic_rows = $db->sql_fetchrowset($result); $db->sql_freeresult($result); ! if ( $album_config['slideshow_script'] == 1 ) { ! $template->assign_block_vars('switch_slideshow_scripts', array()); ! $pic_link = ( $picm == false ) ? 'album_pic' : 'album_picm'; ! $pic_list = ''; ! $tit_list = ''; ! $des_list = ''; ! ! for($i = 0; $i < $total_pic_count; $i++) { ! if ($pic_id == $total_pic_rows[$i]['pic_id']) ! { ! $pic_array_id = $i; ! } ! $pic_list .= 'Pic[' . $i . '] = \'' . append_sid(this_smartor_mxurl("smartor_mode=" . $pic_link . '&pic_id=' . $total_pic_rows[$i]['pic_id']), true) . '\'; ' . "\n"; ! /* ! $pic_list .= 'Pic[' . $i . '] = \'' . append_sid(album_append_uid($pic_link . $phpEx . '?pic_id=' . $total_pic_rows[$i]['pic_id']), true) . '\'; ' . "\n"; ! */ ! $tit_list .= 'Tit[' . $i . '] = \'' . $total_pic_rows[$i]['pic_title'] . '\'; ' . "\n"; ! $des_list .= 'Des[' . $i . '] = \'' . $total_pic_rows[$i]['pic_desc'] . '\'; ' . "\n"; ! /* ! $pic_list .= 'Pic[' . $i . '] = \'' . ALBUM_UPLOAD_PATH . $total_pic_rows[$i]['pic_filename'] . '\'; ' . "\n"; ! */ } ! $template->assign_vars(array( ! 'PIC_LIST' => $pic_list, ! 'TIT_LIST' => $tit_list, ! 'DES_LIST' => $des_list, ! ) ! ); } else { ! for($i = 0; $i < $total_pic_count; $i++) { ! if ($pic_id == $total_pic_rows[$i]['pic_id']) { ! $pic_array_id = $i; } } } ! $first_pic_id = $total_pic_rows[0]['pic_id']; ! $last_pic_id = $total_pic_rows[$total_pic_count - 1]['pic_id']; ! if ($pic_array_id == 0) { ! $no_prev_pic = true; ! if( isset($_GET['mode']) && ($_GET['mode'] == 'next') ) ! { ! mx_message_die(GENERAL_ERROR, $lang['Pic_not_exist']); ! } } ! if ($pic_array_id == ($total_pic_count - 1)) { ! $no_next_pic = true; ! if( isset($_GET['mode']) && ($_GET['mode'] == 'prev') ) ! { ! mx_message_die(GENERAL_ERROR, $lang['Pic_not_exist']); ! } ! } ! // ------------------------------------ ! // PREVIOUS & NEXT ! // ------------------------------------ ! $pic_id_old = $total_pic_rows[$pic_array_id]['pic_id']; ! if( isset($_GET['mode']) && ($_GET['mode'] == 'next') ) ! { ! $new_pic_array_id = $pic_array_id - 1; ! if ($new_pic_array_id == 0) { ! $no_prev_pic = true; ! } ! else ! { ! $no_prev_pic = false; ! $no_next_pic = false; } } ! elseif( isset($_GET['mode']) && ($_GET['mode'] == 'prev') ) { ! $new_pic_array_id = $pic_array_id + 1; ! if ($new_pic_array_id == ($total_pic_count - 1)) { ! $no_next_pic = true; } else { ! $no_next_pic = false; ! $no_prev_pic = false; } } ! else { ! $new_pic_array_id = $pic_array_id; ! } ! $pic_id_tmp = $total_pic_rows[$new_pic_array_id]['pic_id']; ! $pic_cat_id_tmp = $total_pic_rows[$new_pic_array_id]['pic_cat_id']; ! $pic_time_tmp = $total_pic_rows[$new_pic_array_id]['pic_time']; ! $pic_user_id_tmp = $total_pic_rows[$new_pic_array_id]['pic_user_id']; ! $next_pic_count = ($total_pic_count - $new_pic_array_id - 1); ! $prev_pic_count = ($new_pic_array_id); ! if( isset($_GET['mode']) ) ! { ! if ( ($_GET['mode'] == 'next') || ($_GET['mode'] == 'prev') ) { ! $pic_id = $pic_id_tmp; } + } ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav', array( ! 'L_PICS_NAV' => $lang['Pics_Nav'], ! 'L_PICS_NAV_NEXT' => $lang['Pics_Nav_Next'], ! 'L_PICS_NAV_PREV' => $lang['Pics_Nav_Prev'], ! ) ! ); ! } ! if ( $album_config['invert_nav_arrows'] == 0 ) ! { ! $max_pic_counter = min(($total_pic_count - 1), ($new_pic_array_id + 2)); ! $min_pic_counter = max(0, ($new_pic_array_id - 2)); ! for($i = $min_pic_counter; $i <= $max_pic_counter; $i++) { ! $thumbnail_file = append_sid(this_smartor_mxurl('smartor_mode=album_thumbnail&pic_id=' . $total_pic_rows[$i]['pic_id'], TRUE)); ! if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) ! { ! $pic_filename = $total_pic_rows[$i]['pic_filename']; ! $file_part = explode('.', strtolower($pic_filename)); ! $pic_filetype = $file_part[sizeof($file_part) - 1]; ! $pic_title = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1); ! //$pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); ! //$pic_title = ucfirst(substr($pic_filename, 0, strlen($pic_filename) - 4)); ! $pic_thumbnail = ( $total_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . '.' . $pic_filetype : $total_pic_rows[$i]['pic_thumbnail']; ! //$pic_thumbnail = ( $total_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $nav_pic_id[$i]['pic_thumbnail']; ! $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if ( file_exists($pic_thumbnail_fullpath) ) ! { ! $thumbnail_file = $pic_thumbnail_fullpath; ! } ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = ''; ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\'' . append_sid(this_fap_addonurl('smartor_mode=album_picm&pic_id=' . $total_pic_rows[$i]['pic_id'])) . '\',\'' . addslashes($total_pic_rows[$i]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav.pics', array( ! 'U_PIC_THUMB' => $thumbnail_file, ! 'U_PIC_LINK' => ($i == $new_pic_array_id) ? '#' : append_sid(this_smartor_mxurl('smartor_mode=album_showpage&pic_id=' . $total_pic_rows[$i]['pic_id'] . $full_size_param . $nuffimage_vars . $sort_append)), ! 'PIC_TITLE' => $total_pic_rows[$i]['pic_title'], ! 'PIC_PREVIEW' => ($i == $new_pic_array_id) ? '' : $pic_preview, ! 'STYLE' => ($i == $new_pic_array_id) ? 'border: solid 3px #FF5522;' : '', ! ) ! ); ! } ! } ! } ! else ! { ! $max_pic_counter = max(0, ($new_pic_array_id - 2)); ! $min_pic_counter = min(($total_pic_count - 1), ($new_pic_array_id + 2)); ! for($i = $min_pic_counter; $i >= $max_pic_counter; $i--) ! { ! $thumbnail_file = append_sid(this_smartor_mxurl('smartor_mode=album_thumbnail&pic_id=' . $total_pic_rows[$i]['pic_id'], TRUE)); ! if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) ! { ! $pic_filename = $total_pic_rows[$i]['pic_filename']; ! $file_part = explode('.', strtolower($pic_filename)); ! $pic_filetype = $file_part[sizeof($file_part) - 1]; ! $pic_title = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1); ! //$pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); ! //$pic_title = ucfirst(substr($pic_filename, 0, strlen($pic_filename) - 4)); ! $pic_thumbnail = ( $total_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . '.' . $pic_filetype : $total_pic_rows[$i]['pic_thumbnail']; ! //$pic_thumbnail = ( $total_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $nav_pic_id[$i]['pic_thumbnail']; ! $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; ! if ( file_exists($pic_thumbnail_fullpath) ) ! { ! $thumbnail_file = $pic_thumbnail_fullpath; ! } ! } ! if ($album_config['lb_preview'] == 0) ! { ! $pic_preview = ''; ! } ! else ! { ! $pic_preview = 'onmouseover="showtrail(\'' . append_sid(this_fap_addonurl('smartor_mode=album_picm&pic_id=' . $total_pic_rows[$i]['pic_id'], TRUE)) . '\',\'' . addslashes($total_pic_rows[$i]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; ! } ! if ($album_config['show_pics_nav'] == 1) ! { ! $template->assign_block_vars('pics_nav.pics', array( ! 'U_PIC_THUMB' => $thumbnail_file, ! 'U_PIC_LINK' => ($i == $new_pic_array_id) ? '#' : append_sid(this_smartor_mxurl('smartor_mode=album_showpage&pic_id=' . $total_pic_rows[$i]['pic_id'] . $full_size_param . $nuffimage_vars . $sort_append)), ! 'PIC_TITLE' => $total_pic_rows[$i]['pic_title'], ! 'PIC_PREVIEW' => ($i == $new_pic_array_id) ? '' : $pic_preview, ! 'STYLE' => ($i == $new_pic_array_id) ? 'border: solid 3px #FF5522;' : '', ! ) ! ); ! } } } *************** *** 1054,1057 **** --- 973,977 ---- $slideshow_link = append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id)); $slideshow_link_full = '<a href="' . $slideshow_link . '">' . $lang['Slideshow_Off'] . '</a>'; + $pic_link = append_sid(this_smartor_mxurl("smartor_mode=" . $nuffimage_pic . "&pic_id=" . $pic_id, TRUE)); $next_pic = ($no_next_pic == false) ? '<a href="' . append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . $full_size_param . '&mode=next&slideshow=' . $slideshow_delay)) . '#TopPic"><img src="' . $images['icon_right_arrow3'] . '" title="' . $lang['Next_Pic'] . '" border="0" alt="' . $lang['Next_Pic'] . '" align="middle" /></a>' : ''; $prev_pic = ($no_prev_pic == false) ? '<a href="' . append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . $full_size_param . '&mode=prev&slideshow=' . $slideshow_delay)) . '#TopPic"><img src="' . $images['icon_left_arrow3'] . '" title="' . $lang['Prev_Pic'] . '" border="0" alt="' . $lang['Prev_Pic'] . '" align="middle" /></a>' : ''; *************** *** 1075,1082 **** $slideshow_select .= '<option value="10">10 Sec</option>'; $slideshow_select .= '</select> '; ! $slideshow_onoff = $lang['Slideshow_On']; //$slideshow_link = append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . '&full=true&slideshow=' . $slideshow_delay)); $slideshow_link = append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . '&full=true')); $slideshow_link_full = '<a href="' . $slideshow_link . '">' . $lang['Slideshow_On'] . '</a>'; $next_pic = ($no_next_pic == false) ? '<a href="' . append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . $full_size_param . '&mode=next' . $nuffimage_vars)) . '#TopPic"><img src="' . $images['icon_left_arrow3'] . '" title="' . $lang['Next_Pic'] . '" border="0" alt="' . $lang['Next_Pic'] . '" align="middle" /></a>' : ''; $prev_pic = ($no_prev_pic == false) ? '<a href="' . append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . $full_size_param . '&mode=prev' . $nuffimage_vars)) . '#TopPic"><img src="' . $images['icon_right_arrow3'] . '" title="' . $lang['Prev_Pic'] . '" border="0" alt="' . $lang['Prev_Pic'] . '" align="middle" /></a>' : ''; --- 995,1003 ---- $slideshow_select .= '<option value="10">10 Sec</option>'; $slideshow_select .= '</select> '; ! $slideshow_onoff = $lang['Slideshow_On']; //$slideshow_link = append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . '&full=true&slideshow=' . $slideshow_delay)); $slideshow_link = append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . '&full=true')); $slideshow_link_full = '<a href="' . $slideshow_link . '">' . $lang['Slideshow_On'] . '</a>'; + $pic_link = append_sid(this_smartor_mxurl("smartor_mode=" . $nuffimage_pic . "&pic_id=" . $pic_id . $sort_append . $full_size_param . $nuff_http_full_string, TRUE)); $next_pic = ($no_next_pic == false) ? '<a href="' . append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . $full_size_param . '&mode=next' . $nuffimage_vars)) . '#TopPic"><img src="' . $images['icon_left_arrow3'] . '" title="' . $lang['Next_Pic'] . '" border="0" alt="' . $lang['Next_Pic'] . '" align="middle" /></a>' : ''; $prev_pic = ($no_prev_pic == false) ? '<a href="' . append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $pic_id . $full_size_param . '&mode=prev' . $nuffimage_vars)) . '#TopPic"><img src="' . $images['icon_right_arrow3'] . '" title="' . $lang['Prev_Pic'] . '" border="0" alt="' . $lang['Prev_Pic'] . '" align="middle" /></a>' : ''; *************** *** 1144,1148 **** 'U_VIEW_CAT' => ($cat_id != PERSONAL_GALLERY) ? append_sid(this_smartor_mxurl("smartor_mode=album_cat&cat_id=$cat_id")) : append_sid(this_smartor_mxurl("smartor_mode=album_personal&user_id=$user_id")), ! 'U_PIC' => ( $picm ) ? append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=$pic_id", TRUE)) : append_sid(this_smartor_mxurl("smartor_mode=album_picm&pic_id=$pic_id", TRUE)), 'U_PIC_L1' => ( $picm ) ? '' : '<a href='.this_smartor_mxurl("smartor_mode=album_showpage&full=&pic_id=" . $pic_id) . '>', 'U_PIC_L2' => ( $picm ) ? '' : '</a>', --- 1065,1070 ---- 'U_VIEW_CAT' => ($cat_id != PERSONAL_GALLERY) ? append_sid(this_smartor_mxurl("smartor_mode=album_cat&cat_id=$cat_id")) : append_sid(this_smartor_mxurl("smartor_mode=album_personal&user_id=$user_id")), ! //'U_PIC' => ( $picm ) ? append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=$pic_id", TRUE)) : append_sid(this_smartor_mxurl("smartor_mode=album_picm&pic_id=$pic_id", TRUE)), ! 'U_PIC' => $pic_link, 'U_PIC_L1' => ( $picm ) ? '' : '<a href='.this_smartor_mxurl("smartor_mode=album_showpage&full=&pic_id=" . $pic_id) . '>', 'U_PIC_L2' => ( $picm ) ? '' : '</a>', |