MyBB Hacks

Full Version: Forum names on Portal announcements
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wandering about in the old threads here on MYBBHacks and came across this post:

http://mybbhacks.zingaburga.com/showthread.php?tid=50

I had a look at the code - I thought well, that doesn't seem to have changed much - I shall have a go. I made this code edit in my portal.php

PHP Code:
$announcements = '';
$query = $db->query("
	SELECT t.*, t.username AS threadusername, u.username, u.avatar, u.avatardimensions, f.name AS forumname
	FROM ".TABLE_PREFIX."threads t
	LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
	LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid = t.fid)
	WHERE t.fid IN (".$announcementsfids.") AND t.tid IN (0{$tids}) AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
	ORDER BY t.dateline DESC
	LIMIT 0, ".$mybb->settings['portal_numannouncements']
);


and put the edited file in my FTP. This was the result.....

[Image: attachment.php?aid=286]

I don't really understand why its doing this. Is the code non compatible now?

When you edited portal.php, do you have a blank line at the top of the file?
It should start with <?php with no blank lines, spaces or anything else before it.
Oh, I did not realise - yes, that has fixed it. Thank you Smile
Well yay - I also managed to get the forum name and a link to it to show in the latest threads.....

Here is some fun for us - (Zinga and RateU not allowed to play) - based on the information in this thread, what is the href you need to put in the portal_latestthreads_thread template to have the forum name in the latest threads side box link to the forum name displayed?

Just in case it's not clear what I mean, here is the code snippet from the template xxx is the html you need to fill in (line 4 of the code block)

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

Reference URL's