66
Quote:
shinybt wrote:
which stats module u were saying? sorry, this was the 3rd days for me to play this XOOPS and gallery. It was a 1st php portal for me also.. >.<
It's called "Statistics", by Mispunt. The readme instructs you to as follows:
Quote:
Installation. |
--------------------------------
After installing the normal module, you have to modify some files.
First you must at in the file "header.php" (which is in the root directory) under:
include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
the line:
include_once("modules/statistics/include/counter.php");
Whith this peace of code the website add information of the hits to the database, so
you can view them in the admin section.
I've been able to patch the include file so it doesn't stomp on variables. All the patch does is isolate the routine from the global variables by putting it into a funciton instead of inline.
Modify 2 places. Add the line in
red to the TOP of the file to look like this:
[color=FF0000][b]function statistics_counter_countpage() {[/b][/color]
/********************************************************************/
/* File: counter.php */
/* Directory: ./include/ */
...
... now add the 2 lines in
red at the BOTTOM to look like this:
...
else
{
$xoopsDB->queryF("INSERT INTO ".$xoopsDB->prefix("statistics_ip")." (ip, date, hits) VALUES ('$ip', '$now_ip', '1')");
}
[color=FF0000][b]}
statistics_counter_countpage();[/b][/color]
?>
I'll send the author the full patch also, so he can update his code. I won't be posting a patched version since I don't know if I have the latest or not.
Another tip while I'm in there anyway... If you change
$ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
to (all on a single line):
$ip = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : $HTTP_SERVER_VARS['REMOTE_ADDR'];
it'll get IP addresses properly while running on Apache too.