Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-05-2008, 02:32 PM
PGAmerica PGAmerica is offline
 
Join Date: Mar 2008
Posts: 405
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Reorder User Ranks

I have added about a dozen user ranks in my acp and they are working fine. However, on a user's post, when it shows the ranks, it does not list them in the order I have them entered. The way I have it setup, a user can have multiple rankings (eg. Administrator, over 300 posts, etc).

What determines the order the ranks are shown in?
How do I force the system to list ranks in a particular order?

Is there a mod out there that allows me to do this? I searched, but did not find anything.
Reply With Quote
  #2  
Old 12-08-2008, 03:16 PM
PGAmerica PGAmerica is offline
 
Join Date: Mar 2008
Posts: 405
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

I think you need to actually change the code. It looks like this is done in includes/functions_ranks.php at the very bottom where it says "Begin Build Ranks PHP Code function"
Reply With Quote
  #4  
Old 12-08-2008, 03:53 PM
PGAmerica PGAmerica is offline
 
Join Date: Mar 2008
Posts: 405
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem is that I am not a programmer. I have no idea how to do that. Is there anybody that can give me the "find this, replace with this" instructions?
Reply With Quote
  #5  
Old 12-08-2008, 04:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I can't tell you exactly. I'm a trial and error coder and I don't have enough ranks on my test site to be able to test this out myself.
Reply With Quote
  #6  
Old 12-08-2008, 04:24 PM
PGAmerica PGAmerica is offline
 
Join Date: Mar 2008
Posts: 405
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, if it is a test site, can't you just make more ranks? You can also use my test site if you wish.

In the function is the line that says "ORDER BY ranks.usergroupid DESC, minposts DESC". Obviously, it is displaying the ranks by usergroup id. However, not being a programmer, I am just guessing here, but if we add a new column to the ranks table in the database and then connect it to the ranks area of the acp for "display order" we can then change that line to "ORDER BY ranks.displayorderid DESC, minposts DESC" or something like this.

Am I right?

For simplicity sake, can I change the line to something that just replaces "usergroupid" with the rankid? or even list the rank ids in the order I want them displayed?
Reply With Quote
  #7  
Old 12-08-2008, 04:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The ranks table has a field called rankid. So yes, you can order by rank.rankid . You can always try that and see. If it doesn't work, then you go back to default (just keep a copy). I think after you change it in the code, you will need to go to the Ranks area in the Admin CP and Save something to get it to rebuild the ranks list.

If you were to write a modification for this, you would probably want to add a column for order. Then you could order by rank.order.

And I don't want to add more ranks to my test site because I'm trying to keep it as close to my live site as possible since I want to make the big jump from 3.6 to 3.8 as soon as it goes Gold.
Reply With Quote
  #8  
Old 12-08-2008, 04:43 PM
PGAmerica PGAmerica is offline
 
Join Date: Mar 2008
Posts: 405
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, knowing that I want to add a rank.order option in the acp and being able to actually do it are two different things. I will wait to see if anybody can do this for me.

Do you know the mysql command to add a column to an existing table?
Reply With Quote
  #9  
Old 12-08-2008, 04:57 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just add them in phpMyAdmin. But, I did write a product that I shared with someone and this is the query I used to add a new column to the thread table:
Code:
 $db->query("ALTER TABLE " . TABLE_PREFIX . "thread ADD verify_status SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL");
That was to add a new column of type smallint which is probably what you want. Default is '0' and it's not null.

If you go for this approach of adding a new 'order' column, don't forget you need to modify the /admincp/ranks.php page to include it on your User Rank page in the Admin CP
Reply With Quote
  #10  
Old 12-08-2008, 05:37 PM
PGAmerica PGAmerica is offline
 
Join Date: Mar 2008
Posts: 405
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That looks like the command to add to a php file. What is the command I use in phpMyAdmin?
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 01:35 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.07331 seconds
  • Memory Usage 2,254KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (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_postinfo_query
  • fetch_postinfo
  • 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