Various modifications for phpBB3 ⇒ Forum Link to Topic Title
-
- VIP
- Status: Offline
- User theme: Dark
- Posts: 1151
- Joined: Oct 14th, '14, 17:01
Re: Forum Link to Topic Title
Just uninstalled this and trying that ext you pointed out.
-
- Users
- Status: Offline
- User theme: Dark
- Posts: 356
- Joined: Nov 2nd, '14, 20:25
-
- Users
- Status: Offline
- User theme: Dark
- Posts: 27
- Joined: Apr 29th, '16, 10:11
Re: Forum Link to Topic Title
What exactly needs to be replaced in the newest 3.2 version to get this to work properly? All items in this post have been edited as it states, except the $relative_url; - it does not exist in the newest functions_content file. I guess I should ask is this code change still valid for the 3.2 board?
Open: includes/functions_content.php
Open: includes/functions_content.php
Find This may be a partial find and not the whole line
Code: Select all
$text = $relative_url;
Replace with Replace the preceding lines with the following
Code: Select all
$text = fetch_forumtitle($url);
Find This may be a partial find and not the whole line
Code: Select all
$text = htmlspecialchars($text);
Replace with Replace the preceding lines with the following
Code: Select all
$text = str_replace('&', '&', $text);
Find This may be a partial find and not the whole line
Code: Select all
/**
* make_clickable function
Add before Add these lines on a new blank line before the preceding line(s) to find
Code: Select all
/**
* BartVB Show actual forumname or topic title instead of link to forum URLs
*/
function fetch_forumtitle($url)
{
global $db, $auth;
// Search for relevant URL parameters (preceded by '?' or 'amp;'
if(preg_match_all('/(?:\?|&)([ptf])=(\d+)/', $url, $matches))
{
$post_id = $topic_id = $forum_id = 0;
foreach($matches[1] as $set => $param)
{
switch ($param)
{
case 'p':
$post_id = $matches[2][$set];
break;
case 't':
$topic_id = $matches[2][$set];
break;
case 'f':
$forum_id = $matches[2][$set];
break;
}
}
if ($forum_id != 0 && !$auth->acl_get('f_read', $forum_id))
{
return $url;
}
if ($topic_id != 0 || $post_id != 0)
{
$sql = "SELECT
t.forum_id, topic_title, forum_name " . ($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;
}
$username = ($post_id != 0) ? $row['username'] . " @ " : '';
$forum_abbr = (preg_match('/^(\[.+\])/', $row['forum_name'], $matches)) ? $matches[1] . ' ' : '';
return $username . $forum_abbr . $row['topic_title'];
}
}
elseif ($forum_id != 0)
{
$sql = "SELECT forum_name FROM " . FORUMS_TABLE . " WHERE forum_id = " . $forum_id;
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
return $row['forum_name'];
}
}
}
return $url;
}
-
- Admin
- Status: Offline
- User theme: Dark
- Posts: 5060
- Joined: Apr 6th, '14, 14:12
Re: Forum Link to Topic Title
No longer works on 3.2 there is other ext's out now that do the same but work.
-
- Users
- Status: Offline
- User theme: Dark
- Posts: 27
- Joined: Apr 29th, '16, 10:11
Re: Forum Link to Topic Title
Yeah, found out the hard way... Any pointers as to an extension that will do something similar? 

-
- Users
- Status: Offline
- User theme: Dark
- Posts: 310
- Joined: Apr 6th, '15, 16:04
Re: Forum Link to Topic Title
Where? Have you a link?martin wrote: Feb 19th, '17, 20:56 No longer works on 3.2 there is other ext's out now that do the same but work.
-
If you want to get German translations for extensions: ask me.
If you want to get German translations for extensions: ask me.