The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
BBCode only works in single post, not full thread
I've been trying to get Syntax Highlighting to work on my board so I added BB Code utilizing google's prettify.
As we can see it works here: http://snpr.cm/Mhtsv5.png [Link looks like: http://myforum.com/forums/showthread.php?557-Coding-Convention-amp-Guidelines&p=3054#post3054 ] And it doesn't work here: http://snpr.cm/OE9Y3F.png [Link: http://myforum.com/forums/showthread.php?557-Coding-Convention-amp-Guidelines ] My BB Code is this: Code:
<link href="http://myforum.com/prettify/src/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="http://myforum.com/prettify/src/prettify.js"></script> <script type="text/javascript"> var theonload = window.onload; window.onload = function(){ theonload(); prettyPrint(); } </script> <pre class="prettyprint"> {param} </pre> |
#2
|
|||
|
|||
I'm not sure if this will make any difference, but maybe try putting this in headinclude:
Code:
<vb:if condition="THIS_SCRIPT == 'showthread'"> <link href="http://myforum.com/prettify/src/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="http://myforum.com/prettify/src/prettify.js"></script> <script type="text/javascript"> var theonload = window.onload; window.onload = function(){ theonload(); prettyPrint(); } </script> </vb:if> Then just make the bbcode: Code:
<pre class="prettyprint"> {param} </pre> That has the disadvantage of always loading the prettyprint stuff whether or not it's used, but this way it's only loaded once. If that doesn't work, if you could post a link to your threads that might help in figuring out (although I suppose you would have done that if you didn't want to keep it private). |
#3
|
|||
|
|||
Yeah that solution didn't work out. I don't mind letting you check it, it's in a private section which is why I didn't give out the link itself.
I made an account you can view it from, I'll PM it to you. Thanks a lot for your time! |
#4
|
|||
|
|||
Try using:
Code:
<script type="text/javascript"> var theonload = window.onload; window.onload = function(){ if (theonload) theonload(); prettyPrint(); } </script> the part in red is added. The fact that theonload isn't a function is causing an error on the page that doesn't work, but I don't know why it's not causing an error on both pages. |
#5
|
|||
|
|||
Thank you very very much, that fixed the issue right up. Only one tag works per page, but I can live with that hahaha.
EDIT: Nope, managed to fix that too! Code:
<script type="text/javascript"> if (window.onload = " ") { var theonload = window.onload; window.onload = function(){ if (theonload) theonload(); prettyPrint(); } } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|