The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Add additional_css.css to all your pages Details »» | |||||||||||||||||||||||||||||
Instead of finding the template.css file to edit the .css properties for your pages, just put them all in this additional_css.css template. The additional_css.css file is linked right before the </head> in your page. This is for use until this is made standard in the vb product (I put in a bug report requesting this be included - Please consider adding user defined Additional CSS to pages).
Version History: 1.0 2009-11-22: - initial release by Lynne at vbulletin.org 1.1 2009-12-08: - fixed issue with style dateline not showing up. Fixed & issue (changes to &. added additional2_css.css file so the first additional_css file can be used in the parent style and then additional2_css used in the child styles. Notes - if you only want this included on certain pages, then you may open the plugin "Add addition_css.css file to pages" and put a condition around it, such as (this is for just the index page and the showthread page): PHP Code:
. To install: 1. Import product-product-lynne_add_css.xml 2. Add any additional css you want to add to the page in your additional_css.css template. To uninstall: 1. Uninstall "Add additional css to your style" Please mark Installed if you use this. Download Now
Show Your Support
|
Благодарность от: | ||
Toorak Times |
Comments |
#92
|
|||
|
|||
Quote:
explain more please, Thanks Update: do you mean this code: PHP Code:
|
#93
|
|||
|
|||
I have not tested it and I wrote the code pretty verbose so you get the concept. When I get a chance I will rewrite it. I am trying to help quite a few people right now so excuse my brevity.
By your request this is suppose to store a unique "additionalcss(id).css to your main bbs url. Different styles can require different additionalcss files. if you do not need that then all you really need to do is append a new file to the bottom of your <head> code. Code:
// Header Hook: parse_templates $nw_cssbegin = '<link rel="stylesheet" type="text/css" href="'; $nw_cssend = '" ' . '/>'; // additionalcss_00011.css = styleid 11 $nw_cssfile = 'additionalcss_' . str_pad($style['styleid'], 5, '0', STR_PAD_LEFT) . '.css'; $nw_csspath = $vbulletin->options['bburl'] . '/'; $nw_cssout = $nw_cssbegin . $nw_csspath . $nw_cssfile . $nw_cssend; $template_hook['headinclude_bottom_css'] .= $nw_cssout; |
#94
|
|||
|
|||
I believe that code will load the css either from the database or css-stored-as-files: Depending what admincp options are set to.
|
#95
|
|||
|
|||
Quote:
I used it as new plugin using parse_templates, but didn't work... possibly there is something missing!!! I did it like this: PHP Code:
I changed Code:
$template_hook['headinclude_bottom_css'] Code:
$template_hook['headinclude_css'] also, the whole external link on page html doesn't show... any idea?? Thanks, |
#96
|
|||
|
|||
Quote:
I will spend a bit of time and see if you are right about it "additional.css" pulling from the database. Hey, anything is possible. Bugs can creep back in... I have used similar code to overwrite members.css giving each user an extended control panel over their user area, because we have 30,000 users we use our own caching file system to handle this. Because of the amount of data storing this in the database was not feasible. |
#97
|
|||
|
|||
Quote:
something is not correct here. |
#98
|
|||
|
|||
ok, look like I have no other way than waiting your code . I will keep trying anyways.
Thanks a lot. |
#99
|
|||
|
|||
Okay the code worked as it was. But I added a filename base so that it was easier to understand.
Code:
// Header Hook : parse_templates global $vbulletin; $nw_cssfilebase = 'additionalcss_'; $nw_cssbegin = '<link rel="stylesheet" type="text/css" href="'; $nw_cssend = '" ' . '/>'; // additionalcss_00011.css = styleid 11 $nw_cssfile = $nw_cssfilebase . str_pad($style['styleid'], 5, '0', STR_PAD_LEFT) . '.css'; $nw_csspath = $vbulletin->options['bburl'] . '/'; $nw_cssout = $nw_cssbegin . $nw_csspath . $nw_cssfile . $nw_cssend; $template_hook['headinclude_bottom_css'] .= $nw_cssout; unset($nw_csspath, $nw_cssout, $nw_cssend, $nw_cssbegin, $nw_cssfile, $nw_cssfilebase); additionalcss_00005.css Code:
body { background: red !important; } .body_wrapper { background: blue !important; } This code is a learning example it is very verbose, you do want to rewrite it for a production environment. |
Благодарность от: | ||
fxdigi-cash |
#100
|
|||
|
|||
Thanks,
I will try it out and see how things go. by the way, can I place my .css file inside vb folders ?? how about outside vb forum root?? |
#101
|
|||
|
|||
Quote:
I am not sure what link you are refering to using css.php. Pass me a link to your board and I can check it out. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|