Jump to content

[Solved] Random Tags Display Possible?


Recommended Posts

Tags are displayed from most to rarely used tag.

 

in blocktags.php right after $tags = Tag::getMainTags((int)($params['cookie']->id_lang), (int)(Configuration::get('BLOCKTAGS_NBR'))); code  add simple code: shuffle($tags) 

 

example:

	function hookLeftColumn($params)
	{
		$tags = Tag::getMainTags((int)($params['cookie']->id_lang), (int)(Configuration::get('BLOCKTAGS_NBR')));
		shuffle($tags);
  • Like 1
Link to comment
Share on other sites

This works, but they remain the same size as they did when they were in order. Example, if '1 GB' is most used tag, it shows up as biggest, even though it's half way down the list when using shuffle function and it always shows up as biggest (i'm assuming until it's no longer the most used tag). Is there anyway to easily randomize sizes as well?

Link to comment
Share on other sites

well it is possible but you will have to change php code once again.

 

instead of:

$tag['class'] = 'tag_level'.(int)(($tag['times'] - $min) * $coef + 1);

use this:

$tag['class'] = 'tag_level'.(int)((rand(1,10) - $min) * $coef + 1);

Hi Vekia,

Finally got around to implementing this. Changing this code makes the tags all the same size now.  Any ideas?

Link to comment
Share on other sites

hello

try to change (decrease / increase) values in: rand(1,10) 

 

Yes, you're correct. The issue was that change isn't triggered until 18+.

 

I can't believe I just spent an hour of trial and error figuring what triggers what size, but I'm OCD like that. So here it is for anyone who needs it.

 

I'll use 1-22. This will mostly be small grey, then trigger about 25% of the tags to 'pop' (2nd pic). Actually I like the way the more random sizes (1st pic) looks, but it pushes the footer adsense too far down because of the bigger fonts, and I doubt it's any more effective. The 2nd pic is actually probably more effective. Too many random sizes (1st pic) becomes a jumble, even though it looks cooler.

 

Thanks again Vekia.

post-275081-0-46214700-1381403692_thumb.jpg

post-275081-0-83217000-1381403701_thumb.jpg

Edited by damian5000 (see edit history)
Link to comment
Share on other sites

  • 4 months later...

hello..

thanks for all the solutions..it works like charm =D

 

I  wanna ask,

i have about 450 tags,

but i dont think i will display all 450 in 1 time,..

i set to 40 tags only(and setting to randomly),

but, it just appear the same 40 tags only..

how if i wanna changes different tags randomly including all tags that i have while 40 tags appear in 1 time only?

sorry my english.hope you all undertand what im trying to ask =D

Link to comment
Share on other sites

hello..

thanks for all the solutions..it works like charm =D

 

I  wanna ask,

i have about 450 tags,

but i dont think i will display all 450 in 1 time,..

i set to 40 tags only(and setting to randomly),

but, it just appear the same 40 tags only..

how if i wanna changes different tags randomly including all tags that i have while 40 tags appear in 1 time only?

sorry my english.hope you all undertand what im trying to ask =D

help me please =D

Link to comment
Share on other sites

×
×
  • Create New...