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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-28-2003, 07:15 PM   #1
HS-Trixxxia
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
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-28-2003, 08:50 PM   #2
inthestars
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
inthestars is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-28-2003, 08:53 PM   #3
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Quote:
Originally posted by Trixxxia
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
Could you give a bit more info on what exactly you want?
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-28-2003, 08:56 PM   #4
Libertine
sex dwarf
 
Libertine's Avatar
 
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})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2003, 07:15 AM   #5
HS-Trixxxia
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.
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2003, 07:19 AM   #6
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Quote:
Originally posted by Trixxxia
punkworld,
Exactly, what I'm looking for it to do is rotate every 24 hours not everytime it is called.
In other words, send the surfer to the same gallery for 24 hours to come once he's clicked the link?
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2003, 07:24 AM   #7
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
I'm in a hurry, so answer quickly if you want the code.
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2003, 07:36 AM   #8
Brujah
Beer Money Baron
 
Brujah's Avatar
 
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.
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2003, 08:48 AM   #9
HS-Trixxxia
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.
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2003, 01:47 PM   #10
Libertine
sex dwarf
 
Libertine's Avatar
 
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:
<?php
if(isSet($_COOKIE['bobotheclown'])){
 
header("Location: " $_COOKIE['bobotheclown']);
} else {
 
$fileName "./bobotheclown.txt";
 
$a file($fileName);
 
mt_srand( (double) microtime() * 1000000 ); 
 
$randNum mt_rand0sizeof($a)-);
 
setcookie ("bobotheclown"$a[$randNum], time()+86400);
 
header("Location: " $a[$randNum]);
}
?>
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2003, 10:06 PM   #11
HS-Trixxxia
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?
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 05:01 PM   #12
HS-Trixxxia
Confirmed User
 
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
I must be lost or something is not obvious enough. Neither work!
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 05:20 PM   #13
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Quote:
Originally posted by Trixxxia
I must be lost or something is not obvious enough. Neither work!
Mine requires you remove one of the two # before the two lines with dates, depending on the number of lines in your gallery file.
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 05:24 PM   #14
HS-Trixxxia
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] );
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 05:27 PM   #15
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Actually like this:

PHP Code:
<?php
$fileName 
"./bobotheclown.txt"
$a file($fileName); 
$gal date("j"); 
header"Location: "$a[$gal] );
?>

$fileName = "./bobotheclown.txt";
$a = file($fileName);
$gal = date("j");
header( "Location: ". $a[$gal] );
__________________

Last edited by Brujah; 03-02-2003 at 05:30 PM..
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 08:32 PM   #16
HS-Trixxxia
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!!!!!!!!!!!!!!
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 10:59 PM   #17
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Quote:
Originally posted by Trixxxia
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!!!!!!!!!!!!!!
Do you shoot gothic content by any chance ?

Otherwise, nope.. it's all good.
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 11:21 PM   #18
HS-Trixxxia
Confirmed User
 
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
heheh.....no more of a BBW type here sorry ;-)
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-02-2003, 11:45 PM   #19
Plat
Confirmed User
 
Industry Role:
Join Date: Jan 2002
Location: Clearwater, Florida
Posts: 2,680
Quote:
Originally posted by punkworld
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".
i smell aebn
__________________
Im fuckin retired
Plat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-04-2003, 07:27 AM   #20
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Quote:
Originally posted by Plat


i smell aebn
Smells good, doesn't it?

BTW, Trixia, I just tested it myself, and everything is working fine...
http://www.captainevil.com/gfytest.php
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-17-2003, 09:09 PM   #21
HS-Trixxxia
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 ;-)
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 12:55 PM   #22
HS-Trixxxia
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!
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 01:07 PM   #23
HS-Trixxxia
Confirmed User
 
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
:-(
No punkworld or Brujah today?
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 01:53 PM   #24
HS-Trixxxia
Confirmed User
 
Join Date: Mar 2002
Location: Montreal Canada
Posts: 2,946
One more bump?
Help? Please......pretty please with a strawberry on top?
HS-Trixxxia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.