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

Thread: Filter News Module by Thread Prefix

  1. #1
    Join Date
    Nov 2005
    Posts
    127

    Default Filter News Module by Thread Prefix

    Is it possible to have the news module filter the threads it retrives by thread prefix? IE, if I have the news module gather news from several catagories and I only want it to get the threads with an "official" prefix, is this possible?

  2. #2
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Filter News Module by Thread Prefix

    I'm assuming you're using vB 3.7 for your thread prefixes? If so, you should be able to look in your modules/news.php file for this line:
    PHP Code:
    WHERE thread.threadid IN(" . implode(',', $newstids) . "
    And replace with this:
    PHP Code:
    WHERE thread.threadid IN(" . implode(',', $newstids) . ") AND thread.prefixid 'X' 
    Replace the 'X' there with the "Prefix ID" from the prefix you're wanting to use and that should do the trick.

  3. #3
    Join Date
    Nov 2005
    Posts
    127

    Default Re: Filter News Module by Thread Prefix

    Damn Nice work.

  4. #4
    Join Date
    Jul 2008
    Posts
    4

    Default

    Hi.

    I've done it with url GET ( ?section=xxxxxx )

    Nice
    Last edited by PiTXI; 08-12-2008 at 12:06 PM.

  5. #5

    Default

    Quote Originally Posted by PiTXI View Post
    Hi.

    I've done it with url GET ( ?section=xxxxxx )

    Nice
    Can you explain how you have gotten that done?

  6. #6
    Join Date
    Mar 2007
    Posts
    5

    Default

    Hi,

    I can't get this to work correctly, only one thread is shown and the date is set to 0.

    I copy the news.php module and save as a new file called news2.php
    Then copy New Topics and selected to use news2.php.

    What am I doing wrong?
    Last edited by nfn; 12-18-2008 at 06:15 PM.

  7. #7

    Default

    What about for vb 3.8? Would it be the same fix? If I can do this I'll be able to delete 50+ forums on my site by merging with some others.

  8. #8

    Default

    Quote Originally Posted by lukem View Post
    What about for vb 3.8? Would it be the same fix? If I can do this I'll be able to delete 50+ forums on my site by merging with some others.
    I tested it out and yes, it works on vb 3.8 perfectly. This is a very cool feature, maybe you should add it to the options in a future release. Now I just made a decent amount of reorganization work for myself tonight.

  9. #9

    Default

    I'm not sure what is happening but it isn't pulling in ALL the forums with the prefix NEWS that's I've added. I noticed it didn't show any until I posted a few new ones with NEWS as the prefix. I checked my site this morning and it wasn't showing anything. So I added two threads with NEWS and they show up. I have the Cut-Off Date set to 0 so it should be pulling in all forums. Any ideas???

  10. #10

    Default

    As soon as I pull out AND thread.prefixid = 'NEWS' all the threads show up from the forums I have selected. I don't get it.

  11. #11

    Default

    Checked this morning and it is again listing no threads with the NEWS prefix this morning. It is like it is resetting each data yet I still have 0 in the cutoff. I've tried changing that to something like 120 but it still doesn't work.
    USA Carry - Open and Concealed Carry Information and Community

  12. #12

    Default

    Bump for any kind of response from support?
    USA Carry - Open and Concealed Carry Information and Community

  13. #13
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    Sorry, but I'm not sure what to tell you. There shouldn't be any reason it would not pull those threads unless you've modified something else.

  14. #14

    Default

    I haven't modified anything else because when I take the prefix code out it pulls in all the forums just fine. And it seems the user nfn had the same problem as me. I'd be willing to pay for someone to fix this if possible because I rearrange my forums based on this working.
    USA Carry - Open and Concealed Carry Information and Community

  15. #15

    Default

    bump looking for help
    USA Carry - Open and Concealed Carry Information and Community

  16. #16

    Default

    bump for some support on this
    USA Carry - Open and Concealed Carry Information and Community

  17. #17
    Join Date
    Apr 2009
    Posts
    2

    Question

    Quote Originally Posted by Brian View Post
    I'm assuming you're using vB 3.7 for your thread prefixes? If so, you should be able to look in your modules/news.php file for this line:
    PHP Code:
    WHERE thread.threadid IN(" . implode(',', $newstids) . "
    And replace with this:
    PHP Code:
    WHERE thread.threadid IN(" . implode(',', $newstids) . ") AND thread.prefixid 'X' 
    Replace the 'X' there with the "Prefix ID" from the prefix you're wanting to use and that should do the trick.
    I would like to do that with the module Recent Threads. Is it possible??

  18. #18
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    You should be able to do that by adding a new plugin to the 'vba_cmps_module_recthreads_start' hook location with the following code:
    Code:
    $vba_threads_condition .= " AND thread.prefixid = 'X'";
    Replace the 'X' there with the "Prefix ID" from the prefix you'd like to use.

  19. #19
    Join Date
    Apr 2009
    Posts
    2

    Default

    Thanks a lot!

    Works very good.

    All my respect to your work, great job

    greets from switzerland

  20. #20
    Join Date
    Feb 2008
    Posts
    296

    Default

    I have found the problem with this in not displaying the number of news items but unfortunately can not find the answer.

    Adding the thread.prefixid code does work however there are limitations. Say for example:
    1. You have created a prefix say "MyNews"
    2. You have set the records to display by date and descending - which you would normally do for news
    3. You have set "Maximum Number of Threads to Display" to 10
    4. Records 4, 8, 15 and 20 have the prefix of "MyNews"

    You will only see 2 records i.e. 4 and 8 in the display because even though all the other records don't have the prefix of "MyNews" they are still counted in the "Maximum Number of Threads to Display" setting of 10.

    This is a big problem as you can not control the actual number of news items to display and an even bigger problem if you are using the Pagination box.

    Any suggestions on an answer to this

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. Possibilities of filtering news by THREAD PREFIX
    By JohnBee in forum Module & Modification Discussion & Requests
    Replies: 0
    Last Post: 09-14-2007, 07:59 AM
  2. Thread title in news module
    By powerful_rogue in forum "How Do I..." Questions
    Replies: 1
    Last Post: 07-30-2007, 11:28 AM
  3. News Module thread length issue
    By sublimevb in forum "How Do I..." Questions
    Replies: 2
    Last Post: 08-19-2006, 07:45 AM
  4. News Module - Thread Title Question
    By blkatt in forum Troubleshooting / "How do I..." Questions
    Replies: 12
    Last Post: 09-20-2005, 07:58 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
  •