Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
146 stars 127 forks source link

New HTML structure in characterprofile.php, using tables instead of list. #287

Closed Znote closed 5 years ago

Znote commented 7 years ago

image

Mockup html structure:

<table id="characterProfileTable">
    <tbody>
        <tr class="yellow">
            <td colspan="2"><h1><font>Lee Sang Hyeok</font><img src="http://outfit-images.ots.me/animatedOutfits1090/animoutfit.php?id=128&amp;addons=0&amp;head=3&amp;body=132&amp;legs=91&amp;feet=85" alt="img"></h1></td>
        </tr>
        <tr>
            <td>Sex</td>
            <td>Male</td>
        </tr>
        <tr>
            <td>Level</td>
            <td>242</td>
        </tr>
        <tr>
            <td>Vocation</td>
            <td>Master Sorcerer</td>
        </tr>
        <tr>
            <td>Last Login</td>
            <td>29 December 2016 (17:32)</td>
        </tr>
        <tr>
            <td>Status</td>
            <td><font color="red"><b>OFFLINE</b></font></td>
        </tr>
        <tr>
            <td>Created</td>
            <td>01 January 1970 (01:00)</td>
        </tr>
    </tbody>
</table>
<table id="deathListTable">
    <tbody>
        <tr class="yellow">
            <td colspan="2">Death List:</td>
        </tr>
        <tr>
            <td>29 December 2016 (05:56)</td>
            <td>Killed at level 237 by <a href="characterprofile.php?name=King On Three">King On Three</a><br>and by <a href="characterprofile.php?name=Davy">Davy</a></td>
        </tr>
        <tr>
            <td>29 December 2016 (05:31)</td>
            <td>Killed at level 237 by <a href="characterprofile.php?name=King On Three">King On Three</a> <font color="red" style="font-style: italic;">(unjustified)</font><br>and by <a href="characterprofile.php?name=Arca One">Arca One</a>. <font color="red" style="font-style: italic;">(unjustified)</font></td>
        </tr>
        <tr>
            <td>24 December 2016 (22:13)</td>
            <td>Killed at level 125 by a frost dragon<br>and by <a href="characterprofile.php?name=Lee Sang Hyeok">Lee Sang Hyeok</a>.</td>
        </tr>
        <tr>
            <td>24 December 2016 (06:04)</td>
            <td>Killed at level 92 by a midnight asura<br>and by <a href="characterprofile.php?name=Magic Rusha Facil">Magic Rusha Facil</a>.</td>
        </tr>
    </tbody>
</table>
<p><font class="profile_font" name="profile_font_share_url">Address:  <a href="http://demo.znote.eu/Lee Sang Hyeok">http://demo.znote.eu/Lee Sang Hyeok</a></font></p>
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/43179546-new-html-structure-in-characterprofile-php-using-tables-instead-of-list?utm_campaign=plugin&utm_content=tracker%2F532683&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F532683&utm_medium=issues&utm_source=github).
glombers commented 7 years ago

I'll add it tomorrow

ghost commented 7 years ago

And since then, we've never seen or heard from Glombers, neither the table layout...

glombers commented 7 years ago

Because I'm doing the main theme for 1.5 / 1.6. Using sub pages

glombers commented 7 years ago

@Znote Required rewriting of the entire file structure Everything is in Hard to combine it with php requires a lot of work able with death lists is for 3 versions heavy to do enter image description here The code needs to improve tomorrow I'll try to embrace it with your help

<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

if ($config['log_ip']) {
    znote_visitor_insert_detailed_data(4);
}

if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
    $name = getValue($_GET['name']);
    $user_id = user_character_exist($name);

    if ($user_id !== false) {
        $loadOutfits = $config['show_outfits']['characterprofile'];

        if ($config['TFSVersion'] == 'TFS_10') {
            if (!$loadOutfits) {
                $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin');
            } else { // Load outfits
                $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons');
            }
            $profile_data['online'] = user_is_online_10($user_id);

            if ($config['Ach']) {
                $achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`=(int)$user_id");
            }
        } else { // TFS 0.2, 0.3
            if (!$loadOutfits) {
                $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex');
            } else { // Load outfits
                $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons');
            }
        }

        $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');

        $guild_exist = false;

        if (get_character_guild_rank($user_id) > 0) 
        {
            $guild_exist = true;
            $guild = get_player_guild_data($user_id);
            $guild_name = get_guild_name($guild['guild_id']);
        }

        ?>

        <!-- PROFILE MARKUP HERE-->

        <!-- Profile name -->
        <table id="characterProfileTable">
            <tbody>
                <tr class="yellow">
                    <td colspan="2"><h1><font><?php echo $profile_data['name']; ?></font><?php if ($loadOutfits): ?><img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $profile_data['looktype']; ?>&addons=<?php echo $profile_data['lookaddons']; ?>&head=<?php echo $profile_data['lookhead']; ?>&body=<?php echo $profile_data['lookbody']; ?>&legs=<?php echo $profile_data['looklegs']; ?>&feet=<?php echo $profile_data['lookfeet']; ?>" alt="img"><?php endif; ?></h1>
                    </td>
                </tr>
                <tr>
                    <td>Sex</td>
                    <td><?php 
                        if ($profile_data['sex'] == 1) 
                        {
                            echo 'Male';
                        } 
                        else 
                        {
                            echo 'Female';
                        }
                        ?></td>
                </tr>
                <tr>
                    <td>Level</td>
                    <td>
                        <?php 
                            echo $profile_data['level']; 
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>Vocation</td>
                    <td><?php echo vocation_id_to_name($profile_data['vocation']); ?></td>
                </tr>
                <tr>
                    <td>Last Login</td>
                    <td><?php
                    if ($profile_data['lastlogin'] != 0) 
                    {
                        echo getClock($profile_data['lastlogin'], true, true);
                    } 
                    else 
                    {
                        echo 'Never.';
                    }
                    ?></td>
                </tr>
                <tr>
                    <td>Status</td>
                    <td><?php
                if ($config['TFSVersion'] == 'TFS_10') 
                {
                    if ($profile_data['online']) 
                    {
                        echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
                    } 
                    else 
                    {
                        echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
                    }
                } 
                else 
                {
                    if ($profile_data['online']) 
                    {
                        echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
                    } 
                    else 
                    {
                        echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
                    }
                }
                ?></td>
                </tr>
                <tr>
                    <td>Created</td>
            <td><?php echo getClock($profile_znote_data['created'], true); ?></td>
                </tr>
            </tbody>
        </table>
            <ul class="unstyled">

                <!-- Achievement start -->
                <?php 
                if ($config['Ach']) 
                { 
                    foreach ($achievementPoints as $achievement) 
                    {
                        //if player doesn't have any achievement points it won't echo the line below.
                        if ($achievement > 0)
                        {
                            echo '<li>Achievement Points: ' . $achievement . '</li>'; 
                        }
                    }
                }
                ?>
                <!-- Achievement end -->

                <!-- Display house start -->
                <?php
                if ($config['TFSVersion'] !== 'TFS_02') 
                {
                    $townid = ($config['TFSVersion'] === 'TFS_03') ? 'town' : 'town_id';
                    $houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `$townid` AS `town_id` FROM `houses` WHERE `owner` = $user_id;");

                    if ($houses) 
                    {
                        $playerlist = array();
                        foreach ($houses as $h) 
                        {
                            if ($h['owner'] > 0)
                            {
                                $playerlist[] = $h['owner'];
                            }

                            if ($profile_data['id'] = $h['owner']) 
                            {
                            ?>
                                <li>House: <?php echo $h['name']; ?>, <?php 
                                    foreach ($config['towns'] as $key => $value) 
                                    {
                                        if ($key == $h['town_id']) 
                                        {
                                            echo $value;
                                        }
                                    }
                             ?>
                                </li>
                            <?php
                            }
                        }
                    }
                }
                ?>

                <!-- Player Comment -->
                <?php
                //if player doesnt have set a comment dont show it.
                if (!empty($profile_znote_data['comment']))
                { ?>
                    <li>
                        <font class="profile_font" name="profile_font_comment">Comment:</font><br>
                        <textarea name="profile_comment_textarea" cols="70" rows="10" readonly="readonly" class="span12"><?php echo preg_replace('/\v+|\\\r\\\n/','<br/>',$profile_znote_data['comment']); ?></textarea>
                    </li>
                <?php
                }
                ?>

                <!-- Achievements start -->
                <?php if ($config['Ach']) 
                { ?>            
                    <h3 class="header-ok">Achievements</h3>
                    <div id="accordion">
                        <h3>Show/hide player achievements</h3>
                        <div>
                            <table class="table table-striped table-bordered">
                                <tbody>
                                    <style>
                                        #secondD {
                                            margin-left:0px;
                                        }
                                    </style>
                                    <?php
                                    foreach ($config['achievements'] as $key => $achiv) 
                                    {
                                        $uery = mysql_select_single("SELECT `player_id`, `value`, `key` FROM `player_storage` WHERE `player_id`='$user_id' AND `key`='$key' LIMIT 1;");
                                        if (!empty($uery) || $uery !== false) 
                                        {
                                            foreach ($uery as $luery) 
                                            {
                                                if ($luery == $key) 
                                                {
                                                    if (!array_key_exists($key, $achiv)) 
                                                    {
                                                        echo '<tr><td width="17%">' .$achiv[0]. '</td><td>' .$achiv[1]. '</td>';

                                                        if (!isset($achiv['secret'])) 
                                                        {
                                                            echo '<td><img id="secondD" src="http://img04.imgland.net/PuMz0mVqSG.gif"></td>';
                                                        }

                                                        echo '<td>'. $achiv['points'] .'</td>';
                                                        echo '<tr>';
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                    </div><br>
                <?php
                } 
                ?>
                <!-- Achievements end -->

                <!-- DEATH LIST -->
                <li>
                    <b>Death List:</b><br>
                    <?php
                    if ($config['TFSVersion'] == 'TFS_02') 
                    {
                        $array = user_fetch_deathlist($user_id);
                        if ($array) 
                        {
                        ?>
                            <ul>
                            <?php
                            // Design and present the list
                            foreach ($array as $value) 
                            { ?>
                                <li>
                                <?php
                                $value['time'] = getClock($value['time'], true);

                                if ($value['is_player'] == 1) 
                                {
                                    $value['killed_by'] = 'player: <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a>';
                                } 
                                else 
                                {
                                    $value['killed_by'] = 'monster: '. $value['killed_by'] .'.';
                                }

                                echo '['. $value['time'] .'] Killed at level '. $value['level'] .' by '. $value['killed_by']; ?>
                                </li>
                            <?php
                            }
                            ?>
                            </ul>
                            <?php
                        } 
                        else 
                        {
                            echo '<b><font color="green">This player has never died.</font></b>';
                        }
                    } 
                    else if ($config['TFSVersion'] == 'TFS_10') 
                    {
                        $deaths = mysql_select_multi("SELECT 
                            `player_id`, `time`, `level`, `killed_by`, `is_player`, 
                            `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified` 
                            FROM `player_deaths` 
                            WHERE `player_id`=$user_id ORDER BY `time` DESC LIMIT 10;");

                        if ($deaths)
                        { 
                            foreach ($deaths as $d) 
                            {
                                ?>
                                <li>
                                    <?php echo "<b>".getClock($d['time'], true, true)."</b>";
                                    $lasthit = ($d['is_player']) ? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>" : $d['killed_by'];
                                    echo ": Killed at level ".$d['level']." by $lasthit";
                                    if ($d['unjustified']) 
                                    {echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";}

                                    $mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;

                                    if ($mostdmg) 
                                    {
                                        $mostdmg = ($d['mostdamage_is_player']) ? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>" : $d['mostdamage_by'];
                                        echo "<br>and by $mostdmg.";

                                        if ($d['mostdamage_unjustified']) 
                                        { echo " <font color='red' style='font-style: italic;'>(unjustified)</font>"; }
                                    } 
                                    else 
                                    { echo " <b>(soloed)</b>"; }
                                    ?>
                                </li>
                                <?php
                            }
                        }
                        else 
                        {
                            echo '<b><font color="green">This player has never died.</font></b>'; 
                        }
                    } 
                    else if ($config['TFSVersion'] == 'TFS_03') 
                    {
                        //mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
                        $array = user_fetch_deathlist03($user_id);

                        if ($array) 
                        {?>
                            <ul>
                                <?php
                                // Design and present the list
                                foreach ($array as $value) 
                                { ?>
                                    <li>
                                    <?php
                                    $value[3] = user_get_killer_id(user_get_kid($value['id']));

                                    if ($value[3] !== false && $value[3] >= 1) 
                                    {
                                        $namedata = user_character_data((int)$value[3], 'name');

                                        if ($namedata !== false) 
                                        {
                                            $value[3] = $namedata['name'];
                                            $value[3] = 'player: <a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
                                        } 
                                        else 
                                        {
                                            $value[3] = 'deleted player.';
                                        }
                                    } 
                                    else 
                                    {
                                        $value[3] = user_get_killer_m_name(user_get_kid($value['id']));

                                        if ($value[3] === false) 
                                        { $value[3] = 'deleted player.'; }
                                    }

                                    echo '['. getClock($value['date'], true) .'] Killed at level '. $value['level'] .' by '. $value[3];
                                    echo '</li>';
                                }
                                ?>
                            </ul>
                            <?php
                        } 
                        else { echo '<b><font color="green">This player has never died.</font></b>'; }
                    }
                    ?>
                </li>
                <!-- END DEATH LIST -->

                <!-- QUEST PROGRESSION -->
                <?php
                $totalquests = 0;
                $completedquests = 0;
                $firstrun = 1;

                if ($config['EnableQuests'] == true) 
                {
                    $sqlquests =  mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = $user_id");
                    foreach ($config['quests'] as $cquest) 
                    {
                        $totalquests = $totalquests + 1;
                        foreach ($sqlquests as $dbquest) 
                        {
                            if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) 
                            {
                                $completedquests = $completedquests + 1;
                            }
                        }
                        if ($cquest[3] == 1) 
                        {
                            if ($completedquests != 0) 
                            {
                                if ($firstrun == 1) 
                                {
                                ?>
                                    <li>
                                        <b> Quest progression </b>
                                        <table id="characterprofileQuest" class="table table-striped table-hover">
                                            <tr class="yellow">
                                                <th>Quest:</th>
                                                <th>progression:</th>
                                            </tr>
                                <?php
                                $firstrun = 0;
                                }
                                $completed = $completedquests / $totalquests * 100;
                                ?>
                                <tr>
                                    <td><?php echo $cquest[2]; ?></td>
                                    <td id="progress">
                                        <span id="percent"><?php echo round($completed); ?>%</span>
                                        <div id="bar" style="width: '.$completed.'%"></div>
                                    </td>
                                </tr>
                                <?php
                            }

                            $completedquests = 0;
                            $totalquests = 0;

                        }
                    }
                }

                if ($firstrun == 0) 
                { ?>
                    </table></li>
                <?php
                }
                ?>
                <!-- END QUEST PROGRESSION -->

                <!-- CHARACTER LIST -->
                <?php
                if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1) 
                {
                ?>
                    <li>
                        <b>Other visible characters on this account:</b><br>
                        <?php
                        $characters = user_character_list(user_character_account_id($profile_data['name']));
                        // characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
                        if ($characters && count($characters) > 0) 
                        {
                            ?>
                            <table id="characterprofileTable" class="table table-striped table-hover">
                                <tr class="yellow">
                                    <th>Name:</th>
                                    <th>Level:</th>
                                    <th>Vocation:</th>
                                    <th>Last login:</th>
                                    <th>Status:</th>
                                </tr>

                                <?php
                                // Design and present the list
                                foreach ($characters as $char) 
                                {
                                    if ($char['name'] != $profile_data['name']) 
                                    {
                                        if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden') 
                                        { ?>
                                            <tr>
                                                <td><a href="characterprofile.php?name=<?php echo $char['name']; ?>"><?php echo $char['name']; ?></a></td>
                                                <td><?php echo (int)$char['level']; ?></td>
                                                <td><?php echo $char['vocation']; ?></td>
                                                <td><?php echo $char['lastlogin']; ?></td>
                                                <td><?php echo $char['online']; ?></td>
                                            </tr>
                                        <?php
                                        }
                                    }
                                }
                            ?>
                            </table>
                            <?php
                        } 
                        else 
                        {
                            echo '<b><font color="green">This player has never died.</font></b>';
                        }
                        ?>
                    </li>
                <?php
                }
                ?>
                <!-- END CHARACTER LIST -->

                <li>
                    <font class="profile_font" name="profile_font_share_url">Address: 
                    <a href="
                        <?php 
                        if ($config['htwrite']) 
                        { 
                            echo "http://" . $_SERVER['HTTP_HOST']."/" . $profile_data['name']; 
                        }
                        else 
                        { 
                            echo "http://" . $_SERVER['HTTP_HOST'] . "/characterprofile.php?name=" . $profile_data['name']; 
                        }   
                        ?>">
                        <?php
                        if ($config['htwrite']) 
                        { 
                            echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name']; 
                        }
                        else 
                        { 
                            echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name']; 
                        }
                        ?>
                </a></font></li>
            </ul>
        <!-- END PROFILE MARKUP HERE-->

        <?php
    } 
    else 
    {
        echo htmlentities(strip_tags($name, ENT_QUOTES)) . ' does not exist.';
    }
} 
else 
{
    header('Location: index.php');
}

include 'layout/overall/footer.php'; ?>
peonso commented 7 years ago

I did this for a old 1.5 layout (August 2014)

<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>
<img src="layout/images/titles/t_characters.png"/><p>
<?php
if ($config['log_ip']) {
    znote_visitor_insert_detailed_data(4);
}
if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
    $name = $_GET['name'];
    $user_id = user_character_exist($name);
    if ($user_id !== false) {
        if ($config['TFSVersion'] == 'TFS_10') {
            $profile_data = user_character_data($user_id, 'name', 'level', 'vocation', 'lastlogin', 'sex', 'group_id', 'town_id');
            $profile_data['online'] = user_is_online_10($user_id);
        } else $profile_data = user_character_data($user_id, 'name', 'level', 'vocation', 'lastlogin', 'online', 'sex', 'group_id', 'town_id');
        $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');

        $guild_exist = false;
        if (get_character_guild_rank($user_id) > 0) {
            $guild_exist = true;
            $guild = get_player_guild_data($user_id);
            $guild_name = get_guild_name($guild['guild_id']);
        }
        ?>

        <!-- PROFILE MARKUP HERE-->
            <!-- CHARACTER INFORMAION -->
            <table>
            <tr><td colspan="2">Character Information</td></tr>
            <tr><td width="20%">Name:</td>
            <td><?php echo $profile_data['name']; ?></td></tr>
            <tr><td>Sex:</td>
            <td><?php 
                if ($profile_data['sex'] == 1) {
                echo 'Male';
                } else {
                echo 'Female';
                }
                ?></td></tr>
            <tr><td>Vocation:</td>
            <td><?php echo vocation_id_to_name($profile_data['vocation']); ?></td></tr>
            <tr><td>Level:</td>
            <td><?php echo $profile_data['level']; ?></td></tr>
            <tr><td>World:</td>
            <td><?php echo $config['site_title']; ?></td></tr>
            <tr><td>Residence:</td>
            <td><?php 
                foreach ($config['towns'] as $key=>$value) {
                    if ($key == $profile_data['town_id']) {
                        echo $value;
                    }
                } ?></td></tr>
                <?php       $houses = array();
            $houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `town_id` FROM `houses` WHERE `owner` = $user_id ;");
            if ($houses !== false) {
                $playerlist = array();
                foreach ($houses as $h)
                    if ($h['owner'] > 0)
                        $playerlist[] = $h['owner'];

                if ($profile_data['id'] = $h['owner']) { ?>
            <tr><td>House:</td>
            <td><?php echo $h['name']; ?> (<?php 
                foreach ($config['towns'] as $key=>$value) {
                    if ($key == $h['town_id']) {
                        echo $value;
                    }
                } ?>)</td></tr>
                <?php
                    }
                }
                ?>
                <?php 
                if ($guild_exist) {
                ?>
            <tr><td>Guild membership:</td>
            <td><?php echo $guild['rank_name']; ?> of the <a href="guilds.php?name=<?php echo $guild_name; ?>"><?php echo $guild_name; ?></a></td></tr>
                <?php
                }
                ?>          
            <tr><td>Last login:</td>
            <td><?php
                    if ($profile_data['lastlogin'] != 0) {
                        echo getClock($profile_data['lastlogin'], true, true);
                    } else {
                        echo 'never logged in';
                    }

                ?></td></tr>
                <?php 
                if ($profile_data['group_id'] > 1) {
                ?>
            <tr><td>Position:</td>
            <td><?php 
                foreach ($config['ingame_positions'] as $key=>$value) {
                    if ($key == $profile_data['group_id']) {
                        echo $value;
                    }
                } ?></td></tr>
                <?php
                }
                ?>
                <?php if (isset($profile_znote_data['comment']) === true && empty($profile_znote_data['comment']) === false) { ?>
            <tr><td>Comment:</td>
            <td><?php echo $profile_znote_data['comment']; ?></td></tr>
                <?php } ?>
            <tr><td>Created:</td>
            <td><?php echo getClock($profile_znote_data['created'], true); ?></td></tr>
            </table>
            <!-- END CHARACTER INFORMATION -->
            <!-- DEATH LIST -->
                    <?php
                    if ($config['TFSVersion'] == 'TFS_02') {
                        $array = user_fetch_deathlist($user_id);
                        if ($array) { ?>
                            <table>
                                <tr><td colspan="2">Character Deaths</td></tr><?php                                         
                            //data_dump($array, false, "Data:");
                                // Design and present the list
                                foreach ($array as $value) {
                                    // $value[0]
                                    $value['time'] = getClock($value['time'], true);                                
                                    if ($value['is_player'] == 1) {
                                        echo '<tr><td>'. $value['time'] .'</td><td> Killed at Level '. $value['level'] .' by <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a></td></tr>';
                                    } else {
                                        echo '<tr><td>'. $value['time'] .'</td><td> Died at Level '. $value['level'] .' by '. $value['killed_by'] .'</td></tr>';
                                    }
                                ?>
                            </table><?php
                                }
                            } 
                            //Done.
                        } else if ($config['TFSVersion'] == 'TFS_10') {
                            $deaths = mysql_select_multi("SELECT 
                                `player_id`, `time`, `level`, `killed_by`, `is_player`, 
                                `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified` 
                                FROM `player_deaths` 
                                WHERE `player_id`=$user_id ORDER BY `time` DESC LIMIT 10;");

                            if (!$deaths) echo '';
                            else {
                            ?>
                            <table>
                                <tr><td colspan="2">Character Deaths</td></tr><?php     
                                foreach ($deaths as $d) {
                                        echo "<tr><td width='20%'>".getClock($d['time'], true, true)."</td>";
                                        $lasthit = ($d['is_player']) ? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>" : $d['killed_by'];
                                            if ($d['is_player'] > 0) {
                                            echo "<td> Killed at Level ".$d['level']." by $lasthit";
                                            } else echo "<td> Died at Level ".$d['level']." by $lasthit";
                                        if ($d['unjustified']) echo " <font color='red' style='font-style: italic;font-size:85%;'>(unjustified)</font>";
                                        $mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;
                                        if ($mostdmg) {
                                            $mostdmg = ($d['mostdamage_is_player']) ? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>" : $d['mostdamage_by'];
                                            echo " and by $mostdmg.";
                                            if ($d['mostdamage_unjustified']) echo " <font color='red' style='font-style: italic;font-size:85%;'>(unjustified)</font>";
                                        }
                                }
                                //data_dump($deaths, false, "Deaths:");
                                                                ?>
                            </td></tr></table><?php
                            }
                        } else if ($config['TFSVersion'] == 'TFS_03') {
                            //mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
                            $array = user_fetch_deathlist03($user_id);
                            if ($array) {                           ?>
                            <table>
                                <tr><td colspan="2">Character Deaths</td></tr><?php     
                                // Design and present the list
                                foreach ($array as $value) {
                                    $value[3] = user_get_killer_id(user_get_kid($value['id']));
                                    if ($value[3] !== false && $value[3] >= 1) {
                                        $namedata = user_character_data((int)$value[3], 'name');
                                        if ($namedata !== false) {
                                            $value[3] = $namedata['name'];
                                            $value[3] = '<a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
                                        } else {
                                            $value[3] = 'deleted player.';
                                        }
                                        echo '<tr><td>'. getClock($value['date'], true) .'</td><td>Killed at Level '. $value['level'] .' by '. $value[3] .'</td></tr>';
                                    } else {
                                        $value[3] = user_get_killer_m_name(user_get_kid($value['id']));
                                        if ($value[3] === false) $value[3] = 'deleted player.';
                                        echo '<tr><td>'. getClock($value['date'], true) .'</td><td>Died at Level '. $value['level'] .' by '. $value[3] .'</td></tr>';
                                    }
                                }
                                                                ?>
                            </table><?php
                            } 
                        }
                        ?>
                <!-- END DEATH LIST -->
                <!-- QUEST PROGRESSION -->
                                <?php
                                $totalquests = 0;
                                $completedquests = 0;
                                $firstrun = 1;
                                if ($config['EnableQuests'] == true)
                                {
                                        $sqlquests =  mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = $user_id");
                                        foreach ($config['Quests'] as $cquest)
                                        {
                                                $totalquests = $totalquests + 1;
                                                foreach ($sqlquests as $dbquest)
                                                {
                                                        if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value'])
                                                        {
                                                                $completedquests = $completedquests + 1;
                                                        }
                                                }
                                                if ($cquest[3] == 1)
                                                {
                                                        if ($completedquests != 0)
                                                        {
                                                                if ($firstrun == 1)
                                                                {
                                                                        echo '<table id="characterprofileQuest" class="table table-striped table-hover">';
                                                                        echo '<tr class="yellow">';
                                                                        echo '<td colspan="2">Quest Progress</td>';
                                                                        echo '</tr>';
                                                                        $firstrun = 0;
                                                                }
                                                                $completed = $completedquests / $totalquests * 100;
                                                                echo '<tr>';
                                                                echo '<td>'. $cquest[2] .'</td>';
                                                                echo '<td id="progress"><span id="percent">'.round($completed).'%</span><div id="bar" style="width: '.$completed.'%"></div></td>';
                                                                echo '</tr>';
                                                        }
                                                        $completedquests = 0;
                                                        $totalquests = 0;
                                                }
                                        }
                                }
                                if ($firstrun == 0)
                                {
                                        echo '</table>';
                                }
                                ?>
                                <!-- END QUEST PROGRESSION -->
                <!-- CHARACTER LIST -->
                <?php
                if (user_character_hide($profile_data['name']) != 1) {
                ?>
                    <table>
                    <tr><td colspan="4">Characters</td></tr>
                        <?php
                        $characters = user_character_list(user_character_account_id($profile_data['name']));
                        // characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
                        if ($characters && count($characters) > 0) {
                            ?>
                                <tr>
                                    <td><b>Name</b></td>
                                    <td width="55%"><b>Status</b></td>
                                    <td><b>Level</b></td>
                                    <td><b>Vocation</b></td>
                                </tr>
                                <?php
                                // Design and present the list
                                $number = 1;
                                foreach ($characters as $char) {
                                        if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden') {
                                            echo '<tr>';
                                            echo '<td>'. $number .'. <a href="characterprofile.php?name='. $char['name'] .'">'. $char['name'] .'</a></td>';
                                            if ($char['name'] != $profile_data['name']) { echo '<td>'. $char['online'] .'</td>';
                                            } else echo '<td>'. $char['online'] .' <span style="font-size:85%;opacity:.5;"><i> (currently viewing)</i></span></td>';
                                            echo '<td>'. $char['level'] .'</td>';
                                            echo '<td>'. $char['vocation'] .'</td>';
                                            /* echo '<td>';
                                                if ($profile_data['lastlogin'] != 0) {
                                                    echo getClock($profile_data['lastlogin'], true, true);
                                                } else {
                                                    echo 'never logged in';
                                                }
                                            echo '</td>'; */
                                            echo '</tr>';
                                        $number = $number + 1;
                                        }
                                }
                            ?>
                            </table>
                            <?php
                            } else {
                                echo '<b><font color="green">This player has never died.</font></b>';
                            }
                                //Done.
                            ?>
                <?php
                }
                ?>
                <!-- END CHARACTER LIST -->
                <?php /*
                <table>
                <tr><td><font class="profile_font" name="profile_font_share_url">Address</td></tr><tr><td><a href="<?php 
                    if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
                    else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];

                ?>"><?php
                    if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
                    else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
                ?></a></font></td></tr>
                </table>
                */ ?>

        <!-- END PROFILE MARKUP HERE-->

        <?php
    } else {
        echo htmlentities(strip_tags($name, ENT_QUOTES)).' does not exist.';
    }
} else {
    header('Location: unnamed');
}?>
<p><table>
<tr><td>Search Character</td></tr>
<tr class="darkborder"><td>
    <form type="submit" action="characterprofile.php" method="get">
        Name: <input type="text" size="25" name="name" class="search">
        <input type="submit" name="submitName" value="Submit">
    </form>
</td></tr>
</table>
<?php include 'layout/overall/footer.php'; ?>
Znote commented 5 years ago

image