|
From: Markus P. <mar...@us...> - 2005-04-25 23:56:33
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17977/includes Modified Files: mx_functions.php mx_functions_phpbb.php Log Message: Fixed a couple of things and added mouseover effect to pagination. Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mx_functions_phpbb.php 25 Apr 2005 12:07:20 -0000 1.8 --- mx_functions_phpbb.php 25 Apr 2005 23:56:08 -0000 1.9 *************** *** 602,608 **** } ! $previous_string = $use_next_symbol ? '«' : $lang['Previous']; ! $next_string = $use_previous_symbol ? '»' : $lang['Next']; ! $on_page = floor($start_item / $per_page) + 1; --- 602,610 ---- } ! $previous_string = $use_next_symbol ? '«' : $lang['Previous']; ! $next_string = $use_previous_symbol ? '»' : $lang['Next']; ! ! $class = 'class="mx_pagination" onmouseover="if(this.className){this.className=\'mx_pagination_over\';}" onmouseout="if(this.className){this.className=\'mx_pagination\';}"'; ! $on_page = floor($start_item / $per_page) + 1; *************** *** 614,618 **** for($i = 1; $i < $init_page_max + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max ) { --- 616,620 ---- for($i = 1; $i < $init_page_max + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max ) { *************** *** 632,636 **** for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { ! $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { --- 634,638 ---- for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { ! $page_string .= ($i == $on_page) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { *************** *** 648,652 **** for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if( $i < $total_pages ) { --- 650,654 ---- for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if( $i < $total_pages ) { *************** *** 660,664 **** for($i = 1; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $total_pages ) { --- 662,666 ---- for($i = 1; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $total_pages ) { *************** *** 672,681 **** if ( $on_page > 1 ) { ! $page_string = ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $previous_string . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { ! $page_string .= ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( $on_page * $per_page ) ) . '">' . $next_string . '</a>'; } --- 674,683 ---- if ( $on_page > 1 ) { ! $page_string = ' <a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $previous_string . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { ! $page_string .= ' <a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( $on_page * $per_page ) ) . '">' . $next_string . '</a>'; } Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** mx_functions.php 25 Apr 2005 20:50:04 -0000 1.40 --- mx_functions.php 25 Apr 2005 23:56:08 -0000 1.41 *************** *** 34,37 **** --- 34,38 ---- * - mx_url * - mx_this_url + * - mx_session_start * - post_icons * - get_page_id *************** *** 443,459 **** $numargs = func_num_args(); ! $url = $PHP_SELF . '?' . $_SERVER['QUERY_STRING']; ! $url = parse_url( $url ); $url_array = array(); ! if ( ! empty( $url['query'] ) ) { ! $url_array = explode( "&", $url['query'] ); } $arg_list = func_get_args(); // Check for each option if exists in the parameter list ! for ( $i = 0; $i < $numargs; $i++ ) { $option = $arg_list[$i]; --- 444,460 ---- $numargs = func_num_args(); ! $url = $PHP_SELF . '?' . $HTTP_SERVER_VARS['QUERY_STRING']; ! $url = parse_url($url); $url_array = array(); ! if( ! empty($url['query']) ) { ! $url_array = explode('&', $url['query']); } $arg_list = func_get_args(); // Check for each option if exists in the parameter list ! for( $i = 0; $i < $numargs; $i++ ) { $option = $arg_list[$i]; *************** *** 462,478 **** // If not exists in the parameter list then add the parameter $opt_fund = false; ! for ( $j = 0; $j < count( $url_array ); $j++ ) { ! $tmp = explode( "=", $url_array[$j] ); ! if ( $option == $tmp[0] ) { ! $url_array[$j] = $option . "=" . $value ; $opt_fund = true; } } ! if ( !$opt_fund ) { ! $next = count( $url_array ); ! $url_array[$next] = $option . "=" . $value ; } } --- 463,479 ---- // If not exists in the parameter list then add the parameter $opt_fund = false; ! for( $j = 0; $j < count($url_array); $j++ ) { ! $tmp = explode('=', $url_array[$j]); ! if( $option == $tmp[0] ) { ! $url_array[$j] = $option . '=' . $value ; $opt_fund = true; } } ! if( !$opt_fund ) { ! $next = count($url_array); ! $url_array[$next] = $option . '=' . $value ; } } *************** *** 480,492 **** $url = $url[path]; // Build the parameter list ! if ( ! strpos( $url, "?" ) ) { ! $url .= "?"; } ! $url .= implode( '&' , $url_array ); /* for ($j = 0; $j < count($url_array); $j++) { ! if ( $j < count($url_array) -1 ) { $url .= $url_array[$j] . "&" ; --- 481,493 ---- $url = $url[path]; // Build the parameter list ! if( !strpos($url, '?') ) { ! $url .= '?'; } ! $url .= implode('&', $url_array); /* for ($j = 0; $j < count($url_array); $j++) { ! if( $j < count($url_array) -1 ) { $url .= $url_array[$j] . "&" ; *************** *** 498,504 **** } */ ! $url = str_replace( '?&', "?", $url ); ! $url = str_replace( '.php&', ".php?", $url ); ! return ( $url ); } --- 499,505 ---- } */ ! $url = str_replace('?&', '?', $url); ! $url = str_replace('.php&', ".php?", $url); ! return $url; } *************** *** 508,516 **** | ...function based on original function written by Markus :-) \********************************************************************************/ ! function mx_this_url( $args = '', $force_standalone_mode = false, $file = '' ) { global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; ! if ( $force_standalone_mode ) { $mxurl = ( $file == '' ? "./" : $file . '/' ) . ( $args == '' ? '' : '?' . $args ); --- 509,517 ---- | ...function based on original function written by Markus :-) \********************************************************************************/ ! function mx_this_url($args = '', $force_standalone_mode = false, $file = '') { global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; ! if( $force_standalone_mode ) { $mxurl = ( $file == '' ? "./" : $file . '/' ) . ( $args == '' ? '' : '?' . $args ); *************** *** 519,523 **** { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $page_id ) ) { $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); --- 520,524 ---- { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if( is_numeric($page_id) ) { $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); |