Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Closed Thread Reason
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Closed Thread Reason
Requirement: The latest XThreads Version (at least v1.32).

Now, XThreads has a fantastic conditional feature. Amazing. Really really amazing!

This is a simple example application that use that feature.

Adding a reason for closed thread.
    Create a custom thread fields with this settings:
  • Title: Closed Thread Reason
  • Key: ctr
  • Applicable Forums : Select forum that we want to appliy it
  • Input Field Type : Textbox
  • Editable by / Required Field?: Administrators
    Modify it as our needs. Basically, we should give this power to usergroups which has an ability to closed a thread.
    We can choose Custom (specify usergroups) from the list, then select those usergroup in the Editable by Usergroups list.
  • Blank Replacement Value :

    HTML Code
    <if $thread['closed'] == 1 then>
    <div class="smalltext"><strong>Closed Thread Reason:</strong></div>
    <div class="smalltext" style="color: red;"><em>Not specified</em></div>
    </if>

    Modify it as our needs. This layout will be displayed if the thread closed without any reason (the Closed Thread Reason textbox not filled).

  • Display Format  :

    HTML Code
    <if $thread['closed'] == 1 then>
    <div class="smalltext"><strong>Closed Thread Reason:</strong></div>
    <div class="smalltext" style="color: red;"><em>{VALUE}</em></div>
    </if>


Now, we need to put {$GLOBALS['threadfields']['ctr']} variable in our forumdisplay_thread template or template_prefix_forumdisplay_thread template if we use template prefix for the forum.

Find this code:

HTML Code
<div class="author smalltext">{$thread['profilelink']}</div>


Add this variable before the code above:

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


So, the code will be like this:

HTML Code
{$GLOBALS['threadfields']['tcr']}<div class="author smalltext">{$thread['profilelink']}</div>


Do that with search_results_threads_thread template too if we want the reason displayed in search result.

Screenshot:
Threadlist and search result
       

Live Demo:
http://mynie.6te.net/demo/forumdisplay.php?fid=33


09-23-2010 06:28 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Closed Thread Reason - RateU - 09-23-2010 06:28 AM
RE: Closed Thread Reason - Imran - 09-23-2010, 07:12 AM
RE: Closed Thread Reason - ZiNgA BuRgA - 09-23-2010, 08:38 AM
RE: Closed Thread Reason - FBI - 12-12-2010, 01:22 PM
RE: Closed Thread Reason - ZiNgA BuRgA - 12-12-2010, 01:59 PM
RE: Closed Thread Reason - Shukaku - 05-27-2011, 11:02 PM
RE: Closed Thread Reason - RateU - 05-28-2011, 02:28 AM
RE: Closed Thread Reason - Shukaku - 05-28-2011, 02:33 AM
RE: Closed Thread Reason - RateU - 05-28-2011, 02:55 AM
RE: Closed Thread Reason - Shukaku - 05-28-2011, 03:31 AM
RE: Closed Thread Reason - RateU - 05-28-2011, 03:35 AM
RE: Closed Thread Reason - Shukaku - 05-28-2011, 03:40 AM
RE: Closed Thread Reason - RateU - 05-28-2011, 03:45 AM
RE: Closed Thread Reason - Shukaku - 05-28-2011, 03:46 AM
RE: Closed Thread Reason - RateU - 05-28-2011, 03:53 AM
RE: Closed Thread Reason - Shukaku - 05-28-2011, 03:58 AM
RE: Closed Thread Reason - RateU - 05-28-2011, 04:05 AM
RE: Closed Thread Reason - bigvin - 03-30-2013, 05:48 AM
RE: Closed Thread Reason - RateU - 03-30-2013, 06:07 AM
RE: Closed Thread Reason - bigvin - 03-30-2013, 07:03 AM
RE: Closed Thread Reason - RateU - 03-31-2013, 12:51 AM
RE: Closed Thread Reason - Seabody - 03-31-2013, 06:03 PM
RE: Closed Thread Reason - RateU - 04-01-2013, 12:47 AM
RE: Closed Thread Reason - bigvin - 04-01-2013, 03:34 AM
RE: Closed Thread Reason - RateU - 04-01-2013, 03:51 AM
RE: Closed Thread Reason - bigvin - 04-01-2013, 04:47 AM

 Standard Tools
Forum Jump: