Czego bym nie próbował jest źle. A wstawiam wedle instrukcji
CODE-BOX
Open: ./sources/action_public/topic.phpFind [ Inside of function auto_run() ]:
//-----------------------------------------
// Process users active in this forum
//-----------------------------------------
Add before:
// Similar Topics.
if (strlen($this->topic['title']) >= $this->ipsclass->vars['min_search_word'])
{
$similarTopics = $this->similarTopics();
if (!empty($similarTopics))
{
$this->output = str_replace("<!--IBF.MOD_FULL_WRAPPER-->", $similarTopics, $this->output);
}
}
-------------------------------------------------
Find [ Inside of class topic ]:
}
?>
Add before:
/*-------------------------------------------------------------------------*/
// Similar Topics.
/*-------------------------------------------------------------------------*/
function similarTopics()
{
$html = "";
$cond = array(
"tid <> {$this->topic['tid']} AND approved = 1",
"forum_id IN (".implode(",", $this->ipsclass->forums->forums_get_all_allowed_forum_ids("read_perms")).")"
);
// Gets the topic read cookie.
$lastVisit = ($this->ipsclass->member['last_visit'] > $this->ipsclass->member['members_markers']['board']) ? $this->ipsclass->member['last_visit'] : $this->ipsclass->member['members_markers']['board'];
$read = $this->ipsclass->my_getcookie("topicsread");
$readArray = array();
if ($read !== false && $read != "-1")
{
$readArray = $this->ipsclass->clean_int_array(unserialize(stripslashes($read)));
}
// Generates keywords from the topic title.
$keyword = strtolower($this->topic['title']);
if (strpos($keyword, " ") === false)
{
$cond[] = "LOWER(title) LIKE '%{$keyword}%'";
}
else
{
$words = array();
$tmp = explode(" ", $keyword);
foreach ($tmp as $t)
{
$t = trim($t);
$l = strlen($t);
if (!empty($t) && $l >= $this->ipsclass->vars['min_search_word'])
{
$t = str_replace(array('|', '*', '%', '_'), array('|', '%', '', '\\_'), $t);
$t = preg_replace("/\s+(and|or)$/" , "" , $t);
$t = preg_replace("/([0-9]+);/", "", $t);
$t = preg_replace("/[\|\[\]\{\}\(\)\,:\\\\\/\"']|"/", "", $t);
$t = preg_replace("/^(?:img|quote|code|html|javascript|a href|color|span|div|border|style)$/", "", $t);
$t = trim($t);
$l = strlen($t);
if (!empty($t) && $l >= $this->ipsclass->vars['min_search_word'])
{
if (count($words) > 5)
{
break;
}
$words[] = "LOWER(title) LIKE '{$t}%'";
}
}
}
if (count($words) > 0)
{
$cond[] = "(".implode(" OR ", $words).")";
}
else
{
$cond[] = "LOWER(title) LIKE '%{$keyword}%'";
}
}
// Gets data.
$this->ipsclass->DB->simple_construct(array('select' => "*",
'from' => "topics",
'where' => implode(" AND ", $cond),
'order' => "last_post DESC",
'limit' => array(5)
) );
$rs = $this->ipsclass->DB->simple_exec();
if (!$this->ipsclass->DB->get_num_rows($rs))
{
return "";
}
while ($row = $this->ipsclass->DB->fetch_row($rs))
{
$this->ipsclass->forum_read[$row['forum_id']] = isset($this->ipsclass->forum_read[$row['forum_id'] ]) ? $this->ipsclass->forum_read[$row['forum_id']] : 0;
$readArray[$row['tid']] = isset($readArray[$row['tid']]) ? $readArray[$row['tid']] : 0;
$lastTime = ($readArray[$row['tid']] > $lastVisit) ? $readArray[$row['tid']] : $lastVisit;
$dot = "";
if ($this->ipsclass->forum_read[$row['forum_id']] > $lastTime)
{
$lastTime = $this->ipsclass->forum_read[$row['forum_id']];
}
if ($this->ipsclass->member['id'] > 0 && (isset($row['author_id']) & $row['author_id'] > 0))
{
$dot = 1;
}
if ($row['pinned'] == 1)
{
$row['prefix'] = $this->ipsclass->vars['pre_pinned'];
}
else if (!empty($row['poll_state']))
{
$row['prefix'] = $this->ipsclass->vars['pre_polls'] . " ";
}
if (isset($this->ipsclass->member['is_mod']) && $this->ipsclass->member['is_mod'] == 1)
{
$row['posts'] += $row['topic_queuedposts'];
}
if ($row['last_post'] > $lastTime)
{
$row['go_new_post'] = "<a href=\"{$this->ipsclass->base_url}showtopic={$row['tid']}&view=getnewpost\"><{NEW_POST}></a>";
}
else
{
$row['go_new_post'] = "";
}
$row['views'] = $this->ipsclass->do_number_format(intval($row['views']));
$row['posts'] = $this->ipsclass->do_number_format(intval($row['posts']));
$row['start_date'] = $this->ipsclass->get_date($row['start_date'], "LONG");
$row['last_post'] = $this->ipsclass->get_date($row['last_post'], "SHORT");
$row['last_name'] = ($row['last_poster_id'] > 0) ? $this->ipsclass->make_profile_link($row['last_poster_name'], $row['last_poster_id']) : "-" . $row['last_poster_name'] . "-";
$row['start_name'] = ($row['starter_id'] > 0) ? $this->ipsclass->make_profile_link($row['starter_name'], $row['starter_id']) : "-".$row['starter_name']."-";
$row['folder_img'] = $this->ipsclass->folder_icon($row, $dot, $lastTime);
$row['attach_img'] = ($row['topic_hasattach'] > 0) ? "<a href=\"java script:;\" onclick=\"PopUp('{$this->ipsclass->base_url}act=attach&code=showtopic&tid={$row['tid']}','Attach{$row['tid']}',500,400);\" title=\"{$row['topic_hasattach']} {$this->ipsclass->lang['st_attachments']}\"><{ATTACH_ICON}></a>" : "";
$html .= $this->ipsclass->compiled_templates['skin_topic']->similar_topics_row($row);
}
// Return block.
$collapsed_ids = "," . $this->ipsclass->my_getcookie("collapseprefs") . ",";
$fo = "show";
$fc = "none";
if (strpos($collapsed_ids, ",similar_topics,") !== false)
{
$fo = "none";
$fc = "show";
}
return $this->ipsclass->compiled_templates['skin_topic']->similar_topics($fo, $fc, $html);
}
O to mój plik topics.php:
http://rapidshare.com/files/149717900/topics.php.html
Nie wiem co powoduje błąd!