MyBB Community Forums

Full Version: Call to undefined function find_replace_templatesets()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone, sorry for the trivial question but I can not figure it out. Attempting to modify a plugin in which the author has not entered a function find_replace_templatesets (I need to practice) I always get this error Fatal error:

Call to undefined function find_replace_templatesets () in / web / htdocs / www.socialeyes.it / home / forum / inc / plugins / findthetime.php on line 78  

and yet I seem to have written it well

function findthetime_activate() {
    global $db, $lang;    $lang->load("findthetime");
    
    find_replace_templatesets("index", '#'.preg_quote('{$header}').'#i','{$header}{$findthetime}');
    
   $findthetime_group = array(
        'gid'    => 'NULL',
        'name'  => 'Find The Time',
        'title'      => 'Find The Time',
        ecc..
        ecc..
        ecc.. 

Thanks
You need to add
include MYBB_ROOT."/inc/adminfunctions_templates.php";

on the line before find_replace_templatesets.
edit: delayed response !

have you included the file ./inc/adminfunctions_templates.php
require_once MYBB_ROOT."inc/adminfunctions_templates.php"; 
Thank you!!! Big GrinBig GrinBig Grin
I would rather go with require_once instead of just require.