vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   where do I change the order of rank images? (https://vborg.vbsupport.ru/showthread.php?t=109292)

orion808 01-11-2009 02:20 PM

Quote:

Originally Posted by DragonBlade (Post 1684027)
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'] . ",
            rankorder = " 
$vbulletin->GPC['rankorder'] . "
        WHERE rankid = " 
$vbulletin->GPC['rankid'] . "
    "
); 


The 3rd from the last line you had "display" instead of the intended "rankorder". Otherwise, this worked perfectly.

DragonBlade 01-15-2009 02:25 AM

Quote:

Originally Posted by orion808 (Post 1708607)
The 3rd from the last line you had "display" instead of the intended "rankorder". Otherwise, this worked perfectly.

Kickasskewl, you've tried it? I still haven't got around to it. XD

Go me, yay, I did something useful! ^_^

orion808 01-20-2009 01:28 AM

Yeah, works fine. Would be helpful if the "rank" was also visible (not editable) via the User Rank Manager so you would have an overview and know which ranks you needed to edit.

I have 20 ranks that go into 4 different slots. This works perfectly. So:

<<Orion>>
Forum Status (Rank 1)
Guild Status (Rank 2)
Platoon Status (Rank 3)
Squad Status (Rank 4)

n8td 01-31-2009 06:44 AM

In the /admincp/rank.php

Find:
PHP Code:

            print_form_header('ranks''insert'01'name''');
            
print_table_header($vbphrase['images']);
            
construct_hidden_code('usergroupid'$vbulletin->GPC['usergroupid']);
            
construct_hidden_code('ranklevel'$vbulletin->GPC['ranklevel']);
            
construct_hidden_code('minposts'$vbulletin->GPC['minposts']);
            
construct_hidden_code('doinsert'$vbulletin->GPC['rankimg']); 

Change it to:
PHP Code:

            print_form_header('ranks''insert'01'name''');
            
print_table_header($vbphrase['images']);
            
construct_hidden_code('usergroupid'$vbulletin->GPC['usergroupid']);
            
construct_hidden_code('ranklevel'$vbulletin->GPC['ranklevel']);
            
construct_hidden_code('minposts'$vbulletin->GPC['minposts']);
            
construct_hidden_code('rankorder'$vbulletin->GPC['rankorder']);
            
construct_hidden_code('doinsert'$vbulletin->GPC['rankimg']); 

This allows the variable for rankorder to be called.


Find:
PHP Code:

            print_table_header(iif($rank['usergroupid'] == 0$vbphrase['all_usergroups'], $rank['title']), 51);
            
print_cells_row(array($vbphrase['user_rank'], $vbphrase['minimum_posts'], $vbphrase['display_type'], $vbphrase['stack_rank'], $vbphrase['controls']), 1''

Change it to:
PHP Code:

            print_table_header(iif($rank['usergroupid'] == 0$vbphrase['all_usergroups'], $rank['title']), 61);
            
print_cells_row(array($vbphrase['user_rank'], $vbphrase['minimum_posts'], $vbphrase['display_type'], $vbphrase['stack_rank'], 'Rank Order'$vbphrase

Going from 5 to 6 increases the number of headers. Adding 'Rank Order' gives the column a name.


Find:
PHP Code:

        $cell = array(
            
$rankhtml,
            
vb_number_format($rank['minposts']),
            (
$rank['display'] ? $vbphrase['displaygroup'] : $vbphrase['always']),
            (
$rank['stack'] ? $vbphrase['yes'] : $vbphrase['no']),
            
construct_link_code($vbphrase['edit'], "ranks.php?" $vbulletin->session->vars['sessionurl'] . "do=edit&rankid=$rank[rankid]") . construct_link_code($vbphrase['delete'], "ranks.php?" $vbulletin->session->vars['sessionurl'] . "do=remove&rankid=$rank[rankid]")
        ); 

Change it to:
PHP Code:

        $cell = array(
            
$rankhtml,
            
vb_number_format($rank['minposts']),
            (
$rank['display'] ? $vbphrase['displaygroup'] : $vbphrase['always']),
            (
$rank['stack'] ? $vbphrase['yes'] : $vbphrase['no']),
            
vb_number_format($rank['rankorder']),
            
construct_link_code($vbphrase['edit'], "ranks.php?" $vbulletin->session->vars['sessionurl'] . "do=edit&rankid=$rank[rankid]") . construct_link_code($vbphrase['delete'], "ranks.php?" $vbulletin->session->vars['sessionurl'] . "do=remove&rankid=$rank[rankid]")
        ); 

This adds the rankorder number to show up on the User Rank Manager page.


Find:
PHP Code:

// ###################### Start modify #######################
if ($_REQUEST['do'] == 'modify')
{
    
$ranks $db->query_write("
        SELECT rankid, ranklevel, minposts, rankimg, ranks. usergroupid,title, type, display, stack
        FROM " 
TABLE_PREFIX "ranks AS ranks
        LEFT JOIN " 
TABLE_PREFIX "usergroup AS usergroup USING(usergroupid)
        ORDER BY ranks.usergroupid, minposts 

Change it to:
PHP Code:

// ###################### Start modify #######################
if ($_REQUEST['do'] == 'modify')
{
    
$ranks $db->query_write("
        SELECT rankid, ranklevel, minposts, rankimg, ranks. usergroupid,title, type, display, stack, rankorder
        FROM " 
TABLE_PREFIX "ranks AS ranks
        LEFT JOIN " 
TABLE_PREFIX "usergroup AS usergroup USING(usergroupid)
        ORDER BY rankorder, ranks.usergroupid, minposts
    "
); 

This changes the display order on the User Rank Manager page.

All these steps should display the rankorder on the User Rank Manager page.

orion808 02-05-2009 11:12 PM

Nice, I'll install that tomorrow. Thank you.

orion808 02-15-2009 11:20 PM

Well, almost forgot to do this. Thanks for the reminder PM, n8td. One small error, but got it working.

On your last section of code to replace:
Code:

SELECT rankid, ranklevel, minposts, rankimg, ranks. usergroupid,title, type, display, stack, rank
Should be:
Code:

SELECT rankid, ranklevel, minposts, rankimg, ranks. usergroupid,title, type, display, stack, rankorder

Notice that it's rankorder, not rank. Works like a charm though. Thank you for this. Cleans up my ranks for sure. Actually found one that had the wrong order on it that I forgot to edit after a recent change.

n8td 02-16-2009 12:59 AM

Okay thanks. I edited the original post.

SnaKe |WiH| 05-13-2009 01:00 AM

Quote:

Originally Posted by n8td (Post 1745469)
Okay thanks. I edited the original post.

Just to clarify for me, which # post was modified plz? I'd like to try this out.

RLShare 05-13-2009 01:07 AM

That person has only made a single post in this thread that has code in it, I can pretty much guarantee that is the post that is being referred to.

SnaKe |WiH| 05-13-2009 08:17 PM

Ah, duh, thanks!


All times are GMT. The time now is 02:59 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.01419 seconds
  • Memory Usage 1,816KB
  • 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
  • (2)bbcode_code_printable
  • (12)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete