Leaderboard Credits

Results 1 to 9 of 9
  1. #1
    Proficient Member Jiq is offline
    MemberRank
    Nov 2015 Join Date
    MalaysiaLocation
    174Posts

    information Leaderboard Credits

    Hello,

    I am willing to make my leaderboard (credits). On the first, its will show all avatar and from second to last will show head only.

    Just like this, I've been failed on making this ? I means to make the looks and the badge gold, silver and bronze ?

    Thanks.


  2. #2
    Proficient Member Boraida is offline
    MemberRank
    May 2011 Join Date
    The NetherlandsLocation
    161Posts

    Re: Leaderboard Credits

    This is just a simple HTML/CSS task with some information from the backend. You said you have failed, can you show us what you have made so far? Post it on https://jsfiddle.net/ please


    Edit; I just made one during my lunch break. I know it's not perfect, but what else would you expect for 10 minutes work. https://jsfiddle.net/n1gqquL8/
    Last edited by Boraida; 28-02-17 at 02:07 PM.

  3. #3
    Proficient Member Jiq is offline
    MemberRank
    Nov 2015 Join Date
    MalaysiaLocation
    174Posts

    Re: Leaderboard Credits

    I am not asking for html, I am asking for PHP, how do I make it for the first leader get full looks. LOL @Boraida

  4. #4
    Proficient Member Boraida is offline
    MemberRank
    May 2011 Join Date
    The NetherlandsLocation
    161Posts

    Re: Leaderboard Credits

    Quote Originally Posted by Jiq View Post
    I am not asking for html, I am asking for PHP, how do I make it for the first leader get full looks. LOL @Boraida
    Your question was unclear. But if you want the full look an if statement should work. And maybe some CSS modifications.

    Example:
    PHP Code:
    <?php if (/* "first leader" condition */): ?> 
    <!-- element with full look -->
    <?php else: ?>
    <!-- element with head only -->
    <?php endif; ?>

  5. #5
    Member Damien Jolly is offline
    MemberRank
    Apr 2014 Join Date
    89Posts

    Re: Leaderboard Credits

    Seems like alot of people are using my leaderboards now haha.
    Anyway this is what you need to do:

    PHP Code:
     $num 0;
     foreach(
    $usersStats as $userStats) {    
        
    $num++;
        
    $figure ""//whatever
        
    if($num != 1) {
            
    //add headonly to figure
        
    }
        
    //do some html
        
    switch($num) {
            case 
    1:
                
    //1st place
            
    break;
            case 
    2:
                
    //2nd place
            
    break;
            case 
    3:
                
    //3rd place
            
    break;
            default:
                
    //unranked
            
    break;
        }
        
    //do some more html
     


  6. #6
    Proficient Member Jiq is offline
    MemberRank
    Nov 2015 Join Date
    MalaysiaLocation
    174Posts

    Re: Leaderboard Credits

    For the first place I make it select from users and limit 1. So for the first place I put var $Verify = $Row->username;
    and the second place and under I make it like " SELECT * FROM users WHERE username != "'.$Verify.'". Learn by myself. @Damien Jolly @Boraida

  7. #7
    Member Damien Jolly is offline
    MemberRank
    Apr 2014 Join Date
    89Posts

    Re: Leaderboard Credits

    Quote Originally Posted by Jiq View Post
    For the first place I make it select from users and limit 1. So for the first place I put var $Verify = $Row->username;
    and the second place and under I make it like " SELECT * FROM users WHERE username != "'.$Verify.'". Learn by myself. @Damien Jolly @Boraida
    That's not a good way to do it. Best grabbing them all in the first query then just adding the headonly attribute to the figure params for the first one.

  8. #8
    Enthusiast redk0ke is offline
    MemberRank
    Sep 2013 Join Date
    49Posts

    Re: Leaderboard Credits

    Quote Originally Posted by Jiq View Post
    For the first place I make it select from users and limit 1. So for the first place I put var $Verify = $Row->username;
    and the second place and under I make it like " SELECT * FROM users WHERE username != "'.$Verify.'". Learn by myself. @Damien Jolly @Boraida
    No need to run multiple queries for one simple task. We don't care about your existing attempt when it will never work. Jolly came up with a decent solution, so instead of debugging your non-working code, remove it instead.

    Sent from my SM-G928F using Tapatalk

  9. #9
    Proficient Member Jiq is offline
    MemberRank
    Nov 2015 Join Date
    MalaysiaLocation
    174Posts

    Re: Leaderboard Credits

    Then help me in another way ? I can't brain how this system working.



Advertisement