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

Reply
 
Thread Tools Display Modes
  #11  
Old 06-29-2007, 07:48 AM
Lord Omega's Avatar
Lord Omega Lord Omega is offline
 
Join Date: Jul 2005
Location: Kentucky
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I could use this information as well. :O
Reply With Quote
  #12  
Old 03-25-2008, 05:04 AM
pancan17 pancan17 is offline
 
Join Date: Mar 2008
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump for an old-skool question I'm wondering about as well...
Reply With Quote
  #13  
Old 03-25-2008, 06:50 AM
lostgirl815 lostgirl815 is offline
 
Join Date: Apr 2006
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I assume it can't be done, because someone was complaining in vBulletin.com's 'talk about 3.7.0 beta 6' thread that they still haven't provided a way to order ranks.
Reply With Quote
  #14  
Old 03-27-2008, 09:58 AM
DriverDan DriverDan is offline
 
Join Date: Mar 2008
Location: Rochester, NY USA
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It CAN be done, it just requires modifying code.
Reply With Quote
  #15  
Old 03-27-2008, 05:48 PM
Sanctorum's Avatar
Sanctorum Sanctorum is offline
 
Join Date: Sep 2007
Location: Stillwater, Ok
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, ordering ranks would be great, I'm surprised it isn't like that.
Reply With Quote
  #16  
Old 04-04-2008, 12:09 PM
StregSpiller StregSpiller is offline
 
Join Date: Mar 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump....
Still no solution to this one???
Reply With Quote
  #17  
Old 08-05-2008, 04:07 PM
n8td n8td is offline
 
Join Date: Jun 2007
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone know how to do this?
Reply With Quote
  #18  
Old 08-13-2008, 03:07 PM
marrr marrr is offline
 
Join Date: Oct 2007
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

im looking for this also
Reply With Quote
  #19  
Old 08-27-2008, 07:13 PM
Amm0 Amm0 is offline
 
Join Date: May 2008
Location: England
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same here guys

Is there any way to make an official request?
Reply With Quote
  #20  
Old 12-12-2008, 06:40 PM
DragonBlade's Avatar
DragonBlade DragonBlade is offline
 
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm actually working on this. XD

In theory, all we need to do is add a field to the "rank" table called "rankorder".

In the insert block on the /admincp/ranks.php, we need to add a field to this:
PHP Code:
    $vbulletin->input->clean_array_gpc('p', array(
        
'ranklevel'   => TYPE_UINT,
        
'minposts'    => TYPE_UINT,
        
'rankimg'     => TYPE_STR,
        
'usergroupid' => TYPE_INT,
        
'doinsert'    => TYPE_STR,
        
'rankhtml'    => TYPE_NOTRIM,
        
'stack'       => TYPE_UINT,
        
'display'     => TYPE_UINT,
    )); 
This would be the field added
PHP Code:
        'rankorder'     => TYPE_UINT
Then find this code in the same section
PHP Code:
    /*insert query*/
    
$db->query_write("
        INSERT INTO " 
TABLE_PREFIX "ranks
            (ranklevel, minposts, rankimg, usergroupid, type, stack, display)
        VALUES
            (
            " 
$vbulletin->GPC['ranklevel'] . ",
            " 
$vbulletin->GPC['minposts'] . ",
            '" 
$db->escape_string($vbulletin->GPC['rankimg']) . "',
            " 
$vbulletin->GPC['usergroupid'] . ",
            
$type,
            " 
$vbulletin->GPC['stack'] . ",
            " 
$vbulletin->GPC['display'] . "
            )
    "
); 
and change it to
PHP Code:
    /*insert query*/
    
$db->query_write("
        INSERT INTO " 
TABLE_PREFIX "ranks
            (ranklevel, minposts, rankimg, usergroupid, type, stack, display, rankorder)
        VALUES
            (
            " 
$vbulletin->GPC['ranklevel'] . ",
            " 
$vbulletin->GPC['minposts'] . ",
            '" 
$db->escape_string($vbulletin->GPC['rankimg']) . "',
            " 
$vbulletin->GPC['usergroupid'] . ",
            
$type,
            " 
$vbulletin->GPC['stack'] . ",
            " 
$vbulletin->GPC['display'] . ",
            " 
$vbulletin->GPC['rankorder'] . "
            )
    "
); 
That will take care of inserting the rank into the DB.


Now to edit existing ranks, find this in the edit block on the same page:
PHP Code:

    construct_hidden_code
('rankid'$vbulletin->GPC['rankid']);
    
print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['user_rank'], ''$vbulletin->GPC['rankid']));
    
print_input_row($vbphrase['times_to_repeat_rank'], 'ranklevel'$ranks['ranklevel']);
    
print_chooser_row($vbphrase['usergroup'], 'usergroupid''usergroup'$ranks['usergroupid'], $vbphrase['all_usergroups']);
    
print_input_row($vbphrase['minimum_posts'], 'minposts'$ranks['minposts']);
    
print_yes_no_row($vbphrase['stack_rank'], 'stack'$ranks['stack']);
    
print_select_row($vbphrase['display_type'], 'display'$displaytype$ranks['display']);
    
print_table_header($vbphrase['rank_type']);
    
print_input_row($vbphrase['user_rank_file_path'], 'rankimg'$rankimg);
    
print_input_row($vbphrase['or_you_may_enter_text'], 'rankhtml'$ranktext);

    
print_submit_row(); 
Before print_submit_row(); (wherever you want it), add the line:
PHP Code:
    print_input_row('Rank Order''rankorder'$ranks['rankorder']); 


Next, in the doupdate block of the same page, again find this code:
PHP Code:
    $vbulletin->input->clean_array_gpc('p', array(
        
'ranklevel'   => TYPE_UINT,
        
'minposts'    => TYPE_UINT,
        
'rankimg'     => TYPE_STR,
        
'usergroupid' => TYPE_INT,
        
'doinsert'    => TYPE_STR,
        
'rankhtml'    => TYPE_NOTRIM,
        
'stack'       => TYPE_UINT,
        
'display'     => TYPE_UINT,
    )); 
and add in there
PHP Code:
        'rankorder'     => TYPE_UINT
Then find
PHP Code:
    $db->query_write("
        UPDATE " 
TABLE_PREFIX "ranks
        SET ranklevel = " 
$vbulletin->GPC['ranklevel'] . ",
            minposts = " 
$vbulletin->GPC['minposts'] . ",
            rankimg = '" 
$db->escape_string($vbulletin->GPC['rankimg']) . "',
            usergroupid = " 
$vbulletin->GPC['usergroupid'] . ",
            type = 
$type,
            stack = " 
$vbulletin->GPC['stack'] . ",
            display = " 
$vbulletin->GPC['display'] . "
        WHERE rankid = " 
$vbulletin->GPC['rankid'] . "
    "
); 
and edit is so:
PHP Code:
    $db->query_write("
        UPDATE " 
TABLE_PREFIX "ranks
        SET ranklevel = " 
$vbulletin->GPC['ranklevel'] . ",
            minposts = " 
$vbulletin->GPC['minposts'] . ",
            rankimg = '" 
$db->escape_string($vbulletin->GPC['rankimg']) . "',
            usergroupid = " 
$vbulletin->GPC['usergroupid'] . ",
            type = 
$type,
            stack = " 
$vbulletin->GPC['stack'] . ",
            display = " 
$vbulletin->GPC['display'] . ",
            display = " 
$vbulletin->GPC['rankorder'] . "
        WHERE rankid = " 
$vbulletin->GPC['rankid'] . "
    "
); 


Now, you have to change the build_ranks() function in includes/functions_ranks.php. Look for
PHP Code:
// #################### Begin Build Ranks PHP Code function ################
function &build_ranks()
{
    global 
$vbulletin;

    
$ranks $vbulletin->db->query_read_slave("
        SELECT ranklevel AS l, minposts AS m, rankimg AS i, type AS t, stack AS s, display AS d, ranks.usergroupid AS u
        FROM " 
TABLE_PREFIX "ranks AS ranks
        LEFT JOIN " 
TABLE_PREFIX "usergroup AS usergroup USING (usergroupid)
        ORDER BY ranks.usergroupid DESC, minposts DESC
    "
);

    
$rankarray = array();
    while (
$rank $vbulletin->db->fetch_array($ranks))
    {
        
$rankarray[] = $rank;
    }

    
build_datastore('ranks'serialize($rankarray), 1);

    return 
$rankarray;

We are going to change the ORDER BY bit of the query to be
PHP Code:
// #################### Begin Build Ranks PHP Code function ################
function &build_ranks()
{
    global 
$vbulletin;

    
$ranks $vbulletin->db->query_read_slave("
        SELECT ranklevel AS l, minposts AS m, rankimg AS i, type AS t, stack AS s, display AS d, ranks.usergroupid AS u
        FROM " 
TABLE_PREFIX "ranks AS ranks
        LEFT JOIN " 
TABLE_PREFIX "usergroup AS usergroup USING (usergroupid)
        ORDER BY ranks.rankorder, ranks.usergroupid DESC, minposts DESC
    "
);

    
$rankarray = array();
    while (
$rank $vbulletin->db->fetch_array($ranks))
    {
        
$rankarray[] = $rank;
    }

    
build_datastore('ranks'serialize($rankarray), 1);

    return 
$rankarray;


P.S.: I have NOT done this to my own forum yet, so I can only ASSUME this would work. I am also a vB Programming newbie, so there might be a much better, easier, faster way.



Figures, I actually came here because I was looking for help on how to update the rank display for a single user after changing said user's membergroupids. XD
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:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09087 seconds
  • Memory Usage 2,335KB
  • 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
  • (12)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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