[Znote AAC] Most Creature Killers

Discussion in 'Website Applications' started by HalfAway, Sep 17, 2015.

  1. HalfAway

    HalfAway #1

    Joined:
    Sep 3, 2011
    Messages:
    3,604
    Likes Received:
    2,330
    Best Answers:
    15
    I converted this script to ZnoteAAC because of a request here Solved - [Znote v1.5] Most Creature Killers

    The script was orginally coded by @Zonet.

    Code:
    PHP:
    1. <?php require_once 'engine/init.php'; include 'layout/overall/header.php';
    2.  
    3. /*
    4.     Script by zonet.
    5.     Converted to ZnoteAAC by HalfAway.
    6. */
    7.  
    8. // Creature array (name + storage).
    9. $kills = array(
    10.             'dragon' => 9541,
    11.             'dragon lord' => 9542,
    12.             'frost dragon' => 9543,
    13.             'wyrm' => 9544,
    14.             'demon' => 9545
    15.             );
    16.  
    17. // Limits the list of killers for each creature
    18. $limit = 6;
    19.  
    20. echo '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
    21.        <tr bgcolor="#505050" style="color: white;"><th width="10%">Creature</th><th>Creature Name</th><th>Top Killers (Max: '.$limit.')</th></tr>';
    22.     $row = 1;
    23.     foreach($kills as $name => $storage) {
    24.         $monterq = mysql_select_multi('SELECT `player_storage`.`player_id`, `player_storage`.`key`, `player_storage`.`value` AS `value`, `players`.`id`, `players`.`name` AS `name`
    25.            FROM `player_storage` LEFT JOIN `players` ON `player_storage`.`player_id` = `players`.`id` WHERE `player_storage`.`key` = '.$storage.' ORDER BY ABS(value) DESC LIMIT '.$limit);
    26.  
    27.         echo '<tr><td><img src="monsters/'.(str_replace(" ", "" , $name)).'.gif"></td><td width="20%" style="font-size: 13pt; font-weight: bold; color: darkorange;"><center>'.(ucwords($name)).'</center></td><td>';
    28.         $a = 0;
    29.         foreach($monterq as $q) {
    30.             $a++;
    31.             if($a == 1)
    32.                 echo '<font color="green">';
    33.             if($a == $limit)
    34.                 echo '<font color="red">';
    35.             if($a == $limit / 2)
    36.                 echo '<font color="darkorange">';
    37.  
    38.             echo '<b>'.$a.'. Name:</b> <a href="characterprofile.php?name='.urlencode($q['name']).'">'.$q['name'].'</a> (Kills:  '.$q['value'].') </font></font></font><br />';
    39.         }
    40.         echo '</tr>';
    41.     }
    42.     echo '</td></table>';
    43.  
    44. include 'layout/overall/footer.php'; ?>
    You need to add the images into a folder named monsters inside your www directory.

    Image
    [​IMG]
     

    Attached Files:

    Last edited: Sep 17, 2015
    sematico, lopez65, Znote and 11 others like this.
  2. Damon

    Damon Retired | Check my status to contact me :)

    Joined:
    Mar 26, 2011
    Messages:
    6,016
    Likes Received:
    1,870
    Best Answers:
    1
    Nice work! Thanks for contributing this mate :)
     
  3. LuckyM

    LuckyM Ett är Ett

    Joined:
    Jun 13, 2009
    Messages:
    1,365
    Likes Received:
    143
    Best Answers:
    0
    You're awesome m8 :)
     
  4. Tarek1337

    Tarek1337 Well-Known Member

    Joined:
    Jun 9, 2012
    Messages:
    3,552
    Likes Received:
    1,129
    Best Answers:
    3
    Nice mate, I will probaly use this in the future.
     
    Sir Knighter likes this.
  5. Sir Knighter

    Sir Knighter ArchlightOnline.com Premium User

    Joined:
    Jun 29, 2009
    Messages:
    3,894
    Likes Received:
    1,057
    Best Answers:
    0
    Very cool 10/10 will try this on archlight
     
  6. Call Me Taffy

    Call Me Taffy Call Me Maybe

    Joined:
    Aug 9, 2009
    Messages:
    649
    Likes Received:
    119
    Best Answers:
    0
    100% love it, thanks broham!
     
  7. pierroth

    pierroth Mar Co.

    Joined:
    Sep 11, 2008
    Messages:
    344
    Likes Received:
    10
    Best Answers:
    0
    Where can I get the creature images?
     
  8. HalfAway

    HalfAway #1

    Joined:
    Sep 3, 2011
    Messages:
    3,604
    Likes Received:
    2,330
    Best Answers:
    15
    I saved the images from Tibia Wikia and placed them in a folder named monsters.
    This is the images I used:
    http://halfaway.net/files/monsters.zip
     
    pierroth likes this.
  9. pierroth

    pierroth Mar Co.

    Joined:
    Sep 11, 2008
    Messages:
    344
    Likes Received:
    10
    Best Answers:
    0
    Another quick question, where should I put the script at? :)
    Which file is it :p

    Thanks for the assitance HA~
     
  10. HalfAway

    HalfAway #1

    Joined:
    Sep 3, 2011
    Messages:
    3,604
    Likes Received:
    2,330
    Best Answers:
    15
    Create a file in the home dir (same as other pages) and name the file anything you want, for example creature_killers.php import the code and save it. :)
     
    pierroth likes this.
  11. pierroth

    pierroth Mar Co.

    Joined:
    Sep 11, 2008
    Messages:
    344
    Likes Received:
    10
    Best Answers:
    0

    I have a question again :p where in my page is the Most Creature Kills at? and is there anything else I need to do?

    I use tfs 0.3 for 8.6

    Thanks again!
     
  12. Athenuz

    Athenuz Owlz!

    Joined:
    Oct 1, 2015
    Messages:
    234
    Likes Received:
    27
    Best Answers:
    0
    Warning: Invalid argument supplied for foreach() inC:\xampp\htdocs\mosthunted.php on line 29

    Using Znote AAC 1.5 with last TFS commit... 1.X

    I need extra scripts? which ones for this ver.? i saw the other posts and those creaturescript doesn't work :(
     
  13. Dekon

    Dekon Zerenia.net Owner

    Joined:
    Feb 4, 2008
    Messages:
    235
    Likes Received:
    2
    Best Answers:
    0
    Im using tfs 1.2 and i got this error Line 29 foreach($monterq as $q) {
    Code (Text):
    1. Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\creatures.php on line 29
     
  14. lopez65

    lopez65 Member

    Joined:
    May 10, 2012
    Messages:
    231
    Likes Received:
    10
    Best Answers:
    0
    @Dekon

    If the line get this 29 th
    Code (Text):
    1. foreach( $monterq as $q) {
    change it to this worked for me
    Code (Text):
    1. foreach((array) $monterq as $q) {
    regards
     
    Davidvietro likes this.
  15. Dekon

    Dekon Zerenia.net Owner

    Joined:
    Feb 4, 2008
    Messages:
    235
    Likes Received:
    2
    Best Answers:
    0
    @lopez65 Thanks for the help rep++++
     
  16. lopez65

    lopez65 Member

    Joined:
    May 10, 2012
    Messages:
    231
    Likes Received:
    10
    Best Answers:
    0
  17. Itutorial

    Itutorial Well-Known Member

    Joined:
    Dec 23, 2014
    Messages:
    1,321
    Likes Received:
    274
    Best Answers:
    22
    I tried implementing this but nothing changes on the AAC
     
  18. lopez65

    lopez65 Member

    Joined:
    May 10, 2012
    Messages:
    231
    Likes Received:
    10
    Best Answers:
    0
    If you're right, just get him out the images, but do not go neither dead nor palyers monsters for them. : /
     
  19. lopez65

    lopez65 Member

    Joined:
    May 10, 2012
    Messages:
    231
    Likes Received:
    10
    Best Answers:
    0
    Fixed -based search and look for everything OtLand; D
    Well I finally works, you just have to enter the same as for the version Gęsior, minus the php file that has to be for Znote.
     
  20. Chriss Angel

    Chriss Angel Member

    Joined:
    Jun 7, 2008
    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Where can I get the creature images?
     

Share This Page

Loading...