MyBB Community Forums

Full Version: Idea Color Private message when is more than 0 on index ? how to
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hi , When we are on the index page /index.php .. We are login and we see

Private message (Unread 0, Total 0)
how we lets in black the number 0 but when is to 1 Unread or more to 9999999 .. to put in red color the Number.
 
how we can do the same thing with Total 0 With the 0 lets in black and 1 or more in red is appear in red ..

i know is possible because My Alert is do that when is 0 Alert is in black for me and when is 1 or more in red ..

and is give idea to all want to made that
Doing the conditional styling won't be possible without a plugin in this case. You'll need a plugin for this.

Hopefully we have MyBB 1.9 soon with Twig conditional templating support!
wow cool for the 1.9 What do you mean by :
Hopefully we have MyBB 1.9 soon with Twig conditional templating support!

twig conditional templating ?
(2020-08-14, 08:11 PM)HighRank2267 Wrote: [ -> ]wow cool for the 1.9 What do you mean by :
Hopefully we have MyBB 1.9 soon with Twig conditional templating support!

twig conditional templating ?

With the current templating system of MyBB, we can add variables and show them in the templates. We can do this:

show <this>

With Twig, we can add conditionals into templates (this is not possible with 1.8 unless you use a specific plugin such as Template Conditional plugins)

If <condition> show <this> - else show <that>

That's only possible with plugins or Twig for 1.8.
ohh cool if i understand with the new version we can have the color and more ?

color of 1 Private message or Unread message or other when the count is more than 0 is be like red
You only need to add some css rules due this type of improvement was made since 1.6 series for alerts and pms.

Many of us share tutorials about this and has improved many of this customizations without plugins.

However you can use templates and conditionals by zingaburga plugin to implement conditionals in your styles.

See yah...
(2020-08-14, 11:39 PM)Whiteneo Wrote: [ -> ]You only need to add some css rules due this type of improvement was made since 1.6 series for alerts and pms.

Many of us share tutorials about this and has improved many of this customizations without plugins.

However you can use templates and conditionals by zingaburga plugin to implement conditionals in your styles.

See yah...

If you have tutorial working with last version of mybb For made what i want to do Please lets me know i am Terribly noob (new) is my 3rd month and less ..

if the plugins of you speak are better do you have tutorial ? can you share to me the link to the plugins ?

Thanks you Smile peace
I have reviewed the first 10 pages into tutorials but i can not find it.

However here is on my forums a tutorial about pms and alerts to put effects like on our forums there you will see the things you have asked for.

https://soportemybb.es/Tema-tutorial-men...movimiento

There are more tutorials about this but i can not remember where i share it.

And the plugin optional that you can use is this one.

http://mybbhacks.zingaburga.com/showthread.php?tid=260

There you can find information about how it works to use the things that KevinVR said into his post. https://community.mybb.com/thread-229025...pid1354816

I think you can get it working if you can not i recommend you to study single html, css tutorials and php to learn the basics and then you can create any effects and / or addittional contents for your forums Smile
No need for PHP or any plugins to do this.

.unread {
    color: red;
}

.unread.unread-0 {
    color: black;
}

<div class="unread unread-{$mybb->user['pms_unread']}">{$mybb->user['pms_unread']}</div>
hi , Thank you Where i put these line of code ? the first is on .css the second ?

and is for Private message ( unread 0 total 0 ) ?
Pages: 1 2