Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006
    Location
    Northamptonshire, England.
    Posts
    1,303
    Tokens
    0

    Latest Awards:

    Default Need some help :)

    I have this code

    PHP Code:
    <html>
    <body>
    <font size="1" face ="verdana">
    <?php

    if (!isset($index_include) || $index_include !== true)
    {
        require 
    'header.php';
        
    $page 'lookup.php';
    }
    else
    {
        
    $page 'index.php';
    }

    if (isset(
    $_GET['skill']) || isset($_GET['personal']))
    {
    ?>
        
    <?php
    }

    function 
    error ()
    {
    ?>
      <div class="content">
        <font size="1" face ="verdana">No highscore data found for<b>

    <?
    echo $_GET['personal'];
    ?></b></font>
      </div>
    <font size=\"1\" face =\"verdana\">
    <?php
        


        
    exit;
    }

    $skill_list = new skill_list();
    $skills $skill_list->get_list();

    if (isset(
    $_GET['personal']))

        
    $char = new rs_character($_GET['personal']);
        if (@
    $char->load(falsefalse) === false)
        {
            
    error();
        }
        
    ?>
       <div class="content">
        <?php echo $char->get_name(); ?> 
       </div>
       <div class="content">
        <table class="content" <?php echo $iefix?>>
         <tr><th>Skill</th><th>Level</th><th>Experience</th><th>Rank</th></tr>
    <?php

        $gray 
    true;

        foreach (
    $skills as $skill)
        {
            
    $row $char->get_skill($skill);
            
            echo 
    '     <tr class="' . ($gray 'r1' 'r2') . '">';
            
            if (
    $row == false)
            {
                echo 
    '<td class="left">' $skill '</td>' .
                    
    '<td>--</td><td>--</td><td>--</td>';
            }
            else
            {
                echo 
    '<td class="left"><a href="' $page '?user=' 
                        
    valid_rs_name($char->get_name()) .
                        
    '&skill=' $row['Skill'] . '">' $row['Skill'] .
                        
    '</a></td>' 
                    
    '<td>' format($row['Level']) . '</td>' 
                    
    '<td>' format($row['XP']) . '</td>' 
                    
    '<td>' format($row['Rank']) . '</td>';
            }
            
            echo 
    '</tr>' chr(10);
            
    $gray = !$gray;
        }    
        
    ?>
        </table>
       </div>
      </div>
     
    <?php 


    elseif (isset(
    $_GET['skill'])) 
    {


        
    $scores = new rank_search();
        
    $skill strtolower($_GET['skill']);

        if (isset(
    $_GET['rank']))
        {
            
    $scores->load_rank($_GET['rank'], $skill);
            
    $hirank intval($_GET['rank']);
        }
        elseif (isset(
    $_GET['user']))
        {
            
    $scores->load_user($_GET['user'], $skill);
            
    $hirank $scores->find($_GET['user']);
        }
        else
        {
            
    error();
        }

        
    $rows $scores->get_all();
        
    $row $scores->get($hirank);

        
    // End on error, or if no data was retrieved.
        
    if ($rows === false || $scores->get_count() < 1)
        {
            
    error();
        }

        
    $level = ($row !== false) ? $row['Level'] : 0;
        
    $exp = ($row !== false) ? $row['XP'] : 0;


    ?>
      <div class="content">
         <?php echo ucwords($skill) . ' ' . (isset($_GET['user']) ? 'Username' 'Rank'); ?> lookup 
       </div>
       <div class="content">
        <table class="content" <?php echo $iefix?>>
         <tr><th>Rank</th><th>Name</th><th>Level</th><th>Experience</th><th>Difference</th></tr>
    <?php

        $gray 
    true;

        foreach (
    $rows as $row)
        {

            if (
    intval($row['Rank']) == $hirank)
            {
                
    $diff '';
                
    $type '&nbsp;';
            }
            elseif (
    $skill == 'overall')
            {
                
    $diff $level != $row['Level']
                    ? 
    abs($row['Level'] - $level)
                    : 
    abs($row['XP'] - $exp);
                
    $type '&nbsp;' . ($level != $row['Level'] ? 'LVL' 'XP');
            }
            else
            {
                
    $diff abs($row['XP'] - $exp);
                
    $type '&nbsp;XP';
            }
            
            
    $validname valid_rs_name($row['Name']);
            
    $row['Name'] = str_replace(' ''&nbsp;'$row['Name']);
            
            
    $class = (intval($row['Rank']) == $hirank) ? 'hirank' : ($gray 'r1' 'r2');
            echo 
    '     <tr class="' $class '">' 
                
    '<td>' format($row['Rank']) . '</td>' 
                
    '<td class="left"><a href="' $page '?personal=' $validname 
                    
    '">' $row['Name'] . '</a></td>' 
                
    '<td>' format($row['Level']) . '</td>' 
                
    '<td>' format($row['XP']) . '</td>' .
                
    '<td>' format($diff) . $type '</td>' .
                
    '</tr>' chr(10);
            
    $gray = !$gray;
        }    
        
    ?>
        </table>
       </div>
      </div>
     
    <?php
    }
    else
    {

        
    $skillmenu "";
        foreach (
    $skills as $value)
        {
            
    $skillmenu .= '      <option value="' $value '">' $value 
                
    '</option>' chr(10);
        }

    ?>
    <?php 
    if (!$index_include) { ?>

    <?php ?>

      <form method="get" action="<?php echo $page?>">
        <div class="content">
         Enter Name <br />
         <input type="text" name="personal" size="20" /><br />
         <input type="submit" value="Get stats" />
        </div>
       </div>
      </form>
      
    <?php

    ?>
    </font>
    </body>
    </html>
    The outcome is this:

    http://www.slickselect.packagehosts....?personal=xiwl

    Could someone change the code so the outcome comes out in a table

  2. #2
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    It already is in a table.

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  3. #3
    Join Date
    Dec 2006
    Location
    Northamptonshire, England.
    Posts
    1,303
    Tokens
    0

    Latest Awards:

    Default

    Ok then, how do i put a border on the table

    Done it anyways
    Last edited by R; 21-03-2007 at 03:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •