MyBB Community Forums

Full Version: Using a plugin to edit CSS?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was trying to edit the usercp.css using a plugin. I thought I read here that you could, so I was wondering if someone could help me. I just need to add this bit of code to it. There is a way right? I mean, I know how to do it manually.

.usercp_nav_chat_pmfolder{
        padding-left:40px;
        background:  url('images/usercp/chat_pmfolder.gif')no-repeat left center;
}

Aren't I supposed to add the code in plugin_activate(){/*code*/}

Sorry for all my questions. Wink
For the plugin way of adding the CSS code I don't know. What I know is you can add that bit of code in the Admin CP very easily. Templates & Style>Themes>your theme>global.css and press Advanced Mode, then simply add the code there.
The stylesheets are stored under themestylesheets in the database

To edit them grab them from there and work on them and update them once done.

If you want to add your css entries at the end, it will be a simple concatenation, if you want to add it somewhere in the middle, then you''l have to perform regex search to find the terms around where you want to insert it and insert it there.
Of course, how dumb of me!

Thank you very much!

To think I just got done w/ a parser that used the same method!
(2009-07-17, 08:54 PM)- G33K - Wrote: [ -> ]The stylesheets are stored under themestylesheets in the database

To edit them grab them from there and work on them and update them once done.

If you want to add your css entries at the end, it will be a simple concatenation, if you want to add it somewhere in the middle, then you''l have to perform regex search to find the terms around where you want to insert it and insert it there.

However he also has to update the stylesheet that is on the server. Just updating the database instance of it won't be enough.
There are functions available in the ACP functions that update the CSS. They escape memory as of this moment but I know they exist.

Have a look in the style module for the ACP, and see how it's done.
ACP? My dear forum mate, you have lost me.

Admin Control Panel, I got you mate. =D
ACP = Admin Control Panel