Not Solved [How To?] Dynamic PM Alert CSS?
#1
Not Solved
Hi everyone,

As you can see from the screenshot, I've managed to get a user's number of alerts and PMs displayed on my forum.

[img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIUAAAApCAYAAAAbBOqpAAAFiUlEQVR4Ae2bvWscRxjGrzD+E9JqiilUHMkVV6i44iCHrWKLKw60xVUCEbYQRsXiqDjDFVdcoWIhh1mDEGyTIiS4ihNSCFduzAmCQEWwnHCFHSJkLCkochBPeFdZe3TauZnZXX2cGMFpZ2d3R/s885t33p1blRhjsB/rgchASdyxZQsHMWChsJHywkxhobBQWCjsFKmeIm2ksJHCRgobKWykuDAKLBRTCMXnny3gy7vfwykNM33u3fkJ1MZt6Py8XpCHWfzIlVNwxrA0X8X8kgfGKoV0xL07P2eCQYSIoLoNUBThBfli6kcuKJbnGKIoQBRFYG6vkI4QOzdP+TZAkUf/+LUmfmSGojLL0F+aRxSFMRStTgBebuQGY1xM1n0TE27quVm1p11notEYilnG0F/5BANFCfHT7g7AeC0zHGmCstSZmKA61ykzRIF/Tqeo2aTsBxFY2dHyJ4tu2TUqjeJxIygohxj4DaU5/iAC49mihkyUab0oMm85WJ5TajYBY245uD1Q9Nwyomhdy6C6P9ASPt5hpp0vO3+83Tz7A7+upVkXDF1vZNqy1Jvo144Uc4xC6LK2OT1KPnnbGAyZ4MXSEG+fjQCcgn6ebH6AU9qWPqmYmKA6t1VhiMKutvZJcHTDCKzS0vJF5gXVP70/BN4cxV4cAnj0+G+pF3S+SqN4XBuKNqcnjb62MesERatrdDN0YzIjXi4MsY8PWPzqPZ4vbOME/8B5eCQ9XxRZRLnKGcKuq60/DYx2LwSnfItzLV9kXtAAwdZf+HHrFIszu3j77S5eAXBKfxbihzYUfp2gGBiZwtrmj6kyI0YbQ7x8Q8J3EZvyeh/9ZxQt0he5igAhaYOmD7dLHVpFx60a+xBGEapuF1XOMei4qPv5copvSkPsv34P5+FBrP/5F0OMaJCU9grx41Kh4O2+1ohIzKetrJMPN//ALzsExRkE2NnDk81/P+4n9clWbDNvOckpKPTzqgu3yhENOloDpDO4eE3ROcWrx9v/D5jfC/FDG4puiyKFXpKZhE5d8WKnJZ06vj3cHF07FKSLRn2t3YtHfbDanAhGczWIo0uvXfu4nkNt6Poy7kHa/nczQ5wcH+HrjWMpEHSd6LGqrA1FMlqSDtfZemsRGCsb3VCacKq7CZFC1Oz1Q7DZOvxmBdH62jk4ApoumquocY6w7507ViQUj0pDnOzs4enW6cSk+1KgOHvyWLkgTjQprdynZLO8VAgU151TpOqj6aTmoVlhCPtni1s+wVJpwqtxRGF6Yl5EpKC8iqLnr+8AZ2Y0MUpcChS9dsV46khMbMTrFXrZNoU1WaR4sTDEIT19PDjAiyt++pgUJWk6afprYLwaw1/mDH2PFvjOlv8TH8RtEVCMNn7D6PgUzn15cil6qZoyxOPK6cNvcONsWzSAHk0rBk8hohCxfJ3rFJOgSLSSzjAkENR5V14o6OkD7w7iNQrxlzMhrxA7XVVWQhF1W8bTRmJUso2XvVldaxoRQchTVgk3Oa4DRaJVZ5sXiiy+mOhVQuE1OMKgF48CGgmmnyAMUWl1tICgG88iOO0aExNU59rvPq75Rda0Ds5Sp+pok+P2W1JNKHourVuc/9rcWQ21I4KsU7IAkHaNrP1pqk/TlbXORLdy+pA11qDvQgaf3jGgZ3NWX7FQaA4qma9ifVYA0q4T21WVM0NBDdOXRJ47D9fzwKvzuYGgNtMEZalTCZ+G41l0y64x0ZsLCpM/pHtuES+rNu7+UAiguvd8WecV4QVBYurHjYOCXmsnETLiVfVk5G16xT+PF+RVFj9uHBSXNepsu+p/Ako8slAUmBgmpk771kJhobiQf1koLBQWimkP7Vdx/zZS2EhhI8VVjLRp/xs2UthIYSPFtI/iq7j//wAzd+xTLBVLSQAAAABJRU5ErkJggg==[/img]

For the alerts, I'm using the MyAlerts plugin; for the messages, just using the default system.

What I would like to do is have dynamic styles depending on if there are alerts/PMs.

For instance: If there are 0 alerts/PMs, the purple background in the screenshot should be grey. Then, if the alerts/PMs value is > 0, it will show a different color.

I'm capable of making the CSS classes, I'm just not quite sure how to have the values determine which class to utilize.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)