vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Alpha sort by thread title of one forum (https://vborg.vbsupport.ru/showthread.php?t=94597)

Andy 08-19-2005 01:00 AM

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 :)

darnoldy 08-19-2005 01:21 AM

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

Andreas 08-19-2005 01:51 AM

Alternatively you could use https://vborg.vbsupport.ru/showthread.php?t=93074

Andy 08-19-2005 05:03 AM

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;


Boofo 08-19-2005 05:28 AM

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

darnoldy 08-19-2005 05:43 AM

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

Andy 08-19-2005 06:15 AM

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.

Boofo 08-19-2005 06:38 AM

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.

Andreas 08-19-2005 11:38 AM

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


All times are GMT. The time now is 03:36 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.01050 seconds
  • Memory Usage 1,736KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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