MyBB Community Forums

Full Version: Fatal error when deactivate plugin.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After upgrading from 1615 to 1.8 i get the next message if i am trying to deactivate a plugin.

Fatal error: Call to undefined function rebuildsettings() in /var/www/vhosts/mysite.com/httpdocs/inc/plugins/SubforInCols.php on line 89 

In line 89 there is this:

84    $db->update_query("settings", $sett,"name='subforumsindex'");

85    $db->update_query("templates", $template_dp3,"title='forumbit_depth3'");
86    $db->update_query("templates", $template_sub,"title='forumbit_subforums'");
87    $db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='subincol'");
88    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='SubforInCols'");
89    rebuildsettings();

How can i solve this.
Change it to rebuild_settings()
Now same message but now on line 70, there is:
70 }
Did you change anything else? It wouldn't have run the first time if there was a syntax error.
No i didn't do that. This file is the same as the one from a backup before i did the upgrade.
</style>
<br />{$lang->subforums}<br /><ul class="alt_sbc">{$sub_forums}</ul>')
);
$sett = array(
"value" => "100"
);
$db->update_query("settings", $sett,"name='subforumsindex'");
$db->update_query("templates", $template_dp3,"title='forumbit_depth3'");
$db->update_query("templates", $template_sf,"title='forumbit_subforums'");
rebuild_settings()
}

I am now also not be able to login to acp. Can someone help me with this problem?
Mine worked for activating it and deactivatied it, when i made line 69, and 89 this code: rebuild_settings();

My SubforInCols.php:

<?php
if(!defined("IN_MYBB"))
{
 die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

function SubforInCols_info()
{
 return array(
 "name" => "Subforums In Columns",
 "description" => "Show subforums in columns.",
 "website" => "http://mybb-es.com",
 "author" => "Edson Ordaz",
 "authorsite" => "mailto:[email protected]",
 "version" => "1.0",
 "compatibility" => "18*",
 "guid" => "ed1bff6c1ca9f99fdac71eafc107ebe3"
 );
}

function SubforInCols_activate()
{
 global $db;
 $SubforInCols = array(
 "gid" => "NULL",
 "name" => "subincol",
 "title" => "Subforums In Columns",
 "description" => "Show subforums in columns.",
 "disporder" => "0",
 "isdefault" => "no",
 );
 $db->insert_query("settinggroups", $SubforInCols);
 $gid = $db->insert_id();
 
 $SubforInCols1 = array(
 "sid" => "NULL",
 "name" => "SubforInCols",
 "title" => "Columns",
 "description" => "Enter how many columns you want to display the child boards.",
 "optionscode" => "select \n50=2 Columns\n30=3 Columns\n20=5 Columns",
 "value" => "30",
 "disporder" => "1",
 "gid" => intval($gid),
 );
 $db->insert_query("settings", $SubforInCols1);
 $template_dp3 = array(
 "template" => $db->escape_string('<li>{$statusicon}<a href="forumdisplay.php?fid={$forum[\'fid\']}">{$forum[\'name\']}</a></li>')
 );
 $template_sf = array(
 "template" => $db->escape_string('<style>
.alt_sbc {
 list-style: none; 
 margin: 0; 
 padding: 0;
}
.alt_sbc li {
 width: {$mybb->settings[\'SubforInCols\']}%; 
 float: left;
}
</style>
<br />{$lang->subforums}<br /><ul class="alt_sbc">{$sub_forums}</ul>')
 );
 $sett = array(
 "value" => "100"
 );
 $db->update_query("settings", $sett,"name='subforumsindex'");
 $db->update_query("templates", $template_dp3,"title='forumbit_depth3'");
 $db->update_query("templates", $template_sf,"title='forumbit_subforums'");
 rebuild_settings();
}

function SubforInCols_deactivate()
{
 global $db;
 $template_dp3 = array(
 "template" => $db->escape_string('{$comma}{$statusicon}<a href="{$forum_url}" title="{$forum_viewers_text_plain}">{$forum[\'name\']}</a>')
 );
 $template_sub = array(
 "template" => $db->escape_string('<br />{$lang->subforums} {$sub_forums}')
 );
 $sett = array(
 "value" => "2"
 );
 $db->update_query("settings", $sett,"name='subforumsindex'");
 $db->update_query("templates", $template_dp3,"title='forumbit_depth3'");
 $db->update_query("templates", $template_sub,"title='forumbit_subforums'");
 $db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='subincol'");
 $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='SubforInCols'");
 rebuild_settings();
}
?>