MyBB Community Forums

Full Version: remove changes to global_start
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
{EDIT} Also, I just realized... I think this may be in the wrong board? Sorry... {/EDIT}


I'm going to ramble nonsense because I am a complete novice and editing php ... with that said, I've royally screwed something while trying to display some info on my board. So forgive me if what I'm saying makes no sense/isn't accurate...



What I was attempting:
I have newpoints, but for some reason the newpoints postbit doesn't display on the Private Message screen. I was trying to get it to display {$post['newpoints_postbit']} by adding a hook to global_start. I added the following to the file inc/plugins/newpoints/core/hooks.php

	$plugins->add_hook('global_start', 'newpoints_postbit');

.... now I keep getting these messages across the top of the screen. Here's an example:
Warning [2] Cannot modify header information - headers already sent by (output started at /home3/readysg6/public_html/akrasia/inc/plugins/newpoints/core/hooks.php:1) - Line: 1701 - File: inc/functions.php PHP 5.2.17 (Linux)

I had saved a backup of the hooks.php file and reuploaded it (I didn't save a backup of my entire databased because I'm dumb like that)... but the errors are still there and some pages won't display at all.

What I'm assuming happened... (but I could be wrong)
So... it changed global_start file (??? where is this) ... but I don't know how to remove what was added to it or where this file is located.


Help!
The right way to do that it's remaining your code and add one more:

    $plugins->add_hook('postbit', 'newpoints_postbit');
    $plugins->add_hook('postbit_pm', 'newpoints_postbit');

That because when you call your function you use &post instead your function and only works for 4 kind of functions, but you need only that what i give to you.

Cheers.
Thank you very much!
It did what I was originally intending, however didn't fix the errors caused by my mistake. It's still showing those PHP warnings at the top of the page whenever I view any thread... now to just do that.

I asked a friend (but she's unable to get online to look at the code right now) and she said it was doing some sort of hook loop that needed to be corrected. Not sure if that info helps at all...
Delete this:

$plugins->add_hook('global_start', 'newpoints_postbit');

On your.

inc/plugins/newpoints/core/hooks.php

And put both i give to you and have to work, you can use notepad ++ i make some similar to another mods, so you only have to do that and have to work without any kind of problem.
Remember to save file as UTF-8 without BOM - it's a common mistake. Here more solutions: http://stackoverflow.com/questions/80289...es#tab-top
I already deleted it and it didn't do anything, - that's what I said in my first message... but anyway, my friend was finally able to log on and fix things. Thank you very much for the help though!