MyBB Community Forums

Full Version: function is not working in usercp_start hook
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am trying to display some information in usercp, before personal notepad but my function is not working...

Template:-showreferral_recent
Edited Usercp Template:-
{$latest_subscribed}
{$latest_threads}
{$latest_warnings}
{$showreferral_recent}
{$user_notepad}


My Plugin Template Name:- showreferral_recent
Template inner body:-
<div style='border:1px solid black;'>{$showref_recent}</div>


Hook in Plugin:-
$plugins->add_hook("usercp_start", "showreferral_recent");

Function:-
function showreferral_recent()
{
 global $db,$mybb,$templates;
 $showref_recent = "This will be my content to be displayed before personal notepad";
 eval("\$showreferral_recent = \"".$templates->get("showreferral_recent")."\";");
}




My function running  fine on startup of hook , i checked it via "echo" command but not displaying value in templates, What am i mistaken here? i tried everything as much i can do after that i have to write here.. hope i will be get some help from here
Add $showreferral_recent to the global scope.
(2014-11-05, 10:34 AM)Omar G. Wrote: [ -> ]Add $showreferral_recent to the global scope.

its working.... thank you very much <3
its look like only one person is helpful here in mybb staff