Welcome to Geeklog Saturday, December 16 2017 @ 12:30 am EST


Status: offline

machinari

Forum User
Full Member
Registered: 22/03/2004
Posts: 1512
* a counter for your geeklog site. no cgi necessary.
* code is from the stats page and simply displays the page hits in a php block.
* throw this code into your lib-custom.php and create a block using this function.
* style as you please.
PHP Formatted Code
//displays your page hits in a block.
//code is from the gl stats page.
//also uses the same access rights as stats page.
function phpblock_pagehits(){
    global $_CONF, $_USER, $_TABLES, $LANG10;
    //get perms
    if (empty ($_USER['username']) &&
    (($_CONF['loginrequired'] == 1) || ($_CONF['statsloginrequired'] == 1))) {
        $display = '';
    } else {
        //get data
        $totalhits = DB_getItem($_TABLES['vars'],'value',"name = 'totalhits'");
        //display data
        $display = '<p align="center">';
        //$display .= '<span style="font-weight: bold;">' . $LANG10[2] . '</span>';
        $display .= '<span style="color: red; font-weight: bold;">' . $totalhits . '</span>';
        $display .= '</p>';
    }
    //return display
    return $display;
}

 

sammykrupa

Anonymous
Looks good! Thanks

Kiwi

Anonymous
can a similar thing be done for all stats like how many users , and so on?

Status: offline

machinari

Forum User
Full Member
Registered: 22/03/2004
Posts: 1512
yes.. just need to utilize the proper code.

All times are EST. The time is now 12:30 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content