Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Article Gallery
RateU Offline
Administrator
*******
Posts: 2,327
Joined: Mar 2010
Post: #1
Article Gallery
Requirement: XThreads
Latest Edit: 7 October 2012

This idea based on Forum Blog by Yumi. Thank you very much, Yumi Smile

With XThreads, we can create an article gallery. In this example, we will combine XThreads with Thread Tooltip Preview by Yumi.

Here is a simple example to do that:

1. This is for article categories. Create a Custom Thread Fields with this settings:
  • Title: Category
  • Key: atcgal
    This is the key. So, the variable will be: {$GLOBALS['threadfields']['atcgal']}
  • Description: Choose category for this article (required). You can choose more than one category.
  • Applicable Forums: 'select the forum where we will apply this article gallery.
  • Input Field Type: Checkboxes
    We are allowing user to choose more than one category per article.
  • Values List:

    Code:
    Music
    Games
    Other

    Modify it as our needs. These are our categories.

  • Editable by / Required Field?: Everyone (required)
    It will force every user to select at least one category when they create a thread.
  • Display Order: 1
  • Allow Filtering: Yes
    With this option = Yes, we can filter our articles based on their categories.
  • Display Format:

    Code:
    Category: {VALUE}

  • Multiple Value Delimiter: , (plus one space)
    If a user choose more than one category, it will be displayed:

    Code:
    Category: category1, category2

  • Formatting Map List:

    HTML Code
    Music{|}<a href="{$forumurl?}filtertf_atcgal=Music"><span style="color: green;">Music</span></a>
    Games{|}<a href="{$forumurl?}filtertf_atcgal=Games"><span style="color: blue;">Games</span></a>
    Other{|}<a href="{$forumurl?}filtertf_atcgal=Other"><span style="color: red;">Other</span></a>

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


2. Now, XThreads Options in Forum settings (the forum in the settings above):
  • Template Prefix: atcgal_
  • Show first post on every showthread page: Yes
  • Enable XThreads' Inline Forum Search: Yes
  • Override Threads Per Page: 2
    Modify it as our needs. Threads per page in thread list.
  • Settings Overrides:
    • Setting: Showthread Options -> Post Per Page:
      Value: 4
      Modify it as our needs.
    • Setting: Showthread Options -> Post Layout
      Value: horizontal
      This will force horizontal postbit layout when user view all threads in this forum.

      Code:
      postsperpage=4
      postlayout=horizontal


As an option, set Default Sort By: Thread creation time.

3. Create new templates in Global Template:
  • Template Name: atcgal_forumdisplay_nothreads
  • Template Content:

    HTML Code
    <div>{$lang->nothreads}</div>

  • Template Name: atcgal_forumdisplay_thread
  • Template Content:

    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
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" colspan="{$colspan}">
    			<div><strong><a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a></strong></div>
    		</td>
    	</tr>
    	<tr>
    		<td class="tcat" colspan="{$colspan}">
    			<span class="author smalltext float_left">
    				{$lang->author}: {$thread['profilelink']} | {$GLOBALS['threadfields']['atcgal']}
    			</span>
    			{$rating}
    		</td>
    	</tr>
    	<tr>
    		<td class="{$bgcolor}" width="100%">
    			<div class="post_body">
    				 {$thread['postpreview']}
    			</div>
    			<br class="clear" />
    			<span class="float_right smalltext">
    				<em>
    				{$thread['views']} {$lang->views},
    				<a href="javascript:MyBB.whoPosted({$thread['tid']});">{$thread['replies']}</a>{$unapproved_posts} {$lang->replies},
    				<a href="{$thread['lastpostlink']}" title="{$thread['lastpostpreview']}">{$lang->lastpost}</a>: {$lastposterlink}, {$lastpostdate} {$lastposttime}
    				</em>
    			</span>
    			<span class="float_left">
    				<img src="{$theme['imgdir']}/{$folder}.gif" alt="{$folder_label}" title="{$folder_label}" />{$icon}{$prefix}{$gotounread}
    			</span>
    		</td>
    		{$modbit}
    	</tr>
    </table>
    <br />

  • Template Name: atcgal_forumdisplay_threadlist
  • Template Content:

    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
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" colspan="{$colspan}" align="center">
    				<strong>{$foruminfo['name']}</strong>
    		</td>
    	</tr>
    </table>
    <br class="clear" />
    <div class="float_left">
    	{$newthread}
    </div>
    <div class="float_right">
    	{$searchforum}
    </div>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" style="clear: both; width: 100%; background: #FFFFFF;">
    	<tr>
    		<td valign="top" width="250" colspan="{$colspan}">
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    				<tr><td class="thead"><strong>Categories</strong></td></tr>
    				<tr><td class="trow1 {$filters_set['atcgal']['active']['Music']}"><a href="{$forumurl_q}filtertf_atcgal=Music"><span><strong>Music</strong></span></a></td></tr>
    				<tr><td class="trow1 {$filters_set['atcgal']['active']['Games']}"><a href="{$forumurl_q}filtertf_atcgal=Games"><span><strong>Games</strong></span></a></td></tr>
    				<tr><td class="trow1 {$filters_set['atcgal']['active']['Other']}"><a href="{$forumurl_q}filtertf_atcgal=Other"><span><strong>Other</strong></span></a></td></tr>
    			</table>
    			<br class="clear" />
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    				<tr><td class="thead"><strong>Sort By</strong></td></tr>
    				<tr><td class="trow1"><strong><a href="{$sorturl}&amp;sortby=subject&amp;order=asc">{$lang->thread}</a> {$orderarrow['subject']}</strong></td></tr>
    				<tr><td class="trow1"><strong><a href="{$sorturl}&amp;sortby=starter&amp;order=asc">{$lang->author}</a> {$orderarrow['starter']}</strong></td></tr>
    				<tr><td class="trow1"><strong><a href="{$sorturl}&amp;sortby=replies&amp;order=desc">{$lang->replies}</a> {$orderarrow['replies']}</strong></td></tr>
    				<tr><td class="trow1"><strong><a href="{$sorturl}&amp;sortby=views&amp;order=desc">{$lang->views}</a> {$orderarrow['views']}</strong></td></tr>
    				<tr><td class="trow1"><strong><a href="{$sorturl}&amp;sortby=lastpost&amp;order=desc">{$lang->lastpost}</a> {$orderarrow['lastpost']}</strong></td></tr>
    				{$ratingcol}
    			</table>
    		</td>
    		<td valign="top" colspan="{$colspan}">
    			{$threads}{$nullthreads}
    			<br class="clear" />
    			<div class="float_left">
    				{$multipage}
    			</div>
    			<br class="clear" />
    		</td>
    		<td valign="top" colspan="{$colspan}" width="490">
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    				<tr><td class="thead"><strong>Article Legend</strong></td></tr>
    				<tr><td class="trow1"><span class="thread_legend"><strong><img src="{$theme['imgdir']}/newfolder.gif" alt="{$lang->new_thread}" title="{$lang->new_thread}" /> {$lang->new_thread}</strong></span></td></tr>
    				<tr><td class="trow1"><span class="thread_legend"><strong><img src="{$theme['imgdir']}/newhotfolder.gif" alt="{$lang->new_hot_thread}" title="{$lang->new_hot_thread}" /> {$lang->new_hot_thread}</strong></span></td></tr>
    				<tr><td class="trow1"><span class="thread_legend"><strong><img src="{$theme['imgdir']}/hotfolder.gif" alt="{$lang->hot_thread}" title="{$lang->hot_thread}" /> {$lang->hot_thread}</strong></span></td></tr>
    				<tr><td class="trow1"><span class="thread_legend"><strong><img src="{$theme['imgdir']}/folder.gif" alt="{$lang->no_new_thread}" title="{$lang->no_new_thread}" /> {$lang->no_new_thread}</strong></span></td></tr>
    				<tr><td class="trow1"><span class="thread_legend"><strong><img src="{$theme['imgdir']}/dot_folder.gif" alt="{$lang->posts_by_you}" title="{$lang->posts_by_you}" /> {$lang->posts_by_you}</strong></span></td></tr>
    				<tr><td class="trow1"><span class="thread_legend"><strong><img src="{$theme['imgdir']}/lockfolder.gif" alt="{$lang->locked_thread}" title="{$lang->locked_thread}" /> {$lang->locked_thread}</strong></span></td></tr>
    			</table>
    			<br class="clear" />
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    				<tr><td class="thead"><strong>Article Tools</strong></td></tr>
    				<tr><td class="trow1"><strong><a href="misc.php?action=markread&amp;fid={$fid}">{$lang->markforum_read}</a></strong></td></tr>
    				<tr><td class="trow1"><strong><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></td></tr>
    			</table>
    		</td>
    	</tr>
    </table>
    <br class="clear" />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="tcat">
    			<div class="float_left">
    			<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>
    			</div>
    			<div class="float_right">
    				{$forumjump}
    			</div>		
    		</td>
    		{$inlinemodcol}
    	</tr>
    	<tr>
    		<td class="tfoot" align="center" colspan="{$colspan}">
    			<strong><a href="http://mybbhacks.zingaburga.com" target="_blank">XThreads</a> Coded By: <a href="http://mybbhacks.zingaburga.com" target="_blank">ZiNgA BuRgA - MyBB Hacks</a></strong>
    		</td>
    	</tr>
    </table>
    <br class="clear" />
    <div class="float_right" style="text-align: right;">
    	{$inlinemod}
    </div>
    <br style="clear: both" />
    {$inline_edit_js}

  • Template Name: atcgal_forumdisplay_threadlist_rating
  • Template Content:

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    <tr>
    	<td class="trow1">
    		<strong><a href="{$sorturl}&amp;sortby=rating&amp;order=desc">{$lang->rating}</a> {$orderarrow['rating']}</strong>
    		<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>
    	</td>
    </tr>

  • Template Name: atcgal_forumdisplay_thread_rating
  • Template Content:

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <div class="float_left">&nbsp;| {$lang->rating}:&nbsp;</div>
    <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>

  • Template Name: atcgal_postbit
  • Template Content:

    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
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tbody>
    		<tr>
    			<td class="tcat">
    				<div class="float_left smalltext">
    					{$post['onlinestatus']} <strong><span class="smalltext">{$post['profilelink']}</span></strong> -
    					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}"></span>
    				</div>
    				{$post['posturl']}
    			</td>
    		</tr>
    
    		<tr>
    			<td class="trow2 post_content {$unapproved_shade}">
    				<div class="post_body" id="pid_{$post['pid']}">
    					{$post['message']}
    				</div>
    				<div class="post_meta" id="post_meta_{$post['pid']}">
    					{$post['iplogged']}
    				</div>
    				<div class="post_management_buttons float_right">
    					{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>

  • Template Name: atcgal_postbit_first
  • Template Content:

    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
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tbody>
    		<tr>
    			<td class="tcat">
    				<div class="float_left smalltext">
    					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
    				</div>
    				{$post['posturl']}
    			</td>
    		</tr>
    		<tr>
    			<td class="trow1 {$unapproved_shade}">
    				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
    					<tr>
    						<td class="post_avatar" width="1" style="{$post['avatar_padding']}">
    							{$post['useravatar']}
    						</td>
    						<td class="post_author">
    							<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    							<span class="smalltext">
    								{$post['usertitle']}<br />
    								{$post['userstars']}
    								{$post['groupimage']}
    							</span>
    						</td>
    						<td class="smalltext post_author_info" width="165">
    							{$post['user_details']}
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    		<tr>
    			<td class="trow2 post_content {$unapproved_shade}">
    				<span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>
    				<div class="post_body" id="pid_{$post['pid']}">
    					{$post['message']}
    				</div>
    				{$post['attachments']}
    				{$post['signature']}
    				<div class="post_meta" id="post_meta_{$post['pid']}">
    					{$post['iplogged']}
    				</div>
    			</td>
    		</tr>
    		<tr>
    			<td class="trow1 post_buttons {$unapproved_shade}">
    				<div class="author_buttons float_left">
    					{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}
    				</div>
    				<div class="post_management_buttons float_right">
    					{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>

  • Template Name: atcgal_showthread
  • Template Content:

    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
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    <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}
    <div class="float_right">
    	{$newreply}
    </div>
    {$ratethread}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" width="100%" style="clear: both; border-bottom-width: 0;">
    	<tr>
    		<td width="60%" valign="top">
    			<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>
    				{$classic_header}
    			</table>
    			<div>
    				{$first_post}
    			</div>
    			<div align="center">
    				<strong>&laquo; <a href="{$next_oldest_link}">{$lang->next_oldest}</a> | <a href="{$next_newest_link}">{$lang->next_newest}</a> &raquo;</strong>
    			</div>
    		</td>
    		<td valign="top">
    			{$search_thread}
    			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-bottom-width: 0;">
    				<tr>
    					<td class="thead">
    						<div><strong>Comments</strong></div>
    					</td>
    				</tr>
    			</table>
    			<div id="posts">
    				{$posts}
    			</div>
    			<div class="float_right">
    				{$multipage}
    			</div>
    		</td>
    	</tr>
    </table>
    <br style="clear: both;" />
    {$threadexbox}
    {$similarthreads}
    {$quickreply}
    <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: atcgal_showthread_noreplies
  • Template Content:

    HTML Code
    <div id="xthreads_noreplies" align="center">
    <em>There are no comments on this post</em>
    </div>

  • Template Name: atcgal_showthread_ratethread
  • Template Content:

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    <div class="float_left" style="margin-top: 14px;">
    	<strong>{$lang->thread_rating}</strong>&nbsp;
    </div>
    <div class="float_left" style="margin-top: 14px;">
    	<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>

  • Template Name: atcgal_showthread_search
  • Template Content:

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-bottom-width: 0;">
    	<tr>
    		<td class="thead">
    			<div><strong>Search</strong></div>
    		</td>
    	</tr>
    	<tr>
    		<td class="trow1" align="center">
    			<form action="search.php" method="post">
    				<input type="hidden" name="action" value="thread" />
    				<input type="hidden" name="tid" value="{$thread['tid']}" />
    				<input type="text" name="keywords" value="{$lang->enter_keywords}" onfocus="if(this.value == '{$lang->enter_keywords}') { this.value = ''; }" onblur="if(this.value=='') { this.value='{$lang->enter_keywords}'; }" class="textbox" size="25" />
    				<input type="submit" class="button" value="{$lang->search_thread}" />
    			</form>
    		</td>
    	</tr>
    </table>
    <br class="clear" />

  • Template Name: atcgal_forumdisplay_threads_sep
  • Template Content:

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" align="center">
    			<div><strong>Normal Articles</strong></div>
    		</td>
    	</tr>
    </table>
    <br />

  • Template Name: atcgal_forumdisplay_sticky_sep
  • Template Content:

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" align="center">
    			<div><strong>Important Articles</strong></div>
    		</td>
    	</tr>
    </table>
    <br />

  • Template Name: atcgal_forumdisplay
  • Template Content:

    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
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$foruminfo['name']} </title>
    {$headerinclude}
    {$rssdiscovery}
    <script type="text/javascript">
    <!--
    	lang.no_new_posts = "{$lang->no_new_posts}";
    	lang.click_mark_read = "{$lang->click_mark_read}";
    // -->
    </script>
    <style type="text/css">
    .filtertf_active {
    	background: #FFF6BF;
    }
    </style>
    </head>
    <body>
    {$header}
    {$moderatedby}
    {$usersbrowsing}
    {$subforums}
    {$threadslist}
    {$footer}
    </body>
    </html>



Additional Info:

If we want to create an article gallery without the Thread Tooltip Preview plugin, we need another step:

1. Create a Custom Thread Fields with this settings:
  • Title: Article Preview
  • Key: atcgalprev
    This is the key. So, the variable will be: {$GLOBALS['threadfields']['atcgalprev']}
  • Description: Type a preview for this article.
  • Applicable Forums: 'select the article gallery forum'
  • Input Field Type: Multiline Textbox
  • Editable by / Required Field?: Everyone (required)
    It will force every user to write a preview for their article.
  • Display Order: 2
  • Display Parsing: Check all of the checkboxes except Allow HTML.
    Modify it as our needs.

2. Find this code in atcgal_forumdisplay_thread template:

Code:
{$thread['postpreview']}


Replace with:

Code:
{$GLOBALS['threadfields']['atcgalprev']}



Screenshots:

1. User create an article thread:

[Image: 232y2u.jpg]

2. User view the post:

[Image: in98nt.jpg]

3. Thread List:

[Image: 25g4a5s.jpg]

I'm sorry for my English Smile
Live Demo: http://www.14.mynie.co.cc/forumdisplay.php?fid=8


(This post was last modified: 10-08-2012 02:13 AM by RateU.)
05-07-2010 02:39 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #2
RE: Article Gallery
That's a pretty interesting way to use the tooltip preview - never thought of that.
And certainly much nicer than my example Smile
Thanks again!

My Blog
05-07-2010 09:52 PM
Find all posts by this user Quote this message in a reply
Pirata Nervo Offline
Member
***
Posts: 235
Joined: Jan 2008
Post: #3
RE: Article Gallery
Great idea, thank you Smile
05-08-2010 02:35 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,327
Joined: Mar 2010
Post: #4
RE: Article Gallery
(05-07-2010 09:52 PM)ZiNgA BuRgA Wrote:  That's a pretty interesting way to use the tooltip preview - never thought of that.

Biggrin Thanks, Yumi.

(05-08-2010 02:35 AM)Pirata Nervo Wrote:  Great idea, thank you Smile

Thanks, Pirata.

05-08-2010 11:18 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #5
RE: Article Gallery
Hey RateU, just wanted to notify you that you can't use "{$forumurl?}" or "{$threadurl$}" etc in templates unfortunately (it's evaluated differently than display formats).
I might add a specific variable for that in future versions of XThreads, but now, just use the old forumdisplay.php?fid=... thing.  I'd probably say this is more an issue of MyBB's than XThreads', as stuff like the forum display sorters still use forumdisplay.php?fid=... thing.

My Blog
06-06-2010 04:09 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,327
Joined: Mar 2010
Post: #6
RE: Article Gallery
Ah, yes. Thank you very much, Yumi. I've updated it. Smile

06-07-2010 03:27 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #7
RE: Article Gallery
Gee, I noticed that when I updated, so I changed it back - however, as I seemed to be in the running for the title of  "Incorrect Bug Reporter in Chief" I decided it was just me being useless and said nothing. I'm sorry.


[Image: leelink.gif]
MYBB1.6 & XThreads
06-10-2010 02:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,327
Joined: Mar 2010
Post: #8
RE: Article Gallery
Biggrin
Lee, if you've found any bug or anything that doesn't work with any of my XThreads example, please report it Smile
And I'm really sorry for my mistake Smile

06-10-2010 02:52 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: Article Gallery
I set up a similar system to this on my forum, using the categories as set up by RateU (Key: atcgal). I made a box for the categories like in the forumdisplay threadlist template and all works fine. However, I decided to set my number of threads on my thread list to 2. If I run the filter it works fine - on the first page.

For example, I have three items with the category Comics. If I filter comics then I see two threads on the threadlist with the pagination counter showing current page and one additional page - total, two pages. That is correct - three threads in total, 2 visible and one on the next page.

However, if I click on either the 2 or the next button then I am taken to the next page - but the filter is off and its back to default sort order - that is, the pagination shows about 5 available pages - all the threads.

I did not set up the whole forum exactly like RateU did - I don't have a ratings system for my forum. Reading on this forum (mybbhacks) I see that there is some sort of possible issue with MyBB's pagination methods - and probably that is the cause. I just wanted to mention that it looks like if you want to use the filter system it appears only to work on the first page of threads.


[Image: leelink.gif]
MYBB1.6 & XThreads
06-13-2010 11:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #10
RE: Article Gallery
Hmm, I probably should provide some method to fix up the page links...  I think it might be broken if you change the sorters as well.  I'll need to think up a method for that...  Thanks for the pointer though!

My Blog
06-14-2010 12:13 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: