Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Suggestion Forum
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Suggestion Forum
Requirement: XThreads
Last Updated: 7 October 2012

This idea based on the MyBB Ideas section. When viewing the section, I think we can use XThreads to create a similar system for our forum. But we will try to make it for more general purpose.

Here is a simple example to do that:

Create or edit a forum with these settings:
  • Template Prefix: xtsug_
  • Show first post on every showthread page: Yes
  • Settings Overrides:
    • Setting: Showthread Options -> Post Layout
      Value: horizontal

      Code:
      postlayout=horizontal

  • Custom WOL Text:
    • Forum Display:

      HTML Code
      Viewing <a href="{1}">{2}</a>

    • New Thread:

      HTML Code
      Submitting a new suggestion

    • New Reply:

      HTML Code
      Commenting <a href="{1}">{2}</a> suggestion

    • Show Thread:

      HTML Code
      Reading <a href="{1}">{2}</a> suggestion

    Maybe we can disable the img and video tag and the post icons here (optional).

Create a Custom Thread Fields with these settings:
AdminCP -> Configuration -> Custom Thread Fields
  • Title: Status
  • Key: xtsug_status
  • Applicable Forums: 'select our suggestion forum.'
  • Input Field Type: Option Buttons
  • Values List:

    Code:
    Confirmed
    Implemented
    Rejected

  • Editable by / Required Field?: Administrators
  • Allow Filtering: Yes
  • Blank Replacement Value and Display Format:

    Code:
    <if $thread['replies'] > 0 then><div style="padding-top: 9px;"><a href="{$threadurl}#posts"><img src="images/comment.jpg" alt="" title="" /> {$thread['replies']}<if $thread['replies'] == 1 then> Comment<else> Comments</if></a></div></if>

    This status can be used to set whether a suggestion already implemented, or already confirmed and in progress to be implemented, or rejected (we don't want to implement it). This status can be used for a very simple bug report.


Create new templates in Global Template:
AdminCP -> Templates & Style -> Templates -> Global Templates
  1. xtsug_forumdisplay_thread

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <tr>
    	{$rating}
    	<td class="trow1{$thread_type_class}">
    		<div>
    			<strong><a href="{$thread['threadlink']}" class="{$inline_edit_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a></strong>
    		</div>
    		<div class="author smalltext" style="padding-top: 3px;">
    			Submitted by: {$thread['profilelink']}, {$thread['threaddate']}, {$thread['threadtime']}
    		</div>
    		<div style="padding-top: 7px;">{$thread['postpreview']}</div>
    		{$GLOBALS['threadfields']['xtsug_status']}
    	</td>
    	{$modbit}
    </tr>

  2. xtsug_forumdisplay_threadlist

    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
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    	<tr>
    		<td class="thead" colspan="{$colspan}">
    			<div class="largetext" style="text-align: center;"><strong>{$foruminfo['name']}</strong></div>
    		</td>
    	</tr>
    	<tr>
    		<td class="tcat" colspan="2">
    			<div class="float_right">
    				<strong>Filter:</strong>
    				<strong><a href="{$forumurl_q}filtertf_xtsug_status=Confirmed">Confirmed</a></strong> |
    				<strong><a href="{$forumurl_q}filtertf_xtsug_status=Implemented">Implemented</a></strong> |
    				<strong><a href="{$forumurl_q}filtertf_xtsug_status=Rejected">Rejected</a></strong>
    			</div>
    			<div class="float_left">
    				<strong>Sort:</strong>
    				<strong><a href="{$sorturl}&amp;sortby=started&amp;order=asc">Recent Suggested</a></strong> |
    				<strong><a href="{$sorturl}&amp;sortby=replies&amp;order=desc">Most Comments</a></strong>
    				{$ratingcol}
    			</div>
    		</td>
    		{$inlinemodcol}
    	</tr>
    	{$selectall}
    	{$announcementlist}
    	{$threads}{$nullthreads}
    </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_right" style="text-align: right;">
    	{$inlinemod}
    	{$searchforum}
    	{$forumjump}
    </div>
    <br style="clear: both" />
    <div class="smalltext" align="center">
    	{$foruminfo['name']}<br />Powered By <a href="http://mybbhacks.zingaburga.com">XThreads</a> - <a href="http://mybbhacks.zingaburga.com">MyBB Hacks</a>
    </div>
    {$inline_edit_js}

  3. xtsug_forumdisplay_threadlist_rating

    HTML Code
    &nbsp;| <strong><a href="{$sorturl}&amp;sortby=numratings&amp;order=desc">Votes</a></strong>

  4. xtsug_forumdisplay_thread_rating

    HTML Code
    <td align="center" class="{$bgcolor}{$thread_type_class}" id="rating_table_{$thread['tid']}" width="1" valign="top">
    	<a href="ratethread.php?tid={$thread['tid']}&amp;rating=1&amp;my_post_key={$mybb->post_code}"><img src="images/rate.jpg" alt="Vote" title="Vote" /></a>
    	<div><strong>{$thread['numratings']}</strong> Votes</div>
    </td>

  5. xtsug_postbit

    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
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}" class="tborder">
    	<tbody>
    		<tr>
    			<td class="trow1 {$unapproved_shade}">
    				<div class="float_left smalltext">
    					by: <a href="{$post['profilelink_plain']}" id="profile_{$post['pid']}">{$post['username_formatted']}</a>
    					<br />{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
    				</div>
    				{$post['posturl']}
    				<div class="post_body clear" id="pid_{$post['pid']}">{$post['message']}</div>
    				<div class="post_meta" id="post_meta_{$post['pid']}">{$post['iplogged']}</div>
    				<div id="profile_{$post['pid']}_popup" class="popup_menu" style="display: none;">
    					<div class="popup_item_container">
    						<table border="0" cellspacing="0" cellpadding="{$theme['tablespace']}" class="tborder">
    							<tr>
    								<td class="trow1" valign="top" align="center">
    									<div><strong>{$post['profilelink']}</strong></div>
    									<div class="smalltext">{$post['useravatar']}</div>
    									<div class="smalltext">{$post['usertitle']}</div>
    									<div class="smalltext">{$post['userstars']}</div>
    									<div class="smalltext">{$post['groupimage']}</div>
    									<div class="smalltext">{$post['user_details']}</div>
    								</td>
    							</tr>
    							<tr>
    								<td class="tcat" align="center">
    									{$post['button_email']}
    									{$post['button_pm']}
    									{$post['button_www']}
    									{$post['button_find']}
    									{$post['button_rep']}
    								</td>
    							</tr>
    						</table>
    					</div>
    				</div>
    				<div class="post_management_buttons float_right clear">
    					{$post['button_edit']}
    					{$post['button_quickdelete']}
    					{$post['button_quote']}
    					{$post['button_multiquote']}
    					{$post['button_report']}
    					{$post['button_warn']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>
    <script type="text/javascript">
    // <!--
    	if(use_xmlhttprequest == "1")
    	{
    		new PopupMenu("profile_{$post['pid']}");
    	}
    // -->
    </script>

  6. xtsug_postbit_first

    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
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}" width="100%">
    	<tbody>
    		<tr>
    			<td class="trow1 {$unapproved_shade}">
    				<div class="float_left smalltext">
    					Submitted by: <a href="{$post['profilelink_plain']}" id="profile_{$post['pid']}">{$post['username_formatted']}</a>, {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
    				</div>
    				{$post['posturl']}
    				<div class="post_body clear" id="pid_{$post['pid']}">{$post['message']}</div>
    				<div class="post_meta" id="post_meta_{$post['pid']}">{$post['iplogged']}</div>
    				<div id="profile_{$post['pid']}_popup" class="popup_menu" style="display: none;">
    					<div class="popup_item_container">
    						<table border="0" cellspacing="0" cellpadding="{$theme['tablespace']}" class="tborder">
    							<tr>
    								<td class="trow1" valign="top" align="center">
    									<div><strong>{$post['profilelink']}</strong></div>
    									<div class="smalltext">{$post['useravatar']}</div>
    									<div class="smalltext">{$post['usertitle']}</div>
    									<div class="smalltext">{$post['userstars']}</div>
    									<div class="smalltext">{$post['groupimage']}</div>
    									<div class="smalltext">{$post['user_details']}</div>
    								</td>
    							</tr>
    							<tr>
    								<td class="tcat" align="center">
    									{$post['button_email']}
    									{$post['button_pm']}
    									{$post['button_www']}
    									{$post['button_find']}
    									{$post['button_rep']}
    								</td>
    							</tr>
    						</table>
    					</div>
    				</div>
    				<div class="post_management_buttons float_right clear">
    					{$post['button_edit']}
    					{$post['button_quickdelete']}
    					{$post['button_quote']}
    					{$post['button_multiquote']}
    					{$post['button_report']}
    					{$post['button_warn']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>
    <script type="text/javascript">
    // <!--
    	if(use_xmlhttprequest == "1")
    	{
    		new PopupMenu("profile_{$post['pid']}");
    	}
    // -->
    </script>

  7. xtsug_postbit_first_posturl

    HTML Code
    <div style="float: right; width: auto; vertical-align: top">{$post['inlinecheck']}</div>

  8. xtsug_postbit_posturl

    HTML Code
    <div style="float: right; width: auto; vertical-align: top"><span class="smalltext"><strong><a href="{$post['postlink']}#pid{$post['pid']}">#{$postcounter}</a></strong>{$post['inlinecheck']}</span></div>

  9. xtsug_showthread

    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
    <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=1600"></script>
    </head>
    <body>
    {$header}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
    	<tr>
    		<td class="thead" colspan="2">
    			<div>
    				<strong>{$thread['subject']}</strong>
    			</div>
    		</td>
    	</tr>
    	<tr>
    		{$ratethread}
    		<td class="trow1">
    			{$first_post}
    		</td>
    	</tr>
    </table>
    <br class="clear" />
    <div class="largetext float_right clear">Comments</div>
    <div id="posts" class="clear">
    	{$posts}
    </div>
    <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_right" style="text-align: right;">
    	{$moderationoptions}
    	{$forumjump}
    </div>
    <br style="clear: both;" />
    {$usersbrowsing}
    <div class="smalltext" align="center">
    	{$forum['name']}<br />Powered By <a href="http://mybbhacks.zingaburga.com">XThreads</a> - <a href="http://mybbhacks.zingaburga.com">MyBB Hacks</a>
    </div>
    {$footer}
    </body>
    </html>

  10. xtsug_showthread_noreplies

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <table border="0" cellspacing="{$GLOBALS['theme']['borderwidth']}" cellpadding="{$GLOBALS['theme']['tablespace']}" id="xthreads_noreplies" class="tborder">
    	<tbody>
    		<tr>
    			<td class="trow1">
    				<div style="text-align: center;" class="post_body">There are no comments in this suggestion</div>
    			</td>
    		</tr>
    	</tbody>
    </table>

  11. xtsug_showthread_ratethread

    HTML Code
    <td align="center" class="trow1" valign="top">
    	<a href="ratethread.php?tid={$thread['tid']}&amp;rating=1&amp;my_post_key={$mybb->post_code}"><img src="images/rate.jpg" alt="Vote" title="Vote" /></a>
    	<div><strong>{$thread['numratings']}</strong> Votes</div>
    </td>



Additional Info:
  • For displaying the suggestion preview in threadlist, like the screenshot, we need to install the Thread Tooltip Preview plugin.
  • There are two optional images needed: images/rate.jpg and images/comment.jpg.
  • I don't have many idea, so, I just use a similar layout there. But it is depends on our themes though. So, just modify it as our needs.
  • The templates above based on MyBB 1.6 template.

Screenshots:
Threadlist - Showthread
       

Live Demo: http://www.14.mynie.co.cc/forumdisplay.php?fid=18

Please tell me if I do something wrong. I'm still learning Smile

Change Logs: 05 February 2011

(This post was last modified: 10-08-2012 02:30 AM by RateU.)
01-27-2011 05:50 AM
Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #2
RE: Suggestion Forum
Great job RateU. Just to let everyone know, you need to add the comment.jpg, and vote.jpg yourself.
I added mine to match my site.

http://fbfanatics.tk/showthread.php?tid=29

Forum Freebies
01-27-2011 07:49 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #3
RE: Suggestion Forum
(01-27-2011 07:49 AM)x-Treme Wrote:  Just to let everyone know, you need to add the comment.jpg, and vote.jpg yourself.

Forgot to say that Biggrin
Thanks Smile

You have a very nice theme there Smile

01-27-2011 08:03 AM
Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #4
RE: Suggestion Forum
Thank you.

Forum Freebies
01-27-2011 08:52 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #5
RE: Suggestion Forum
Ugh... Forgot (again) to say this Biggrin
If we want to display the suggestion preview in threadlist, like the screenshot, we need to install Thread Tooltip Preview plugin. The templates above already used the variable for displaying the preview.

01-27-2011 09:18 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Suggestion Forum
Thanks for the tutorial RateU!

My Blog
01-27-2011 10:32 AM
Find all posts by this user Quote this message in a reply
RocketFoot Offline
Senior Member
****
Posts: 338
Joined: Jul 2010
Post: #7
RE: Suggestion Forum
Yes, thanks RateU!  Another outstanding tutorial!

[Image: gallery_2_628_39582.jpg]
01-27-2011 11:14 AM
Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #8
RE: Suggestion Forum
Thank you RateU. Another great tutorial Smile

[Image: 468x602b.png]
01-27-2011 12:43 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: Suggestion Forum
Smashing stuff - thats really good Smile


[Image: leelink.gif]
MYBB1.6 & XThreads
01-27-2011 01:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #10
RE: Suggestion Forum
Update:
xtsug_forumdisplay_threadlist_rating template:

HTML Code
&nbsp;| <strong><a href="{$sorturl}&amp;sortby=numratings&amp;order=desc">Votes</a></strong>


02-05-2011 12:00 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: