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

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2010, 03:44 AM
Crimm's Avatar
Crimm Crimm is offline
 
Join Date: Feb 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Including a PHP file in a widget

Okay I've been playing with this for a few of my mods to update them from 3.X to 4.X and I'm having issues with the CMS. I'm trying to include PHP files (Local to the forum) in the widget. I've been doing some searching and some copy/pasting.

I'm getting tired, so a break from the PC may be what I need, but I figured I would post and see if some wonderful person would stop by and help me.

Here's what I've tried.

I've tried flat out includes:
http://www.vbulletin.com/forum/showt...-php-in-Widget

Code:
// UNTESTED
ob_start();
include("path/to/your.php");
echo "<br />\n";
$output .= ob_get_contents();
ob_end_clean();
but I'm getting a Bootstrap error:

Quote:
Fatal error: Cannot redeclare class vB_Bootstrap_Forum in /XXXXXX/class_bootstrap.php on line 1579
Now, I've also tried including the PHP file using preRegistered vairables in plugins and styles by combining my own article:

https://vborg.vbsupport.ru/showthread.php?t=242454

:P (Thanks for approving it Lynne)

and this article: https://vborg.vbsupport.ru/showthread.php?t=236245


I'm getting the same error.

Quote:
Fatal error: Cannot redeclare class vB_Bootstrap_Forum in /XXXXXX/class_bootstrap.php on line 1579
It seems that I can't include a PHP file in a widget... Any help? Searches on that error specifically aren't producing very much.

I'm going to take a break and play some Halo Reach and get some frustration out. If anyone would be so kind as to drop me a tidbit to work from; that would be great.
Reply With Quote
  #2  
Old 05-18-2010, 09:16 AM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's happening in your external php file?
Paste youre code here
Reply With Quote
  #3  
Old 05-18-2010, 01:06 PM
Crimm's Avatar
Crimm Crimm is offline
 
Join Date: Feb 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's far too complicated yo examine it that way. I was thinking about isolating the php file last night.

I'm going to try a few things this am. I'll be back shortly.
Reply With Quote
  #4  
Old 10-08-2010, 04:00 AM
Frank T Frank T is offline
 
Join Date: Jun 2010
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I figured this out. It's a bug in vBulletin. Edit "global.php" and change the following:
require('./includes/class_bootstrap.php');

Change that to:
require_once('./includes/class_bootstrap.php');

I was having the same exact problem. I noticed that the problem disappeared after I disabled one of my own customizations (mine was coded correctly). So I tracked it down further to the problem above.
Reply With Quote
  #5  
Old 10-08-2010, 05:33 PM
Crimm's Avatar
Crimm Crimm is offline
 
Join Date: Feb 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Frank.

I'll give this a shot when I get back into my vB mods soon-ish.
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:41 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.03956 seconds
  • Memory Usage 2,197KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete