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 10-16-2008, 04:54 AM
too_cool_3's Avatar
too_cool_3 too_cool_3 is offline
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to make moderators appear in alphabetical order on the moderator list?

I have moderators set-up on my forum (www.tbaec.ca) but on the main forum page, the /forum/index.php page where it lits - Forums - Last Post - Threads - Posts - Moderator - it has the moderators listed under Moderator in a different order depending on the category. Is there a way I can make them listed alphabetically instead of just at random?

I have tried adding them in ACP starting with the last username in alphabetical order as well as adding them starting with the first username in alphabetical order but they still sometimes appear in whatever order they feel regardless of the oder in which they are added?!

Is there a way to make them show up listed first to last, A-Z, not just mis-matched? In my opinion it just makes the forum look un-organized and is just something that has been bugging me so any help is appreciated!

Thank you for your time,
-Marc

--------------- Added [DATE]1224136606[/DATE] at [TIME]1224136606[/TIME] ---------------

NOTE: how MarcGSR appears at the bottom of the list instead of in between Frogg & Neeman77 like it should be if it was alphabetical order...






I've tried fooling around with it and it STILL list the mods in random order! This is really bugging me :|

Reply With Quote
  #2  
Old 10-16-2008, 03:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi again. I decided to do a quick try of what I was suggesting over on vb.com. Go to includes/functions_forumlist.php and find the query around line 21. At the end of the query you need to add "ORDER BY user.username ASC". This is what my line 26 and 27 look like when I add this:
PHP Code:
        " . ($userid != null ? "WHERE moderator.userid " . intval($userid) : "") . "ORDER BY user.username ASC
    
"); 
It seemed to work.
Reply With Quote
  #3  
Old 10-16-2008, 05:19 PM
too_cool_3's Avatar
too_cool_3 too_cool_3 is offline
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh perfect, I will try that out later tonight when I get home from work. Thank you very much!

So now I presume it won't matter which order I add the mods, they will just get sorted into alphabetical order?

P.S. Strange that vB doesn't do this naturally... I figured that more people would have been bothered by this issue and having their mods showing up in random order.
Reply With Quote
  #4  
Old 12-04-2009, 08:24 AM
msibm msibm is offline
 
Join Date: Aug 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great! Thanks to Lynne!
Reply With Quote
  #5  
Old 02-14-2013, 03:27 PM
james shadle's Avatar
james shadle james shadle is offline
 
Join Date: Oct 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got my Mods to display in order in the forum list, but it messed up the PMs.
Database error - wrong syntax.

Any ideas?
Thanks
Reply With Quote
  #6  
Old 02-14-2013, 04:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by james shadle View Post
I got my Mods to display in order in the forum list, but it messed up the PMs.
Database error - wrong syntax.

Any ideas?
Thanks
Post the code original code and then the modified code (just five lines above and below the code so we can tell where it is) and the file name so we can see what you did. Please use the php tags.
Reply With Quote
  #7  
Old 02-14-2013, 04:33 PM
james shadle's Avatar
james shadle james shadle is offline
 
Join Date: Oct 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the message I received:
Code:
                 SELECT moderator.*, user.username,
                                  IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid
                                  FROM moderator AS moderator
                                  INNER JOIN user AS user USING(userid)
                                    WHERE moderator.userid = 444ORDER BY moderator.userid;
   
  MySQL Error   : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BY moderator.userid' at line 5
includes/functions_forumlist.php

This was the original code:
Code:
IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid
        FROM " . TABLE_PREFIX . "moderator AS moderator
        INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
        " . ($userid != null ? "WHERE moderator.userid = " . intval($userid) : "") . "
    ");
    while ($moderator = $vbulletin->db->fetch_array($forummoderators))
    {
        fetch_musername($moderator);
        $imodcache["$moderator[forumid]"]["$moderator[userid]"] = $moderator;
        $mod["$moderator[userid]"] = 1;
    }

I cut and pasted your code:
Code:
IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid
        FROM " . TABLE_PREFIX . "moderator AS moderator
        INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
              " . ($userid != null ? "WHERE moderator.userid = " . intval($userid) : "") . "ORDER BY user.username ASC
    "); 
    while ($moderator = $vbulletin->db->fetch_array($forummoderators))
    {
        fetch_musername($moderator);
        $imodcache["$moderator[forumid]"]["$moderator[userid]"] = $moderator;
        $mod["$moderator[userid]"] = 1;
    }

Thanks
Reply With Quote
  #8  
Old 02-14-2013, 04:49 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add a space before the ORDER.
Reply With Quote
  #9  
Old 02-14-2013, 09:32 PM
james shadle's Avatar
james shadle james shadle is offline
 
Join Date: Oct 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne,
Thank you!
That worked.
James
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 08:17 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.03668 seconds
  • Memory Usage 2,245KB
  • 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
  • (1)bbcode_php
  • (1)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