Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 News Bar
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
News Bar
Requirement: XThreads
Latest Update: 30 October 2011

This is other simple example using XThreads Custom Thread Fields as plugin settings. Similar to displaying selected threads in portal. In this simple example, we will have a news bar contained selected threads. In this example, we will have more than one settings.

We need this settings for it:
  1. Listbox to select a thread to be displayed in news bar. With this setting, we can select each news/thread whether we want to display it on every page (Global), Index, Portal Forumdisplay or Showthread. So, we can have a different news for for different area. And have some news available for all pages.
    Create a custom thread fields with this setting:
    • Title: Display As News In
    • Key : xtnewsbar
    • Applicable Forums : select some forums
    • Input Field Type : Listbox
    • Field Input Height : 1
    • Values List :

      Code:
      Global
      Index
      Portal
      Forumdisplay

      Use file name (if the script name not given) in the Value List above for displaying a thread as newsbar for an additional page.
      For example:

      Code:
      Games

      If we have the above value inside our Value List, and there is a thread uses that value, then the thread will be displayed as newsbar on our Game Section page.

    • Editable by / Required Field? : Administrators.
      If we want to give this "power" to some usergroups like Super Moderator and Moderator, select Custom (specify usergroups), and select those usergroups in Editable by Usergroups setting.
    • Display Order : 20
      Modify it as our needs. Use a big number. So, it will be displayed at the very end of other custom thread fields applied in that forum. And because we use more than one setting, with this way we can make it "grouped".
    • We can use Settable Value Permissions setting to prevent some usergroups for displaying a thread as news to some area.
      For example:
      We have these values inside our Value List:

      Code:
      1
      2
      3
      4
      5
      6
      Global
      Index
      Portal
      Games
      Forumdisplay
      Showthread

      And we have these values inside our Settable Value Permissions setting:

      Code:
      Global{|}3,4
      Index{|}3,4
      Portal{|}3,4
      Games{|}3,4

      It means that only Administrators and Super Moderators have an ability to set a thread as news in the newsbar to be displayed on every page, index, portal and our games section (assuming that we set our Moderators can use this custom thread fields, it means that they can help us to set a thread as news in our newsbar for forumdisplay and showthread only).

  2. Listbox to select a CSS class for each news bar. With this setting, we can use a different style for each news. If we want to edit the newsbar style, edit the xtnewsbar.css stylesheet inside each theme's style to edit the bars style. Please remember, if we change or add a class name, we need to change or add it to our xtnewsbar.css stylesheet too.
    Create a custom thread fields with this setting:
    • Title: News CSS Class
    • Key : xtnewsbar_class
    • Applicable Forums : select the forum above
    • Input Field Type : Listbox
    • Field Input Height : 1
    • Values List :

      Code:
      xtnewsbar_blue
      xtnewsbar_yellow
      xtnewsbar_green
      xtnewsbar_red
      xtnewsbar_grey

    • Editable by / Required Field? : Administrators.
      Or make it the same as usergroups selected in setting 1.
    • Display Order : 21
      This will make this input field displayed bellow the setting 1.
    • We can use Settable Value Permissions setting to prevent some usergroups for using some styles.
  3. Textbox to add "prefix" for each news. Not filtered fields. This is only to put some text before the thread title. With this way, we can have different "prefix" for each news.
    Create a custom thread fields with this setting:
    • Title: News Prefix
    • Key : xtnewsbar_prefix
    • Applicable Forums : select the forum above
    • Input Field Type : Textbox
    • Editable by / Required Field? : Administrators.
      Or make it the same as usergroups selected in setting 1 and 2.
    • Display Order : 22
      This will make this input field displayed bellow the setting 2.


That is our settings Biggrin

Additional Info:
  • If we use Thread Tooltip Preview plugin, we will have a preview in tooltip, when hovering cursor to each bar.
  • Because there is an option to load the newsbar globally (every page), so our newsbar uses MyBB cache system.
    Use this URL to update the cache manually: xtnewsbar=1 (I don't know whether it is better or not if we use tasks system for this?).
    Only Admin and Moderators can update the cache.
    Example from index page:

    Code:
    index.php?xtnewsbar=1

  • If there is a thread comes from a forum that a user doesn't have permission to view it, then that bar won't be displayed for that user.


Logs: 26 November 2010

Screenshot:
   

Live Demo:
http://www.14.mynie.co.cc


Attached File(s)
.7z  xtnewsbar.7z (Size: 2.13 KB / Downloads: 648)

(This post was last modified: 11-02-2011 07:18 AM by RateU.)
09-26-2010 05:24 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
News Bar - RateU - 09-26-2010 05:24 AM
RE: News Bar - leefish - 09-26-2010, 08:07 AM
RE: News Bar - Imran - 09-26-2010, 01:59 PM
RE: News Bar - ZiNgA BuRgA - 09-26-2010, 05:14 PM
RE: News Bar - Firefox Wins - 09-26-2010, 05:52 PM
RE: News Bar - RateU - 09-27-2010, 07:12 AM
RE: News Bar - x-Treme - 11-09-2010, 12:54 PM
RE: News Bar - leefish - 11-09-2010, 03:26 PM
RE: News Bar - x-Treme - 11-09-2010, 09:00 PM
RE: News Bar - Jumper - 11-19-2010, 02:56 PM
RE: News Bar - RateU - 11-26-2010, 11:49 AM
RE: News Bar - Sama34 - 10-28-2011, 08:44 AM
RE: News Bar - RateU - 10-29-2011, 05:22 AM
RE: News Bar - Sama34 - 10-29-2011, 06:54 AM
RE: News Bar - RateU - 10-30-2011, 07:56 AM
RE: News Bar - Sama34 - 10-30-2011, 11:23 AM
RE: News Bar - RateU - 10-31-2011, 03:05 AM
RE: News Bar - Sama34 - 10-31-2011, 10:03 AM
RE: News Bar - RateU - 11-01-2011, 02:51 AM
RE: News Bar - Sama34 - 11-02-2011, 05:29 AM
RE: News Bar - RateU - 11-02-2011, 05:58 AM
RE: News Bar - Sama34 - 11-02-2011, 06:05 AM
RE: News Bar - RateU - 11-02-2011, 07:20 AM
RE: News Bar - Sama34 - 11-03-2011, 12:44 AM
RE: News Bar - RateU - 11-03-2011, 04:04 AM
RE: News Bar - Blinding - 11-11-2011, 10:16 AM
RE: News Bar - ZiNgA BuRgA - 11-11-2011, 10:21 AM
RE: News Bar - Blinding - 11-11-2011, 11:01 AM
RE: News Bar - Sama34 - 11-12-2011, 06:28 AM
RE: News Bar - adsol93 - 05-09-2015, 09:11 AM
RE: News Bar - XPMai - 06-14-2015, 01:50 AM

 Standard Tools
Forum Jump: