The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Headers already sent in plugin functions
#1
First, I've installed pure GS 3.1 r646, w/o any plugins. The only change I made - enabled GSDEBUG in gsconfig.php.
Second, I've created simple plugin, with 1 line of code:
Code:
<?php
# get correct id for plugin
$thisfile = basename(__FILE__, ".php");

# register plugin
register_plugin(
    $thisfile, //Plugin id
    'Someplugin',     //Plugin name
    '0.1',         //Plugin version
    'Author Name',  //Plugin author (nickname: Zorato)
    'http://www.example.com/', //author website
    'Nothing special here', //Plugin description
    'Settings', //page type - on which admin tab to display
    'somefunction'  //main function (administration)
);

add_action('settings-sidebar','createSideMenu',array($thisfile,'Some Plugin'));

function somefunction(){
    error_reporting(E_ALL); //for debugging purposes
    header('Location: settings.php');
}
?>
With PHP 5.3.8 and PHP 5.3.9 (IMHO, PHP 5.3+) runs like clockwork.
The problem is, that I use header() function within my plugins on hosting with PHP 5.2.17 (IMHO, with any PHP >5.2 and <5.3)
I've got this:
Quote:Warning: Cannot modify header information - headers already sent by (output started at /var/www/user21243/data/www/~/pure/admin/inc/template_functions.php:27) in /var/www/user21243/data/www/~/pure/plugins/someplugin.php on line 25
Any ideas?
As a temporary solution I use redirect($url) function from basic.php file, but it causes double page refresh and it is not very comfortable to work like that.
I sniffed around, but didn't find any functions in load.php, common.php or template_functions.php that may work differently in PHP 5.3 and PHP 5.2
Reply


Messages In This Thread
Headers already sent in plugin functions - by Zorato - 2012-02-14, 04:44:33



Users browsing this thread: 5 Guest(s)