Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 12

46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.4.x.x forum
54.234.x.x forum
78.46.x.x forum
93.74.x.x forum

Last Seen

mrstipfan Wed 19:48
Gagi2 Mon 16:30
EFiNST0RM Sun 15:39
85filip58 Sun 12:14
brlight Tue 04:18

Newest Members

Forums
2 column players list
TacTicToe
Thu Jan 15 2015, 12:52AM
Posts: 42
Joined: Mon Aug 13 2012, 01:33AM
Registered Member #7356
Trying to get the lgsl_details.php to display the players in two separate columns instead of one single column. Any ideas?
Website
Dodgeitorelse
Sat Jan 17 2015, 08:05PM
Posts: 246
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
in lgsl 5.8 SA in unmodified lsgl_details.php locate show players and try this


// SHOW THE PLAYERS
$number = 0;
$numberodd = 0;
$numbereven = 0;

  $output .= "
  <div style='width:100%' margin:auto; overflow:auto; text-align:center; padding:10px'>";

  if (empty($server['p']) || !is_array($server['p']))
  {
    $output .= "
    <table cellpadding='4' cellspacing='2' style='margin:auto'>
      <tr style='".lgsl_bg(FALSE)."'>
        <td> {$lgsl_config['text']['npi']} </td>
      </tr>
    </table>";
  }
  else
  {
    foreach ($server['p'] as $player)
      {
      $number++;
      }
       
       if($number == 1)
       {
       $output .= "
    <table cellpadding='4' cellspacing='2' style='margin:auto'>
      <tr style='".lgsl_bg(FALSE)."'>";

      foreach ($fields as $field)
      {
        $field = ucfirst($field);
        $output .= "
        <td> <b>{$field}</b> </td>";
      }

      $output .= "
      </tr>";

      foreach ($server['p'] as $player_key => $player)
      {
        $numberodd++;
        
        if($numberodd % 2 == 1)
        {
        $output .= "
        <tr style='".lgsl_bg()."'>";

        foreach ($fields as $field)
        {
          $output .= "<td> {$player[$field]} </td>";
        }

        $output .= "
        </tr>";
      }
      }

    $output .= "
    </table>";
    }
    
    else
    {
        $output .="
    <table align='center' cellspacing='25'>
    <tr>
    <td>";
    
    $output .= "
    <table cellpadding='4' cellspacing='2' style='margin:auto'>
      <tr style='".lgsl_bg(FALSE)."'>";

      foreach ($fields as $field)
      {
        $field = ucfirst($field);
        $output .= "
        <td> <b>{$field}</b> </td>";
      }

      $output .= "
      </tr>";

      foreach ($server['p'] as $player_key => $player)
      {
        $numberodd++;
        
        if($numberodd % 2 == 1)
        {
        $output .= "
        <tr style='".lgsl_bg()."'>";

        foreach ($fields as $field)
        {
          $output .= "<td> {$player[$field]} </td>";
        }

        $output .= "
        </tr>";
      }
      }

    $output .= "
    </table>";
    
    
    $output .="
    </td>";
    
    $output .="
    <td>";
    
    
    $output .= "
    <table cellpadding='4' cellspacing='2' style='margin:auto'>
      <tr style='".lgsl_bg(FALSE)."'>";

      foreach ($fields as $field)
      {
        $field = ucfirst($field);
        $output .= "
        <td> <b>{$field}</b> </td>";
      }

      $output .= "
      </tr>";

      foreach ($server['p'] as $player_key => $player)
      {
        $numbereven++;
        
        
        if($numbereven % 2 == 0)
        {
        $output .= "
        <tr style='".lgsl_bg()."'>";

        foreach ($fields as $field)
        {
          $output .= "<td> {$player[$field]} </td>";
        }

        $output .= "
        </tr>";
      }
      }

    $output .= "
    </table>";
    
    }
  }
$output .= "
    </td>
    </tr>
    </table>";
  $output .= "
  </div>";



good luck as this was only tried with americas army so you may have to adjust it to your needs

lack of effort on your part requires less effort on my part
Website
jjourneyy22
Wed Jan 21 2015, 02:19AM
Posts: 3
Joined: Wed Jan 21 2015, 02:13AM
Registered Member #8194
Schedule ample interviews.Use every possible method to Runescape Gold get interviews——answering ads,using search firms,contacting companies directly,surfing the Web,and networking.Even if a rsgpfast job is notperfect for you,every interview can be approached as a positive experience.
TacTicToe
Thu Feb 05 2015, 03:10AM
Posts: 42
Joined: Mon Aug 13 2012, 01:33AM
Registered Member #7356
Thanks Dodgeit, that works. Only downside is that if there is an odd number of players the list looks lop sided? Is there a way to fix this so odd number of players both columns would line up?

http://cod-servers.com
Website
Dodgeitorelse
Thu Feb 05 2015, 06:22PM
Posts: 246
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
will work on it for you

*EDIT*


try this


// SHOW THE PLAYERS
    $number = 0;
    $numberodd = 0;
    $numbereven = 0;
    $oddnumberarray = array(3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99);

      $output .= "<div style='width:100%' margin:auto; overflow:auto; text-align:center; padding:10px'>";

            if (empty($server['p']) || !is_array($server['p']))  // if no players then no player info
            {
                $output .= "<table cellpadding='4' cellspacing='2' style='margin:auto'>
                            <tr style='".lgsl_bg(FALSE).";>
                            <td> {$lgsl_config['text']['npi']} </td>
                            </tr>
                            </table>";
            }
            else
            {
                foreach ($server['p'] as $player)
                {
                    $number++;
                }
                if($number == 1) //if $number = 1 then display a single table
                {
                    $output .= "<table cellpadding='4' cellspacing='2' style='margin:auto'>
                                <tr style='".lgsl_bg(FALSE)."'>";
                                    foreach ($fields as $field)
                                    {
                                        $field = ucfirst($field);
                                        $output .= "<td> <b>{$field}</b> </td>";
                                    }
                    $output .= "</tr>";
                                    foreach ($server['p'] as $player_key => $player)
                                    {
                                        $numberodd++;
                                        if($numberodd % 2 == 1) //for each player add 1 to $numberodd, divide by 2 and if remainder 1
                                        {
                                            $output .= "<tr style='".lgsl_bg()."'>";
                                                foreach ($fields as $field)
                                                {
                                                    $output .= "<td> {$player[$field]} </td>";
                                                }
                                            $output .= "</tr>";
                                        }
                                    }
                    $output .= "</table>";
                }
                
                elseif(in_array($number, $oddnumberarray)) // if $number is found in $oddnumberarray then make a main table to house 2 tables side by side
                {
                    $output .="<table align='center' cellspacing='2'>
                               <tr>
                               <td>";
                                    $output .= "<table cellpadding='4' cellspacing='2'>
                                                <tr style='".lgsl_bg(FALSE)."'>";
                                            foreach ($fields as $field)
                                            {
                                                $field = ucfirst($field);
                                                    $output .= "<td> <b>{$field}</b> </td>";
                                            }
                                    $output .= "</tr>";
                                        foreach ($server['p'] as $player_key => $player) 
                                        {
                                            $numberodd++;
                                            if($numberodd % 2 == 1)   // adds 1 to $numberodd divides by 2 and if = 1 
                                            {
                                                $output .= "<tr style='".lgsl_bg()."'>";
                                                foreach ($fields as $field)
                                                {
                                                    $output .= "<td> {$player[$field]} </td>";
                                                }
                                                $output .= "
                                                </tr>";
                                            }
                                        }
                                    $output .= "</table>";
                    $output .="</td>";
                    
                    $output .="<td>";
                                    $output .= "<table cellpadding='4' cellspacing='2'>
                                                <tr style='".lgsl_bg(FALSE)."'>";
                                        foreach ($fields as $field)
                                        {
                                            $field = ucfirst($field);
                                            $output .= "<td> <b>{$field}</b> </td>";
                                        }
                                        $output .= " </tr>";
                                        foreach ($server['p'] as $player_key => $player)
                                        {
                                            $numbereven++;
                                            if($numbereven % 2 == 0)
                                            {
                                                $output .= "<tr style='".lgsl_bg()."'>";
                                                foreach ($fields as $field)
                                                {
                                                    $output .= "<td> {$player[$field]} </td>";
                                                }
                                                    $output .= "</tr>";
                                            }
                                        }
                                                $output .= "<tr style='background: transparent'><td style='visibility:hidden;'>.</td>";
                                        $output .= "</tr>";
                                                
                                    $output .= "</table>";
                    $output .= "</table>";                
                }
                
                else
                {
                    $output .="<table align='center' cellspacing='25'>
                               <tr>
                               <td>";
                                    $output .= "<table cellpadding='4' cellspacing='2' style='margin:auto'>
                                                <tr style='".lgsl_bg(FALSE)."'>";
                                    foreach ($fields as $field)
                                    {
                                        $field = ucfirst($field);
                                        $output .= "<td> <b>{$field}</b> </td>";
                                    }
                                    $output .= "</tr>";
                                    foreach ($server['p'] as $player_key => $player)
                                    {
                                        $numberodd++;
                                        if($numberodd % 2 == 1)
                                        {
                                            $output .= "<tr style='".lgsl_bg()."'>";
                                            foreach ($fields as $field)
                                            {
                                                $output .= "<td> {$player[$field]} </td>";
                                            }
                                            
                                        }
                                        
                                        $output .= "</tr>";
                                    }
                                    $output .= "</table>";
                    $output .="</td>";
                    $output .="<td>";
                                    $output .= "<table cellpadding='4' cellspacing='2' style='margin:auto'>
                                                <tr style='".lgsl_bg(FALSE)."'>";
                                    foreach ($fields as $field)
                                    {
                                        $field = ucfirst($field);
                                        $output .= "<td> <b>{$field}</b> </td>";
                                    }
                                    $output .= "</tr>";
                                    foreach ($server['p'] as $player_key => $player)
                                    {
                                        $numbereven++;
                                        if($numbereven % 2 == 0)
                                        {
                                            $output .= "<tr style='".lgsl_bg()."'>";
                                            foreach ($fields as $field)
                                            {
                                                $output .= "<td> {$player[$field]} </td>";
                                            }
                                            $output .= "</tr>";
                                        }
                                    }
                                    $output .= "</table>";
                }
            }
$output .= "</td>
            </tr>
            </table>";
$output .= "</div>";



I just set the color of the table row to transparent and set the <td> as hidden visibility. I used a period (.) in the <td> or else it wont display a row thus keeping tables lop sided if uneven number of players.

find $output .= "<tr style='background: transparent'><td style='visibility:hidden;'>.</td>"; to edit how the filler row displays.

lack of effort on your part requires less effort on my part
Website
TacTicToe
Mon Feb 23 2015, 11:16PM
Posts: 42
Joined: Mon Aug 13 2012, 01:33AM
Registered Member #7356
Works perfectly!! Thank you very much!!
Website
Dodgeitorelse
Mon Feb 23 2015, 11:36PM
Posts: 246
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
glad I could help

lack of effort on your part requires less effort on my part
Website
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org