|
From: OryNider <ory...@us...> - 2008-01-31 10:22:39
|
Update of /cvsroot/mxbb/mx_counter In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22757 Modified Files: Tag: core28x db_install.php db_uninstall.php mx_counter.php readme.txt Log Message: upgrade for 2.8.1 Index: mx_counter.php =================================================================== RCS file: /cvsroot/mxbb/mx_counter/mx_counter.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** mx_counter.php 11 Jun 2007 03:17:42 -0000 1.2 --- mx_counter.php 31 Jan 2008 10:22:35 -0000 1.2.2.1 *************** *** 10,14 **** - if( !defined('IN_PORTAL') || !is_object($mx_block)) { --- 10,13 ---- *************** *** 33,79 **** //Set a cookie for the counter so we know we have been here before ! setcookie($board_config['cookie_name'] . '_pubOry_counter',"set",time() + 31536000,$board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); //check cookie global $HTTP_COOKIE_VARS; ! if($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_pubOry_counter']) { ! $bInc=false; } else { ! $bInc=true; ! } ! ! ! $digitpath = $counter_config['digitpath']; ! $digits = $counter_config['digits']; ! ! if (empty($digitpath)) ! { ! $digitpath = 'set1'; } ! if (empty($digits)) ! { ! $digits = '5'; ! } //read old counter data $imagedirectory = $module_root_path . 'numbers/' . $digitpath . '/'; ! $sql2 = "SELECT * FROM ".COUNTER_SESSION_TABLE." WHERE count_id = 1"; ! $result2 = $db->sql_query($sql2); ! if( !($result2 = $db->sql_query($sql2)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't query counter session table", "", __LINE__, __FILE__, $sql2); } ! else { ! while( $currentcount = $db->sql_fetchrow($result2) ) { --- 32,70 ---- //Set a cookie for the counter so we know we have been here before ! setcookie($board_config['cookie_name'] . '_mx_counter',"set",time() + 31536000,$board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); //check cookie global $HTTP_COOKIE_VARS; ! if($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_mx_counter']) { ! $binc=false; } else { ! $binc=true; } ! $digitpath = ($counter_config['digitpath']) ? $counter_config['digitpath'] : 'set1'; ! $digits = ($counter_config['digits']) ? intval($counter_config['digits']) : 5; //read old counter data $imagedirectory = $module_root_path . 'numbers/' . $digitpath . '/'; ! $sql = "SELECT * FROM ".COUNTER_SESSION_TABLE." WHERE count_id = 1"; ! $result = $db->sql_query($sql); ! /* ! if( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, "Couldn't query counter session table", "", __LINE__, __FILE__, $sql2); } ! */ ! ! if( ($result = $db->sql_query($sql)) ) { ! while( $currentcount = $db->sql_fetchrow($result) ) { *************** *** 81,85 **** //check if we are incrementing counter ! if($bInc) { $newcount = $currentcount + 1; --- 72,76 ---- //check if we are incrementing counter ! if($binc) { $newcount = $currentcount + 1; *************** *** 95,100 **** for ($a=0;$a<$digits;$a++) { ! $img[$a] = "$imagedirectory"; ! $img[$a] .= "0.gif"; } --- 86,90 ---- for ($a=0;$a<$digits;$a++) { ! $img[$a] = $imagedirectory . "0.gif"; } *************** *** 104,109 **** { $showdig = substr($newcount, $a, 1); ! $img[$digits - $actdigits + $a] = "$imagedirectory"; ! $img[$digits - $actdigits + $a] .= "$showdig.gif"; } --- 94,98 ---- { $showdig = substr($newcount, $a, 1); ! $img[$digits - $actdigits + $a] = $imagedirectory . $showdig . ".gif"; } *************** *** 111,131 **** if($numdigits > $digits) { ! $bOver=true; for ($a=0;$a<$digits;$a++) { ! $img[$a] = "$imagedirectory"; ! $img[$a] .= "9.gif"; } } //this is what we are ouputing ! $displayblock = ""; for ($a=0;$a<$digits;$a++) { ! $displayblock .= "<img src=$img[$a]>"; } //if we incremented, write this value ! if($bInc) { update_count($newcount); --- 100,119 ---- if($numdigits > $digits) { ! $bover=true; for ($a=0;$a<$digits;$a++) { ! $img[$a] = $imagedirectory . "9.gif"; } } //this is what we are ouputing ! $displayblock = ''; for ($a=0;$a<$digits;$a++) { ! $displayblock .= '<img alt="' . $img[$a] . '" src="' . $img[$a] . '" />'; } //if we incremented, write this value ! if($binc) { update_count($newcount); *************** *** 140,147 **** //$counter_data is the variable that holds the stuff to output ! $counter_data.=$displayblock; ! if($bOver == true)$counter_data.='+'; - // // Start output of page // --- 128,138 ---- //$counter_data is the variable that holds the stuff to output ! $counter_data .= $displayblock; ! ! if($bover == true) ! { ! $counter_data .= '+'; ! } // Start output of page // |