• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Znote queststatus.php

Swiff

Member
Joined
Apr 6, 2009
Messages
366
Reaction score
12
Location
Sweden
Hello! I found this .php page and I wonder how to use it properly with znote aac:
Code:
<table id="questTable">
    <?php
    $completed = '<font color="green">[Completed]</font>';
    $notstarted = '';
    function Progress($min, $max, $design = '<font color="orange">[x%]</font>') {
        $design = explode("x%",$design);
        $percent = ($min / $max) * 100;
        return $design[0] . $percent . $design[1];
    }
    $quests = array(
        // Simple quests
        'Bearslayer' => 1057,
        'Sword Quest' => 1337,

        // Advanced quest with progress par:
        'Postman Quest' => array(
            1338,
            3,
        ),
    );
    ?>
    <tr class="yellow">
        <td>Quest Name</td>
        <td>Status</td>
    </tr>
    <?php
    // Rolling through quests
    foreach ($quests as $key => $quest) {

        // Is quest NOT an array (advanced quest?)
        if (!is_array($quest)) {
            // Query to find quest results
            $query = mysql_select_single("SELECT `value` FROM `player_storage` WHERE `key`='$quest' AND `player_id`='$user_id' AND `value`='1' LIMIT 1;");

            if ($query !== false) $quest = $completed;
            else $quest = $notstarted;

        } else {
            $query = mysql_select_single("SELECT `value` FROM `player_storage` WHERE `key`='".$quest[0]."' AND `player_id`='$user_id' AND `value`>'0' LIMIT 1;");
            if (!$query) $quest = $notstarted;
            else {
                if ($query['value'] >= $quest[1]) $quest = $completed;
                else $quest = Progress($query['value'], $quest[1]);
            }
        }
        ?>
        <tr>
            <td><?php echo $key; ?></td>
            <td><?php echo $quest; ?></td>
        </tr>
        <?php
    }
    ?>
</table>

What I have done:
¤put it in the menu in library tab
¤change "[CODE'Bearslayer' => 1057,[/CODE]" to my starter chest uid
¤created character and took the starter chest to get the storage
¤log in to page and check in queststatus tab

And what I can see is:
1o44.png


I figured it would show the quests and show I completed one but, maybe this script is not completed yet? Can anyone comfirm this, or am I doing something wrong? ^^
 
You're supposed to paste the code into your characterprofile.php.

YfqWn3u.png



Btw, could you take a look at this:

Code:
<?php
    $completed = '        <div class="progress progress-success"><div class="bar" style="width: 100%">Completed</div</div>';
    $notstarted = '<div class="progress progress-danger"><div class="bar" style="width: 100%">Not started</div></div>';
    function Progress($min, $max, $design = '<div class="progress progress-warning"><div class="bar" style="width: x%%"><font color="orange">x%</font></div></div>') {
        $design = explode("x%",$design);
        $percent = ($min / $max) * 100;
        return $design[0] . $percent . $design[1];
    }
    $quests = array(
        // Simple quests
        'Annihilator Quest' => 2216,
        'The Hidden City of Beregar Quest' => 9211,

     

        // Advanced quest with progress par:
        'Big foot burden Quest' => array(
            954,
            5,
        ),
    );
    ?>



So currently it doesn't show up the %~, but if I remove the progress bar it does. (I need 2x "explode"?~
 
Did you even read the post o_O?

You have to include the queststatus.php to the characterview.php (or something like that)

What post? ^^ I got it from github

Thanks guys :)

Edit: I just assumed it would be a standalone page since the script was called queststatus.php xd
 
Last edited:
So currently it doesn't show up the %~, but if I remove the progress bar it does. (I need 2x "explode"?~
You could do that, e.g
Code:
    function Progress($min, $max, $design = '<div class="progress progress-warning"><div class="bar" style="width: x%%">', $d = 'z%%</div></div>') {
        $design = explode("x%",$design);
        $d = explode("z%", $d);
        $percent = round(($min / $max) * 100);
        return $design[0] . $percent . $design[1] . $percent . $d[1];
    }
 
for me it's lookin like this

2014-02-15_20h39_20.png



Code:
                <table id="questTable">
    <?php
    $completed = '<font color="green">[Completed]</font>';
    $notstarted = '';
    function Progress($min, $max, $design = '<font color="orange">[x%]</font>') {
        $design = explode("x%",$design);
        $percent = ($min / $max) * 100;
        return $design[0] . $percent . $design[1];
    }
    $quests = array(
        // Simple quests
        'Annihilator' => 30015,
        'Inquestion' => 6076,
       

        // Advanced quest with progress par:
        'Svargrond Arena' => array(
            42381,
            3,
        ),
    );
    ?>
    <tr class="yellow">
        <td>Quest</td>
        <td>Status</td>
    </tr>
    <?php
    // Rolling through quests
    foreach ($quests as $key => $quest) {

        // Is quest NOT an array (advanced quest?)
        if (!is_array($quest)) {
            // Query to find quest results
            $query = mysql_select_single("SELECT `value` FROM `player_storage` WHERE `key`='$quest' AND `player_id`='$user_id' AND `value`='1' LIMIT 1;");

            if ($query !== false) $quest = $completed;
            else $quest = $notstarted;

        } else {
            $query = mysql_select_single("SELECT `value` FROM `player_storage` WHERE `key`='".$quest[0]."' AND `player_id`='$user_id' AND `value`>'0' LIMIT 1;");
            if (!$query) $quest = $notstarted;
            else {
                if ($query['value'] >= $quest[1]) $quest = $completed;
                else $quest = Progress($query['value'], $quest[1]);
            }
        }
        ?>
        <tr>
            <td><?php echo $key; ?></td>
            <td><?php echo $quest; ?></td>
        </tr>
        <?php
    }
    ?>
</table>
 
Back
Top