Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using XThreads Custom Thread Fields For Plugin Settings
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Using XThreads Custom Thread Fields For Plugin Settings
Requirement: XThreads
Last Update: 18 October 2011

I have an idea using XThreads custom thread fields as plugin settings. This is a simple example plugin that uses XThreads as its setting (attached).

This plugin will display thread title and its preview form selected thread. We need Thread Tooltip Preview plugin to display the preview, and put this variable in portal template:

Code:
{$xtdispportal_threads}


Create a custom thread fields with this setting:

  • Title: Display To Portal?
  • Key: xtdispportal
  • Applicable Forums: select some forums
  • Input Field Type: Listbox
  • Field Input Height: 1
  • Values List :

    Code:
    Yes

  • Editable by / Required Field? : Administrators
  • Allow Filtering: Yes

That is our plugin setting. Basically, we need a setting that we can choose Yes in a thread that want be displayed in portal. We can set it when creating a new thread or editing an existing threads.

Because this is not a required fields, we will get two option in new thread or edit post page:

Code:
(Not set)
Yes


The (Not set) is the "default value". So, when a regular user create a new thread or edit their thread, this value will be set automatically. Of course they can't change the setting because we already set this custom thread fields permission to Administrators only. And we can give the "power" to some user group like Super Moderator or Moderator to be able to set a thread to be displayed in portal, if there is a good thread from member to display (by editing the thread, select Yes in the setting).

Optional Setting
Do this only if we are allowing Moderators to set a thread to be displayed in portal.

Create Moderator Tools:
Admin CP -> Configuration -> Moderator Tools -> Add New Thread Tool

  • Name: Display In Portal
  • Name: Display this thread in portal
  • Available in forums: Select in which forum we apply the xtdispportal custom thread field. Related to Applicable Forums setting of the custom thread field.
  • Modify Custom Thread Field(s):
    • Field: xtdispportal
    • Value: Yes

    Code:
    xtdispportal=Yes

With this custom Moderator Tools, we can set a thread to be displayed in portal directly without needed to full edit the thread.

Of course this is for example only. We need to create different settings depends on what settings needed for our plugin.

Update Logs: 19 March 2011


Attached File(s)
.7z  xtdispportal.7z (Size: 2.09 KB / Downloads: 762)

(This post was last modified: 10-18-2011 05:56 AM by RateU.)
09-20-2010 06:12 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Using XThreads Custom Thread Fields For Plugin Settings - RateU - 09-20-2010 06:12 AM

 Standard Tools
Forum Jump: