MyBB Community Forums

Full Version: Support Again please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey! Check out this: http://setupwith.us/showthread.php?tid=4...132#pid132 at the top I get a error with my plugin installed, I was wondering if you could look through it and tell me what I'm doing wrong, thanks.

Code:
Quote:<?php

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}




$plugins->add_hook("postbit", "future_postbit");

function random_future_info()
{
return array(
'name' => 'Random Future',
'description' => 'Give your future a spice!',
'website' => 'http://www.setupwith.us',
'author' => 'Daniel Watts',
'authorsite' => 'http://www.setupwith.us',
'version' => '1.0',
"guid" => "",
"compatibility" => "*"
);
}

function random_future_activate()
{
global $mybb, $templates;

require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit_author_user", '#inglevel\']}#', 'inglevel\']}<br />Random Future:');

rebuild_settings();

}

function random_future_deactivate()
{
global $mybb, $templates;

require "../inc/adminfunctions_templates.php";
find_replace_templatesets("postbit_author_user", '#<br />Random Future:#', '',0);


rebuild_settings();

}

?>
Replace all with this;
<?php

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}




$plugins->add_hook("postbit", "future_postbit");

function random_future_info()
{
return array(
'name'     => 'Random Future',
'description'    => 'Give your future a spice!',
'website'     => 'http://www.setupwith.us',
'author'     => 'Daniel Watts',
'authorsite'    => 'http://www.setupwith.us',
'version'     => '1.0',
"guid" => "",
"compatibility" => "*"
);
}

function random_future_activate()
{
global $mybb;
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit_author_user", '#inglevel\']}#', 'inglevel\']}<br />Random Future:');

}

function random_future_deactivate()
{
global $mybb;

    require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
	find_replace_templatesets("postbit_author_user", "#".preg_quote('<br />Random Future:')."#i", '', 0);

}

?>
Still produces error, I just need help with trying to stop it doing the error that is does up the top, I've sorted out the other problems.
What error it is producing ?
Check out the link: http://setupwith.us/showthread.php?tid=4...132#pid132 and look at the error at the top, I've sorted everything else apart from that error.
You mean "Guests cannot view threads." error ?

Its;
error("Guests cannot view threads.", "Error");
Oh crap, let me remove that, no the error you get now at the top.
Any ideas anyone?
Open plugin file and find the following and Remove;
$plugins->add_hook("postbit", "future_postbit");
Omg! I love you dude, your now my new ebuddy!! <3
haha, Cheers =)