Autor Zpráva
ptcnadruhou
Profil
Ahoj Prosím o radu.
Potřebuju poradit jak mám upravit tento kód.Zobrazuje čas serveru,no problém je v tom že je spoždění o dvě hodiny.
1 je Tady
                    <div class="rr" id="oClock"><span style="color:rgb(92,92,91);">Current Server Time:</span> <span id="liveclock"><?php echo date("F d, Y H:i:s", time()); ?></span></div>
                    
A druhý pokračuje tak to
Všem moc děkuji

<script type="text/javascript">
var currenttime = '<?php echo date("F d, Y H:i:s", time()); ?>';
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var serverdate=new Date(currenttime);
$(function(){
    if(typeof window.OP_TIME_GET == 'function') {
        setInterval("OP_TIME_GET()", 1000);
    }
    $('.ui-widget-content:visible').each(function(){if($(this).height()<20){$(this).css('background-position','50% 50%');}});
    $('body').bind('mousemove', function(){
        t = $('#tooltip',this);
        
        if(t.hasClass('ui-state-default')){
            t.css({'text-shadow':'0 0 3px #000'})
        }
    });
});
</script>    
pcmanik
Profil
ptcnadruhou:
Ja tam nikde cron nevidím a čas servera je logicky potrebné zmeniť na serveri...
ptcnadruhou
Profil
pcmanik:
Cron

<?php

    function _OP_CRON_00_00_ERROR($error, $file, $line){
        
        $body = "TIME: ".date('Y/m/d H:i:s');        
        $body .= "\nFILE: ".$file;
        $body .= "\nLINE: ".$line;
        $body .= "\nERROR: ".$error;
        
        mail(SITE_INFO_SUPPORT, 'ERROR: CRON RENTED', $body);
    }

    function _OP_AVG($time, $clicks){
        $avg['time_1'] = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
        $avg['time_2'] = mktime(0, 0, 0, date('m', $time), date('d', $time), date('Y', $time));
        $avg['time_3'] = $avg['time_1'] - $avg['time_2'];
        $avg['days'] = floor( $avg['time_3'] / 86400 );
        
        if($avg['days'] == 0 || $clicks == 0){
            return number_format( 0 , 3 );
        } else {
            return number_format( ($clicks / $avg['days']), 3 );
        }
    }
    
    ini_set("max_execution_time", -1);
    
    require_once(dirname(__FILE__).'/../../../config.php');
    
    $link = mysql_connect(XEON_DB_HOST, XEON_DB_USER, XEON_DB_PASS) or die(_OP_ERROR('DB/CONNECT; FATAL ERROR!', __FILE__, __LINE__));
            mysql_select_db(XEON_DB_DBNA) or die(_OP_ERROR('DB/SELECT; FATAL ERROR!', __FILE__, __LINE__));
  
    mysql_query("DELETE FROM `xeon_clicks` WHERE `day` != '".date("d")."';") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);
    mysql_query("UPDATE `xeon_users` SET `config_update_stats` = '1', `config_pm_limit` = '0';") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);

    $QUERY_AVG_DIRECT_SQL = mysql_query("SELECT * FROM `xeon_users` WHERE `s_clicks` > 0;") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);    
    while($d = mysql_fetch_assoc($QUERY_AVG_DIRECT_SQL)){
        mysql_query("UPDATE `xeon_users` SET `s_avg` = '"._OP_AVG($d['x_register'], $d['s_clicks'])."' WHERE `xeon_users`.`id` = {$d['id']} LIMIT 1;") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);        
    }
    
    $QUERY_AVG_RENTED_SQL = mysql_query("SELECT * FROM `xeon_users_rented` WHERE `clicks` > 0;") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);    
    while($r = mysql_fetch_assoc($QUERY_AVG_RENTED_SQL)){
        mysql_query("UPDATE `xeon_users_rented` SET `avg` = '"._OP_AVG($r['since'], $r['clicks'])."' WHERE `xeon_users_rented`.`id` = {$r['id']} LIMIT 1;") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);
    }
    
    $TABLES_OPTIMIZE = mysql_query("SHOW TABLES") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);
    
    while($table = mysql_fetch_assoc($TABLES_OPTIMIZE)){
        foreach($table as $db => $tablename){
            mysql_query("OPTIMIZE TABLE `$tablename`;") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);
        }
    }
    
    if(date('D') == 'Sun'){
        
        mysql_query("UPDATE `xeon_users` SET `config_jp_0_limit` = '0', `config_jp_1_limit` = '0';") or _OP_CRON_00_00_ERROR(mysql_error(), __FILE__, __LINE__);
        
    }
    
    mysql_close($link);

?>

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: