![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
Help! Someone experienced in PHP
I have a code that is supplied to me from a sponsor that rotates the galleries in the database with every refresh. I'd like that simple code to rotate only after 24 hours. Anybody have the secret?
<?php $fileName = "./bobotheclown.txt"; mt_srand( (double) microtime() * 1000000 ); $a = file($fileName); $randNum = mt_rand( 0, sizeof($a)-1 ); header( "Location: ". $a[$randNum] ); ?> Thanks Trixxxia |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Join Date: Sep 2002
Location: California
Posts: 2,021
|
If you go to either of the these sites, there are plenty of PHP experts on the message boards to help:
http://www.codewalkers.com http://phpbuilder.org |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
Quote:
__________________
/(bb|[^b]{2})/ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
BTW, the code you have now is not time-based, and does not rotate the galleries in the "database". The time thing in it is only to seed the "random" function. Right now a random gallery is chosen from the file every time the script is called, there is no "refresh" or "rotation".
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
punkworld,
Exactly, what I'm looking for it to do is rotate every 24 hours not everytime it is called. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
Quote:
__________________
/(bb|[^b]{2})/ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
I'm in a hurry, so answer quickly if you want the code.
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
How many galleries are in the file ? If you're only sending once a day, you can go by the day # ( day of month, day of year ).
$fileName = "./bobotheclown.txt"; $a = file($fileName); #$gal = date("j"); // day of month #$gal = date("z"); // day of year header( "Location: ". $a[$gal] ); if you only have around 30 or so then use day of month. if you have 100 or more then just fill the file up with enough to equal 367 or so, duplicate as necessary if you don't have enough of them. only one will show per day.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
You guys are great!
Thanks I appreciate it. I couldn't for the life of me understand what had to be changed - all the resource sites wanted me to install their own code. The simpler for me, the better! Again, thank you. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
cookie-based, unlike the one above it handles other numbers of galleries than just 31 or 365
PHP Code:
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
punkworld, do you have ICQ?
9.3.0.8.6.5.8.6 Could you Oh-Oh me? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
I must be lost or something is not obvious enough. Neither work!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Quote:
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
In other words...Brujah...would this be what it should look like?
$fileName = "./bobotheclown.txt"; $a = file($fileName); #$gal = date("j"); /31/ day of month header( "Location: ". $a[$gal] ); |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Actually like this:
PHP Code:
$fileName = "./bobotheclown.txt"; $a = file($fileName); $gal = date("j"); header( "Location: ". $a[$gal] );
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
Brujah! God Bless! Thank you!
Do I owe you anything? Have any sponsors you want me to sign-up under you? Thanks again.........it works!!!!!!!!!!!!!! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Quote:
![]() Otherwise, nope.. it's all good.
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
heheh.....no more of a BBW type here sorry ;-)
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | |
Confirmed User
Industry Role:
Join Date: Jan 2002
Location: Clearwater, Florida
Posts: 2,680
|
Quote:
__________________
Im fuckin retired ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
Quote:
![]() BTW, Trixia, I just tested it myself, and everything is working fine... http://www.captainevil.com/gfytest.php
__________________
/(bb|[^b]{2})/ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
Brujah or punkworld,
Can I get more complicated and add a picture to represent the link or have a random text? /me wants to complicate her life some more ;-) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
I just feel like complicating life a little........
Anyone know how to add a pic & description to the loop? What has to be added to the code& what has to be added to the .txt file? Thanks for your help! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
:-(
No punkworld or Brujah today? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Confirmed User
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
|
One more bump?
Help? Please......pretty please with a strawberry on top? |
![]() |
![]() ![]() ![]() ![]() ![]() |