Jump to the post that solved this thread.
Solved: 4 Years, 5 Months, 3 Weeks ago Latest threads/posts from one category
#6
Solved: 4 Years, 5 Months, 3 Weeks ago
It doesn't work for me - when i add this {$thread['threadprefix']} then nothing displays ;/

Thats my portal_latestthreads_thread with added {$thread['threadprefix']}:

<tr>
<td class="{$altbg}">
{$thread['threadprefix']}
<strong><a href="{$mybb->settings['bburl']}/{$thread['threadlink']}">{$thread['subject']}</a></strong>
<span class="smalltext"><br />
{$lang->forum} <a href="{$thread['forumlink']}">{$thread['forumname']}</a><br />
<a href="{$thread['lastpostlink']}">{$lang->latest_threads_lastpost}</a> {$lastposterlink}<br />
{$lastpostdate}<br />
<strong>&raquo; </strong>{$lang->latest_threads_replies} {$thread['replies']}<br />
<strong>&raquo; </strong>{$lang->latest_threads_views} {$thread['views']}
</span>
</td>
</tr>

and my portal.php

while($thread = $db->fetch_array($query))
	{
        $thread['threadprefix'] = $threadprefix = '';
        if($thread['prefix'] != 0)
        {
            $threadprefix = build_prefixes($thread['prefix']);
            if(!empty($threadprefix))
            {
                $thread['threadprefix'] = $threadprefix['displaystyle'].'&nbsp;';
            }
        }
		$forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);

		// Make sure we can view this thread
		if(isset($forumpermissions[$thread['fid']]['canonlyviewownthreads']) && $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
		{
			continue;
		}

		$lastpostdate = my_date('relative', $thread['lastpost']);
		$lastposter = htmlspecialchars_uni($thread['lastposter']);
		$thread['replies'] = my_number_format($thread['replies']);
		$thread['views'] = my_number_format($thread['views']);

		// Don't link to guest's profiles (they have no profile).
		if($thread['lastposteruid'] == 0)
		{
			$lastposterlink = $lastposter;
		}
		else
		{
			$lastposterlink = build_profile_link($lastposter, $thread['lastposteruid']);
		}
		if(my_strlen($thread['subject']) > 25)
		{
			$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
		}
		$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
		$thread['threadlink'] = get_thread_link($thread['tid']);
		$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
		$thread['forumlink'] = get_forum_link($thread['fid']);
		$thread['forumname'] = $forum_cache[$thread['fid']]['name'];
		eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
		$altbg = alt_trow();
	}
	if($threadlist)
	{
		// Show the table only if there are threads
		eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
	}
}
Reply
Jump to the post that solved this thread.


Messages In This Thread
RE: Latest threads/posts from one category - by DeepSea - 2017-05-01, 08:27 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)