vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   ibProArcade Archive (https://vborg.vbsupport.ru/forumdisplay.php?f=174)
-   -   More Leaders of the Leaderboard? (https://vborg.vbsupport.ru/showthread.php?t=202855)

maasland 01-23-2009 07:54 PM

More Leaders of the Leaderboard?
 
Below is the code (arcade.php) to show 1 Leader of the Leaderboard (avatar + name + total score)
Anyone know how to change this into 3 Leaders of the Leaderboard (avatar + name + total score)?

Code:

        $DB->query("SELECT mid, gid, sum(position) AS position, sum(points) AS points FROM ibf_games_league GROUP BY mid ORDER BY points DESC LIMIT 1");
        $row = $DB->fetch_row();
        $points=$row['points'];
        $name = "<span class=\"smallfont\"><strong><a href=\"";
        $name = $name . $ibforums->base_url."act=Arcade&amp;module=report&amp;user=".$row['mid']."\">";

        if ($row['mid'] > 0)
        {
        $Touruserid = $row['mid'];
        $DB->query("SELECT name FROM ibf_members WHERE id=".$Touruserid);
        $row = $DB->fetch_row();
        $name = $name . $row['name'].'</a></strong></span>';
        $tourneyinfo['champ'] = "<b>".$name."</b><br /><span class=\"smallfont\">{$ibforums->lang['tourneyinfo_txt1']}<b>".$points."</b>{$ibforums->lang['tourneyinfo_txt2']}</span>";

        $tourneyinfo['champavatar'] = "";

        $DB->query("SELECT avatar,avatar_size AS size FROM ibf_members WHERE id=".$Touruserid);

        if ($avatar = $DB->fetch_row())
                {
                        $tourneyinfo['champavatar'] = $std->get_avatar($avatar , 1 , $avatar['size']);
                        if ($tourneyinfo['champavatar'] == "")
                        {
                                $tourneyinfo['champavatar'] = "<img src='./arcade/images/noavatar.gif' alt='' />";
                        }
                }
        else
                {
                        $tourneyinfo['champavatar'] = "<img src='./arcade/images/noavatar.gif' alt='' />";
                }

        }
        else
        {
                $tourneyinfo['champ'] = "{$ibforums->lang['top3box_norank']}";
                $tourneyinfo['champavatar'] = "";
        }


stangger5 01-23-2009 09:59 PM

Have you tried changing the LIMIT in first line ??

Code:

$DB->query("SELECT mid, gid, sum(position) AS position, sum(points) AS points FROM ibf_games_league GROUP BY mid ORDER BY points DESC LIMIT 1");
Change the DESC LIMIT to 3..

maasland 01-23-2009 10:41 PM

Thanks stangger5, but nope, that alone doesn't work. How would one call 3 different names, avatars and total scores that way? There's no array to take avatar123, total score123, name123 from. Ofcourse the limit should be raised to 3, but that's just step one. Changes should be made to a 'while', if you catch my drift. I just don't know howto exactly...

stangger5 01-23-2009 10:55 PM

Have a look at this mod,,it might help you or give you a idea on how to do it..

IbproArcade 2.5.7- Top 25 player


All times are GMT. The time now is 01:36 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.00999 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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