Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 08-12-2011, 06:14 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EquinoxWorld View Post
global_start.
For both plugins? That could be the problem, because unless you set the execution order you probably don't know which one is running first. But if you're using the same hook for more than one plugin you could also combine them into one. (What Sherif posted above might also work because it's using two hook locations).
Reply With Quote
  #12  
Old 08-12-2011, 06:21 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
Try This:

PHP Code:
$templater vB_Template::create('COTW_SIDEMENU');
$templater->register('php_include'$php_include);
$cotw_sidemenu $templater->render();
vB_Template::preRegister('COTW_SOTW',array('cotw_sidemenu' => $cotw_sidemenu)); 
And

Plugin Hook: parse_templates

Code:
ob_start();
  require_once('test.php');
  $php_include .= ob_get_contents();
ob_end_clean();
Thanks for your reply Sherif, although still no results.

These are the plugins I am using.

hook parse_templates
PHP Code:
$templater vB_Template::create('COTW_SIDEMENU');
$templater->register('php_include'$php_include);
$cotw_sidemenu $templater->render();
vB_Template::preRegister('COTW_SOTW',array('cotw_sidemenu' => $cotw_sidemenu)); 
and

hook global_start
PHP Code:
ob_start();
  require_once(
'test.php');
  
$php_include .= ob_get_contents();
ob_end_clean(); 
Then adding {vb:raw php_include} to my COTW_SIDEMENU template. Unfortunately still no results.
Reply With Quote
  #13  
Old 08-12-2011, 06:41 PM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EquinoxWorld View Post
Thanks for your reply Sherif, although still no results.

These are the plugins I am using.

hook parse_templates
PHP Code:
$templater vB_Template::create('COTW_SIDEMENU');
$templater->register('php_include'$php_include);
$cotw_sidemenu $templater->render();
vB_Template::preRegister('COTW_SOTW',array('cotw_sidemenu' => $cotw_sidemenu)); 
and

hook global_start
PHP Code:
ob_start();
  require_once(
'test.php');
  
$php_include .= ob_get_contents();
ob_end_clean(); 
Then adding {vb:raw php_include} to my COTW_SIDEMENU template. Unfortunately still no results.
I told you to use

Parse template hook for this code

PHP Code:
ob_start();
  require_once(
'test.php');
  
$php_include .= ob_get_contents();
ob_end_clean(); 
the hook for other code is which u were using earlier.
Reply With Quote
  #14  
Old 08-12-2011, 06:49 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
I told you to use

Parse template hook for this code

PHP Code:
ob_start();
  require_once(
'test.php');
  
$php_include .= ob_get_contents();
ob_end_clean(); 
the hook for other code is which u were using earlier.
Sorry about that. Tried that as well but still no luck I'm afraid. The sidemenu shows perfectly but just not that variables output. Would you think it may have to do with the execution order ? Maybe the template is being rendered before the variable is included in the template? I'm so frustrated right now. In any case thanks for your help guys, I really appreciate it. If anyone has any more ideas or anything info at ALL please let me know. Thanks.

P.S.: If anyone is willing to help further I would gladly provide log in to my test site if anyone is up for it. To be honest I have reached my skill level on this one.
Reply With Quote
  #15  
Old 08-12-2011, 06:54 PM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EquinoxWorld View Post
Sorry about that. Tried that as well but still no luck I'm afraid. The sidemenu shows perfectly but just not that variables output. Would you think it may have to do with the execution order ? Maybe the template is being rendered before the variable is included in the template? I'm so frustrated right now. In any case thanks for your help guys, I really appreciate it. If anyone has any more ideas or anything info at ALL please let me know. Thanks.
Try This

Plugin Hook: parse_templates

Code:
ob_start(); 
  require_once('test.php'); 
  $php_include = ob_get_contents(); 
ob_end_clean();  

$templater = vB_Template::create('COTW_SIDEMENU'); 
$templater->register('php_include', $php_include); 
$cotw_sidemenu = $templater->render(); 
vB_Template::preRegister('COTW_SOTW',array('cotw_sidemenu' => $cotw_sidemenu));

To be fair, why you are including external file from outside. just write php code in plugins or make functions.
Reply With Quote
  #16  
Old 08-12-2011, 07:04 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
Try This

Plugin Hook: parse_templates

Code:
ob_start(); 
  require_once('test.php'); 
  $php_include = ob_get_contents(); 
ob_end_clean();  

$templater = vB_Template::create('COTW_SIDEMENU'); 
$templater->register('php_include', $php_include); 
$cotw_sidemenu = $templater->render(); 
vB_Template::preRegister('COTW_SOTW',array('cotw_sidemenu' => $cotw_sidemenu));

To be fair, why you are including external file from outside. just write php code in plugins or make functions.

HURRRAAYYYYYY!!!! FOR SHERRRIFFFFFF Needless to say I will NOT shoot the sherif

Thanks a bunch for your help. Also thanks to our advisor kh99, without your guys help I would have probably exploded my server or something. Thanks again guys. I'm so stoked this works now.

About your question I guess I have not been too familiar yet with vb plugin system as you can tell; as a noob still I feel more comfortable using files. I feel I have more control and organization with files than plugins. Performance wise does it have any impact choosing one over the other??
Reply With Quote
  #17  
Old 08-12-2011, 07:09 PM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EquinoxWorld View Post
HURRRAAYYYYYY!!!! FOR SHERRRIFFFFFF Needless to say I will NOT shoot the sherif

Thanks a bunch for your help. Also thanks to our advisor kh99, without your guys help I would have probably exploded my server or something. Thanks again guys. I'm so stoked this works now.

About your question I guess I have not been too familiar yet with vb plugin system as you can tell; as a noob still I feel more comfortable using files. I feel I have more control and organization with files than plugins. Performance wise does it have any impact choosing one over the other??
not really.. but when plugin has option to add php code then why not use it..
Reply With Quote
  #18  
Old 08-12-2011, 07:19 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
not really.. but when plugin has option to add php code then why not use it..
True. One last question. If I wanted to include the variable in more than one template can I do this:

PHP Code:
vB_Template::preRegister('COTW_SOTW',array('cotw_sidemenu' => $cotw_sidemenu));
vB_Template::preRegister('other template',array('cotw_sidemenu' => $cotw_sidemenu));
vB_Template::preRegister('other template',array('cotw_sidemenu' => $cotw_sidemenu));
vB_Template::preRegister('other template',array('cotw_sidemenu' => $cotw_sidemenu)); 
Or is there a better way of doing it If it is for more than a couple of templates?
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 05:03 AM.


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.05705 seconds
  • Memory Usage 2,271KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_code
  • (8)bbcode_php
  • (8)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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete