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
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #2
RE: Closed Thread Reason
Magnificent, really magnificent. I was actually going to make such plugin (Not using XThreads), you did it first Smile

[Image: logo.png]

[Image: twitter.png]
09-23-2010 07:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #3
RE: Closed Thread Reason
Interesting use, thanks for the tip!

My Blog
09-23-2010 08:38 AM
Find all posts by this user Quote this message in a reply
FBI Offline
Junior Member
**
Posts: 19
Joined: Apr 2010
Post: #4
RE: Closed Thread Reason
Just installed, nice Smile
Where is the field should be edit for entering and typing "the reason"?

Brand New Portal from MyBB Indonesia  to get local Bahasa (language) support.
My Unique Plugin here Smile
12-12-2010 01:22 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: Closed Thread Reason
It'll show up when you (full) edit the first post.

My Blog
12-12-2010 01:59 PM
Find all posts by this user Quote this message in a reply
Shukaku Offline
Junior Member
**
Posts: 7
Joined: May 2011
Post: #6
RE: Closed Thread Reason
Hi

I just installed xThreads and have added in the stuff for the Closed Thread reason. Is it possible to add the content into a table so it can be noticed (eg, using the theme table background etc)?
05-27-2011 11:02 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #7
RE: Closed Thread Reason
You can put the Closed Thread Reason in your forumdisplay_thread and/or your showthread/postbit/postbit_first template. You can style it as you want (depends on how the layout you want).

Basically, the Closed Thread Reason will be "called" by this variable in your template:

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


You can style it directly from your template, or via the Display Format (again, depends on how the layout you want).

Not quite sure where and how exactly you want it to be displayed?


05-28-2011 02:28 AM
Find all posts by this user Quote this message in a reply
Shukaku Offline
Junior Member
**
Posts: 7
Joined: May 2011
Post: #8
RE: Closed Thread Reason
I mean, putting that variable inside table tags and displaying it inside a table.
05-28-2011 02:33 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #9
RE: Closed Thread Reason
Like I said before, you can style it directly in your template or in the Display Format.
If you want to style it directly in your template, put the variable inside your table tags.
If you want to style it in the Display Format, put the {VALUE} inside the table tags.

05-28-2011 02:55 AM
Find all posts by this user Quote this message in a reply
Shukaku Offline
Junior Member
**
Posts: 7
Joined: May 2011
Post: #10
RE: Closed Thread Reason
I did that, but it doesn't appear in a table. Erf
(This post was last modified: 05-28-2011 03:31 AM by Shukaku.)
05-28-2011 03:31 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: