Hi!
I donwnloaded the random record mod from the RC, the one that you can use on 'non' database pages. Trouble is, I am using the verification system, and as it just reads from the .db file it brings up all those unverified records!
Any way to restrict to 'approved' records only?
Here is the mod:
$db_script_url = $db_dir_url . "/db.pl";
$db_file = "/home/xxx/xxx/db/gallery.db";
print "Content-type: text/html\n\n";
open (DATABASE, "<$db_file") || die print "Couldn't open database!";
@line=<DATABASE>;
close (DATABASE);
srand;
$array = $line[int rand(@line)];
# If you're $db_delim is not '|', change it here (between /\ and /,)
@dbman_field = split (/\|/, $array);
# Display Section:
print qq|<center><table border="1" width="230" height="150" bordercolor="#008000" cellspacing="0" align="center">
<tr height="100"><td align="center">
<a href="db.pl?db=gallery&uid=default&view_records=1&ID=$dbman_field[0]"><IMG SRC="http://www.xxx.com/db/upload/sml_pic/$dbman_field[0].jpg" width="230" ALT="$dbman_field[1]" height="100" border="0"></a></td>
</tr><tr><td align="center"><b><font size=-1><a href="db.pl?db=gallery&uid=default&view_records=1&ID=$dbman_field[0]">$dbman_field[1]</a></b><BR>$dbman_field[4]</font></td></tr></table></CENTER>|;
exit;Cheers people!
Cheers!
Ben
------------
http://www.travel-experiences.com
I donwnloaded the random record mod from the RC, the one that you can use on 'non' database pages. Trouble is, I am using the verification system, and as it just reads from the .db file it brings up all those unverified records!
Any way to restrict to 'approved' records only?
Here is the mod:
Code:
$db_dir_url = "http://www.xxx.com/xxx/db"; $db_script_url = $db_dir_url . "/db.pl";
$db_file = "/home/xxx/xxx/db/gallery.db";
print "Content-type: text/html\n\n";
open (DATABASE, "<$db_file") || die print "Couldn't open database!";
@line=<DATABASE>;
close (DATABASE);
srand;
$array = $line[int rand(@line)];
# If you're $db_delim is not '|', change it here (between /\ and /,)
@dbman_field = split (/\|/, $array);
# Display Section:
print qq|<center><table border="1" width="230" height="150" bordercolor="#008000" cellspacing="0" align="center">
<tr height="100"><td align="center">
<a href="db.pl?db=gallery&uid=default&view_records=1&ID=$dbman_field[0]"><IMG SRC="http://www.xxx.com/db/upload/sml_pic/$dbman_field[0].jpg" width="230" ALT="$dbman_field[1]" height="100" border="0"></a></td>
</tr><tr><td align="center"><b><font size=-1><a href="db.pl?db=gallery&uid=default&view_records=1&ID=$dbman_field[0]">$dbman_field[1]</a></b><BR>$dbman_field[4]</font></td></tr></table></CENTER>|;
exit;
Cheers!
Ben
------------
http://www.travel-experiences.com