MyBB-Plugins Forums
error making dice plugin - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: Archived Forums (http://forums.mybb-plugins.com/Forum-Archived-Forums)
+--- Forum: MyBB 1.4.x (http://forums.mybb-plugins.com/Forum-MyBB-1-4-x)
+---- Forum: General (http://forums.mybb-plugins.com/Forum-General)
+---- Thread: error making dice plugin (/Thread-error-making-dice-plugin)



error making dice plugin - Shadows - 08-19-2009

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>'); 

Thanks,
- 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


RE: error making dice plugin - Diogo Parrinha - 08-19-2009

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>').'#' 



RE: error making dice plugin - Shadows - 08-19-2009

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


RE: error making dice plugin - Diogo Parrinha - 08-19-2009

global $db


RE: error making dice plugin - Shadows - 08-19-2009

ok that was stupid lol


RE: error making dice plugin - Diogo Parrinha - 08-19-2009

lol yeap