MyBB Hacks

Full Version: News Bar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
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:
      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:
[attachment=213]

Live Demo:
http://www.14.mynie.co.cc
This is looking very cool, I shall test it Smile
RateU never ceases to put some magnificent ideas using Xthreads Smile This example enforces me to use Xthreads Smile
Nice!
Looks Great RateU + can be modified in many ways, thanks.
Thanks. I'm still learning. Please tell me if I did something wrong Biggrin
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.
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?
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.
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
Pages: 1 2 3 4
Reference URL's