Thread Rating:
  • 1 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to display forum names on portal page
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: How to display forum names on portal page
Oh okay, sorry.

In portal.php
Find:

PHP Code:
1
2
3
4
5
6
7
8
	$query = $db->query("
		SELECT t.*, u.username
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
		WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
		ORDER BY t.lastpost DESC 
		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
	);

Replace with:

PHP Code:
1
2
3
4
5
6
7
8
9
10
	$uv = str_replace('fid', 't.fid', $unviewwhere);
	$query = $db->query("
		SELECT t.*, u.username, 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 1=1 $uv AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
		ORDER BY t.lastpost DESC 
		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
	);

Then edit your portal_latestthreads_thread template - add {$thread['forumname']} wherever you want the name to appear.  You can also use {$thread['fid']} if you need the FID.


My Blog
01-27-2008 07:07 PM
Find all posts by this user

« Next Oldest | Next Newest »

Messages In This Thread
RE: How to display forum names on portal page - ZiNgA BuRgA - 01-27-2008 07:07 PM

 Standard Tools
Forum Jump: