View Single Post
Old 2006-12-22, 08:30 AM   #17
oast
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
 
oast's Avatar
 
Join Date: May 2004
Location: UK
Posts: 316
Quote:
Originally Posted by bustherh
You can have this one for free. It may need some tweaking to suit your needs, but it works and does what you asked:

Set up a MySQL table called 'galleries' with 3 fields; 'url', 'title', and 'niche' and populate it with at least 100 galleries.

Create the necessary connections to the database.

PHP Code:
<table style="width:630px;margin:auto;border:0;padding:0;">
<tr><td valign="top" style="padding:3px;width:310px;">
<?php
$i 
0;
$today date('M d');
$yester date('M d',mktime(000date("m"), date("d")-1date("Y")));
$number rand(95,98);
$query "SELECT * FROM galleries ORDER BY RAND() LIMIT 100";
$result mysql_query("$query");
while(
$links mysql_fetch_array($result)){
    if(
$i == 50)
        echo 
'</td><td valign="top" style="padding:3px;width:310px;">';
    if(
$i $number)
        echo 
'('.$yester.') <a href="'.$links[url].'" target="_blank">'.$links[niche].'</a> - '.$links[title].'<br>';
    else
        echo 
'('.$today.') <a href="'.$links[url].'" target="_blank">'.$links[niche].'</a> - '.$links[title].'<br>';
    
$i++;
}
?>
</td></tr>
</table>
What that does is grab 100 random galleries from your database and lists them in two columns of 50 with today's date on most of them except the last few that have yesterday's.
(If you didn't want to use a database, you could list them in an array and 'shuffle' it)

To see it in action check out http://oast.com/adult/ (about half way down the page under "Latest Free Sites")
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare.
oast is offline   Reply With Quote