MyBB-Plugins Forums

Full Version: error making dice plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay, the template edits... I hate template edits xD

I get an error while activating the plugin + it erases the whole template (it's there but is blank)

PHP Code:
    find_replace_templatesets("newreply"'<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="6"{$postoptionschecked[\'signature\']} /> {$lang->options_sig}</label>''{$dice}<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="6"{$postoptionschecked[\'signature\']} /> {$lang->options_sig}</label>'); 

- Shadows.

edit: I included the file for it..

The error:
Warning [2] preg_replace() [function.preg-replace]: Unknown modifier '<' - Line: 30 - File: C:\xampp\htdocs\mybb\inc\adminfunctions_templates.php PHP 5.2.9 (WINNT)File Line Function
[PHP] errorHandler->error
C:\xampp\htdocs\mybb\inc\adminfunctions_templates.php 30 preg_replace
C:\xampp\htdocs\mybb\inc\plugins\diceroll.php 68 find_replace_templatesets
[PHP] diceroll_activate
C:\xampp\htdocs\mybb\admin\modules\config\plugins.php 208 call_user_func
C:\xampp\htdocs\mybb\admin\index.php 380 require
replace the second parameter with:
PHP Code:
'#'.preg_quote('<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="6"{$postoptionschecked[\'signature\']} /> {$lang->options_sig}</label>').'#' 
Ok, thanks got it to work. Now i'm getting another error ugh lol.

Fatal error: Call to a member function update_query() on a non-object in C:\xampp\htdocs\mybb\inc\plugins\diceroll.php on line 114

$rolldice = array(
"rolldice" => $rolled, //$rolled is the nr on the dice & rolldice = the mysql col..

$db->update_query("posts", $rolldice, "pid='{$pid}'");

you got any idea?
i globalled all the ones i needed to
global $db
ok that was stupid lol
lol yeap