View Single Post
  #1  
Old 08-17-2010, 12:00 AM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Plugins for Forum Postbit generate errors in CMS?

I adapted the Latest Blog Using Carp add-on to vB4 here: https://vborg.vbsupport.ru/showthread.php?t=234254

At the time, I was using only the Forum (CMS and Blog disabled in the Suite) and it worked fine, displaying the title of the latest (external) blog feed in the postbit for any forum post by that member.

The add-on uses two small plug-ins:

1. Carp Configuration, attached to the "global_start" hook location (I realize this should now be changed to global_bootstrap_init_start but doing that makes no difference - I still get the errors).

PHP Code:
require_once '/path/to/forum/carp/carp.php';
CarpConf('carperrors',0);
CarpConf('cacheinterval',120);
/** You may want to set a cachepath specifically for your forum **/
/** CarpConf('cachepath','/path/to/carp_cache/'); **/
/** CarpConf('cacherelative',0); **/
/** You can omit the above two lines without a problem **/
CarpConf('cborder','');
CarpConf('poweredby','');
CarpConf('maxitems',1);
CarpConf('iorder','link');
CarpConf('linktarget',1); 

2. Get Users Blog Entry, attached to postbit_display_start

PHP Code:
ob_start();
CarpCacheShow($post[field6]);
$blogentry ob_get_contents();
ob_end_clean();
vB_Template::preRegister('postbit',array('blogentry' => $blogentry)); 
When I enable CMS, however, I get errors like this depending on which hook I attach the two plgins to:

Quote:
Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21
The thing is that this should only function for forum posts anyway. It isn't needed in CMS (or the vBulletin Blog for that matter although I haven't enabled that yet). For me, the errors are seen whenever I try to edit the CMS article or add or edit a comment. Another user who has this installed reported the same problems.

What do I need to do to eliminate these errors?
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01051 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete