The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
"Compiled template"
Hi everybody! Let's start
Here what kh99 Quote:
I tried your code (FOR SHOWTHREAD) and it gets me a blank text file, so nothing This is the code that i need to "convert" Code:
<vb:comment><h2 class="forumtitle"><a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a></h2></vb:comment> <h2 class="forumtitle"><div id="scanu"><a <vb:if condition="$show[\'forumdescription\']">title=\'<scanu>{vb:raw forum.description}</scanu>\'</vb:if> href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a></div></h2> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js"></script> <script> $("#scanu a[title]").tooltip({ position: \'center right\', effect: \'slide\' }); </script> <style> scanu { background:black; color:white; padding: 5px 10px; -moz-border-radius: 8px; -webkit-border-radius: 8px; filter:alpha(opacity=68); -moz-opacity:.68; opacity:.68; } </style> thanks in advance --------------- Added [DATE]1324331782[/DATE] at [TIME]1324331782[/TIME] --------------- I see the database and i've tried this code Code:
$find = '<h2 class="forumtitle"><a href="' . vB_Template_Runtime::linkBuild("forum", $forum) . '">' . $forum['title'] . '</a></h2>'; $replace = ' <h2 class="forumtitle"><div id="scanu"><a title=\'<scanu>' . $forum['description'] . '</scanu>\' href="' . vB_Template_Runtime::linkBuild("forum", $forum) . '">' . $forum['title'] . '</a></div></h2> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js"></script> <script> $("#scanu a[title]").tooltip({ position: \'center right\', effect: \'slide\' }); </script> <style> scanu { background:black; color:white; padding: 5px 10px; -moz-border-radius: 8px; -webkit-border-radius: 8px; filter:alpha(opacity=68); -moz-opacity:.68; opacity:.68; } </style>'; $vbulletin->templatecache['forumhome_forumbit_level2_post'] = str_replace($find, $replace, $vbulletin->templatecache['forumhome_forumbit_level2_post']); --------------- Added [DATE]1324332260[/DATE] at [TIME]1324332260[/TIME] --------------- Code:
$find = '' . $forum['title'] . ''; $replace = ''; $vbulletin->templatecache['forumhome_forumbit_level2_post'] = str_replace($find, $replace, $vbulletin->templatecache['forumhome_forumbit_level2_post']); Code:
$find = 'test'; $replace = ''; $vbulletin->templatecache['forumhome_forumbit_level2_post'] = str_replace($find, $replace, $vbulletin->templatecache['forumhome_forumbit_level2_post']); |
#2
|
|||
|
|||
The reason the code using the showthread hook didn't work for you is that not every template is loaded on every page, and the forumbit templates aren't loaded on the showthread page. But as you figured out, you can look in the database and find the same info.
I'm not sure if you're saying you figured it out or you still have a problem. |
#3
|
||||
|
||||
ok i try the code of the showthread for the showthread exactly as you said just for see, but doesn't work. then yesy i see the code in the databse and i tried this code
Code:
$find = '<h2 class="forumtitle"><a href="' . vB_Template_Runtime::linkBuild("forum", $forum) . '">' . $forum['title'] . '</a></h2>'; $replace = ' <h2 class="forumtitle"><div id="scanu"><a title=\'<scanu>' . $forum['description'] . '</scanu>\' href="' . vB_Template_Runtime::linkBuild("forum", $forum) . '">' . $forum['title'] . '</a></div></h2> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js"></script> <script> $("#scanu a[title]").tooltip({ position: \'center right\', effect: \'slide\' }); </script> <style> scanu { background:black; color:white; padding: 5px 10px; -moz-border-radius: 8px; -webkit-border-radius: 8px; filter:alpha(opacity=68); -moz-opacity:.68; opacity:.68; } </style>'; $vbulletin->templatecache['forumhome_forumbit_level2_post'] = str_replace($find, $replace, $vbulletin->templatecache['forumhome_forumbit_level2_post']); |
#4
|
|||
|
|||
OK, try this:
Code:
$find = '<h2 class="forumtitle"><a href="\' . vB_Template_Runtime::linkBuild("forum", $forum) . '">\' . $forum['title'] . \'</a></h2>'; $replace = ' <h2 class="forumtitle"><div id="scanu"><a title=\'<scanu>' . $forum['description'] . '</scanu>\' href="' . vB_Template_Runtime::linkBuild("forum", $forum) . '">' . $forum['title'] . '</a></div></h2> Edit: well, the replace code there isn't right, but the point is that you need to escape all single quotes in the string you're trying to match. You seem to have escaped the quotes in the string you're adding, but not in the string you got from the compiled template. |
#5
|
||||
|
||||
What!? The code didn't worked but i've changed this
' . $forum['title'] . ' in this: ' . $forum[\'title\'] . ' And it worked just this code with this code Code:
$find = '\' . $forum[\'title\'] . \''; $replace = ''; $vbulletin->templatecache['forumhome_forumbit_level2_post'] = str_replace($find, $replace, $vbulletin->templatecache['forumhome_forumbit_level2_post']); --------------- Added [DATE]1324383827[/DATE] at [TIME]1324383827[/TIME] --------------- Everything work but there is a problem: This is my code Code:
$find = '<h2 class="forumtitle"><a href="\' . vB_Template_Runtime::linkBuild("forum", $forum) . \'">\' . $forum[\'title\'] . \'</a></h2>'; $replace = '<h2 class="forumtitle"><div id="scanu"><a title="<scanu>\' . $forum[\'description\'] . \'</scanu>" href="\' . vB_Template_Runtime::linkBuild("forum", $forum) . \'">\' . $forum[\'title\'] . \'</a></div></h2> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js"></script> <script> $("#scanu a[title]").tooltip({ position: "center right", effect: "slide" }); </script> <style> scanu { background:black; color:white; padding: 5px 10px; -moz-border-radius: 8px; -webkit-border-radius: 8px; filter:alpha(opacity=68); -moz-opacity:.68; opacity:.68; } </style>'; $vbulletin->templatecache['forumhome_forumbit_level2_post'] = str_replace($find, $replace, $vbulletin->templatecache['forumhome_forumbit_level2_post']); Code:
title="<scanu>\' . $forum[\'description\'] . \'</scanu>" Code:
title=\'<scanu>\' . $forum[\'description\'] . \'</scanu>\' |
#6
|
|||
|
|||
I believe html attributes need to have " and not '.
|
#7
|
||||
|
||||
No that's a choice of the coder (as php) in fact in normal html works but in this code not. As i change " to \' it delete all the template o.o. I need that is ' and not "
In php syntax this would be work That's strange |
#8
|
|||
|
|||
Oh, OK - I don't do enough html to keep that stuff straight. But I think then the reason it doesn't work is that it ends up producing a php string where the quotes are unmatched (or matched but not the way you intended). This stuff gets really confusing and hard to keep track of in my mind, but I think if you did this is might work:
Code:
title=\\'<scanu>\' . $forum[\'description\'] . \'</scanu>\\' |
#9
|
||||
|
||||
Quote:
I tried " and it worked but not as i want I tried \' and it doesn't work Now i tried \\' and it still doesn't work Now the last thing i can do is change this Code:
$replace = ' '; Code:
$replace = " "; --------------- Added [DATE]1324395032[/DATE] at [TIME]1324395032[/TIME] --------------- Worst! Damn this code is perfect! Code:
$find = '<h2 class="forumtitle"><a href="\' . vB_Template_Runtime::linkBuild("forum", $forum) . \'">\' . $forum[\'title\'] . \'</a></h2>'; $replace = '<h2 class="forumtitle"><div id="scanu"><a title="<scanu>\' . $forum[\'description\'] . \'</scanu>" href="\' . vB_Template_Runtime::linkBuild("forum", $forum) . \'">\' . $forum[\'title\'] . \'</a></div></h2> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js"></script> <script> $("#scanu a[title]").tooltip({ position: "center right", effect: "slide" }); </script> <style> scanu { background:black; color:white; padding: 5px 10px; -moz-border-radius: 8px; -webkit-border-radius: 8px; filter:alpha(opacity=68); -moz-opacity:.68; opacity:.68; } </style>'; $vbulletin->templatecache['forumhome_forumbit_level2_post'] = str_replace($find, $replace, $vbulletin->templatecache['forumhome_forumbit_level2_post']); |
#10
|
|||
|
|||
Maybe try using "heredoc" syntax for the replacement string: http://us2.php.net/manual/en/language.types.string.php
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|