SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: kcmartz on May 18, 2010, 01:22:21 PM
-
Hello. I use SMF Links and would love a random link script (one per pageload, or 5 per pageload) and that means one less "Custom PHP" code for the code I use currently:
$quotes[] = "<a href=\"http://www.google.com\">Google</a><br />Best Search Engine";
$quotes[] = "<a href=\"http://www.simplemachines.org\">SMF</a><br />Forum Software I Use";
$quotes[] = "<a href=\"http://www.youtube.com\">Youtube</a><br />Best Video Site";
$quotes[] = "<a href=\"http://www.cnet.com\">Cnet</a><br />Best Tech Site";
//
//etc......
//
srand ((double) microtime() * 1000000);
$randomquote = rand(0,count($quotes)-1);
echo $quotes[$randomquote];
Thanks in advance!
-
You might consider contacting the mod author for information on the best way to extract random links from the links catalog. Unless the author provides a "random links" feature, this may involve cribbing some code from one or more of the SMF Links functions and working in srand() where you need it.
You know which files come from the mod -- they are the ones in the ZIP file you downloaded.
Then, it should just be a matter of seeing how the mod gets info about links out of the database.
-
Sorry been away with school etc... (only like 3 weeks left).
I will contact the author, and if he gives me code, is it ok if I post it here for others?
-
As long as that is OK with the author
-
Ok will ask in a week (leaving for Oregon after school, and will only be on my cell phone at most posting here, simplemachines.org, and my website...)...
-
no answer so far :(