|
Posted by Paul Herber on 10/01/07 19:00
On Mon, 1 Oct 2007 18:47:54 +0100, Krustov <me@privacy.net> wrote:
><comp.lang.php>
><itcassy>
><Mon, 01 Oct 2007 17:19:48 -0000>
><1191259188.218679.86660@g4g2000hsf.googlegroups.com>
>
>> I would like to pull a random or alphabetical result on the home page
>> of a site and leave that same result on there for one week. The
>> closest example I have found online is Random Quote Version 3.1 which
>> pulls from a text file rather than the database. I cannot mod it to
>> pull from my db and also it relies on cookies, so I would assume it
>> would pull a different random item for each computer and then keep
>> that item on the page for whatever time you specify (?). I am working
>> with dealers and would like to automatically feature a different
>> dealer every week without having to go into the db and choose which
>> one to feature.
>>
>
><?php
>
>$temp=time()+604800;
>
># the above is TIME NOW plus one week
>
># save $temp to database or flat file
>
>?>
>
><?php
>
># grab $temp from database or flat file
>
>$rambo=time();
>
>if ($rambo>$temp) {print "One week has passed - select another dealer";}
>
>?>
Whatever you do, do not follow Krusty's variable naming style.
--
Regards, Paul Herber, Sandrila Ltd. http://www.sandrila.co.uk/
[Back to original message]
|