![]() |
"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> 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>'; --------------- Added [DATE]1324332260[/DATE] at [TIME]1324332260[/TIME] --------------- Code:
$find = '' . $forum['title'] . ''; Code:
$find = 'test'; |
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. |
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>'; |
OK, try this:
Code:
$find = '<h2 class="forumtitle"><a href="\' . vB_Template_Runtime::linkBuild("forum", $forum) . '">\' . $forum['title'] . \'</a></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. |
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\'] . \''; --------------- 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>'; Code:
title="<scanu>\' . $forum[\'description\'] . \'</scanu>" Code:
title=\'<scanu>\' . $forum[\'description\'] . \'</scanu>\' |
I believe html attributes need to have " and not '.
|
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 |
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>\\' |
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>'; |
Maybe try using "heredoc" syntax for the replacement string: http://us2.php.net/manual/en/language.types.string.php
|
All times are GMT. The time now is 10:54 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|