Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using XThreads Custom Thread Fields For Plugin Settings
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #28
RE: Using XThreads Custom Thread Fields For Plugin Settings
Here is a pro_portal block for the display in portal as posted by RateU. Its just RateU's code wrapped in a block - you will need ZingaBurga's thread tooltip preview plugin to get the post preview.

The limit for threads is hardcoded to 5. If you want to change the template then you have to change it in the block as that is how pro_portal does it.

In the block it is this bit:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$xtportaldisplay.="<tr>
	<td class='{$altbg}'>
		<div>
			{$xtdispportal_thread_icon}
			<strong><a href='{$xtdispportal_thread_link}'>{$xtdispportal_thread_subject}</a></strong>
			By: {$xtdispportal_profile_link}{$xtdispportal_user_avatar}
		</div>
		<br class='clear' />
		<div class='post_body'>
			{$xtdispportal_postpreview}
		</div>
		<div class='smalltext'>
			<em>Posted In: <a href='{$xtdispportal_forum_link}'>{$xtdispportal_forum_name}</a>,
			{$xtdispportal_date} at {$xtdispportal_time}<br />
			Replies: {$xtdispportal_replies}, Views: {$xtdispportal_views}</em>
		</div>
	</td>
</tr>";


If you want to change the number of threads then you need to open the block in your editor and find

Code:
1
2
3
4
5
6
7
8
9
10
11
$result = mysql_query
("
		SELECT t.*, t.username AS tusername, u.username, u.avatar, u.usergroup, u.displaygroup, f.name
			FROM ".TABLE_PREFIX."threads t
			LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
			LEFT JOIN ".TABLE_PREFIX."threadfields_data td ON (td.tid=t.tid)
			LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
			WHERE t.visible=1 AND td.xtdispportal='Yes' AND t.closed NOT LIKE 'moved|%''.$xtdispportal_unviewwhere.'
		    	ORDER BY t.dateline desc
			LIMIT 5
;")


and just change the number of the limit.

I have it running over on my testboard if you want to have a look:

http://www.leefish.nl/testfish/portal.php

Attachment removed - see later post.



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 06-19-2011 10:56 PM by leefish.)
06-12-2011 09:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Using XThreads Custom Thread Fields For Plugin Settings - leefish - 06-12-2011 09:04 PM

 Standard Tools
Forum Jump: