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: 681)

(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
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #2
RE: News Bar
This is looking very cool, I shall test it Smile


[Image: leelink.gif]
MYBB1.6 & XThreads
09-26-2010 08:07 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #3
RE: News Bar
RateU never ceases to put some magnificent ideas using Xthreads Smile This example enforces me to use Xthreads Smile

[Image: logo.png]

[Image: twitter.png]
09-26-2010 01:59 PM
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: #4
RE: News Bar
Nice!

My Blog
09-26-2010 05:14 PM
Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #5
RE: News Bar
Looks Great RateU + can be modified in many ways, thanks.
09-26-2010 05:52 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #6
RE: News Bar
Thanks. I'm still learning. Please tell me if I did something wrong Biggrin

09-27-2010 07:12 AM
Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #7
RE: News Bar
Possible bug maybe?
Seems that quick edit doesn't work in the forums that I use this in.

EDIT:
Very strange...quick reply works when using Chrome, but not when using Firefox. Maybe there's a code conflict within my theme.

Forum Freebies
(This post was last modified: 11-09-2010 12:59 PM by x-Treme.)
11-09-2010 12:54 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #8
RE: News Bar
Thats weird x-Treme - I did a quick test in one of my forums with the news bar options enabled - quick reply is working on Opera10 and Firefox3.6 on Win7.
By quick reply you just mean the standard quick reply in the thread view correct? Not another plugin?


[Image: leelink.gif]
MYBB1.6 & XThreads
11-09-2010 03:26 PM
Visit this user's website Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #9
RE: News Bar
I did the same thing with the same result as you. So I now know it isn't xthreads...it has to be something within the theme itself.
Whatever it is I'll find it.

Forum Freebies
11-09-2010 09:00 PM
Find all posts by this user Quote this message in a reply
Jumper Offline
Member
***
Posts: 75
Joined: Aug 2010
Post: #10
RE: News Bar
Thank you RateU Wink

i just build in the news bar, and it´s really great!
now my mods can use it too, to sticky important threads. great work Yes
11-19-2010 02:56 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: