scriptygoddess

13 Oct, 2002

Little Green Footbal Referrer hack: Display date

Posted by: Jennifer In: How to's

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…

22 Responses to "Little Green Footbal Referrer hack: Display date"

1 | Eve

October 13th, 2002 at 3:35 pm

Avatar

Worked perfectly!! Thank you so much. I was just looking for such a thing!

2 | kristine

October 13th, 2002 at 4:33 pm

Avatar

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!

3 | Jennifer

October 13th, 2002 at 5:44 pm

Avatar

Don't worry about it :) Actually I'm curious if you did your differently. You'll have to let me know.

4 | kristine

October 14th, 2002 at 3:22 pm

Avatar

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! :)

5 | Jill

October 14th, 2002 at 8:30 pm

Avatar

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)

6 | Jill

October 14th, 2002 at 11:03 pm

Avatar

Oh good grief… sorry about my spelling… that is what I get for typing in the dark. LOL

7 | melanie

October 15th, 2002 at 11:14 pm

Avatar

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.

8 | Jill

October 15th, 2002 at 11:25 pm

Avatar

Oh I would LOVE to know how to grab the IP! Please let me know how you did that. Thanks!

9 | Melanie

October 16th, 2002 at 6:19 am

Avatar

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 :)

10 | Jill

October 16th, 2002 at 8:06 am

Avatar

That is awesome! Thanks Melanie!

11 | Donna

October 23rd, 2002 at 3:16 pm

Avatar

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…

12 | Kymberlie R. McGuire

February 27th, 2003 at 2:06 pm

Avatar

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.

13 | Jennifer

February 27th, 2003 at 2:08 pm

Avatar

Kymberlie – see this post.

14 | Daniel

October 15th, 2003 at 7:56 pm

Avatar

Melanie,

In both your source code files, you have a parse error on line 15. Your opening comment was transposed:

*/ instead of /*

15 | Neurotic Fishbowl

October 13th, 2002 at 3:59 pm

Avatar

Displaying Dates in LGF's Referral Script
Those smart girls (and guys) over at Scripty Goddess have a quick, simple change that you can add to Little

16 | The Quidnunc: A Myopic Mindfulness

October 23rd, 2002 at 1:44 pm

Avatar

Updates, etc…
The referral script is working well. I have added the 'display date' feature to it as well. Thanks to the

17 | Daisyhead

February 16th, 2003 at 6:34 pm

Avatar

Tweak! Tweak!
Sundays seem to be my tweak day. Maybe I should lobby to make it a National Tweak Day? So far,

18 | The Unknown Geek

May 5th, 2003 at 12:44 pm

Avatar

Datage…
Thanks to a little hack, the reflog now has dates and times… Lets see how it holds when the Spam…

19 | Live in the Delirious Cool

August 20th, 2003 at 2:34 pm

Avatar

Things left behind.
Oh, and no more WeatherPixie.

20 | patchwork progression

November 30th, 2003 at 1:20 pm

Avatar

MT Tweaks
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…

21 | DeeDee

September 23rd, 2004 at 1:44 am

Avatar

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!

22 | Kamilla

October 29th, 2004 at 7:44 am

Avatar

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 :)

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements