MyBB Hacks

Full Version: Showcase Forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Requirement: XThreads
Last Update: 08 February 2011

With XThreads, we can create a showcase forum. Here is a simple example to do that:

1. First, we will create a textbox for Website Name:
Create a Custom Thread Fields with this settings:
  • Title: Website Name
  • Key: scfname
  • Description: Your website name
  • Applicable Forums: 'select a forum that we will apply the showcase forum'
  • Input Field Type: Textbox
  • Editable by / Required Field?: Everyone (required)
    Later, we need to put {$GLOBALS['threadfields']['scfname']} variable to display it into our template.

2. Next, we will create a textbox for Website URL:
Create a Custom Thread Fields with this settings:
  • Title: Website URL
  • Key: scfurl
  • Description: e.g: www.yoursite.com
  • Applicable Forums: 'select the forum in point 1'
  • Input Field Type: Textbox
  • Editable by / Required Field?: Everyone (required)
  • Display Order: 2
    Later, we need to put {$GLOBALS['threadfields']['scfurl']} variable to display it into our template.

3. Then, we will create a txtbox for Website Language:
Create a Custom Thread Fields with this settings:
  • Title: Website Language
  • Key: scflang
  • Description: The major language in your website
  • Applicable Forums: 'select the forum in point 1 or 2'
  • Input Field Type: Textbox
  • Editable by / Required Field?: Everyone (required)
  • Display Order: 3
  • Display Format:

    HTML Code
    <tr>
    <td valign="top">Language</td><td valign="top">:</td><td valign="top">{VALUE}</td>
    </tr>

    We need to put {$GLOBALS['threadfields']['scflang']} variable to display it into our template.


4. Now, we will create a textbox for Website Slogan:
Create a Custom Thread Fields with this settings:
  • Title: Website Slogan
  • Key: scfslogan
  • Description: Your website slogan (not required)
  • Applicable Forums: 'select the forum in point 1, 2 or 3'
  • Input Field Type: Textbox
  • Editable by / Required Field?: Everyone
  • Display Order: 4
  • Display Format:

    HTML Code
    <tr>
    <td valign="top">Slogan</td><td valign="top">:</td><td valign="top">{VALUE}</td>
    </tr>

    We need to put {$GLOBALS['threadfields']['scfslogan']} variable to display it into our template.


5. Then, we will create a textbox for Founded (Year):
Create a Custom Thread Fields with this settings:
  • Title: Founded (Year)
  • Key: scffounded
  • Description: e.g: 2010
  • Applicable Forums: 'select the forum in point 1, 2, 3 or 4'
  • Input Field Type: Textbox
  • Editable by / Required Field?: Everyone (required)
  • Display Order: 5
  • Display Format:

    HTML Code
    <tr>
    <td valign="top">Founded</td><td valign="top">:</td><td valign="top">{VALUE}</td>
    </tr>

  • Text Mask Filter:

    Code:
    ^(19|20)\d\d$

    We need to put {$GLOBALS['threadfields']['scffounded']} variable to display it into our template.


6. Now, we will create categories:
Create a Custom Thread Fields with this settings:
  • Title: Website Category
  • Key: scfcat
  • Description: Select your website category
  • Applicable Forums: 'select the forum in point 1, 2, 3, 4 or 5'
  • Input Field Type: Listbox
  • Field Input Height: 1
  • Values List:

    Code:
    Entertainment
    Encyclopedia
    Other

  • Editable by / Required Field?: Everyone (Required)
  • Display Order: 6
  • Allow Filtering: Yes
  • Formatting Map List:
    EDIT: Using {$forumurl?} for the filtering.

    HTML Code
    Entertainment{|}<a href="{$forumurl?}filtertf_scfcat=Entertainment"><span style="color: green;"><strong>Entertainment</strong></span></a>
    Encyclopedia{|}<a href="{$forumurl?}filtertf_scfcat=Encyclopedia"><span style="color: blue;"><strong>Encyclopedia</strong></span></a>
    Other{|}<a href="{$forumurl?}filtertf_scfcat=Other"><span style="color: yellow;"><strong>Other</strong></span></a>

    To display this formatting list, later we need to put {$GLOBALS['threadfields']['scfcat']} variable in our template.



7. Now, XThreads Options in Forum settings (the forum in the settings 1, 2, 3, 4, 5 and 6 above):
  • Template Prefix: scf_
  • Enable XThreads' Inline Forum Search: Yes
  • Override Threads Per Page: 5
    Modify it as our needs.

8. Create new templates in Global Template:
  • Template Name: scf_forumdisplay_threadlist
  • Template Content:

    HTML Code
    <div class="float_left">
    	{$multipage}
    </div>
    <div class="float_right">
    	{$newthread}
    </div>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" colspan="{$colspan}">
    			<div style="float: right;">
    				<span class="smalltext"><strong><a href="misc.php?action=markread&amp;fid={$fid}">{$lang->markforum_read}</a> | <a href="usercp2.php?action={$add_remove_subscription}subscription&amp;type=forum&amp;fid={$fid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a>{$clearstoredpass}</strong></span>
    			</div>
    			<div>
    				<strong>{$foruminfo['name']}</strong>
    			</div>
    		</td>
    	</tr>
    	<tr>
    		<td class="tcat" width="100%" colspan="2"><span class="smalltext"><strong>Sort By: <a href="{$sorturl}&amp;sortby=subject&amp;order=asc">{$lang->thread}</a> {$orderarrow['subject']} | <a href="{$sorturl}&amp;sortby=starter&amp;order=asc">{$lang->author}</a> {$orderarrow['starter']} | <a href="{$sorturl}&amp;sortby=replies&amp;order=desc">{$lang->replies}</a> {$orderarrow['replies']} | <a href="{$sorturl}&amp;sortby=views&amp;order=desc">{$lang->views}</a> {$orderarrow['views']} {$ratingcol} | <a href="{$sorturl}&amp;sortby=lastpost&amp;order=desc">{$lang->lastpost}</a> {$orderarrow['lastpost']}</strong></span></td>
    		{$inlinemodcol}
    	</tr>
    </table>
    <br class="clear" />
    	{$threads}{$nullthreads}
    <br class="clear" />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="tfoot" align="right" colspan="{$colspan}">
    			<form action="forumdisplay.php" method="get">
    				<input type="hidden" name="fid" value="{$fid}" />
    				<select name="sortby">
    					<option value="subject" {$sortsel['subject']}>{$lang->sort_by_subject}</option>
    					<option value="lastpost" {$sortsel['lastpost']}>{$lang->sort_by_lastpost}</option>
    					<option value="starter" {$sortsel['starter']}>{$lang->sort_by_starter}</option>
    					<option value="started" {$sortsel['started']}>{$lang->sort_by_started}</option>
    					{$ratingsort}
    					<option value="replies" {$sortsel['replies']}>{$lang->sort_by_replies}</option>
    					<option value="views" {$sortsel['views']}>{$lang->sort_by_views}</option>
    				</select>
    				<select name="order">
    					<option value="asc" {$ordersel['asc']}>{$lang->sort_order_asc}</option>
    					<option value="desc" {$ordersel['desc']}>{$lang->sort_order_desc}</option>
    				</select>
    				<select name="datecut">
    					<option value="1" {$datecutsel['1']}>{$lang->datelimit_1day}</option>
    					<option value="5" {$datecutsel['5']}>{$lang->datelimit_5days}</option>
    					<option value="10" {$datecutsel['10']}>{$lang->datelimit_10days}</option>
    					<option value="20" {$datecutsel['20']}>{$lang->datelimit_20days}</option>
    					<option value="50" {$datecutsel['50']}>{$lang->datelimit_50days}</option>
    					<option value="75" {$datecutsel['75']}>{$lang->datelimit_75days}</option>
    					<option value="100" {$datecutsel['100']}>{$lang->datelimit_100days}</option>
    					<option value="365" {$datecutsel['365']}>{$lang->datelimit_lastyear}</option>
    					<option value="9999" {$datecutsel['9999']}>{$lang->datelimit_beginning}</option>
    				</select>
    				{$gobutton}
    			</form>
    		</td>
    	</tr>
    </table>
    <div class="float_left">
    	{$multipage}
    </div>
    <div class="float_right" style="margin-top: 4px;">
    	{$newthread}
    </div>
    <br style="clear: both;" />
    <br />
    <div class="float_left">
    	<div class="float_left">
    		<dl class="thread_legend smalltext">
    			<dd><img src="{$theme['imgdir']}/newfolder.gif" alt="{$lang->new_thread}" title="{$lang->new_thread}" /> {$lang->new_thread}</dd>
    			<dd><img src="{$theme['imgdir']}/newhotfolder.gif" alt="{$lang->new_hot_thread}" title="{$lang->new_hot_thread}" /> {$lang->new_hot_thread}</dd>
    			<dd><img src="{$theme['imgdir']}/hotfolder.gif" alt="{$lang->hot_thread}" title="{$lang->hot_thread}" /> {$lang->hot_thread}</dd>
    		</dl>
    	</div>
    
    	<div class="float_left">
    		<dl class="thread_legend smalltext">
    			<dd><img src="{$theme['imgdir']}/folder.gif" alt="{$lang->no_new_thread}" title="{$lang->no_new_thread}" /> {$lang->no_new_thread}</dd>
    			<dd><img src="{$theme['imgdir']}/dot_folder.gif" alt="{$lang->posts_by_you}" title="{$lang->posts_by_you}" /> {$lang->posts_by_you}</dd>
    			<dd><img src="{$theme['imgdir']}/lockfolder.gif" alt="{$lang->locked_thread}" title="{$lang->locked_thread}" /> {$lang->locked_thread}</dd>
    		</dl>
    	</div>
    	<br style="clear: both" />
    </div>
    
    <div class="float_right" style="text-align: right;">
    	{$inlinemod}
    	{$searchforum}
    	{$forumjump}
    </div>
    <br style="clear: both" />
    {$inline_edit_js}

  • Template Name: scf_forumdisplay_threadlist_rating
  • Template Content:

    HTML Code
    | <a href="{$sorturl}&amp;sortby=rating&amp;order=desc">{$lang->rating}</a> {$orderarrow['rating']}
    <script type="text/javascript" src="jscripts/rating.js?ver=1400"></script>
    <script type="text/javascript">
    <!--
    	lang.stars = new Array();
    	lang.stars[1] = "{$lang->one_star}";
    	lang.stars[2] = "{$lang->two_stars}";
    	lang.stars[3] = "{$lang->three_stars}";
    	lang.stars[4] = "{$lang->four_stars}";
    	lang.stars[5] = "{$lang->five_stars}";
    // -->
    </script>

  • Template Name: scf_forumdisplay_thread
  • Template Content:

    HTML Code
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" align="center" colspan="{$colspan}">
    			<div><strong><a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a></strong></div>
    			<div class="author smalltext">{$lang->author}: {$thread['profilelink']}</div>
    		</td>
    	</tr>
    	<tr>
    		<td class="{$bgcolor}" width="50%">
    			<span class="float_left">
    				<img src="{$theme['imgdir']}/{$folder}.gif" alt="{$folder_label}" title="{$folder_label}" />{$icon}{$prefix}{$gotounread}
    			</span>
    			<br class="clear" />
    			<table width="100%" border="0">
    				<tr>
    					<td width="90">URL</td>
    					<td>:</td>
    					<td>http://{$GLOBALS['threadfields']['scfurl']}</td>
    				</tr>
    				<tr>
    					<td>Link</td>
    					<td>:</td>
    					<td><a href="http://{$GLOBALS['threadfields']['scfurl']}"><strong>{$GLOBALS['threadfields']['scfname']}</strong></a></td>
    				</tr>
    				{$rating}
    				{$GLOBALS['threadfields']['scflang']}
    				{$GLOBALS['threadfields']['scffounded']}
    				<tr>
    					<td>Category</td>
    					<td>:</td>
    					<td>{$GLOBALS['threadfields']['scfcat']}</td>
    				</tr>
    				{$GLOBALS['threadfields']['scfslogan']}
    			</table>
    		</td>
    	
    		<td class="{$bgcolor}" width="50%">
    			<table width="100%" border="0">
    				<tr>
    					<td align="center" valign="middle">
    						<a href="http://www.alexa.com/siteinfo/{$GLOBALS['threadfields']['scfurl']}"><script type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/s/a?url={$GLOBALS['threadfields']['scfurl']}'></script></a>
    					</td>
    				</tr>
    			</table>
    		</td>
    		{$modbit}
    	</tr>
    	<tr>
    		<td class="tfoot" colspan="{$colspan}" align="center">
    			{$thread['views']} {$lang->views},
    			<a href="javascript:MyBB.whoPosted({$thread['tid']});">{$thread['replies']}</a>{$unapproved_posts} {$lang->replies},
    			<a href="{$thread['lastpostlink']}">{$lang->lastpost}</a>: {$lastposterlink}, {$lastpostdate} {$lastposttime}
    		</td>
    	</tr>
    </table>
    <br />

  • Template Name: scf_forumdisplay_thread_rating
  • Template Content:

    HTML Code
    <tr>
    <td>Rating</td>
    <td>:</td>
    <td>
    <div class="float_left" id="rating_table_{$thread['tid']}">
    	<ul class="star_rating{$not_rated}" id="rating_thread_{$thread['tid']}">
    		<li style="width: {$thread['width']}%" class="current_rating" id="current_rating_{$thread['tid']}">{$ratingvotesav}</li>
    	</ul>
    	<script type="text/javascript">
    	<!--
    		Rating.build_forumdisplay({$thread['tid']}, { width: '{$thread['width']}', extra_class: '{$not_rated}', current_average: '{$ratingvotesav}' });
    	// -->
    	</script>
    </div>
    </td>
    </tr>

  • Template Name: scf_showthread
  • Template Content:

    HTML Code
    <html>
    <head>
    <title>{$thread['subject']}</title>
    {$headerinclude}
    <script type="text/javascript">
    <!--
    	var quickdelete_confirm = "{$lang->quickdelete_confirm}";
    // -->
    </script>
    <script type="text/javascript" src="jscripts/thread.js?ver=1400"></script>
    </head>
    <body>
    	{$header}
    	{$pollbox}
    	<br class="clear" />
    	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
    		<tr>
    			<td class="thead" colspan="2">
    				<div style="float: right;">
    					<span class="smalltext"><strong><a href="showthread.php?mode=threaded&amp;tid={$tid}&amp;pid={$pid}#pid{$pid}">{$lang->threaded}</a> | <a href="showthread.php?mode=linear&amp;tid={$tid}&amp;pid={$pid}#pid{$pid}">{$lang->linear}</a></strong></span>
    				</div>
    				<div>
    					<strong>{$thread['subject']}</strong>
    				</div>
    			</td>
    		</tr>
    		<tr>
    			<td class="tcat" width="50%">
    				<table width="100%" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="trow1" style="clear: both;">
    					<tr>
    						<td width="50%">
    							<table width="100%">
    								<tr>
    									<td width="90">URL</td>
    									<td width="1">:</td>
    									<td>http://{$GLOBALS['threadfields']['scfurl']}</td>
    								</tr>
    								<tr>
    									<td>Link</td>
    									<td>:</td>
    									<td><a href="http://{$GLOBALS['threadfields']['scfurl']}"><strong>{$GLOBALS['threadfields']['scfname']}</strong></a></td>
    								</tr>
    								{$ratethread}
    								{$GLOBALS['threadfields']['scflang']}
    								{$GLOBALS['threadfields']['scffounded']}
    								<tr>
    									<td>Category</td>
    									<td>:</td>
    									<td>{$GLOBALS['threadfields']['scfcat']}</td>
    								</tr>
    								{$GLOBALS['threadfields']['scfslogan']}
    								<tr>
    									<td colspan="3">
    										<span class="float_left smalltext">
    											<em>
    											{$lang->views} {$thread['views']},
    											{$lang->replies} <a href="javascript:MyBB.whoPosted({$thread['tid']});">{$thread['replies']}</a>{$unapproved_posts} 
    											</em>
    										</span>
    									</td>
    								</tr>
    							</table>
    						</td>
    						<td align="center" valign="middle">
    							<table width="100%" border="0">
    								<tr>
    									<td align="center" valign="middle">
    										<a href="http://www.alexa.com/siteinfo/{$GLOBALS['threadfields']['scfurl']}"><script type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/s/a?url={$GLOBALS['threadfields']['scfurl']}'></script></a>
    									</td>
    								</tr>
    							</table>
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    	</table>
    	<br class="clear" />
    	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
    		{$classic_header}
    	</table>
    	<div id="posts">
    		{$first_post}{$posts}
    	</div>
    	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
    		<tr>
    			<td colspan="2" class="tfoot">
    				{$search_thread}
    				<div>
    					<strong>&laquo; <a href="{$next_oldest_link}">{$lang->next_oldest}</a> | <a href="{$next_newest_link}">{$lang->next_newest}</a> &raquo;</strong>
    				</div>
    			</td>
    		</tr>
    	</table>
    	<div class="float_left">
    		{$multipage}
    	</div>
    	<div style="padding-top: 4px;" class="float_right">
    		{$newreply}
    	</div>
    	<br style="clear: both;" />
    	{$quickreply}
    	{$threadexbox}
    	{$similarthreads}
    	<br />
    	<div class="float_left">
    		<ul class="thread_tools">
    			<li class="printable"><a href="printthread.php?tid={$tid}">{$lang->view_printable}</a></li>
    			<li class="sendthread"><a href="sendthread.php?tid={$tid}">{$lang->send_thread}</a></li>
    			<li class="subscription_{$add_remove_subscription}"><a href="usercp2.php?action={$add_remove_subscription}subscription&amp;tid={$tid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a></li>
    		</ul>
    	</div>
    
    	<div class="float_right" style="text-align: right;">
    		{$moderationoptions}
    		{$forumjump}
    	</div>
    	<br style="clear: both;" />
    	{$footer}
    </body>
    </html>

  • Template Name: scf_showthread_ratethread
  • Template Content:

    HTML Code
    <tr>
    <td>Rating</td>
    <td>:</td>
    <td>
    <div class="float_left">
    	<script type="text/javascript" src="jscripts/rating.js?ver=1400"></script>
    	<div class="inline_rating">
    		<ul class="star_rating{$not_rated}" id="rating_thread_{$thread['tid']}">
    			<li style="width: {$thread['width']}%" class="current_rating" id="current_rating_{$thread['tid']}">{$ratingvotesav}</li>
    			<li><a class="one_star" title="{$lang->one_star}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=1&amp;my_post_key={$mybb->post_code}">1</a></li>
    			<li><a class="two_stars" title="{$lang->two_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=2&amp;my_post_key={$mybb->post_code}">2</a></li>
    			<li><a class="three_stars" title="{$lang->three_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=3&amp;my_post_key={$mybb->post_code}">3</a></li>
    			<li><a class="four_stars" title="{$lang->four_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=4&amp;my_post_key={$mybb->post_code}">4</a></li>
    			<li><a class="five_stars" title="{$lang->five_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=5&amp;my_post_key={$mybb->post_code}">5</a></li>
    		</ul>
    	</div>
    </div>
    </td>
    </tr>

  • Template Name: scf_forumdisplay_threads_sep
  • Template Content:

    HTML Code
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" align="center">
    			<div><strong>Normal Sites</strong></div>
    		</td>
    	</tr>
    </table>
    <br />

  • Template Name: scf_forumdisplay_sticky_sep
  • Template Content:

    HTML Code
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" align="center">
    			<div><strong>Important Sites</strong></div>
    		</td>
    	</tr>
    </table>
    <br />


Screenshots:

1. User create a showcase thread:

[Image: wuphfs.jpg]

2. User view the post:

[Image: 68y990.jpg]

3. Thread List:

[Image: 2eykkrm.jpg]
Wow, Rateu's on a roll!
Nice work Smile
Wow, that is really cool. It would also make a very good latest finds set up for my sims site..... I will try it out, Thank you Rateu.
(05-03-2010 10:20 AM)ZiNgA BuRgA Wrote: [ -> ]Wow, Rateu's on a roll!
Nice work Smile

Biggrin

(05-04-2010 04:18 AM)leefish Wrote: [ -> ]Wow, that is really cool. It would also make a very good latest finds set up for my sims site..... I will try it out, Thank you Rateu.

Glad to see you here, Lee Smile
That is awesome! XThreads does marvellous things Tongue
wow, xthreads is very cool.  I just need to set some time aside to learn and use it!  Showcase forum looks awesome.
i like this. but i really dont get it? where is the instalation for this plugin?
thanks. preview not appear. huhu
(01-28-2011 11:59 PM)thalhah Wrote: [ -> ]thanks. preview not appear. huhu

If you mean by the preview is the website thumbnail, I don't know what happen to the thumbnail service. It is the second days the thumbnail not appear.
You can use other thumbnail service if you want, like thumbshots. I use this for Link Directory now. It is also a free thumbnail service, but you need to register there.

After register, if you don't know how to integrate it to your Showcase Forum, you can ask it here.
Pages: 1 2 3 4 5
Reference URL's