Little Green Footbal Referrer hack: Display date
Kristine posted on her blog a few weeks ago that she added the date/time to the show referrers. Since I can’t see another toy and not know how it’s done (and have it for myself) - I figured out how to do it…
First (obviously) if you haven’t already, you’ll need to grab the original code from here.
Then, open up lgf-reflog.php. Where you see these lines:
if (count($rfile) == $maxref)
array_pop($rfile);
add this line just below it
$ref = date(”F j, Y, g:i a”).” ||| “.$ref;
Then open up show-refs.php
Change(replace) this:
$r = chop($r);
if ($r <> “Direct request”) echo “<a href=\”$r\”>$r</a><br />\n”;
to this:
$r = chop($r);
$rpieces = explode(” ||| “, $r);
if (count($rpieces) >1) {
if ($r <> “Direct request”) echo “$rpieces[0] : <a href=\”$rpieces[1]\”>$rpieces[1]</a><br />\n”;
} else {
if ($r <> “Direct request”) echo “<a href=\”$r\”>$r</a><br />\n”;
}
To change how the date is displayed - you can change that first part:
date(”F j, Y, g:i a”). Just go here to see the different ways dates can be displayed - what you put in between the (” and the “) after ‘date’ will determine how it gets displayed…
October 13th, 2002 at 3:35 pm
Worked perfectly!! Thank you so much. I was just looking for such a thing!
October 13th, 2002 at 3:59 pm
Those smart girls (and guys) over at Scripty Goddess have a quick, simple change that you can add to Little
October 13th, 2002 at 4:33 pm
Well again, I’m sorry, Jenn - nobody seemed interested when I posted on my blog, so I didn’t post it over here.
I feel like a bad goddess now!!! I’ll look at my version and post anything spectacularly different when I get back!
October 13th, 2002 at 5:44 pm
Don’t worry about it
Actually I’m curious if you did your differently. You’ll have to let me know.
October 14th, 2002 at 3:22 pm
Well, Jenn’s code is probably cleaner than mine - I’m still a newbie at php, but I’ll post links to mine anyhow
LGF-Reflog
Show-Refs
Mine adds the time in as an array, and I shifted the date for the number of hours off from my server time to my time. (personal mod changed it from 50 to 100 referrals and I’m filtering out 4 bots that hit my site - you can read more about how to do that on this site!)
Hope this helps somebody!
October 14th, 2002 at 8:30 pm
Thanks for posting all of this! I had been wondering if there was a way for the time/day stamp to be added. And Thanks Kristing for showing how to adjust the time for different time zones… I was just about to ask how to do that. :o)
October 14th, 2002 at 11:03 pm
Oh good grief… sorry about my spelling… that is what I get for typing in the dark. LOL
October 15th, 2002 at 11:14 pm
mine shows the date and time, the referrer, the ip they came from, and the page they visited.
I took out the bit that stops it reporting on those coming fromwithin my domain, so that I can see where people go when they get here. Hopefully it will give me an idea of what’s interesting and what’s not.
I’m at work atm, but if anyone wants to know the extra bits of code I can post back.
October 15th, 2002 at 11:25 pm
Oh I would LOVE to know how to grab the IP! Please let me know how you did that. Thanks!
October 16th, 2002 at 6:19 am
I pinched Kristines idea, and posted text files of my code here <a href=”http://wiccked.com/wish/snippets/lgf-reflog-code.txt”>lgf-reflog</a> and here <a href=”http://wiccked.com/wish/snippets/show-refs-code.txt”>show-refs</a>
I was even very good and commented it all nicely
October 16th, 2002 at 8:06 am
That is awesome! Thanks Melanie!
October 23rd, 2002 at 1:44 pm
The referral script is working well. I have added the ‘display date’ feature to it as well. Thanks to the
October 23rd, 2002 at 3:16 pm
I’m just posting this here in case it helps anyone else - when you paste the longer bit of code into show-refs.php, don’t leave off the trailing bracket, or delete the one that’s already there; there should be two, one right after the other in the altered code. Trial and error…
February 16th, 2003 at 6:34 pm
Sundays seem to be my tweak day. Maybe I should lobby to make it a National Tweak Day? So far,
February 27th, 2003 at 2:06 pm
This is kind of off-topic, but does anyone know if you can choose URLs to ignore in your list? I’m getting referral spam and would like to filter those out.
February 27th, 2003 at 2:08 pm
Kymberlie - see this post.
May 5th, 2003 at 12:44 pm
Thanks to a little hack, the reflog now has dates and times… Lets see how it holds when the Spam…
August 20th, 2003 at 2:34 pm
Oh, and no more WeatherPixie.
October 15th, 2003 at 7:56 pm
Melanie,
In both your source code files, you have a parse error on line 15. Your opening comment was transposed:
*/ instead of /*
November 30th, 2003 at 1:20 pm
Running list (reverse chronology) of modifications made to the default MT installation, links to corresponding snippets or plugins, and other technical changes related to my blog …or yours if you run MT…
September 23rd, 2004 at 1:44 am
Can someone guide me installing this referrer script? I am confused with the lgf-reblog and show-refs pages. Am I supposed to create another page like example.php? If you can list all the files I need to have in my referrer dir that would be great! Thanks!
October 29th, 2004 at 7:44 am
I have searched the original site for the download link but can’t find it anywhere. It seems like a really neat script and I’d like to give it a try.
Can anyone post the link here?
Thanks much