The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
Aha that would explain the template not appearing correctly.
Thanks Simon you are a star. i'll try that out and let you know how i get on. --------------- Added [DATE]1339175622[/DATE] at [TIME]1339175622[/TIME] --------------- ok sorry for being a bit thick - what exactly do i do? I've imported this plugin. I want to create a custom headinclude with my modified code and i want that headinclude to display exclusively in SHOWTHREAD whilst everything else uses the default headinclude code. |
#12
|
||||
|
||||
If the pluging is turned on for it, it should show "My Template Stuff!" in the top left of your forum, it's found in the template hd_form, in the template hd_form you need to add a conditional <if condition="THIS_SCRIPT == 'showthread' ">ALL THE TEMPLATE STUFF</if> now the contents of the hd_form will only appear when using showthread template.
|
#13
|
|||
|
|||
Ok the script is working, and i've edited hd_form to include the code i would like it to run but it doesn't appear to run correctly.
My code does have IF ELSE statement in it and i'm wondering if this is affecting it? It shouldn't do as it runs the code correctly if its pasted directly into the SHOWTHREAD template. |
#14
|
||||
|
||||
depends how you implemented it!
|
#15
|
|||
|
|||
I'll explain what i'm doing.
I'm trying to show different Google DFP ad tags in the header depending on whether somebody is browsing (not logged in) or logged in. The reason for this is Google DFP don't like it if you activate all of your ad units in the header when those ad units aren't displayed on a given page the header is on. So users who are not logged in see more ad units on a page than a registered user. So in headinclude the default 2 ad tags (on the footer and forum nav bar) are initiated. On showthread I need it to do the same but add an IF conditional that if a user isn't logged in then it initiates more ad tags. I cant' do this in headinclude because those ad units only appear in showthread and not on other pages (such as forum listings or on the forum homepage). So - am i right in thinking copying the entire contents of headinclude and putting it in hd_form with the IF conditionals for the ad tags is the correct thing to do? This is what it looks like: Code:
<if condition="THIS_SCRIPT == 'showthread' "> <meta name="google-site-verification" content="edited out for privacy reasons" /> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'edited out for privacy reasons']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <if condition="!$bbuserinfo['userid']"> <script type='text/javascript'> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; (function() { var gads = document.createElement('script'); gads.async = true; gads.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(gads, node); })(); </script> <script type='text/javascript'> googletag.cmd.push(function() { googletag.defineSlot('/13461183/Forum_beneathfirstpost', [728, 90], 'div-gpt-ad-1338664095261-0').addService(googletag.pubads()); googletag.defineSlot('/13461183/Forum_bottom', [728, 90], 'div-gpt-ad-1338664095261-1').addService(googletag.pubads()); googletag.defineSlot('/13461183/Forum_firstpost_300x250', [300, 250], 'div-gpt-ad-1338664095261-2').addService(googletag.pubads()); googletag.defineSlot('/13461183/Forum_leaderboard', [728, 90], 'div-gpt-ad-1338664095261-3').addService(googletag.pubads()); googletag.defineSlot('/13461183/Forum_secondpost_300x250', [300, 250], 'div-gpt-ad-1338664095261-4').addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); googletag.enableServices(); }); </script> <else /> <script type='text/javascript'> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; (function() { var gads = document.createElement('script'); gads.async = true; gads.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(gads, node); })(); </script> <script type='text/javascript'> googletag.cmd.push(function() { googletag.defineSlot('/13461183/Forum_bottom', [728, 90], 'div-gpt-ad-1338664095261-1').addService(googletag.pubads()); googletag.defineSlot('/13461183/Forum_leaderboard', [728, 90], 'div-gpt-ad-1338664095261-3').addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); googletag.enableServices(); }); </script> </if> <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> <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> </if> |
#16
|
||||
|
||||
I think you just need to import this product and manipulate it as you want (dont forget to choose overwrite!)
|
#17
|
|||
|
|||
Thanks I just tested it out - and its still the same problem with it not parsing the code correctly in hd_form in thread topics.
However something slightly strange I noticed: If i modify headinclude and display a thread its still pulling in data from headinclude. If i modify hd_form its also displaying that data too. So something isnt right. |
#18
|
||||
|
||||
It's not replacing headinclude it's adding to it!
|
#19
|
|||
|
|||
Ah! Well i need something to completely replace it!
I need to replace headinclude on certain sections on my forum. At the moment i'm concentrating on showthread. Is that possible? |
#20
|
||||
|
||||
Yep with that template, remove everything except <!-- / CSS Stylesheet --> in headinclude, in the template hd_form under <if THIS_SCRIPT.....etc add your entire modified headinclude, before the last </if> put <else /> and then the original contents of the headinclude and you should be good
--------------- Added [DATE]1339181995[/DATE] at [TIME]1339181995[/TIME] --------------- Can i ask why you are wanting to replace the headinclude? what are you trying to do? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|