vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Function works in Forum but undefined in CMS (https://vborg.vbsupport.ru/showthread.php?t=241715)

djbaxter 05-02-2010 02:19 PM

Function works in Forum but undefined in CMS
 
I am using a customization to pull the title of the latest entry in an external blog. See https://vborg.vbsupport.ru/showthread.php?t=234254 for details

This works fine and generates no errors in the Forum.

However, I've now enabled the CMS and when I do that and try to leave a comment I get this error:

Code:

Fatal error: Call to undefined function CarpCacheShow() in /path/to/forum/includes/class_postbit.php(277) : eval()'d code on line 2
I assume this means something is not declared properly for the CMS.

The function in question is called in a plugin using the postbit_display_start hook:

PHP Code:

ob_start();
CarpCacheShow($post[field6]);
$blogentry ob_get_contents();
ob_end_clean();
vB_Template::preRegister('postbit',array('blogentry' => $blogentry)); 

What do I need to add/change to get CMS to "see" and process this?

(Reposted from http://www.vbulletin.com/forum/showt...defined-in-CMS as Lynne suggested)

--------------- Added [DATE]1272819511[/DATE] at [TIME]1272819511[/TIME] ---------------

I've discovered that I can avoid error messages if I use the global_start hook instead of the postbit_display_start hook and add a line like this:

PHP Code:

ob_start();
CarpCacheShow($post[field6]);
$blogentry ob_get_contents();
ob_end_clean();
vB_Template::preRegister('postbit',array('blogentry' => $blogentry));
vB_Template::preRegister('vbcms_page',array('blogentry' => $blogentry)); 

However, I'm not sure this is an efficient way to do this.

--------------- Added [DATE]1272854336[/DATE] at [TIME]1272854336[/TIME] ---------------

Added: No. That disables the errors on the home page of the CMS but as soon as you click through to one of the articles there are errors again.


All times are GMT. The time now is 08:24 PM.

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.01676 seconds
  • Memory Usage 1,717KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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