Is it possible to do an add-on to "Forum_Link_to_Topic_Title_v.0.0.2" ?
It should be simple, but a made a mistake, and I got: "<span class="[solved]">[Solved]</span>My Title" :/
EDIT: I dunno too much of preg_replace. but it's something like this:
Code: Select all
$atribute = (preg_match('<span class="(.+)">(.+)</span>', $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']), $matches)) ? $matches[2] . ' ' : '';
I've already this above:
Code: Select all
$sql = "SELECT
t.forum_id, topic_title, forum_name, t.topic_attr_id, t.topic_attr_user, t.topic_attr_time " . ($post_id != 0 ? ", username" : "") . "
all code:
Code: Select all
if ($topic_id != 0 || $post_id != 0)
{
$sql = "SELECT
t.forum_id, topic_title, forum_name, t.topic_attr_id, t.topic_attr_user, t.topic_attr_time " . ($post_id != 0 ? ", username" : "") . "
FROM " .
($post_id != 0 ? POSTS_TABLE . " p, " . USERS_TABLE . " u, " : "") .
TOPICS_TABLE . " t
LEFT JOIN " . FORUMS_TABLE . " f ON (t.forum_id = f.forum_id)
WHERE " .
($post_id != 0 ? "post_id = $post_id AND p.topic_id = t.topic_id AND p.poster_id = u.user_id " : "topic_id = " . $topic_id);
$result = $db->sql_query($sql);
if($row = $db->sql_fetchrow($result))
{
if (!$auth->acl_get('f_read', $row['forum_id']))
{
return $url;
}
$atributo = (preg_match('<span class="(.+)">(.+)</span>', $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']), $matches)) ? $matches[2] . ' ' : '';
$username = ($post_id != 0) ? $row['username'] . " @ " : '';
$forum_abbr = (preg_match('/^(\[.+\])/', $row['forum_name'], $matches)) ? $matches[1] . ' ' : '';
return $username . $forum_abbr . $atributo . ' ' . $row['topic_title'];
}
}