The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
hook $template_hook[postbit_user_popup] - problems
There is hook:
$template_hook[postbit_user_popup] Example 1: HTML Code:
<template name="test" templatetype="template" date="1182869201" username="Makc666" version="1.0.0"> <![CDATA[ <if condition="$show['pmlink']"> <tr><td class="vbmenu_option">Test Phrase - PostID $post[postid] - Postcount $post[postcount]</td></tr> </if> ]]> </template> <plugin active="1" executionorder="5"> <title>Test (1)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ eval('$template_hook[postbit_user_popup] = "' . fetch_template('test') . '";'); ]]> </phpcode> </plugin> HTML Code:
<template name="test" templatetype="template" date="1182869201" username="Makc666" version="1.0.0"> <![CDATA[ <if condition="$show['pmlink']"> <tr><td class="vbmenu_option">Test Phrase - PostID $post[postid] - Postcount $post[postcount]</td></tr> </if> ]]> </template> <plugin active="1" executionorder="5"> <title>Test (1)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ eval('$template_hook[postbit_user_popup] .= "' . fetch_template('test') . '";'); ]]> </phpcode> </plugin> The difference between Example 1 and Example 2 is on line: eval('$template_hook[postbit_user_popup] = "' . fetch_template('test') . '";'); In Example 1 there is NO . (dot) near = In Example 2 there is . (dot) near .= If I use Example 1 then I replace $template_hook[postbit_user_popup] with my template and no one will not be able to use $template_hook[postbit_user_popup] once again in another product. You will say, use Example 2 with . (dot) near .= as for example in this article is advised: https://vborg.vbsupport.ru/showthread.php?t=147447 But if I use Example 2 I have some problem... Look on screenshot. I don't know what to do... P.S. I don't want manual template changes. |
#2
|
||||
|
||||
What other modifications do you have that uses this template hook?
|
#3
|
||||
|
||||
Quote:
Do you understand what is the nature of that problem? I understand, but I can't find a sollution fot it. May be I am using wrong hookname... <hookname>postbit_display_complete</hookname |
#4
|
||||
|
||||
I know what you mean, but since you have no mods, what's the problem with just assigning it? Anyway, try this:
HTML Code:
<template name="test" templatetype="template" date="1182869201" username="Makc666" version="1.0.0"> <![CDATA[ <if condition="$show['pmlink']"> <tr><td class="vbmenu_option">Test Pharase</td></tr> </if> ]]> </template> <plugin active="1" executionorder="5"> <title>Test (1)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[if ($post['postcount'] == 1) { eval('$template_hook[postbit_user_popup] .= "' . fetch_template('test') . '";'); }]]> </phpcode> </plugin> |
#5
|
||||
|
||||
Quote:
I am making a product and don't want to assign it. I am realy wondering it that hook will real work there? Quote:
Yes it will display only one line of mine. But it will display in every post the line which belongs to the first post. Also it will not work on pages like this one: https://vborg.vbsupport.ru/showpost....78&postcount=4 I understand that I have to make some checkup but I can't "cook up" one and also I don't want to right a SQL query for that think up. |
#6
|
||||
|
||||
Quote:
PHP Code:
|
#7
|
||||
|
||||
Quote:
The answer for "old" post: I have replaced text: Test Phrase with text: Test Phrase - PostID $post[postid] - Postcount $post[postcount] in my first post: https://vborg.vbsupport.ru/showthread.php?t=150769 And I reuploaded the screenshot also. So you will understand now clearly But!!! Here is the answer for "new" post: I added a line you said me to my code and now it looks like: HTML Code:
<plugin active="1" executionorder="5"> <title>Test (1)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ unset($template_hook['postbit_user_popup']); eval('$template_hook[postbit_user_popup] .= "' . fetch_template('test') . '";'); ]]> </phpcode> </plugin> P.S. Realy I had a thought to destroy the specified variable but... Thanks, Dismounted! I am very happy I now know this little tip now! P.S.S. Oh... I remade the code 100% the way you said... HTML Code:
<plugin active="1" executionorder="1"> <title>Test (0)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ unset($template_hook['postbit_user_popup']); ]]></phpcode> </plugin> <plugin active="1" executionorder="5"> <title>Test (1)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ eval('$template_hook[postbit_user_popup] .= "' . fetch_template('test') . '";'); ]]> </phpcode> </plugin> Because both variants work there |
#8
|
||||
|
||||
Cool!
Mike Sullivan just answer me on www.vbulletin.com that this one is connected with BUG introduced in 3.6.7: http://www.vbulletin.com/forum/showt...64#post1379664 Quote:
|
#9
|
||||
|
||||
HTML Code:
<plugin active="1" executionorder="1"> <title>Test (0)</title> <hookname>postbit_display_start</hookname> <phpcode><![CDATA[ unset($template_hook['postbit_user_popup']); ]]></phpcode> </plugin> <plugin active="1" executionorder="5"> <title>Test (1)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ eval('$template_hook[postbit_user_popup] .= "' . fetch_template('test') . '";'); ]]> </phpcode> </plugin> |
#10
|
||||
|
||||
Once again Thanks, Dismounted.
As I said that problem is connected with BUG: http://www.vbulletin.com/forum/proje...?issueid=22069 Now I meet with another strange problem. I added a check in my code: HTML Code:
<plugin active="1" executionorder="5" product="test"> <title>Test One (2)</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ if ($vbulletin->options['test_enable_global']) { $template_hook[postbit_user_popup] = print "->123<-"; } else { $template_hook[postbit_user_popup] = print "->456<-"; } ]]></phpcode> </plugin> As I see value $vbulletin->options['test_enable_global'] is not return to plugin. I attached test.xml which is a simle test product with that code. ->123<- or ->456<- are printed on forum/showthread.php page on the top. Moved attachment here: https://vborg.vbsupport.ru/showpost....4&postcount=14 Maybe you can help me with this one. As I realy don't understand if this one connected with that BUG: issueid=22069 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|