Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 01:01 pm EST

Geeklog Forums

phpblock_pagehits


Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
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.
Text 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;
}

 
 Quote

sammykrupa

Anonymous
Looks good! Thanks Big Celebration
 Quote

Kiwi

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

Status: Banned

machinari

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

All times are EST. The time is now 01:01 pm.

  • 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