Welcome to Geeklog, Anonymous Saturday, June 22 2024 @ 02:11 am EDT

Geeklog Forums

Fix for Daily Digest function and Visitor Stats plugin conflict

Status: offline


Forum User
Registered: 03/18/05
Posts: 3
Fix for Visitor Stats and Daily Digest conflict.

Issue at hand: emailgeeklogstories cron script creates a page hit from the local system. REMOTE_ADDR server variable is undefined and therefore causes gethostbyaddr to report a warning about an invalid ip. This fix sets REMOTE_ADDR to so that it doesn't complain. It should only do it if REMOTE_ADDR is empty. The other idea is to not log them at all. I will provide both instructions.

File to edit (for both instructions): [geeklog_install]/plugins/glstats/functions.inc

To log them but have for ip address:

Text Formatted Code

function ST_addStats()

    $browser = ST_getBrowser();
    if ($_USER['uid'] < 2) {
        $usr = 1;
        $usern = 'Anonymous';
    } else {
        $usr = $_USER['uid'];
        $usern = $_USER['username'];

Text Formatted Code

    if ($REMOTE_ADDR == "") {
       $REMOTE_ADDR = "";

To ignore them completely:

Text Formatted Code

    if ((in_array($_USER['username'],$_ST_USER_IGNORE)) || (in_array($REMOTE_ADDR,$_ST_IP_IGNORE))) {

Text Formatted Code

    if ((in_array($_USER['username'],$_ST_USER_IGNORE)) || (in_array($REMOTE_ADDR,$_ST_IP_IGNORE)) || ($REMOTE_ADDR == "")) {

I know others have found other methods of fixing this but I have not been able to get them to work including setting emailgeeklogstories as an ignored file with both just the filename and the full path. The cron script resides outside the html directory but even if I placed it within the html directory Visitor Stats plugin still doesn't know what file it logged (the field is blank in the database). This error was occuring when the hit was being logged in the userstats table. So bad entries in the database had nothing to do with this one.

All times are EDT. The time is now 02:11 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