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

Reply
 
Thread Tools Display Modes
  #21  
Old 01-11-2009, 02:20 PM
orion808 orion808 is offline
 
Join Date: Dec 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DragonBlade View Post
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.
Reply With Quote
  #22  
Old 01-15-2009, 02:25 AM
DragonBlade's Avatar
DragonBlade DragonBlade is offline
 
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by orion808 View Post
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! ^_^
Reply With Quote
  #23  
Old 01-20-2009, 01:28 AM
orion808 orion808 is offline
 
Join Date: Dec 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #24  
Old 01-31-2009, 06:44 AM
n8td n8td is offline
 
Join Date: Jun 2007
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #25  
Old 02-05-2009, 11:12 PM
orion808 orion808 is offline
 
Join Date: Dec 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice, I'll install that tomorrow. Thank you.
Reply With Quote
  #26  
Old 02-15-2009, 11:20 PM
orion808 orion808 is offline
 
Join Date: Dec 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #27  
Old 02-16-2009, 12:59 AM
n8td n8td is offline
 
Join Date: Jun 2007
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay thanks. I edited the original post.
Reply With Quote
  #28  
Old 05-13-2009, 01:00 AM
SnaKe |WiH| SnaKe |WiH| is offline
 
Join Date: May 2006
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by n8td View Post
Okay thanks. I edited the original post.
Just to clarify for me, which # post was modified plz? I'd like to try this out.
Reply With Quote
  #29  
Old 05-13-2009, 01:07 AM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #30  
Old 05-13-2009, 08:17 PM
SnaKe |WiH| SnaKe |WiH| is offline
 
Join Date: May 2006
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, duh, thanks!
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 05:58 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.10888 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
  • (2)bbcode_code
  • (12)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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