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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-31-2004, 12:13 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 01-31-2004, 06:24 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 01-31-2004, 07:43 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 01-31-2004, 11:45 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 01-31-2004, 11:54 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 01-31-2004, 12:06 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes but not in default alphabetical order.
Reply With Quote
  #7  
Old 01-31-2004, 12:14 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 08-30-2005, 09:16 AM
vprp vprp is offline
 
Join Date: May 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 08-30-2005, 12:44 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #10  
Old 08-30-2005, 07:10 PM
vprp vprp is offline
 
Join Date: May 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
What version of vb are you wanting to do this with?
I am using vB 3.0.3.
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 02:44 PM.


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.04280 seconds
  • Memory Usage 2,268KB
  • Queries Executed 11 (?)
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
  • (5)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete