[-_-] Posted May 15, 2008 Share Posted May 15, 2008 Hi there. I have a search/tag cloud on my website and Im trying to randomly move the content of my div around everytime someone reloads the page. The tag links are contained in spans and each have an id and class. Heres a sample of the code. <span id="120" class="tagcloud0"><a href="http://www.plentyoftorrents.com/results_new.php?site=Btmon&q=pukka#tagcloud">pukka</a></span> <span id="121" class="tagcloud0"><a href="http://www.plentyoftorrents.com/results_new.php?site=Btjunkie&q=pc%20games#tagcloud">PC games</a></span> <span id="122" class="tagcloud0"><a href="http://www.plentyoftorrents.com/results_new.php?site=Btjunkie&q=Adobe%20Creative%20Suite%202%20Premium#tagcloud">adobe creative suite 2 premium</a></span> Just hundreds of lines like that. Is there any simple way of doing this? maybe like the php image rotater? Heres a link to the cloud http://www.plentyoftorrents.com/cloud.php Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/105742-randomize-span-for-tag-cloud/ Share on other sites More sharing options...
MadTechie Posted May 15, 2008 Share Posted May 15, 2008 you could build and array of urls and sizes and get a random index from the array ehco that then remove it from the array then repeat until the array is empty.. Just an idea Quote Link to comment https://forums.phpfreaks.com/topic/105742-randomize-span-for-tag-cloud/#findComment-541766 Share on other sites More sharing options...
redarrow Posted May 15, 2008 Share Posted May 15, 2008 nice website sorry no advice the page would be so huge unreel........ Quote Link to comment https://forums.phpfreaks.com/topic/105742-randomize-span-for-tag-cloud/#findComment-541773 Share on other sites More sharing options...
[-_-] Posted May 16, 2008 Author Share Posted May 16, 2008 you could build and array of urls and sizes and get a random index from the array ehco that then remove it from the array then repeat until the array is empty.. Just an idea Do you have a link to something similar or a tutorial that deals with arrays the way I need to use them? Im a total noob at php. Quote Link to comment https://forums.phpfreaks.com/topic/105742-randomize-span-for-tag-cloud/#findComment-542601 Share on other sites More sharing options...
cooldude832 Posted May 16, 2008 Share Posted May 16, 2008 if you pull the cloud out of mysql then why don't you do a random order by? Quote Link to comment https://forums.phpfreaks.com/topic/105742-randomize-span-for-tag-cloud/#findComment-542602 Share on other sites More sharing options...
[-_-] Posted May 16, 2008 Author Share Posted May 16, 2008 if you pull the cloud out of mysql then why don't you do a random order by? Its not from mysql just some css and html. I want to make it look random on every page reload so it kind of looks like its always being updated. So aXXo would move over to where the first link is "adobe CS3" and adobe would move to where aXXo was and similar with other tags. Im looking at the random image rotator Im using for the banner right now to see If I can do it with that but just change jpg, gif to id="1", id="4"....... Quote Link to comment https://forums.phpfreaks.com/topic/105742-randomize-span-for-tag-cloud/#findComment-542653 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.