Jump to content

Recommended Posts

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. :-*

Link to comment
https://forums.phpfreaks.com/topic/105742-randomize-span-for-tag-cloud/
Share on other sites

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.  :-[

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.  ;D 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"....... :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.