vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Add .PHP File as Plug-in - Admin Panel Will NOT Start (https://vborg.vbsupport.ru/showthread.php?t=317607)

ae3799t 03-03-2015 08:57 AM

Add .PHP File as Plug-in - Admin Panel Will NOT Start
 
I do hope this is the right forum and apologize if not. I thought this might be one of those things that takes some programming knowledge, as well as an understanding of the forum itself. We have VB 4.2

One of our guys wrote a .PHP file to rotate banners, then he tried to add it to the Admin Panel as a Plug-in. Now when you try to log-on to the Admin Panel you get the following error message.

save from other path!Unable to add cookies, header already sent.
File: /home/roadtr5/public_html/forum/global.php(29) : eval()'d code
Line: 16

Does anyone understand this enough to figure out what happened from my description?
The forum is still up and you can look at things, but you cannot edit a thread and the sign-on page of the Admin Panel comes up to log-on, but when you do, you get a blank page with the above error. :confused:

Since the Admin Panel is hosed, you cannot edit the forum either, so we are basically down.

Any help would be greatly appreciated. I can only guess that one of the templates used for plugins was damaged, but even if I knew which one, I could not get to it by way of the Admin panel.

the one 03-03-2015 09:09 AM

If you have access to your config file you could try this below

Edit config.php and add this directly below <?php:

Code:
define('DISABLE_HOOKS', true); then press save

Then go to your plugins and delete the one you are talking about then go back to your config.php remove define('DISABLE_HOOKS', true); press save

kh99 03-03-2015 11:05 AM

Do what michelle81 posted above to get back in your forum. As for the error, the problem is that the plugin is creating output (in this case, the message 'save from other path!'). The way vbulletin code works, no output is produced until just before the script ends, so a plugin cannot echo or print without causing that warning.

TheLastSuperman 03-03-2015 12:32 PM

Michelle nailed it, here's a more detailed bit of info for anyone interested: https://vborg.vbsupport.ru/showthread.php?t=259619

ae3799t 03-03-2015 04:17 PM

You guys were right on, "all the way".

I disabled the addon.

To kh99 's point, under Plugin PHP Code" he had the following:

$topImage = 'forum/top-image-ads.php';
if(file_exists($topImage))
{
echo 'not exits';
}
else
{
echo 'save from other path!';
}

Is this where the echo you were talking about, or would it be in "top-image-ads.php"?

Also is there an article that might advise on the proper way to write an add-on?

Again. Many Thanks Frank :up:

kh99 03-03-2015 05:16 PM

Quote:

Originally Posted by ae3799t (Post 2539419)
You guys were right on, "all the way".

I disabled the addon.

To kh99 's point, under Plugin PHP Code" he had the following:

$topImage = 'forum/top-image-ads.php';
if(file_exists($topImage))
{
echo 'not exits';
}
else
{
echo 'save from other path!';
}

Is this where the echo you were talking about, or would it be in "top-image-ads.php"?

That looks like it, based on the message being the same. And that code doesn't do anything except print messages, so you could comment it out and see what happens.


All times are GMT. The time now is 01:03 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.01470 seconds
  • Memory Usage 1,723KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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