Page 1 of 2 12 LastLast
Results 1 to 20 of 33

Thread: Mark Thread As News

  1. #1

    Default Mark Thread As News

    I tried a search but only found a thread from a few years ago that won't work anymore. Basically what I'd like to do is allow certain usergroups to mark their thread as News, and then it automatically be added to the list of threads shown by the News module.

    I mean, I can always add it in using the Show Threads thing in the AdminCP but it would be a million times easier to be able to mark it "News" upon posting the thread.

    I'd have a News forum but I want to keep each band's specific news in their own forum. Because of this, users might post threads that I would want to then change into a news post, so probably being able to mark it as News after-the-fact is ideal.

    Is there a mod out there that can do this, is it easy hacking, or is it way more complicated and involved than that?

  2. #2

    Default Re: Mark Thread As News

    Anyone?

  3. #3
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Mark Thread As News

    there is a brillant hack somewhere which uses the icon as a toggle. First you add an icon and set group permissions (so only those authorized can see it) and remember its icon ID. When you post the news or edit a thread, you can select that icon if you want that thread to display in your main news.

    Now in the news module you need to change the query which look for news from whatever it is and substitute the clause with icon number XX

    It's in the forums somewhere. Like you said it could be old and some adjustments might be needed. here is mine, just replace the XX

    $getnewsids = $db->query_read("
    SELECT $ratingsql threadid, firstpostid FROM " . TABLE_PREFIX . "thread AS thread
    WHERE visible = 1
    AND open != 10
    AND thread.iconid = 'XX'
    " . iif($mod_options['portal_news_cutoffdate'], 'AND thread.dateline > ' . (TIMENOW - ($mod_options['portal_news_cutoffdate'] * 86400))) . "
    ORDER BY " . iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline', 'dateline', $mod_options['portal_news_orderby']) . " $mod_options[portal_news_direction]
    $newslimit
    ");
    With that, any thread in any forums can be news, as long as you had selected the news icon
    Last edited by Lionel; 08-12-2007 at 08:50 PM.

  4. #4

    Default Re: Mark Thread As News

    As per this thread ..

    http://www.vbadvanced.com/forum/showthread.php?t=12669

    The coding in vBa has changed a little bit in version 3 however ..

    You need to look for the following text within news.php

    PHP Code:
    AND thread.forumid IN(" . implode(',', $mods['inforums']) . "
    and REPLACE with ..

    PHP Code:
    AND iconid 
    Changing the X to the id number of the icon you want to use as your news thread indicator.

    I believe that will work, although I've not tried it myself as I've not upgraded to 3.0 yet. Let us know how you get on

  5. #5
    Join Date
    Nov 2005
    Posts
    100

    Default Re: Mark Thread As News

    Great! anyone have tried it?

  6. #6
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Mark Thread As News

    I have been using this for years

  7. #7
    Join Date
    Nov 2005
    Posts
    100

    Default Re: Mark Thread As News

    Lionel can u explain what we have to replace with the code that u have posted?

    Thanks

  8. #8
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Mark Thread As News

    In the news.php module there are similar code. Look for $getnewsids and replace that block

  9. #9
    Join Date
    Nov 2005
    Posts
    100

    Default Re: Mark Thread As News

    Quote Originally Posted by Lionel View Post
    In the news.php module there are similar code. Look for $getnewsids and replace that block

    great!
    thanks

  10. #10
    Join Date
    Jul 2007
    Posts
    4

    Default Re: Mark Thread As News

    guys, this thing needs to work, its really great!

    its working, but not completely.

    If the thread is created and not marked with the NEWS icon, and then modified to add the NEWS icon, it doesn't show up.

    If the thread has been created as a NEWS, everything is working. If you try to remove the NEWS icon to mark it as "normal" thread, it stays on the NEWS forum anyway.

    So it seems that the ICON variable is not changing if the thread is modified.

    anybody have a clue what to do?

    thank you

  11. #11
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Mark Thread As News

    Make sure that you use the thread tools to edit thread and not the edit link which edits post

  12. #12
    Join Date
    Jun 2007
    Posts
    516

    Default Re: Mark Thread As News

    Would it be simpler to designate a forum as "news" and then set the CMPS to always post threads from there?

    Basically, whatever is posted in the forum, ends up on the page.

  13. #13
    Join Date
    Jul 2007
    Posts
    4

    Default Re: Mark Thread As News

    wow, Lionel, that was fast thank you!

    working A1!

    so here's the code for people who wants to do this again

    $getnewsids = $db->query_read("
    SELECT $ratingsql threadid, firstpostid FROM " . TABLE_PREFIX . "thread AS thread
    WHERE visible = 1 AND open != 10 AND iconid = 15
    thanks again!

  14. #14
    Join Date
    Aug 2006
    Posts
    2

    Default Re: Mark Thread As News

    I wouldn't replace the forum with the icon part.

    Instead id do it more like

    AND ((thread.forumid IN(" . implode(',', $mods['inforums']) . ")) OR (iconid = X))


    Replacing it breaks the base functionality. This way lets you have a "news" forum as well as letting you have custom threads.

    Where I admin we have a news forum, but this way lets us pick specific threads from our main forums for front page "article" selections (we use news more as articles, and recent threads as news since they are RSS feeds)

    Oh, and please, don't just copy and paste the code I wrote. That was just off the top of my head for an example.
    Last edited by liquidrage; 08-26-2007 at 01:10 AM.

  15. #15
    Join Date
    Feb 2006
    Posts
    5

    Default Re: Mark Thread As News

    this works great to me, but is there also a way to select a single posting in a thread to be displayed on the news ? because there might be single postings in a thread that should also be displayed on the news. is there any way for this ?

  16. #16
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Mark Thread As News

    Currently this is selecting from TABLE_PREFIX . "thread. You would need to do a different module and select from posts
    Real useful and Cool vBulletin addons

  17. #17
    Join Date
    Feb 2006
    Posts
    5

    Default Re: Mark Thread As News

    is there any idea how this might be done ?

  18. #18
    Join Date
    Feb 2006
    Posts
    5

    Default Re: Mark Thread As News

    anyone an idea ?

  19. #19
    Join Date
    Feb 2004
    Location
    Austin, Texas
    Posts
    185

    Default Re: Mark Thread As News

    I would suggest in that case to split the post into its own thread, if it is important enough to be news and all.
    My new vB CMPS coming soon

    I'm back!

  20. #20

    Default Re: Mark Thread As News

    Has anyone tried this approach with vb3.7?

    Because tampering the code as suggested here, produced a database error in my vbadvanced page.

    Any ideas?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mark a thread as new
    By s0b in forum "How Do I..." Questions
    Replies: 3
    Last Post: 06-12-2007, 12:01 PM
  2. Mark / Unmark thread as news.
    By KieuTuan in forum Modifications (version 3.x & 2.x)
    Replies: 9
    Last Post: 03-11-2007, 04:29 PM
  3. Another way to mark news
    By s0b in forum "How Do I..." Questions
    Replies: 1
    Last Post: 01-05-2007, 01:28 PM
  4. Mark Thread as News
    By Blue Moose Aaron in forum Add-On Modules & Modifications
    Replies: 142
    Last Post: 06-13-2006, 01:53 AM
  5. Get the "Mark Thread As News" hack working on v2.x
    By CheapyD in forum Feedback & Suggestions
    Replies: 0
    Last Post: 03-15-2006, 09:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •