SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: kcmartz on May 18, 2010, 01:22:21 PM

Title: SMF Links Random Links Block (or just code to use it)
Post 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:
Code: [Select]
$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!
Title: Re: SMF Links Random Links Block (or just code to use it)
Post by: AngelinaBelle on May 18, 2010, 03:30:32 PM
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.
 
 
 
 
Title: Re: SMF Links Random Links Block (or just code to use it)
Post by: kcmartz on May 26, 2010, 11:13:56 AM
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?
Title: Re: SMF Links Random Links Block (or just code to use it)
Post by: AngelinaBelle on May 26, 2010, 01:57:42 PM
As long as that is OK with the author
Title: Re: SMF Links Random Links Block (or just code to use it)
Post by: kcmartz on May 27, 2010, 09:15:17 AM
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...)...
Title: Re: SMF Links Random Links Block (or just code to use it)
Post by: kcmartz on July 09, 2010, 04:49:23 PM
no answer so far :(
SimplePortal 2.3.8 © 2008-2024, SimplePortal