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-19-2005, 01:00 AM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Alpha sort by thread title of one forum

I would like to be able to have just one forum be alpha sorted by the thread name as opposed to the deafult last post time.

A plug in for this would be great. Thank you
Reply With Quote
  #2  
Old 08-19-2005, 01:21 AM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Andy-

Try this:

Find the forumbit template that calls the forum on your forumhome (this will vary depending on your forum hierarchy).

In that template, Find:
Code:
			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
				<strong>$forum[title]</strong>
			</a>
Change it to:
Code:
			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]<if condition="$forum[forumid] = ##">&order=asc&sort=title</if>">
				<strong>$forum[title]</strong>
			</a>
Replace the ## in the above code with the ID number of the forum you want to affect.


This should cause that forum to be displayed in ascii order by title.

--don
Reply With Quote
  #3  
Old 08-19-2005, 01:51 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alternatively you could use https://vborg.vbsupport.ru/showthread.php?t=93074
Reply With Quote
  #4  
Old 08-19-2005, 05:03 AM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi darnoldy,

Thank you for your help. Your example works almost perfect. First I had to change the "=" to "==".

The problem with the your solution is if a user makes a post in the thread or clicks on the bread crumb, the alpha sorting is lost.

I ended up modifying the forumdisplay.php as follows. This works perfect.

Code:
Find:

	if ($vbulletin->GPC['sortorder'] != 'asc') 

REPLACE it with:

	if ($vbulletin->GPC['sortorder'] != 'asc' AND $foruminfo['forumid'] != 'XX') 


Find:

	$sqlsortfield = 'lastpost';
	$sortfield = 'lastpost'; 

REPLACE it with:

	if ($foruminfo['forumid'] == 'XX'):
		$sqlsortfield = 'thread.title';
		$sortfield = 'thread.title';
	else:
		$sqlsortfield = 'lastpost';
		$sortfield = 'lastpost';
	endif;
Reply With Quote
  #5  
Old 08-19-2005, 05:28 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Andy, you should use Kirby's hack for that. That way you can change it for whatever forum you want to and not have to touch any php files.
Reply With Quote
  #6  
Old 08-19-2005, 05:43 AM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andy
Your example works almost perfect. First I had to change the "=" to "==".
Oops, sorry about the typo.

Quote:
The problem with the your solution is if a user makes a post in the thread or clicks on the bread crumb, the alpha sorting is lost.
Yeh, that would be a problem.

Quote:
I ended up modifying the forumdisplay.php
Glad you solved it

--don
Reply With Quote
  #7  
Old 08-19-2005, 06:15 AM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
Andy, you should use Kirby's hack for that. That way you can change it for whatever forum you want to and not have to touch any php files.
I appreciate the suggestion. I have yet to install any hacks. For example with Kirby's hack here is what is modified;

1 Product XML with 2 Queries, 9 Plugins, 15 Phrases and 2 Settings 4 Template Edits

I only needed to add a few lines to the php file. I always prefer a simple solution to one that changes a lot of things.
Reply With Quote
  #8  
Old 08-19-2005, 06:38 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But with the hack, this is now an option in each forum and there is no direct editing of php files so upgrading vb will be a snap and you would not have to re-edit the file or re-install the hack. The product system really is remarkable.
Reply With Quote
  #9  
Old 08-19-2005, 11:38 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Andy
If you just want to set the Default in Admin CP and don't need/want a UserCP Option and Thread Start Date, you would just have to import the XML of my Hack - that's it (no Template Edits).
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 10:19 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.04031 seconds
  • Memory Usage 2,238KB
  • 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
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete