MyBB Community Forums

Full Version: Plugin MyCode Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im adding a mycode via a plugin. When i activate the plugin inserts the mycode as i want , my problem is i need to select the mycode in ACP and click "Save MyCode" for the mycode to become effective.

Heres how im inserting the mycode (Just an example):
$mycode_test = array_map(array($db, 'escape_string'), array(
    "title"           => "Test",
    "description"     => "",
    "regex"           => "Reg expression here",
    "replacement"     => "Replacement here",
    "active"           => "1",
    "parseorder"           => "1",
    ));
	$db->insert_query("mycode", $mycode_test);
	$cid = $db->insert_id();

Ive tried using different parse orders , but for soem reason it wont active the actull mycode untill i click save mycode.

Any ideas on how i can activate the plugin apon activating the plugin ?

Add this after $cid = $db->insert_id();

$cache->update_mycode();

Also make sure you add $cache to your function's global declaration.
Ahhhhh yes

Thanks - G33K - Big Grin