The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Template Css adding in my addon
I used this plugin to upload my template.css, but sometimes is it loaded and others no why? (vBulletin 4.1.5)
Code:
<plugin active="1" executionorder="5"> <title>CSS</title> <hookname>parse_templates</hookname> <phpcode><![CDATA[ if($vbulletin->options['ct_list_active']) { $template_hook['custom_css_list'] .= ',ct_thread.css'; } ]]></phpcode> </plugin> In several articles I found this code, but everyone says outdated Code:
<plugin active="1" executionorder="5"> <title>CSS - Inject CSS into vBulletin</title> <hookname>css_start</hookname> <phpcode><![CDATA[if(in_array('vbulletin.css',$matches[1])) { $matches[1][] = 'ct_thread.css'; }]]></phpcode> </plugin> Regards |
#2
|
||||
|
||||
Take a look at the headinclude template:
HTML Code:
<vb:if condition="$vboptions['storecssasfile']"> {vb:cssfile main-rollup.css} {vb:raw template_hook.custom_css_links} <vb:else /> {vb:cssfile bbcode.css,editor.css,popupmenu.css,reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css{vb:raw template_hook.custom_css_list}} </vb:if> PHP Code:
|
#3
|
||||
|
||||
Thanks Lynne
I have to replace xxxx and yyy with the name of my template.css, is it correct? Regards |
#4
|
||||
|
||||
No, not exactly. The _links hook requires a full on link. (I actually got this code from one of BOPs mods.)
Try this: Code:
$template_hook['custom_css_links'] .= '<link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style' . str_pad($style['styleid'], 5, '0', STR_PAD_LEFT) . $vbulletin->stylevars['textdirection']['string'][0] . '/ct_thread.css" />'; $template_hook['custom_css_list'] .= ',ct_thread.css'; |
Благодарность от: | ||
CvP |
#5
|
||||
|
||||
Thanks it works fine.
You know how these two ways of interpreting the CSS code Regards |
#6
|
||||
|
||||
I have no idea why that gap is there. You'd need to analyze the box using something like firebug.
|
#7
|
||||
|
||||
I actually got in to some trouble with this a few minutes ago and Lynne was kind enough (as always!) to point me I'm using process_tempaltes_complete instead of parse_templates.
With that help, now I am using this in my codes: PHP Code:
|
3 благодарности(ей) от: | ||
Asterix_ita, HMBeaty, Lynne |
#8
|
||||
|
||||
Hi CvP
Thanks, but your code works fine on my addon with parse_templates hook, doesn't work with process_tempaltes_complete regards |
#9
|
||||
|
||||
Yes, it needs to be on parse_templates. I used process_templates_complete and banging my head on table until Lynne stepped in.
|
#10
|
||||
|
||||
What hooks would you use if the css IS stored in the file system?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|