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
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-15-2008, 05:43 PM   #1
F U S I O N
Confirmed User
 
F U S I O N's Avatar
 
Join Date: Jan 2006
Posts: 1,898
Looking for a script...

I have a list of 100 urls and descriptions that look like this:

SiteName.com - This is a description of the above site...

I want to have a page load and have 20-30 of these links be displayed at a time. Refresh the page and have a different set of 30 links load, all random.

Any ideas of a script or snippet of code I could use to accomplish this? I searched google but can't seem to find a script that will display the amount of links that I want it to...

Thanks in advance
F U S I O N is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2008, 07:00 PM   #2
Swish
Confirmed User
 
Swish's Avatar
 
Join Date: Mar 2006
Location: San Diego, CA
Posts: 1,421
Something like this:

Code:
<?php

$ARRAY = array(
    'sitename1.com' => 'This is a description',
    'sitename2.com' => 'This is a description'
    );

foreach ( $ARRAY as $URL => $DESC )
    print "<a href=\"$URL\">$URL</a> - $DESC\n";

?>
__________________


Naughty America - Director of Technology
It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!
Swish is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2008, 07:02 PM   #3
da man
Confirmed User
 
da man's Avatar
 
Join Date: Nov 2005
Location: NorCal
Posts: 2,375
I love your sig Swish
__________________
Mike Cross : Kink.com : ICQ: 413115769

da man is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-16-2008, 02:17 AM   #4
F U S I O N
Confirmed User
 
F U S I O N's Avatar
 
Join Date: Jan 2006
Posts: 1,898
Thanks Swish!

How do I go about only displaying a certain amount of links at a time tho out of a bigger list?
F U S I O N is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-16-2008, 02:34 AM   #5
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Code:
<?php

$ARRAY = array(
    'sitename1.com' => 'This is a description',
    'sitename2.com' => 'This is a description'
    );

shuffle($ARRAY);
$counter=0; 
foreach ( $ARRAY as $URL => $DESC ) {
    if($counter < 30) {
    print "<a href=\"$URL\">$URL</a> - $DESC\n";
    $counter++;
    }
}
?>
A bit half-assed. I would do this with a mysql db instead.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-16-2008, 04:45 AM   #6
Emil
Confirmed User
 
Emil's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 5,650
Quote:
Originally Posted by k0nr4d View Post
A bit half-assed. I would do this with a mysql db instead.
Sounds pretty unnecessary for such a small script.
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
(Signup with ONLY your Email and Password. You can also refer people and get even more.)
Emil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-16-2008, 02:48 PM   #7
F U S I O N
Confirmed User
 
F U S I O N's Avatar
 
Join Date: Jan 2006
Posts: 1,898
Thanks, Ill give that a shot
F U S I O N is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2008, 03:58 PM   #8
Swish
Confirmed User
 
Swish's Avatar
 
Join Date: Mar 2006
Location: San Diego, CA
Posts: 1,421
Quote:
Originally Posted by k0nr4d View Post
Code:
<?php

$ARRAY = array(
    'sitename1.com' => 'This is a description',
    'sitename2.com' => 'This is a description'
    );

shuffle($ARRAY);
$counter=0; 
foreach ( $ARRAY as $URL => $DESC ) {
    if($counter < 30) {
    print "<a href=\"$URL\">$URL</a> - $DESC\n";
    $counter++;
    }
}
?>
A bit half-assed. I would do this with a mysql db instead.
There are obviously more elegant ways to do this. This was only a simple example.
__________________


Naughty America - Director of Technology
It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!
Swish is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2008, 03:59 PM   #9
Swish
Confirmed User
 
Swish's Avatar
 
Join Date: Mar 2006
Location: San Diego, CA
Posts: 1,421
Quote:
Originally Posted by da man View Post
I love your sig Swish
LOL Thanks
__________________


Naughty America - Director of Technology
It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!
Swish 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



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.