vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   List threads alphabetically for only 1 forum? (https://vborg.vbsupport.ru/showthread.php?t=60985)

Boofo 01-31-2004 12:13 AM

List threads alphabetically for only 1 forum?
 
Is there a way that I can list the threads from a certain forum alphabetically, but only for that forum?

g-force2k2 01-31-2004 06:24 AM

Boofo,

You can try this code, but I did not test it.

Open forumdisplay.php

Find:

PHP Code:

        default:
            
$sqlsortfield 'lastpost';
            
$sortfield 'lastpost'

Relace With:

PHP Code:

        default:
            if ( 
$foruminfo['forumid'] == $yourforumid ) :
                
$sqlsortfield 'thread.title' ;
            else :
                
$sqlsortfield 'lastpost' ;
                
$sortfield 'lastpost' ;
            endif ; 

replace the variable $yourforumid with forumid of the forum that you want to display it as the default. Hope this helps.

Cheers,
g-force2k2

Boofo 01-31-2004 07:43 AM

That did the trick. Thank you, sir. ;)

One last thing, is there a way to reverse the sort order? It goes from the largest to the smallest number now. I would like it to go from the smallest to the largest. Do you know what I mean? ;)

Dean C 01-31-2004 11:45 AM

An even easier way is to make the forum into a link. Then in the url have:

http://www.yoursite.com/forum/forumdisplay.php?f=xx&daysprune=30&order=asc&sort=title

Boofo 01-31-2004 11:54 AM

Quote:

Originally Posted by Mist
An even easier way is to make the forum into a link. Then in the url have:

http://www.yoursite.com/forum/forumdisplay.php?f=xx&daysprune=30&order=asc&sort=title

But that wouldn't catch it for searches and new posts, would it?

Dean C 01-31-2004 12:06 PM

Yes but not in default alphabetical order.

Boofo 01-31-2004 12:14 PM

I need to have it that way anywhere you get to it from the board. ;)

Edit: I got it. I just replaced:

PHP Code:

 // look at sorting options:
if ($sortorder != 'asc')


with:

PHP Code:

 // look at sorting options:
if ($sortorder != 'asc' AND $foruminfo['forumid'] != '37')


and that took care of it. ;)

g-force2k2, I changed the code that you suggested to this:

PHP Code:

         default:
            if ( 
$foruminfo['forumid'] == '37' ):
                
$sqlsortfield 'thread.title';
                
$sortfield 'thread.title';
            else:
                
$sqlsortfield 'lastpost';
                
$sortfield 'lastpost';
            endif; 

That will be ok, right? ;)

vprp 08-30-2005 09:16 AM

Boofo, I did those template edits to my forumdisplay.php. It works for 2 sub-forums but it doesn't work for 5. Let's say I have 5 sub-forums (ids = 19, 20, 26, 27, 28) that I want sorted alphabetically, how would I code that?

Boofo 08-30-2005 12:44 PM

Quote:

Originally Posted by vprp
Boofo, I did those template edits to my forumdisplay.php. It works for 2 sub-forums but it doesn't work for 5. Let's say I have 5 sub-forums (ids = 19, 20, 26, 27, 28) that I want sorted alphabetically, how would I code that?

What version of vb are you wanting to do this with?

vprp 08-30-2005 07:10 PM

Quote:

Originally Posted by Boofo
What version of vb are you wanting to do this with?

I am using vB 3.0.3.

Andreas 08-30-2005 07:50 PM

naxialys made a Hack for 3.0 which lets you specify default sort Order for each Forum via AdminCP.

Talisman 08-30-2005 11:52 PM

That sounds like a nice option to have. But what kind of forum would it be that you'd want the posts to be shown in alphabetical order?

:bunny:

vprp 08-31-2005 06:51 AM

Found it. Thank you for pointing me to the hack. Here's an example of a forum I want sorted alphabetically:

Driver Reviews


All times are GMT. The time now is 03:11 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.01297 seconds
  • Memory Usage 1,747KB
  • 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
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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