예제 #1
0
/**
* Footer
*
* To show footer of any page you want 
* paramenters : none
*/
function Saafooter($outscript = false)
{
    global $tpl, $SQL, $starttm, $config, $usrcp, $lang, $olang;
    global $do_gzip_compress, $script_encoding, $errorpage, $extras, $userinfo;
    //show stats ..
    $page_stats = '';
    if ($config['statfooter'] != 0) {
        $gzip = $config['gzip'] == '1' ? "Enabled" : "Disabled";
        $hksys = !defined('STOP_HOOKS') ? "Enabled" : "Disabled";
        $endtime = get_microtime();
        $loadtime = number_format($endtime - $starttm, 4);
        $queries_num = $SQL->query_num;
        $time_sql = round($SQL->query_num / $loadtime);
        $page_url = preg_replace(array('/([\\&\\?]+)debug/i', '/&/i'), array('', '&'), kleeja_get_page());
        $link_dbg = user_can('enter_acp') && $config['mod_writer'] != '1' ? '[ <a href="' . str_replace('&', '&amp;', $page_url) . (strpos($page_url, '?') === false ? '?' : '&amp;') . 'debug">More Details ... </a> ]' : null;
        $page_stats = "<strong>[</strong> GZIP : {$gzip} - Generation Time: {$loadtime} Sec  - Queries: {$queries_num} - Hook System:  {$hksys} <strong>]</strong>  " . $link_dbg;
    }
    $tpl->assign("page_stats", $page_stats);
    //if admin, show admin in the bottom of all page
    $tpl->assign("admin_page", user_can('enter_acp') ? '<a href="' . ADMIN_PATH . '" class="admin_cp_link"><span>' . $lang['ADMINCP'] . '</span></a>' : '');
    //assign cron
    $tpl->assign("run_queue", '<img src="' . $config['siteurl'] . 'go.php?go=queue" width="1" height="1" alt="queue" />');
    // if google analytics, new version
    //http://www.google.com/support/googleanalytics/bin/answer.py?answer=55488&topic=11126
    $googleanalytics = '';
    if (strlen($config['googleanalytics']) > 4) {
        $googleanalytics .= '<script type="text/javascript">' . "\n";
        $googleanalytics .= '<!--' . "\n";
        $googleanalytics .= 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");' . "\n";
        $googleanalytics .= 'document.write("\\<script src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'>\\<\\/script>" );' . "\n";
        $googleanalytics .= '-->' . "\n";
        $googleanalytics .= '</script>' . "\n";
        $googleanalytics .= '<script type="text/javascript">' . "\n";
        $googleanalytics .= '<!--' . "\n";
        $googleanalytics .= 'var pageTracker = _gat._getTracker("' . $config['googleanalytics'] . '");' . "\n";
        $googleanalytics .= 'pageTracker._initData();' . "\n";
        $googleanalytics .= 'pageTracker._trackPageview();' . "\n";
        $googleanalytics .= '-->' . "\n";
        $googleanalytics .= '</script>' . "\n";
    }
    $tpl->assign("googleanalytics", $googleanalytics);
    //check for extra header
    if (empty($extras['footer'])) {
        $extras['footer'] = false;
    }
    ($hook = kleeja_run_hook('func_Saafooter')) ? eval($hook) : null;
    //run hook
    $footer = $tpl->display("footer");
    ($hook = kleeja_run_hook('Saafooter_func')) ? eval($hook) : null;
    //run hook
    echo $footer;
    //page analysis
    if (isset($_GET['debug']) && user_can('enter_acp')) {
        kleeja_debug();
    }
    //at end, close sql connections
    $SQL->close();
}
예제 #2
0
파일: mysql.php 프로젝트: Saleh7/Kleeja
 function close()
 {
     if ($this->connect_id) {
         // Commit any remaining transactions
         if ($this->in_transaction) {
             mysql_query("COMMIT", $this->connect_id);
         }
         #loggin -> close connection
         kleeja_log('[Closing connection] :' . kleeja_get_page());
         return @mysql_close($this->connect_id);
     } else {
         return false;
     }
 }