The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
Creating a product
When creating a product, what would be the best way to add a line of code to an existing template?
Currently I'd like to add Code:
<script type="text/javascript" src="clientscript/jquery/1.3/jquery-1.3.2.min.js"></script> Code:
<meta http-equiv="Content-Type" content="text/html; charset=$stylevar[charset]" /> <meta name="generator" content="vBulletin $vboptions[templateversion]" /> <if condition="$show['threadinfo']"> <meta name="keywords" content="<if condition="$threadinfo['taglist']">$threadinfo[taglist], </if>$threadinfo[prefix_plain_html] $threadinfo[title], $vboptions[keywords]" /> <meta name="description" content="<if condition="$pagenumber>1"><phrase 1="$pagenumber">$vbphrase[page_x]</phrase>-</if>$threadinfo[prefix_plain_html] $threadinfo[title] $foruminfo[title_clean]" /> <else /><if condition="$show['foruminfo']"> <meta name="keywords" content="$foruminfo[title_clean], $vboptions[keywords]" /> <meta name="description" content="<if condition="$pagenumber>1"><phrase 1="$pagenumber">$vbphrase[page_x]</phrase>-</if>$foruminfo[description_clean]" /> <else /> <meta name="keywords" content="$vboptions[keywords]" /> <meta name="description" content="$vboptions[description]" /> </if></if> <!-- CSS Stylesheet --> $style[css] <if condition="is_browser('opera') AND !is_browser('opera', '8.0.1')"> <style type="text/css" id="vbulletin_opera8fix_css"> ul, ol { padding-$stylevar[left]:20px; } </style> </if> <if condition="$show['editor_css']"> $editor_css </if> <!-- / CSS Stylesheet --> <script type="text/javascript" src="$stylevar[yuipath]/yahoo-dom-event/yahoo-dom-event.js?v=$vboptions[simpleversion]"></script> <script type="text/javascript" src="$stylevar[yuipath]/connection/connection-min.js?v=$vboptions[simpleversion]"></script> <script type="text/javascript"> <!-- var SESSIONURL = "$session[sessionurl_js]"; var SECURITYTOKEN = "$bbuserinfo[securitytoken]"; var IMGDIR_MISC = "$stylevar[imgdir_misc]"; var vb_disable_ajax = parseInt("$vboptions[disable_ajax]", 10); // --> </script> <script type="text/javascript" src="clientscript/vbulletin_global.js?v=$vboptions[simpleversion]"></script> <if condition="$show['popups']"><script type="text/javascript" src="clientscript/vbulletin_menu.js?v=$vboptions[simpleversion]"></script></if> <script type="text/javascript" src="clientscript/jquery/1.3/jquery-1.3.2.min.js"></script> <if condition="$vboptions['externalrss']"> <link rel="alternate" type="application/rss+xml" title="$vboptions[bbtitle] RSS Feed" href="external.php?type=RSS2" /> <if condition="$show['foruminfo'] OR $show['threadinfo']"> <link rel="alternate" type="application/rss+xml" title="$vboptions[bbtitle] - $foruminfo[title_clean] - RSS Feed" href="external.php?type=RSS2&forumids=$foruminfo[forumid]" /> </if> </if> this doesn't seem to work Code:
<plugins> <plugin active="1" executionorder="5"> <title>test</title> <hookname>global_start</hookname> <phpcode><![CDATA[$find = '<if condition="$show['popups']"><script type="text/javascript" src="clientscript/vbulletin_menu.js?v=$vboptions[simpleversion]"></script></if>'; $replace = '<if condition="$show['popups']"><script type="text/javascript" src="clientscript/vbulletin_menu.js?v=$vboptions[simpleversion]"></script></if> <script type="text/javascript" src="clientscript/jquery/1.3/jquery-1.3.2.min.js"></script>'; $vbulletin->templatecache['headinclude'] = str_replace($find, $replace, $vbulletin->templatecache['headinclude']);]]></phpcode> </plugin> </plugins> got it Code:
$search = '<!-- / CSS Stylesheet -->'; $replace = '<!-- / CSS Stylesheet --> test123'; $vbulletin->templatecache['headinclude'] = str_replace($search, $replace, $vbulletin->templatecache['headinclude']); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|