function callbuild(){
$this->buildLink(stripslashes($row_wall['text']));
}
function buildLink($text){
if(preg_match('/@u(\w+)/', $text, $name_in_text)){
$name = $name_in_text[1];
$username_in_the_wall = $db->super_query("SELECT user_id,user_name, user_lastname FROM `".PREFIX."_users` WHERE user_id = '$name'");
if($username_in_the_wall==""){
$ss = stripslashes($text;
$tpl->set('{text}',$ss);
}
else{
$ss = preg_replace('/@(\w+)/','<a onclick="Page.Go(this.href); return false" href="u'.$username_in_the_wall['user_id'].'">'.$username_in_the_wall['user_name'].' '.$username_in_the_wall['user_lastname'].'</a>',$text);
$tpl->set('{text}',$ss);
}
}
elseif(preg_match('/$public(\w+)/', $text, $group)){
$group_in_text = $group[1];
$group_in_the_wall = $db->super_query("SELECT id,title FROM `".PREFIX."_communities` WHERE id = '$group_in_text'");
if($group_in_the_wall==""){
$ss = $text;
$tpl->set('{text}',$ss);
}
else
{
$ss = preg_replace('/$public(\w+)/','<a onclick="Page.Go(this.href); return false" href="public'.$group_in_the_wall['id'].'">'.$group_in_the_wall['title'].'</a>',$text);
$tpl->set('{text}',$ss);
}
}
else{
$ss = $text;
$tpl->set('{text}',$ss);
}
}
Не могу вызвать функцию buildLink внутри класса, ругается вот так вот:
Call to a member function set() on a non-object