different coloured tags

Is there a way to make the different sized tags a different random colour as the image below? I tried css by changing 'one_tag' but this changes all the colour and I want random colours. 

Quote · 4 Dec 2015

good idea

Quote · 5 Dec 2015

Can the colors be random that change on every page load?   ... because that's really easy to do.  Otherwise, you need a much more complex function that applies a color based on tag size

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 5 Dec 2015

I was thinking different colours per tag size.

Quote · 6 Dec 2015

I still really want different coloured tags, come on Modzzz make us a new mod to play with :)

Quote · 9 Dec 2015

 

I still really want different coloured tags, come on Modzzz make us a new mod to play with :)

   Add this JS code in footer, you will see a different color for each tag.

<script>
$$('.one_tag').length && [].forEach.call($$('.one_tag > a'), function(e){
  e.style.color = '#' + Math.random().toString().slice(-6);
})
</script>
Looking for Help? http://www.boonex.com/kevinmitnick
Quote · 10 Dec 2015

I tried this but it didn't seem to work for me

Quote · 10 Dec 2015

If you want a specific color for each tag size then do this.

Edit administration\profiles.php

Look for this around line 200-224 depending on version of dolphin.

function getBlockTags($sDefault)
{
    $oTags = new BxTemplTags();
    $oTags->setTemplateContent('<span class="one_tag" style="font-size:__tagSize__px;"><a href="javascript:void(0)" onclick="javascript:__tagHref__" title="__countCapt__: __countNum__">__tag__</a></span>');

Add the following highlighted in GREEN below.

function getBlockTags($sDefault)
{
    $oTags = new BxTemplTags();
    $oTags->setTemplateContent('<span class="one_tag tag_color__tagSize__" style="font-size:__tagSize__px;"><a href="javascript:void(0)" onclick="javascript:__tagHref__" title="__countCapt__: __countNum__">__tag__</a></span>');


The above code change adds a new class after the one_tag class that matches the font size that is used.

Now edit general.css and add the following to the bottom to set colors for each tag size.

.tag_color10 {

    color: #000000;

}

.tag_color20 {

    color: #0066FF;

}

.tag_color30 {

    color: #CCCC00;

}



Those are the only 3 sizes i have seen, if you find more, just add them to general.css as needed.


Once you make these changes, clear dolphins cache.

https://www.deanbassett.com
Quote · 10 Dec 2015

Excellent and simple solution Deano.

 

Another way to do the same thing, would be to move a copy of view_tags.html from /templates/base to whatever template you are using, and apply your changes in that file.... maybe directly to the <a> tag.

 

 <span class="one_tag" style="font-size:__tagSize__px;"><a class="tag_color__tagSize__" href="__tagHref__" title="__countCapt__: __countNum__">__tag__</a></span>

 

Then add the css to common.css

 

EX:

.one_tag a.tag_color30 {
color:#cc6666;
}

view_tags.html · 163B · 324 downloads
My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 11 Dec 2015

awesome thankyou guys i'll get fixin stuff now

Quote · 11 Dec 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.