Forum names on Portal announcements
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #1
Forum names on Portal announcements
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:
1
2
3
4
5
6
7
8
9
10
$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?



Attached File(s) Thumbnail(s)
   


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 11-18-2010 11:51 AM by leefish.)
11-18-2010 11:48 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Forum names on Portal announcements
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.

My Blog
11-18-2010 01:05 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #3
RE: Forum names on Portal announcements
Oh, I did not realise - yes, that has fixed it. Thank you Smile


[Image: leelink.gif]
MYBB1.6 & XThreads
11-18-2010 01:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #4
RE: Forum names on Portal announcements
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:
1
2
3
4
5
6
7
8
9
10
11
12
<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>



[Image: leelink.gif]
MYBB1.6 & XThreads
11-18-2010 07:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: