[Znote AAC] Quest Information

Discussion in 'Website Applications' started by krotus, Aug 14, 2013.

Tags:
  1. krotus

    krotus Member

    Joined:
    Jul 15, 2009
    Messages:
    65
    Likes Received:
    2
    Best Answers:
    0
    Hi folks!
    I was boring so, I decided to make a simple piece of PHP code to show which quest has done the player and which not yet.
    So, It's a simple code so don't blame me, it's my first resource that I make.

    Well, let's go to move to our principal folder ('www') and open the file, characterprofile.php and search the line:
    PHP:
    1. <li><font class="profile_font" name="profile_font_comment">Comment:</font> <br><textarea name="profile_comment_textarea" cols="70" rows="10" readonly="readonly"><?php echo $profile_znote_data['comment']; ?></textarea></li>
    Below from this last line between the clauses comment text and death list, anyway you can put this anywhere but I decided there, put this :
    PHP:
    1.  
    2. <!-- Quest information by Krotus to Otland.net-->
    3.                 <div>
    4.                 <table>
    5.                     <th colspan="2">Quest</th>
    6.                 <?php
    7.                 $storage=array('First Quest' => 50020, 'Second Quest' => 42355, 'Third Quest' => 52321);
    8.                 foreach($storage as $name => $value)
    9.                 {
    10.                     echo "<tr>";
    11.                     echo "<td width=90%>".$name."</td>";
    12.                     $quest = mysql_select_single("SELECT `value` FROM `player_storage` WHERE `key`='$value' AND `player_id`='$user_id' LIMIT 1;");
    13.                     if ($quest['value'] == 1) {
    14.                         echo "<td><img src='images/yes_quest.png'></td>";
    15.                     }else{
    16.                         echo "<td><img src='images/no_quest.png' ></td>";
    17.                     }
    18.                     echo "</tr>";
    19.                 }
    20.                 ?>
    21.                 </table>
    22.                 </div>
    23.  
    Configuration:
    On the line:
    PHP:
    1. $storage=array('First Quest' => 50020, 'Second Quest' => 42355, 'Third Quest' => 52321);
    You can change the Questname and his storage value, it is just an exemple.

    This method shows us if the player has done the quest with an image, so you can put any path/picture that you want.
    How I said before It's a simple code but I think that could be useful got it on our website.

    Exemple:
    quest_information.jpg

    Regards,
    Krotus
     
    killing likes this.
  2. cbrm

    cbrm Just another mod Staff Member Global Moderator

    Joined:
    Jan 6, 2009
    Messages:
    6,541
    Likes Received:
    834
    Best Answers:
    0
    Approved
     
  3. GOD Suimy

    GOD Suimy Member

    Joined:
    Sep 11, 2012
    Messages:
    98
    Likes Received:
    15
    Best Answers:
    0
    I show the error it says:

    But the system works.

    How I put the images?
     
  4. krotus

    krotus Member

    Joined:
    Jul 15, 2009
    Messages:
    65
    Likes Received:
    2
    Best Answers:
    0
    To put your image you've to change the tag <img src='by your path/source'>
    PHP:
    1. echo "<td><img src='images/yes_quest.png'></td>";
    Where the images/ <-- is the folder which contain the source PNG.
    The first tag is for player has done the quest and the second is when the player doesn't done it yet.
     
  5. GOD Suimy

    GOD Suimy Member

    Joined:
    Sep 11, 2012
    Messages:
    98
    Likes Received:
    15
    Best Answers:
    0
    !bump
    Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 39 in C:\xampp\htdocs\engine\function\users.php on line 990
     
  6. GOD Suimy

    GOD Suimy Member

    Joined:
    Sep 11, 2012
    Messages:
    98
    Likes Received:
    15
    Best Answers:
    0
    !bump

    Code (Text):
    1.  Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 39 in C:\xampp\htdocs\engine\function\users.php on line 990
     
  7. Gordittox

    Gordittox Member

    Joined:
    Mar 11, 2013
    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Never Repair This Problem?
     

Share This Page

Loading...