Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 06-29-2007, 06:16 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<plugin active="1" executionorder="5" product="test">
<title>Test One (2)</title>
<hookname>postbit_display_complete</hookname>
<phpcode><![CDATA[global $vbulletin;

if ($vbulletin->options['test_enable_global'])
{
$template_hook[postbit_user_popup] = print "->123<-";
}
else
{
$template_hook[postbit_user_popup] = print "->456<-";
}
]]></phpcode>
</plugin>
Reply With Quote
  #12  
Old 06-29-2007, 01:32 PM
Makc666's Avatar
Makc666 Makc666 is offline
 
Join Date: Dec 2002
Location: MSK-RU
Posts: 392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Dismounted!
This one helped.

P.S. Saying the truth I was trying to do the same way, but it didn't help I think I have to get some rest.
Reply With Quote
  #13  
Old 07-01-2007, 02:14 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should have a '.=' not an '='. You are let others use the hook if your hack gets processed after.
Reply With Quote
  #14  
Old 07-02-2007, 07:03 AM
Makc666's Avatar
Makc666 Makc666 is offline
 
Join Date: Dec 2002
Location: MSK-RU
Posts: 392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Abe1 View Post
You should have a '.=' not an '='. You are let others use the hook if your hack gets processed after.
Yes. Thanks Abe1 for the note.

Realy, the code must have '.='

I attached a product Test Popup Menu in Postbit (test_postbit.xml) for anyone who want to check this one.

HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="test_postbit" active="1">
<title>Test Popup Menu in Postbit</title>
<description>A simple test product using hook $template_hook[postbit_user_popup] in popup menu of postbit and postbit_legacy template</description>
<version>1.0.0</version>

<templates>
		<template name="test_postbit1" templatetype="template" date="1182869201" username="Makc666" version="1.0.0"><![CDATA[
	<tr><td class="vbmenu_option">
	->123<- | UserName - $post[username] | Post ID - $post[postid]
	</td></tr>
	]]></template>
		<template name="test_postbit2" templatetype="template" date="1182869202" username="Makc666" version="1.0.0"><![CDATA[
	<tr><td class="vbmenu_option">
	->456<- | UserName - $post[username] | Post ID - $post[postid]
	</td></tr>
	]]></template>
</templates>

<plugins>

	<plugin active="1" executionorder="1" product="test_postbit">
			<title>Test Postbit One (1)</title>
			<hookname>postbit_display_start</hookname>
			<phpcode><![CDATA[
			unset($template_hook['postbit_user_popup']);
]]></phpcode>
	</plugin>
	
	<plugin active="1" executionorder="5" product="test_postbit">
			<title>Test Postbit One (2)</title>
			<hookname>postbit_display_complete</hookname>
			<phpcode><![CDATA[
	global $vbulletin;

	if ($vbulletin->options['test_postbit_enable_global'])
	{
		eval('$template_hook[postbit_user_popup] .= "' . fetch_template('test_postbit1') . '";');
	}
	else
	{
		eval('$template_hook[postbit_user_popup] .= "' . fetch_template('test_postbit2') . '";');
	}
]]></phpcode>
	</plugin>	

</plugins>

<phrases>
	<phrasetype name="vBulletin Settings" fieldname="vbsettings">
		<phrase name="settinggroup_test_postbit"><![CDATA[Test Postbit One]]></phrase>
		<phrase name="setting_test_postbit_enable_global_title"><![CDATA[Enable Whole Hack]]></phrase>
		<phrase name="setting_test_postbit_enable_global_desc"><![CDATA[If you want to disable, just set "No".]]></phrase>
	</phrasetype>
</phrases>

<options>
	<settinggroup name="test_postbit" displayorder="601">
		<setting varname="test_postbit_enable_global" displayorder="5">
			<datatype>free</datatype>
			<optioncode>yesno</optioncode>
			<defaultvalue>1</defaultvalue>
		</setting>
	</settinggroup>
</options>

</product>
Attached Images
File Type: png test_postbit.png (50.1 KB, 0 views)
Attached Files
File Type: xml test_postbit.xml (2.3 KB, 8 views)
Reply With Quote
  #15  
Old 07-02-2007, 11:34 AM
Makc666's Avatar
Makc666 Makc666 is offline
 
Join Date: Dec 2002
Location: MSK-RU
Posts: 392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I released a hack based on this code:
Quote Post in PM
https://vborg.vbsupport.ru/showthread.php?t=151163
https://vborg.vbsupport.ru/misc.php?...help&pid=qpipm
Reply With Quote
  #16  
Old 01-07-2010, 10:10 AM
Makc666's Avatar
Makc666 Makc666 is offline
 
Join Date: Dec 2002
Location: MSK-RU
Posts: 392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This problem raised again in 4.0.0 PL1 with new hook memberaction_dropdown_items

The bug is here -> http://www.vbulletin.com/forum/proje...?issueid=35014
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05327 seconds
  • Memory Usage 2,245KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (2)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete