vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to make this code works in vb4? (https://vborg.vbsupport.ru/showthread.php?t=232771)

almannai 01-11-2010 05:36 AM

How to make this code works in vb4?
 
Hi all

Any help will be apriatiated

the following code that is working in vb3 is giving error in vb4
PHP Code:

<plugin active="1" executionorder="5">
<
hookname>global_start</hookname>
<
phpcode><![CDATA[
switch (
$vbulletin->options['myplugin_place']) 

case 
1
$place '$header';
break; 
case 
2
$place '$navbar'
break; 
default: 
$place '$navbar'
break; 


if (
$place == '$navbar'){
$vbulletin->templatecache['FORUMDISPLAY'] = str_replace($place$place $vbulletin->templatecache['myplugin_template'], $vbulletin->templatecache['FORUMDISPLAY']);
$vbulletin->templatecache['FORUMHOME'] = str_replace($place$place $vbulletin->templatecache['myplugin_template'], $vbulletin->templatecache['FORUMHOME']);
}else{
$vbulletin->templatecache['FORUMHOME'] = str_replace($place$place $vbulletin->templatecache['myplugin_template'], $vbulletin->templatecache['FORUMHOME']);
}

]]></
phpcode>
</
plugin

the error is
Quote:

Parse error: syntax error, unexpected T_STRING, expecting T_PAAMAYIM_NEKUDOTAYIM in class_core.php(3811) : eval()'d code on line 13
So can someone tell me what am doing wrong? Please show some examples to fix it.

Regards,

Lynne 01-11-2010 02:38 PM

How can you replace $navbar in FORUMDISPLAY when there is no $navbar in either of those templates any longer? You will need to look at the FORUMDISPLAY and FORUMHOME templates to find the appropriate lines to replace. (FORUMHOME now has a template_hook near the top that you could probably use).

Paul M 01-22-2010 09:57 AM

You should also note that global_start is going to be removed at some point, both from the CMS and eventually the forums, so you should look to use a different hook.


All times are GMT. The time now is 12:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00946 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete