The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Changing templates with plugins
Just when I thought I had finally understood a small percentage of the vBulletin code, a completely new (but very powerful) template syntax has been released!
I have a small piece of code that adds an extra checkbox when a user is posting a reply. This ultimately adds some text to the message area and changes the prefix. Unfortunately with the new version, the page wont even load. I've read some of the template articles and examined some 4.0 mods. However, they are at a level higher than my current vBulletin code comprehension. Here is the code that is compatible with vB 3.8 using the "newreply_form_complete" hook: Code:
$str = "<!-- Some comment in a template-->"; $replace = "<br /> <input type='checkbox' name='resolved' value='1' />Resolution? "; $vbulletin->templatecache['newreply'] = str_replace($str,$str.$replace,$vbulletin->templatecache['newreply']); There is also another plugin hooked to "newreply_post_start" that massages the data. It probably isn't compatible either, but I'll cross that bridge when I get to it. Is there still a way to perform the functionality of my current code? If so, could someone give me some guidance? |
#2
|
||||
|
||||
Is there a question here?
|
#3
|
|||
|
|||
Whoops! I just realized I forgot to ask one. Thanks Lynne!
Is there still a way to perform the functionality of my current code? If so, could someone give me some guidance? Thanks in advance. |
#4
|
||||
|
||||
It would be like this.
Code:
$str = "<!-- Some comment in a template-->"; $replace = "<br /><input type='checkbox' name='resolved' value='1' />Resolution?"; $vbulletin->templatecache['newreply'] = str_replace($str,$str.$replace, $vbulletin->templatecache['newreply']); |
#5
|
|||
|
|||
Quote:
The above code still doesn't work in vB 4.0 |
#6
|
||||
|
||||
With the proper hook location? process_templates_complete
|
#7
|
|||
|
|||
Well, I originally didn't have the hook location set to "process_templates_complete". However, even after changing the hook location, I get the following error message and the page does not load:
Code:
Parse error: syntax error, unexpected T_STRING in D:\wamp\othersites\beta\includes\class_core.php(3917) : eval()'d code on line 104 Any Ideas? |
#8
|
||||
|
||||
Can I see your exact code.
You can post the error all day long with out the code its no good. |
#9
|
|||
|
|||
Most certainly,
Here is the section of the style 'newreply' with the comment Code:
</div> <vb:if condition="$show['additional_options']"> <h3 class="blockhead">{vb:rawphrase additional_options}</h3> <div class="blockbody formcontrols"> <vb:if condition="$show['misc_options']"> <div class="blockrow"> <!-- Some Comment --> <ul class="checkradio group"> <vb:if condition="$bbuserinfo['signature'] != ''"> <li> <label for="cb_signature"><input type="checkbox" name="signature" value="1" id="cb_signature" tabindex="4" {vb:raw checked.signature} /> {vb:rawphrase show_your_signature}</label> Code:
$str = "<!-- Some Comment -->"; $replace = "<br /><input type='checkbox' name='resolved' value='1' />Resolution?"; $vbulletin->templatecache['newreply'] = str_replace($str,$str.$replace,$vbulletin->templatecache['newreply']); Please let me know if you need any more information. Thanks Again. |
#10
|
||||
|
||||
Try this
Code:
$str = "<!-- Some Comment -->"; $replace = '<br /><input type="checkbox" name="resolved" value="1" />Resolution?'; $vbulletin->templatecache['newreply'] = str_replace($str,$str.$replace,$vbulletin->templatecache['newreply']); |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|