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

This idea based on Thread Description. But we will use it as a very simple Testimonials Forum

Here is a simple example to do that:

Multiline Textbox for testimonial message (the only custom thread fields in this sample).
Create a Custom Thread Fields with this settings:
  1. Title: Your Testimonial
  2. Key: xttes_tes
  3. Applicable Forums: 'select a forum where we will apply this modification'
  4. Input Field Type: Multiline Textbox
  5. Editable by / Required Field?: Everyone (required)
  6. Display Parsing: Plain text with newlines
    Modify it as our needs. Example: if we want users can use BBCode, select Use MyBB Parser (MyCode), and tick some options in MyBB Parser Options setting.
  7. Display Format:

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    <if THIS_SCRIPT == 'forumdisplay.php' then>
    <if $thread['replies'] > 0 then>
    <div class="post_body">{VALUE}</div>
    <div class="float_right smalltext">
    <a href="{$threadurl}">Read Comments</a> |
    <a href="newreply.php?tid={$thread['tid']}">Post Comment</a>
    </div>
    <else>
    <div class="post_body">{VALUE}</div>
    <div class="float_right smalltext">
    <a href="newreply.php?tid={$thread['tid']}">Post Comment</a>
    </div>
    </if>
    <else>
    {VALUE}
    </if>

    For displaying this field value, we need to put {$GLOBALS['threadfields']['xttes_tes']} variable in our template.



XThreads Options in Forum settings (the forum in the settings above):
  • Template Prefix: xttes_
  • Show first post on every showthread page: Yes
  • Settings Overrides:
    • Setting: Showthread Options -> Post Layout
      Value: horizontal

      Code:
      postlayout=horizontal

  • Allow Blank Post Message: Yes
  • Hide Forum: Yes
    We need to put this forum URL manually in our template.
  • Custom WOL Text:
    • Forum Display: Viewing Testimonials
    • New Thread: Create A New Testimonial
    • New Reply: Commenting <a href="{1}">{2}</a> Testimonial
    • Show Thread: Reading <a href="{1}">{2}</a> Testimonial

Create new templates in Global Template:
  1. Template Name: xttes_editpost_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
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
    </head>
    <body>
    {$header}
    {$preview}
    {$post_errors}
    {$attacherror}
    <form action="editpost.php?pid={$pid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
    	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
    	<div style="width: 600px; margin: auto auto;">
    		<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    			<tr>
    				<td class="thead" colspan="2"><strong>Edit Testimonial</strong></td>
    			</tr>
    			<tr>
    				<td class="trow2"><strong>Subject</strong></td>
    				<td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
    			</tr>
    			{$extra_threadfields}
    			<tr style="display: none;">
    				<td class="trow2" valign="top"><strong>{$lang->your_message}:</strong></td>
    				<td class="trow2">
    				<textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
    				</td>
    			</tr>
    		</table>
    		<br />
    		<div align="center"><input type="submit" class="button" name="submit" value="{$lang->update_post}" tabindex="3" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
    		<input type="hidden" name="action" value="do_editpost" />
    		<input type="hidden" name="posthash" value="{$posthash}" />
    		<input type="hidden" name="attachmentaid" value="" />
    		<input type="hidden" name="attachmentact" value="" />
    	</div>
    </form>
    <br />
    <form action="editpost.php" method="post" name="editpost">
    <input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" colspan="3"><strong>{$lang->delete_post}</strong></td>
    </tr>
    <tr>
    <td class="trow1" style="white-space: nowrap"><input type="checkbox" class="checkbox" name="delete" value="1" tabindex="9" /> <strong>{$lang->delete_q}</strong></td>
    <td class="trow1" width="100%">{$lang->delete_1}<br /><span class="smalltext">{$lang->delete_2}</span></td>
    <td class="trow1"><input type="submit" class="button" name="submit" value="{$lang->delete_now}" tabindex="10" /></td>
    </tr>
    </table>
    <input type="hidden" name="action" value="deletepost" />
    <input type="hidden" name="pid" value="{$pid}" />
    </form>
    {$footer}
    </body>
    </html>

  2. Template Name: xttes_forumdisplay_nothreads

    HTML Code
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td colspan="{$colspan}" class="trow1" align="center"><strong><em>There is no testimonial</em></strong></td>
    </tr>
    </table>

  3. Template Name: xttes_forumdisplay_sticky_sep

    HTML Code
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="trow_sep" colspan="{$colspan}" align="center">Important Testimonials</td>
    </tr>
    </table>

  4. Template Name: xttes_forumdisplay_thread

    HTML Code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <br />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    	<tr>
    		<td class="{$bgcolor}" width="100%">
    			<div>
    				<span><strong><a href="{$thread['threadlink']}" class="{$inline_edit_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a></strong></span>
    				<div class="author smalltext">by: {$thread['profilelink']}</div>
    			</div>
    			{$GLOBALS['threadfields']['xttes_tes']}
    		</td>
    		{$modbit}
    	</tr>
    </table>

  5. Template Name: xttes_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
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    	<tr>
    		<td class="thead" align="center">
    			<div>
    				<strong><a href="{$forumurl}">{$foruminfo['name']}</a></strong>
    			</div>
    		</td>
    		{$inlinemodcol}
    	</tr>
    	<tr>
    		<td class="trow1" colspan="2">
    			{$threads}{$nullthreads}
    		</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_right" style="text-align: right;">
    	{$inlinemod}
    	{$forumjump}
    </div>
    <br style="clear: both" />
    {$inline_edit_js}
    <div class="smalltext clear" align="center">
    Testimonials<br />
    Powered By <a href="http://mybbhacks.zingaburga.com">XThreads</a> - <a href="http://mybbhacks.zingaburga.com">MyBB Hacks</a>
    </div>

  6. Template Name: xttes_forumdisplay_threads_sep

    HTML Code
    1
    2
    3
    4
    5
    6
    <br />
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="trow_sep" colspan="{$colspan}" align="center">Normal Testimonials</td>
    </tr>
    </table>

  7. Template Name: xttes_newthread

    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
    <html>
    <head>
    <title>{$lang->newthread_in}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
    </head>
    <body>
    {$header}
    {$preview}
    {$thread_errors}
    {$attacherror}
    <form action="newthread.php?fid={$fid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
    	<div style="width: 600px; margin: auto auto;">
    		<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
    		<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    			<tr>
    				<td class="thead" colspan="2"><strong>Your Testimonial</strong></td>
    			</tr>
    			<tr>
    				<td class="trow2" width="20%">
    					<strong>Subject</strong>
    				</td>
    				<td class="trow2">
    					<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" />
    				</td>
    			</tr>
    			{$extra_threadfields}
    			<tr style="display: none;">
    				<td class="trow2" valign="top">
    					<strong>{$lang->your_message}</strong>
    				</td>
    				<td class="trow2">
    					<textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>
    				</td>
    			</tr>
    			{$captcha}
    		</table>
    		<br />
    		<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="5" /></div>
    		<input type="hidden" name="action" value="do_newthread" />
    		<input type="hidden" name="posthash" value="{$posthash}" />
    		<input type="hidden" name="attachmentaid" value="" />
    		<input type="hidden" name="attachmentact" value="" />
    		<input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
    		<input type="hidden" name="tid" value="{$tid}" />
    		{$editdraftpid}
    	</div>
    </form>
    {$forumrules}
    {$footer}
    </body>
    </html>

  8. Template Name: xttes_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
    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="trow2 post_content {$unapproved_shade}">
    				{$post['posturl']}
    				<br class="clear" />
    				<div class="post_body" id="pid_{$post['pid']}">
    					{$post['message']}
    				</div>
    				<br class="clear" />
    				<div class="float_right">
    					<span class="smalltext">
    						<em>Commented by:
    						<a href="{$post['profilelink_plain']}" id="profile_{$post['pid']}">{$post['username_formatted']}</a>
    						</em>
    					</span>
    					<div id="profile_{$post['pid']}_popup" class="trow1" style="display: none;width: 350px;">
    						<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    							<tr>
    								<td class="tcat" align="center" colspan="2">
    									<span class="largetext"><strong>User Info</strong></span>
    								</td>
    							</tr>
    							<tr>
    								<td class="post_avatar trow1" width="1" style="{$post['avatar_padding']}">
    									{$post['useravatar']}
    								</td>
    								<td class="post_author trow1">
    									<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    									<span class="smalltext">
    										{$post['usertitle']}<br />
    										{$post['userstars']}
    										{$post['groupimage']}
    									</span>
    								</td>
    							</tr>
    						</table>
    					</div>
    				</div>
    				<div class="post_management_buttons float_left">
    					{$post['button_edit']}{$post['button_quickdelete']}{$post['button_report']}{$post['button_warn']}
    				</div>
    				<div class="post_meta clear" id="post_meta_{$post['pid']}">
    					{$post['iplogged']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>
    <script type="text/javascript">
    // <!--
    	if(use_xmlhttprequest == "1")
    	{
    		new PopupMenu("profile_{$post['pid']}");
    	}
    // -->
    </script>

  9. Template Name: xttes_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
    58
    59
    60
    61
    62
    63
    {$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 tc largetext">
    				<div>{$post['subject']}</div>
    			</td>
    		</tr>
    		<tr>
    			<td class="trow2 post_content {$unapproved_shade}">
    				<div class="post_body" id="pid_{$post['pid']}">
    					{$GLOBALS['threadfields']['xttes_tes']}
    					{$post['message']}
    				</div>
    				<br class="clear" />
    				<div class="float_right">
    					<span class="smalltext">
    						<em>Submitted by:
    						<a href="{$post['profilelink_plain']}" id="profile_{$post['pid']}">{$post['username_formatted']}</a>
    						</em>
    					</span>
    					<div id="profile_{$post['pid']}_popup" class="trow1" style="display: none;width: 350px;">
    						<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    							<tr>
    								<td class="tcat" align="center" colspan="2">
    									<span class="largetext"><strong>Submitter Info</strong></span>
    								</td>
    							</tr>
    							<tr>
    								<td class="post_avatar trow1" width="1" style="{$post['avatar_padding']}">
    									{$post['useravatar']}
    								</td>
    								<td class="post_author trow1">
    									<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    									<span class="smalltext">
    										{$post['usertitle']}<br />
    										{$post['userstars']}
    										{$post['groupimage']}
    									</span>
    								</td>
    							</tr>
    						</table>
    					</div>
    				</div>
    				<div class="post_management_buttons float_left">
    					{$post['button_edit']}{$post['button_quickdelete']}{$post['button_report']}{$post['button_warn']}
    				</div>
    				<div class="post_meta clear" id="post_meta_{$post['pid']}">
    					{$post['iplogged']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>
    <script type="text/javascript">
    // <!--
    	if(use_xmlhttprequest == "1")
    	{
    		new PopupMenu("profile_{$post['pid']}");
    	}
    // -->
    </script>

  10. Template Name: xttes_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
    <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}
    <div>
    	{$first_post}
    </div>
    <br />
    <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>
    <br />
    <div id="posts">
    	{$posts}
    </div>
    <br />
    <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>
    <div class="smalltext clear" align="center">
    Testimonials<br />
    Powered By <a href="http://mybbhacks.zingaburga.com">XThreads</a> - <a href="http://mybbhacks.zingaburga.com">MyBB Hacks</a>
    </div>
    {$footer}
    </body>
    </html>


That is the very simple example Testimonials Forum. We can still expand it, like adding Product List, so users can select whether the testimonial is for general testimonial or a testimonial specified for the selected product. We can add other fields like "rate" based on some specified things, like quality, support, and etc. So, users can "rate" our site or product based on those specified things.
The template above based on MyBB 1.4

Screenshots:

1. Testimonial "Index":
   

2. Thread:
   

3. Newthread/editpost:
   

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

(This post was last modified: 10-13-2012 01:18 AM by RateU.)
11-12-2010 06:24 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Testimonials Forum - RateU - 11-12-2010 06:24 AM
RE: Testimonials Forum - ZiNgA BuRgA - 11-12-2010, 01:36 PM
RE: Testimonials Forum - x-Treme - 11-12-2010, 01:57 PM
RE: Testimonials Forum - Imran - 11-12-2010, 11:34 PM
RE: Testimonials Forum - Firefox Wins - 11-17-2010, 06:09 PM
RE: Testimonials Forum - terzier - 04-08-2012, 06:55 PM
RE: Testimonials Forum - RateU - 10-08-2012, 02:26 AM
RE: Testimonials Forum - bekti - 10-11-2012, 01:45 AM
RE: Testimonials Forum - RateU - 10-13-2012, 01:19 AM
RE: Testimonials Forum - WINBOY - 11-20-2012, 06:33 AM

 Standard Tools
Forum Jump: