MyBB Community Forums

Full Version: find_replace_templatesets hide, the plugin list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
function upgrade_activate()
{
global $mybb;
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("footer", '#<a href="{\$mybb->settings['homeurl']}">{\$mybb->settings['homename']}</a>#', "<a href="{\$mybb->settings['homeurl']}">{\$mybb->settings['homename']}</a> | <a href="/upgrade.php">Upgrade</a>");
}

If i use that code in my script it hides everything in the plugin list. This is my first time trying to make a plugin. What do i do wrong?
Try adding the variable in similar fashion instead:

function upgrade_activate()
{
global $db;
find_replace_templatesets("footer", "#".preg_quote("{\$auto_dst_detection}")."#i", "{\$auto_dst_detection}{\$variable_name}");
}

Also, $mybb doesn't need to be defined as global variable while activating, I think it would do OK without it, you just define $db as global in most cases.
How should i make it if i want the links to do like that.

EDIT:
I got it working. Thanks!