Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2004, 05:05 PM
crepo crepo is offline
 
Join Date: Jun 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default New Posts - sorting first by forum then by date

After moving from Snitz to vBulletin we have a lot of questions by or visitors for one option.

If we use "active postings" (same result like New Posts) on Snitz the postings are sorted by forum and then on the time of last post.

In vBulletin al the new posts are sorted by time.

Is there a way that we can use to change the "New Post" that it first sorted the forum and then the time?

Thanks,
Peter
Reply With Quote
  #2  
Old 08-22-2004, 05:10 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check this out: https://vborg.vbsupport.ru/showthread.php?t=68382
Reply With Quote
  #3  
Old 08-22-2004, 05:20 PM
crepo crepo is offline
 
Join Date: Jun 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm... that's a way... but not exactly what i have in mind.

When you have on top (between calendar and search) the New Post I want this always sorted by forum, and then by time.

thx, for the link to the other posting.
peter
Reply With Quote
  #4  
Old 08-22-2004, 05:37 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Open search.php

find:
PHP Code:
        AND sticky IN (0,1)
        
ORDER BY lastpost DESC 

Replace with:
PHP Code:
        AND sticky IN (0,1)
        
ORDER BY title ASC 
I hope this helps.
Reply With Quote
  #5  
Old 08-22-2004, 06:23 PM
crepo crepo is offline
 
Join Date: Jun 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Abe1
I hope this helps.
Like this is what I want. But not sorted on title, but on forum.

But I don't find the forum in the table POST. )-:

p
Reply With Quote
  #6  
Old 08-22-2004, 06:39 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry. Can't sort by forum category.
Reply With Quote
  #7  
Old 08-22-2004, 07:58 PM
CarCdr CarCdr is offline
 
Join Date: Apr 2004
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

crepo,

Do you want only the "New Posts" link to:
a) sort threads
b) by forum title ascending and
c) then by last post time descending

or do you want the main listing (index.php) to sort this way as well?

If you want only "New Posts" to do it, you can just JOIN the forum table. This will slow down searches of course. Anyway, if you want *all* invocations of "New Posts" to work this way you can try this query (for 3.0.3, untested)...

Change the query on line 2133 to this:
Code:
     $threads = $DB_site->query("
          SELECT threadid
          FROM " . TABLE_PREFIX . "thread AS thread
          LEFT JOIN " . TABLE_PREFIX . "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread')
          LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (thread.forumid=forum.forumid)
          WHERE thread.forumid IN(" . implode(', ', $forumids) . ")
          AND thread.lastpost >= $datecut
          AND visible = 1
          AND delthread.primaryid IS NULL
          AND sticky IN (0,1)
          ORDER BY forum.title ASC, thread.lastpost DESC
          LIMIT $vboptions[maxresults]
     ");
Reply With Quote
  #8  
Old 09-02-2004, 09:27 PM
crepo crepo is offline
 
Join Date: Jun 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello CarCdr,

You are a 'god' for a lot of or visitors. :nervous:

This was exactly what i want. I have it now more than in week in production on http://forum.belgiumdigital.com (sorry, dutch only). And I don't see extra load on or machine (dedicated server, dual Xeon 2.8Ghz, 2Gb ram, SCSI disks).

Thanks for you code!
Peter
Reply With Quote
  #9  
Old 10-20-2004, 11:17 AM
benFF benFF is offline
 
Join Date: Jul 2004
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats CarCdr, this is fantastic, however would there be a way to order them by their display order? I've tried, but due to categories and subcategories being in the same table, just doing an Order By displayorder returns some very odd results!

I have you see a forum called 'Latest News' which I would always want at the top, but due to it starting with the letter L, this won't happen...
Reply With Quote
  #10  
Old 02-02-2005, 01:48 PM
crepo crepo is offline
 
Join Date: Jun 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We are using since some months the solution of CarCdr with work fine.

But now we have added a lot of new forums. And the sorting on forumname is not so nice. Therefore we want to sort the result on forum Display Order.

Is that possible?

Thanks for helping us.

peter
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05215 seconds
  • Memory Usage 2,254KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete