Skip to main content
Topic: Fatal error: Call to undefined function call_template_callbacks() (Read 2072 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Fatal error: Call to undefined function call_template_callbacks()

I uploaded all files from the 1.0 download folder (except Settings.php and the installation files) and now I get an fatal error where the info center should be shown:

Code: [Select]
Fatal error: Call to undefined function call_template_callbacks() in /www/htdocs/xyz/elkhilfe_support/sources/Load.php(2611) : eval()'d code on line 131

It seems like an error with my theme, cause with the default theme there's no such error. I'm investigating...

Edit: I made a new copy from default theme with the function in the admin center and then replaced the logo, the board icons and the css file. And the error is gone. Hmm, maybe look to prevent this nevertheless in case anyone has the same problem?

Re: Fatal error: Call to undefined function call_template_callbacks()

Reply #1

It is something added before 1.0.0 release.

In index.template.php find:
Code: [Select]
		'mentions' => array('mentioner_template' => '<a href="{mem_url}" class="mentionavatar">{avatar_img}{mem_name}</a>')
);
}
and replace it with:
Code: [Select]
		'mentions' => array('mentioner_template' => '<a href="{mem_url}" class="mentionavatar">{avatar_img}{mem_name}</a>')
);
}

/**
 * Simplify the use of callbacks in the templates.
 * @param string $id - A prefix for the template functions the final name
 *                     should look like:
 *                     template_{$id}_{$array[n]}
 * @param string[] $array - The array of function suffixes
 */
function call_template_callbacks($id, $array)
{
if (empty($array))
return;

foreach ($array as $callback)
{
$func = 'template_' . $id . '_' . $callback;
if (function_exists($func))
$func();
}
}

@mods: maybe move this to Support board?

Re: Fatal error: Call to undefined function call_template_callbacks()

Reply #2

Thanks, see my edit please.  :-[

Re: Fatal error: Call to undefined function call_template_callbacks()

Reply #3

Also see:
http://www.elkarte.net/community/index.php?topic=1962.0
and in particular:
http://www.elkarte.net/community/index.php?topic=1962.msg12233#msg12233
f you changed the index.template.php and you have problems updating it feel free to attach it here, I'll check it out. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Fatal error: Call to undefined function call_template_callbacks()

Reply #4

I only changed the css files and some images, that's all. But thanks for the offer. :)

Re: Fatal error: Call to undefined function call_template_callbacks()

Reply #5

I think that in overall there are 3 pieces of code that you would need to add, so as emanuele said things to work and for some future modifications.

Re: Fatal error: Call to undefined function call_template_callbacks()

Reply #6

Then if you changed just css and icons, replace index.template.php is perfectly safe. ;D
Bugs creator.
Features destroyer.
Template killer.