vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   New Posts - sorting first by forum then by date (https://vborg.vbsupport.ru/showthread.php?t=68615)

crepo 08-22-2004 05:05 PM

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

Abe1 08-22-2004 05:10 PM

Check this out: https://vborg.vbsupport.ru/showthread.php?t=68382

crepo 08-22-2004 05:20 PM

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

Abe1 08-22-2004 05:37 PM

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.

crepo 08-22-2004 06:23 PM

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

Abe1 08-22-2004 06:39 PM

Sorry. Can't sort by forum category.

CarCdr 08-22-2004 07:58 PM

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]
    ");


crepo 09-02-2004 09:27 PM

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! :mad:
Peter

benFF 10-20-2004 11:17 AM

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...

crepo 02-02-2005 01:48 PM

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


All times are GMT. The time now is 07:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01172 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete