vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   ibProArcade Archive (https://vborg.vbsupport.ru/forumdisplay.php?f=174)
-   -   Moving Player Details To Arcade Homepage (https://vborg.vbsupport.ru/showthread.php?t=207406)

edytwinky 03-05-2009 06:47 AM

Moving Player Details To Arcade Homepage
 
Is it possible to move individuals Player Details to the first page.

The information that shows that particular players 1st Place Finishes, 2nd Place Finishes, 3rd Place finishes, Top Ten Finishes, Total Games Played, etc?

I believe this is the code from the skin_arcade.php file but when I placed it in there, only the word "Player Details For" show up and nothing else, not even the players name.

PHP Code:

           <td width="*" valign="top">
                <
div class="tborder">
                <
table border="0" cellpadding="2" cellspacing="0" width="100%" class="alt1">
                    <
tr>
                        <
td width="100%" align="center" class="thead" colspan="2">{$ibforums->lang['details']}{$rank}</td>
                    </
tr>
                    {
$html['rank_detail_row']}
                </
table>
                </
div>
            </
td>
        </
tr>
    </
table


stangger5 03-05-2009 09:43 AM

It should work if its coded right..

All this info is pulled from arcade/module/mod_report.php
You might need to move some of that code to your skin_arcade.php..;)

edytwinky 03-05-2009 03:27 PM

Any idea which code to move over to the skin_arcade.php file? Here's the mod_report.php

I know this {$html['rank_detail_row']} is the code that has the information but I cannot get it to extract on my arcade homepage when I place it somewhere.

PHP Code:

<?php

class module
{
    var 
$html;

    function 
module()
    {
        global 
$main$ibforums$DB$std;

        
$main->arcade->authorize();  //Makes sure user can see the arcade

        
$main->arcade->top_links($main->html);
        
$this->html .= $main->arcade->extra_links;

        
$tmp_html = array();

    
$mid = (isset($ibforums->input['user'])) ? intval($ibforums->input['user']) : $ibforums->member['id'];

    if( 
$mid <= )
    {
    
$mid $ibforums->member['id'];
    }

        
$DB->query("SELECT name FROM ibf_members WHERE id=".$mid);
        
$user $DB->fetch_row();

        
//Numbers
        
$topten             0;
        
$firstplace         0;
        
$secondplace         0;
        
$thirdplace         0;
        
$totalgames         0;
        
$gamesplayed         0;
        
$totalgamesplayed     0;
        
$game_string         "(0)";
        
//Arrays
        
$games                 = array();
        
$score_totals         = array();
        
$top_scores         = array();
        
$users_place         = array();
        
$users_top             = array();
        
$gid_array             = array();

        
$DB->query("SELECT g.gid, g.gtitle, g.gcount, g.highscore_type, c.password from ibf_games_list AS g, ibf_games_cats AS c WHERE g.active=1 AND g.gcat=c.c_id AND trim(password)='' ORDER BY ".$main->arcade->settings['g_display_sort']." ".$main->arcade->settings['g_display_order']);
        while( 
$this_game $DB->fetch_row() )
        {
            
$games[] = array(
                                
'gid'        => $this_game['gid'],
                                
'gtitle'    => $this_game['gtitle'],
                                
'played'    => $this_game['gcount'],
                                
'type'        => $this_game['highscore_type'],
                       );
            
$gid_array[] = $this_game['gid'];
            
$totalgames++;
        }

        if( 
count($gid_array) > )
        {
            
$game_string "(".implode("," $gid_array).")";
        }

        
$DB->query("SELECT s.*, g.highscore_type AS type FROM ibf_games_scores AS s, ibf_games_list AS g WHERE s.gid=g.gid AND s.gid IN ".$game_string." ORDER BY score DESC, timespent ASC");
        while( 
$this_score $DB->fetch_row() )
        {
            if( !isset( 
$score_totals$this_score['gid'] ] ) )
            {
                
$top_scores$this_score['gid'] ]['score'] = 0;
                
$score_totals$this_score['gid'] ] = 0;
            }

            if( !isset(
$users_place$this_score['gid'] ]) )
            {
                
$users_place$this_score['gid'] ] = 0;
                
$users_top$this_score['gid'] ] = 0;
            }

            if( (
$this_score['score'] > $top_scores$this_score['gid'] ]['score']) && $this_score['type'] == "high" )
            {
                
$top_scores$this_score['gid'] ]['score'] = $this_score['score'];
                
$top_scores$this_score['gid'] ]['time'] = $this_score['datescored'];
            }

            if( ((
$this_score['score'] < $top_scores$this_score['gid'] ]['score']) && $this_score['type'] == "low") || $top_scores$this_score['gid'] ]['score'] == )
            {
                
$top_scores$this_score['gid'] ]['score'] = $this_score['score'];
                
$top_scores$this_score['gid'] ]['time'] = $this_score['datescored'];
            }

            
$score_totals$this_score['gid'] ]++;

            if( 
$this_score['mid'] == $mid )
            {
                
$gamesplayed++;
                if( (
$this_score['score'] > $users_top$this_score['gid'] ]) && $this_score['type'] == "high" )
                {
                    
$users_top$this_score['gid'] ] = $this_score['score'];
                    
$users_place$this_score['gid'] ] = $score_totals$this_score['gid'] ];
                }

                if( ((
$this_score['score'] < $users_top$this_score['gid'] ]) && $this_score['type'] == "low") || $users_top$this_score['gid'] ] == )
                {
                       
$users_top$this_score['gid'] ] = $this_score['score'];
                    
$users_place$this_score['gid'] ] = $score_totals$this_score['gid'] ];
                }
            }
        }

        
$col "row2";
        foreach( 
$games as $the_game )
        {
            if( 
$main->arcade->settings['skin'] != )
            {
                
$col = ($col == "row2") ? "row1" "row2";
            }
            
$score $ibforums->lang['n_a'];
            
$the_age $ibforums->lang['n_a'];
            if( isset(
$top_scores$the_game['gid'] ]['time']) )
            {
                
$the_age $this->thatdatetime() - $top_scores$the_game['gid'] ]['time'] );
            }
            if( 
$users_place$the_game['gid'] ] )
            {
                if( 
$the_game['type'] == "high" )
                {
                    
$rank $users_place$the_game['gid'] ];
                }
                else
                {
                    
$rank = ($score_totals$the_game['gid'] ] - $users_place$the_game['gid'] ]) + 1;
                }

                if( 
$rank == )
                {
                    
$rank "<big><b>".$rank."</b></big>";
                    
$firstplace++;
                }
                elseif( 
$rank <= 10 )
                {
                    if( 
$rank == )
                    {
                        
$secondplace++;
                    }
                    elseif( 
$rank == )
                    {
                        
$thirdplace++;
                    }
                    else
                    {
                        
$topten++;
                    }
                    
$rank "<b>".$rank."</b>";
                }
                
$rank $rank.$ibforums->lang['out_of'].$score_totals$the_game['gid'] ];

                if( 
$users_top$the_game['gid'] ] )
                {
                    
$score $main->arcade->t3h_format($users_top$the_game['gid'] ]);
                }
            }
            else
            {
                
$rank $ibforums->lang['n_a'];
            }

            
$totalgamesplayed += $the_game['played'];

            
$the_game['gtitle'] = $main->arcade->make_links$the_game['gid'] , $the_game['gtitle'] , );

            
$tmp_html['rank_row'] .= $main->html->rankrow$col $main->arcade->links['click'] , $score ,$rank $the_game['played'] , $the_age );
        }

        
$col "row2";
        
$detail_rows = array(
                                  
$ibforums->lang['first_place']                        => $firstplace,
                                
$ibforums->lang['second_place']                        => $secondplace,
                                
$ibforums->lang['third_place']                        => $thirdplace,
                                
$ibforums->lang['top_ten']                            => $topten,
                                
$ibforums->lang['total_games']                        => $totalgames,
                                
$ibforums->lang['total_i_play']    => $gamesplayed,
                                
$ibforums->lang['total_play']                        => $totalgamesplayed,
                       );

        foreach( 
$detail_rows as $header=>$content )
        {
            if( 
$main->arcade->settings['skin'] != )
            {
                
$col = ($col == "row2") ? "row1" "row2";
            }
            
$tmp_html['rank_detail_row'] .= $main->html->rankdetailrow($col $header $content);
        }

        
$this->html .= $main->html->report_main($tmp_html $user['name']);

        
$this->html .= $main->html->copyright($main->version,$ibforums->lang['timeformat1']);
        
$main->arcade->print_it($this->html"Rankings""Rankings");

    }

    function 
thatdate($time)
    {
        global 
$ibforums;

        
$diff $time;
        
$daysDiff floor($diff/60/60/24);
        
$diff -= $daysDiff*60*60*24;
        
$hrsDiff floor($diff/60/60);
        
$diff -= $hrsDiff*60*60;
        
$minsDiff floor($diff/60);
        
$diff -= $minsDiff*60;
        
$secsDiff $diff;

        
$eltime "";
        if(
$daysDiff)
        {
             
$eltime $eltime.$daysDiff." ".$ibforums->lang['acp_day1'];
    if (
$daysDiff == 1) { $eltime $eltime." "; }
    else { 
$eltime $eltime.$ibforums->lang['acp_day2']." "; }
        }

        if(
$hrsDiff)
        {
    if (
$hrsDiff 10) { $hrsDiff="0".$hrsDiff; }
            
$eltime $eltime.$hrsDiff.":";
        }

        if(
$minsDiff)
        {
    if (
$minsDiff 10) { $minsDiff="0".$minsDiff; }
            
$eltime $eltime.$minsDiff.":";
        }

    if (
$secsDiff 10) { $secsDiff="0".$secsDiff; }
            
$eltime $eltime.$secsDiff."";

        return 
$eltime;
    }

}

$module = new module;

?>



All times are GMT. The time now is 10:28 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.01137 seconds
  • Memory Usage 1,870KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete