Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Use a 2nd Portal as a filterable gallery
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #1
Use a 2nd Portal as a filterable gallery
I wanted this for so long - I have no idea if anyone else wants it, but as a thank you to ZingaBurga and RateU (without whom this would not exist) I am sharing it here on MYBBHacks.

Assumptions:
You have XThreads installed.
You have one or more forums that are similar in content/use the same sorting filters and you want to present the threads from those forums in one big overview, but NOT on the usual portal page.

1) Download the attached file browse.php and upload it to the forum root.
2) Add the browseportal template to your global templates
3) Apply the portal announcement layout to the forums you want to show in the browse. Warning - as this is a totally different template do not show these forums in your standard portal announcements.

Template name: browseportal
Location: Global templates

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
<title>{$mybb->settings['bbname']} - Downloads</title>
{$headerinclude}
<style type="text/css">
#container{width:1000px;margin:auto auto;}
.swordfish {height:140px;padding:1px;max-height:120px}
.filterfish {float:left; height: 525px; padding: 3px; max-height: 525px;}
</style>
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">	
<tr>
		<td class="thead" colspan="{$colspan}" align="center">
				<strong>The Big List of Everything</strong>
		</td>
</tr>
<tr>
<td  align="center" valign="top">
<div class="float_left">
<div class="filterfish" align="left">
	<table class="trow1" style="border: 1px solid;min-height:523px;width:190px;">
		<tbody style="clear:both;">
			   	<tr><td class="tcat"><strong>Filters</strong></td></tr>
			   	<tr><td class="trow1"><a href="browse.php?"><span><strong>View all Downloads</strong></span></a></td></tr>
				<tr><td class="trow1 {$filters_set['prefix']['active']['Prefix 1']}"><a href="browse.php?&amp;filtertf_prefix=Prefix 1"><strong>View only Prefix 1</strong></a></td></tr>
				<tr><td class="trow1 {$filters_set['prefix']['active']['Prefix 2']}"><a href="browse.php?&amp;filtertf_prefix=Prefix 2"><strong>View only Prefix 2</strong></a></td></tr>
		</tbody>
		<tbody>
		<tr>
		<td align="center">
		<div class="swordfish; smalltext" style="margin-top:20px;">
		<img src="http://i52.tinypic.com/ekf8eu.gif" /></div>
		<br />
		</td>
		</tr>
		</tbody>
		<tbody>
		<tr>
		<td valign="top" style="margin-top: 5px; max-height: 45px; min-height: 45px;">
		<strong><a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}">{$announcement['subject']}</a></strong>
		</td>
		</tr>
		</tbody>
	</table>
</div>


Template name: forum_portal_announcement
Location: Global templates

* forum_portal_announcement where "forum" is your template prefix. Eg, if you have a forum with XThreads templates with the prefix woot then you would call this template woot_portal_announcement

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<div style="float:left; height: 260px; padding: 3px; max-height: 260px;" align="center">
	<table class="trow2" style="border: 1px solid;width:190px; height:258px;">
		<tbody>
		<tr>
		<td valign="top">
		<div style="clear:both;">
		<div style="float:left; margin-top:1px;">{$GLOBALS['threadfields']['prefix']}</div>
		<div class="smalltext" style="margin-top:1px;">Uploader: <a href="{$mybb->settings['bburl']}/member.php?action=profile&amp;uid={$announcement['uid']}">{$announcement['username']}</a></div>
		</div>
		</td>
		</tr>
		</tbody>
		<tbody>
		<tr>
		<td align="center">
		<div class="swordfish; smalltext" style="margin-top:20px;">
{$message}
<br />

</div>
		</td>
		</tr>
		</tbody>
		<tbody>
		<tr>
		<td valign="top" style="margin-top: 5px; height: 45px; min-height: 45px;">
		<strong><a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}">{$announcement['subject']}</a></strong>
		</td>
		</tr>
		</tbody>
	</table>
</div>


A guide on how to make the custom thread field for the prefixes is here:

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

Customising the browse.php to your needs:

on lines 48 - 50 of the php file there are these settings:

PHP Code:
add_breadcrumb("Downloads", $mybb->settings['bburl']."/browse.php");

$mybb->settings['portal_announcementsfid'] = '16, 7,14,22,29,53,55,73,78';
$mybb->settings['portal_numannouncements'] = '13';


The add breadcrumb can be changed to whatever you want your page to be called.

The portal_announcementsfid is the list of forums you are adding - yea , I have a lot Smile
The portal_numannouncements is the number of boxes you wish to show per page.

You can show a picture instead of the message but you need to have an XThreads picture in the post.

You can set up an image field following this :
http://mybbhacks.zingaburga.com/showthread.php?tid=531 .


The articles layout in combination with this layout I am sharing here would make a pretty good news page I think. HINT.

If you want to see it in action on leefish here is the link:  http://www.leefish.nl/mybb/browse.php



Attached File(s)
.php  browse.php (Size: 6.24 KB / Downloads: 397)


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 07-09-2011 01:14 PM by leefish.)
07-09-2011 09:33 AM
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
Use a 2nd Portal as a filterable gallery - leefish - 07-09-2011 09:33 AM

 Standard Tools
Forum Jump: