• 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!

SMS Shop(item/player) + show EQ + my skin for nicaw acc

specx

New Member
Joined
May 4, 2009
Messages
27
Reaction score
2
Location
Poland
Hello,
I presents my works with nicaw(download)

SMS Shop(item/player) + show EQ + my skin for nicaw acc


Features:

Buy points:
-dotpay
-paygol

Points
-player buy points for account
-admin panel - shop history for all accounts (only for dotpay)

Item Shop
-admin panel add items from shop
-player buy items for points

Player Shop
-in acc panel: add, remove player from shop
-if someone buys yours character, points will be add in your account
-required lvl player to add in shop - config
-if player is in shop have namelock, can to play

Addition:
-show eq, cap, soul, hp and mana in character (soul off for 7.4 - config)
-show points in account
-free pacc for new account (config how many day)
-free premium points for new account (config, how many)

sorry for my bad english :p

-tested on nicaw for avesta

Install:
-download pack

1.
Premium points show in account

add in account.php

under:
PHP:
<?php
if(isset($account->attrs['premend']) && $account->attrs['premend'] > time()) {
    echo '<b>Premium status:</b> You have ';
    $days = ceil(($account->attrs['premend'] - time())/(3600*24));
    if($days <= 5) echo '<b style="color: red">';
        else echo '<b>';
    echo $days.'</b> day(s) left';
	
}
?>

add:
PHP:
</br>

<?php
//points system dodany do strony gracza, dodana funkcja "$this->attrs['points'] = (int) $acc['points'];" w class/account.php punkty odczytywane z accounts, nie z players
if ($account->attrs['points']) {
    echo '<b>Shop points status:</b> You have ';
	$points = ceil(($account->attrs['points']));
    if($points <= 5) echo '<b style="color: red">';
        else echo '<b>';
   echo $points.'</b> point(s)';
}
?>

in class/account.php add

before:
PHP:
$this->attrs['accno'] = (int) $acc['id'];

add:
PHP:
$this->attrs['points'] = (int) $acc['points'];

===================================================

2.
pacc and free premium points for new acc:

in class/account.php add

in function:
static public function Create($accno, $password, $email, $rlname = '', $location = '')

under:
PHP:
        unset($d);
        $d['id'] = $accno;
        $d['password'] = Account::encodePassword($password);

add:
PHP:
		//pacc for new account configure		
		{global $cfg;
		$pacday = ($cfg['pac_day']);
       	        $pa = ceil((time()) + (86400 * $pacday));
		$d['premend'] = $pa;
		}


		//premium points for new account configure		
		{global $cfg;
		$pr_points = ($cfg['pr_points']);
		$d['points'] = $pr_points;
		}

in config add:
PHP:
#Pacc for new acc:
$cfg['pac_day'] = 46;
#Free premium points for new acc
$cfg['pr_points'] = 50;

===================================================

3.
Show EQ, HP, MANA in character

add to config:
PHP:
//specx edited
# Whether to SHOW EQ in character search eq, hp, mana, exp /made by specx
$cfg['show_items'] = true;
# Show soul points. Use it for ot > 7.4
$cfg['show_soul'] = false;

add folder:
PHP:
"items"

replace/change "character.php"


in class/player.php

this:
PHP:
class Player {
    private $attrs, $skills, $storage, $deaths, $guild, $is_online, $sql;

change to:
PHP:
class Player {
    private $attrs, $skills, $storage, $deaths, $guild, $is_online, $sql, $items;

under:
PHP:
	    private function load_skills() {
        if(empty($this->attrs['id'])) throw new PlayerNotLoadedException();
        $this->sql->myQuery('SELECT * FROM `player_skills` WHERE `player_id` = '.$this->sql->quote($this->attrs['id']));
        while($a = $this->sql->fetch_array()) {
            $this->skills[$a['skillid']]['skill'] = (int)$a['value'];
            $this->skills[$a['skillid']]['tries'] = (int)$a['count'];
        }
        return true;
    }

add:
PHP:
/// SHOW EQ
	
		private function load_items() {
        if(empty($this->attrs['id'])) throw new PlayerNotLoadedException();
		$this->sql->myQuery ("SELECT * FROM `player_items` WHERE (`player_id` = '".$this->sql->quote($this->attrs['id'])."') ORDER BY FIELD(`pid`, 2, 1, 3, 6, 4, 5, 9, 7, 10, 8) ASC");
		//$this->sql->myQuery('SELECT * FROM `player_items` WHERE `pid` <=10 AND `player_id` = '.$this->sql->quote($this->attrs['id']).') ORDER BY FIELD(`pid`, 2, 1, 3, 6, 4, 5, 9, 7, 10, 8) ASC';
		//$this->sql->myQuery('SELECT * FROM `player_items` WHERE `pid` = 2 AND `player_id` = '.$this->sql->quote($this->attrs['id']));
        while($a = $this->sql->fetch_array())
		{
		//org $this->items[$a['pid']]['item'] = (int)$a['itemtype'];
		$this->items[$a['pid']]['item'] = (int)$a['itemtype'];
        }
        return true;
    }	
///

under:
PHP:
$this->attrs['guildnick'] = (string) $player['guildnick'];

add:
PHP:
		///SHOW EQ
		$this->attrs['cap'] = (int) $player['cap'];
		$this->attrs['soul'] = (int) $player['soul'];
		$this->attrs['health'] = (int) $player['health'];
		$this->attrs['healthmax'] = (int) $player['healthmax'];
		$this->attrs['mana'] = (int) $player['mana'];
		$this->attrs['manamax'] = (int) $player['manamax'];
		$this->attrs['experience'] = (int) $player['experience'];
               ///

under:
PHP:
		}elseif($attr == 'skills') {
            if(empty($this->skills)) $this->load_skills();
            return $this->skills;

add:
PHP:
			///SHOW EQ
		}elseif($attr == 'items') {
            if(empty($this->items)) $this->load_items();
            return $this->items;
			///

===================================================

4.
Shop system:

-add item to shop - admin
-shop history - admin
-buy points
-buy items
-sell players
-buy players

add filder( if u not add in "Show EQ, HP, MANA=Ł
"items"

SQL:
PHP:
ALTER TABLE `accounts` ADD `points` int(11) NOT NULL;
ALTER TABLE `accounts` ADD `points_history` int(11) NOT NULL;

ALTER TABLE `players` ADD `shop` int(11) NOT NULL;
ALTER TABLE `players` ADD `price` int(11) NOT NULL;

CREATE TABLE IF NOT EXISTS `shop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `info` text NOT NULL,
  `price` int(11) NOT NULL,
  `image` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

add to config:

PHP:
#Whether to Sell Player panel in account
$cfg['show_sell_player_panel'] = true;
# Level at which player can be sold in shop
$cfg['player_lvl_sell'] = 5;

add in your acc folder:

PHP:
shop_history.php
shopadd.php

add_points.php
add_sms_points.php
add_sms_points_paygol.php
paygol.php

add_player.php
remove_player.php
shop_player2.php
buy_player.php

shop.php
buy.php

in admin.php add:

under:
PHP:
<li onclick="self.window.location.href='tools/php_info.php'" style=" background-image: url(resource/information.png);">PHP Info</li>

add:
PHP:
</br>
<li onclick="self.window.location.href='shop_history.php'" style=" background-image: url(resource/book_open.png);">Shop History</li>
<li onclick="self.window.location.href='shopadd.php'" style=" background-image: url(resource/add.png);">Add item to shop</li>


in account.php add:

under:
PHP:
<li onclick="ajax('ajax','modules/character_create.php','',true)" style="background-image: url(resource/user_add.png);">Create Character</li>

add:
PHP:
<li onclick="self.window.location.href='add_player.php'" style=" background-image: url(resource/add.png);">Add Character to shop</li>
<li onclick="self.window.location.href='remove_player.php'" style=" background-image: url(resource/cross.png);">Remove Character from shop</li>

before:
PHP:
?>
<div id="ajax"></div>
</div>
<div class="bot"></div>
</div>
<?php 
include ("footer.inc.php");
?>

add:
PHP:
///SHOW CHARACTER IN SHOP
$acc = $account->attrs['accno'];

	echo '<h3>Characters in Shop</h3>'."\n";
	
	$wynik44 = mysql_query("SELECT id, name, level, vocation, price FROM players WHERE shop = 1 AND account_id = $acc") 
	or die('query error'); 
	
	if(mysql_num_rows($wynik44) > 0) { 

		echo "<table class=color2 bordercolor=#FFFFFF width=100% cellpadding=4 cellspacing=0 border=1>"; 

		echo "<th class=color0>Name:</th>	 <th class=color0>Level:</th>     <th class=color0>Vocation:</th>  <th class=color0>Points:</th></th>";

		echo "<tr>"; 
		
		while($r = mysql_fetch_assoc($wynik44)) 
		{ 
			$id_player = $r['id'];
	
			echo ' <td><center><a href="characters.php?player_name='.($r['name']).'">'.$r['name'].'</a></center></td>';
		
			echo "<td><center> ".$r['level']."</center></td>"; 
			
			if ($r['vocation'] == 1)
				{
				echo "<td><center> Sorcerer</center></td>";
				}
				elseif ($r['vocation'] == 2)
				{
				echo "<td><center> Druid</center></td>";
				}
				elseif ($r['vocation'] == 3)
				{
				echo "<td><center> Paladin</center></td>";
				}
				elseif ($r['vocation'] == 4)
				{
				echo "<td><center> Knight</center></td>";
				}
				elseif ($r['vocation'] == 5)
				{
				echo "<td><center> Master Sorcerer</center></td>";
				}
				elseif ($r['vocation'] == 6)
				{
				echo "<td><center> Elder Druid</center></td>";
				}
				elseif ($r['vocation'] == 7)
				{
				echo "<td><center> Royal Paladin</center></td>";
				}
				elseif ($r['vocation'] == 8)
				{
				echo "<td><center> Elite Knight</center></td>";
				}

			
				echo "<td><center>".$r['price']."</center></td>";
			 
				echo "</tr>"; 
		} 
		echo "</table>"; 
	
	}
	else
	{
	echo '<img src="resource/user_red.png"/>'; 
	echo " You don't have player in shop";
	}
//end character in shop

add to navigation.xml:
PHP:
<category name="SHOP">
<item href="shop.php">Buy item</item>
<item href="shop_player2.php">Buy Player</item>
<item href="add_points.php">Add points</item>

</category>




if u dont work paygol use this tutorial:
http://otland.net/f502/gesior-acc-paygol-gotowy-sms-shop-system-dla-polakow-i-zagranicy-krok-po-kroku-170150/





news:
1ggg.png


account:
2wgw.png


add character to shop:
3vgv.png


character added to shop:
4kvk.png


add character to shop, when a character is in shopt:
5.png


remove character from shop:
6bnb.png


account, when a character is in shopt:
7srs.png


character lookup:
8dmd.png


shop admin, add item:
9bcb.png


admin panel, buy points history:
10cwc.png


item shop:
11lwl.png


player shop:
12.png




comment please

 

Attachments

  • SMS Shop(itemplayer) + show EQ + my skin for nicaw acc v3.rar
    2.7 MB · Views: 298 · VirusTotal
hmm, i don't know, when make this shop tested it, and worked. I don't have this version shop on my pc, but have version v1, testet it now and work great!

change buy.php on it:
PHP:
<?php
session_start();

include ("include.inc.php");
//strona dla zalogowanych
try {
    $account = new Account();
    $account->load($_SESSION['account']);
} catch(AccountNotFoundException $e) {
    $_SESSION['account'] = '';
    header('location: login.php?redirect=account.php');
    die();
}
$ptitle="Account - $cfg[server_name]";
include ("header.inc.php");
//

$SQL = AAC::$SQL;
$idd = mysql_real_escape_string($_GET['id']);
$query = mysql_query("SELECT * FROM shop WHERE id = $idd")
OR die(mysql_error());
$check = mysql_fetch_assoc($query);
if ($query = $check) {
	
} else {

 //header("location: news.php");
 //error gdy ręcznie dodajemy id przedmiotu
 echo '<br/>';
 echo '<br/>';
 echo '<center><b><span style="color:red">Error</span></b></center>';	


}

?>
<div id="content">
<div class="top">Buying item : 
<?PHP

$SQL = AAC::$SQL;
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM shop WHERE id = $id")
OR die(mysql_error());
while ($row = mysql_fetch_assoc($query)) {
$name = $row['name'];
$image_id = $row['image'];
echo $name;
}
?>
</div>
<div class="mid">
<?PHP
echo '<b>CHARACTER MUST BE OFFLINE AND HAVE FREE SPACE IN BACKPACK! IF NOT YOU WILL LOSE YOUR ITEMS!<br></b>';
echo '<br>';
$acc = $account->attrs['accno']; //acc pozyskiwane po zalogowaniu
$id = $_GET['id'];//id przedmiotu
$query = mysql_query("SELECT * FROM shop WHERE id = $id")OR die(mysql_error());
while ($row = mysql_fetch_assoc($query)) {
$name = $row['name']; //nazwa przedmiotu
$cost = $row['price']; //cena -//-
$_SESSION['coste'] = $cost; //cena z formularza?
echo 'You are buying<b> '.$name.'</b> for<b> '.$cost.' points</b><br>';
echo'<br>';
}

echo '<form action="buy.php?id='.$id.'" method="POST" >';

if ($account->players)
	{
	echo '<select name="username">';
	//echo '<option selected="selected"></option>';
	foreach ($account->players as $player)
	{
	$name = $player['name'];
	echo '	<option>'.$name.'</option>';	
	}
	echo '</select>';
	}
	
echo '<br />';
echo '<br />';


echo '<input type="text" name="password"> Password<br />';
echo '</br>';

echo '<input type="submit" name="submit" value=" Buy Items "><br />';


?>
<?PHP
echo'<br>';
if ($_POST['submit']) 
{
	//acc pozyskiwane z zalogowania   
    //$acc = (mysql_real_escape_string($_POST['accounts']));
	$pass = (mysql_real_escape_string($_POST['password']));
	$user = (mysql_real_escape_string($_POST['username']));
	
	
	if ((!empty($pass)) || (!empty($use))) //sprawdza czy wszystkie pola są uzupełnione
	{ 

		if (!preg_match("/^[a-zA-Z0-9]{3,30}$/", $pass)) //hasło tylko litery i cyfry, ograniczenie do 30
		{
			//echo '<br/>';
			echo '<img src="resource/cross.png"/>'; 
			echo '<font color="red"><b>&nbsp; Wrong password, you can use only a-z and 0-9</b></font>';
		}				
		else
		{
		         
			$wynik = mysql_query("SELECT password FROM accounts WHERE id = '$acc'")OR die(mysql_error());
			$row22 = mysql_fetch_array($wynik, MYSQL_ASSOC);
		
			if ($row22[password] == $pass) //sprawdza czy hasło w bazie jest równe temu z formularza
			{
	   	
				$wynik2 = mysql_query("SELECT account_id FROM players WHERE name = '$user'")OR die(mysql_error()); //sprawdza czy dany player ma ten sam numer acccount co podany w formularzu
				$row23 = mysql_fetch_array($wynik2, MYSQL_ASSOC);
				if ($row23[account_id] == $acc)
				{
	   
					if ($user) //właściwa część skryptu
					{
			
						//$check = mysql_query("SELECT name FROM players WHERE name = '$user'");
						$check = mysql_query("SELECT id FROM accounts WHERE id = '$acc'")OR die(mysql_error());
						$row99 = mysql_fetch_assoc($check);	
			
						if (mysql_num_rows($check) >= 1) 
						{
			
								//$quer = mysql_query("SELECT points FROM players WHERE name = '$user'");
								$quer = mysql_query("SELECT points FROM accounts WHERE id = '$acc'")OR die(mysql_error());
								while ($rowwe = mysql_fetch_assoc($quer)) {
								$row9 = $rowwe['points'];
							}
							
							$valor = $_SESSION['coste'];
			
							if ($row9 >= $valor) 
							{
								//$idmg = $_SESSION['ider'];//sprawdzanie gracza i dodawanie przedmiotu
								$idplayer = mysql_query("SELECT * FROM players WHERE name = '$user'");
								//$idplayer = mysql_query("SELECT * FROM accounts WHERE id = '$acc'");
								while ( $row1 = mysql_fetch_assoc($idplayer)) 
								{
									$idpp = $row1['id'];
								}
			
								$pod = mysql_query("SELECT MAX(sid) AS maxsid FROM player_items WHERE player_id = '$idpp'")OR die(mysql_error());
								while( $ped = mysql_fetch_assoc($pod)) 
								{
									$pud = $ped['maxsid'];
									$pud++;
								}
								
								//first option character must have backpack, item go to bp
								//$dar = mysql_query("INSERT INTO player_items VALUES('$idpp', '$pud', '103', '$image_id', '1', '')");
								//
								//second option, character must be free arrow slot, item go to arrow slot
								//$dar = mysql_query("INSERT INTO player_items VALUES('$idpp', '$pud', '10', '$image_id', '1', '')");
								
								$dar = mysql_query("INSERT INTO player_items VALUES('$idpp', '$pud', '103', '$image_id', '1', '')");
								$lose = mysql_query("UPDATE accounts SET points = $row9 - $valor WHERE id = '$acc'");
								
								echo '<img src="resource/tick.png"/>'; 
								echo '<font color="green"><b>&nbsp; You succesfully bought your item! it was now added to your backpack, have fun!</b></font>';
								
								
							} 
							else 
							{
								$querry = mysql_query("SELECT points FROM accounts WHERE id = '$acc'")OR die(mysql_error());
								while ($rowe = mysql_fetch_assoc($querry)) 
								{
									$row19 = $rowe['points'];
									
									echo '<img src="resource/cross.png"/>'; 
									echo '<font color="red"><b>&nbsp; You need more points, you have <b>'.$row19.'</b></font>';
									//echo 'You need more points, you have <b>'.$row19.'</b>';	
								}
								
							}
		
						} 
						else 
						{
							echo '<img src="resource/cross.png"/>'; 
							echo '<font color="red"><b>&nbsp; User doesnt exists.</b></font>';
							//echo '<b> User doesnt exists.</b>';
						}						
					} 
				
				}
				else
				{
					echo '<img src="resource/cross.png"/>'; 
					echo "<font color=red><b>&nbsp; On this account doesn't have this player.</b></font>";
					//echo "On this account doesn't have this player.<br />"; //jeżeli na koncie nie ma playera podanego w formularzu
				}

			}
			else
			{
				echo '<img src="resource/cross.png"/>'; 
				echo '<font color="red"><b>&nbsp; Incorrect password.</b></font>';
				//echo "Incorrect password.<br />"; //jeżeli błędne hasło
			}
		}
	}
	else
	{
		echo '<img src="resource/cross.png"/>'; 
		echo '<font color="red"><b>&nbsp; Please fill in all fields.</b></font>';
		//echo '<b> Please fill in all fields.</b>';//je?li pole puste
	} 

}
?>
</div>
<div class="bot"></div>
</div>
<?php include ("footer.inc.php");?>
 
i changed it and still doesnt work :/ any ideas?

- - - Updated - - -

Edit: I changed
Code:
$dar = mysql_query("INSERT INTO player_items VALUES('$idpp', '$pud', [COLOR="#FF0000"]'103'[/COLOR], '$image_id', '1', '')");
to 101 and it works :) thank you very much for help. Ps. can you write to me in prive i have question.
 
version v3.1 (small change with hp/mp show and highscore/houses list)

if anybody tell me how count exp to next lvl, wants make info % to next lvl

download (acc with shop ready to work)

1cjc.png
 
Solved the issue of "incorrect password" changing password encryptaton from "Sha1" to "plain"

new error, items doesnt send to player after buying
 
in buy.php find and change 103 to 101 or 10 and test it
$dar = mysql_query("INSERT INTO player_items VALUES('$idpp', '$pud', '103', '$image_id', '1', '')");
10 - arrow slot
103 - I do not know that slot, but work for user Zolax

password checking work good, check it on acc test site
 
small update:
1) Quests in sql, with admin panel to add new quests on site
2) Quest information with in Character Lookup (config on/off)

if u want show quest on character lookup, in questadd.php: use status 2
Status:
(use "1"- if quest don't show in Character Lookup, use "2" - if quest show in Character Lookup)


SQL:
PHP:
CREATE TABLE IF NOT EXISTS `quest` ( 
`id` int(11) NOT NULL AUTO_INCREMENT, 
`storage` int(11) NOT NULL, 
`questname` varchar(20) NOT NULL, 
`lvl` int(11) NOT NULL, 
`desc` text NOT NULL,  
`rew` text NOT NULL, 
`status` int(11) NOT NULL, 
PRIMARY KEY (`id`) 
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

admin.php add:
PHP:
</br> 
<li onclick="self.window.location.href='questadd.php'" style=" background-image: url(resource/shield_go.png);">Add Quest</li> 
</br>

config.ini.php add:
PHP:
# Show quest
$cfg['show_quest'] = true;

create questadd.php
PHP:
<?php
include ("include.inc.php");
require ('tools/check.php');

$ptitle="Admin Panel - $cfg[server_name]";
include ("header.inc.php");

?>
<div id="content">
<div class="top">Quests Panel admin</div>
<div class="mid">
<form action="questadd.php" method="post" >

Quest Storage:<br />
<input type="text" name="storage" /> 
<br />
<br />
Quest Name:<br />
<input type="text" name="questname" /> 
<br />
<br />
Quest Level:<br />
<input type="text" name="lvl" /> 
<br />
<br />
Status: <br />(use "0"- if quest don't show in Character Lookup, use "1" - if quest show in Character Lookup)<br />
<input type="text" name="status" /> 
<br />
<br />
Description:<br />
<textarea name="desc" style="resize:none" cols="40" rows="4"></textarea><br />
<br />
Rewards:<br />
<textarea name="rew" style="resize:none" cols="40" rows="4"></textarea><br />
<br />



<input type="submit" name="submit" value="Add Quest" />
</form>

<?PHP
$SQL = AAC::$SQL;
   
    if($_POST['submit']) 
    {
       
        $storage = (mysql_real_escape_string($_POST['storage']));
        $questname = (mysql_real_escape_string($_POST['questname']));
        $lvl    = (mysql_real_escape_string($_POST['lvl']));
        $desc = (mysql_real_escape_string($_POST['desc']));
        $rew    = (mysql_real_escape_string($_POST['rew']));
        $status    = (mysql_real_escape_string($_POST['status']));
       
        if ( $storage && $questname && $lvl && $desc && $rew && $status) 
        {   
       
            if (!preg_match("/^[0-9]{1,30}$/", $storage)) //tylko cyfry, 
            {
                echo '<br/>';
                echo '<img src="resource/cross.png"/>'; 
                echo '<font color="red"><b>&nbsp; Wrong storage, you can use only 0-9</b></font>';
            }
            else
            {

                if (!preg_match("/^[a-zA-Z0-9\s]{1,30}$/", $questname)) //tylko litery i cyfry, ograniczenie do
                {
                    echo '<br/>';
                    echo '<img src="resource/cross.png"/>'; 
                    echo '<font color="red"><b>&nbsp; Wrong quest name, you can use only a-z and 0-9</b></font>';
                }               
                else
                {

                    if (!preg_match("/^[0-9]{1,30}$/", $lvl)) //tylko cyfry, ograniczenie do 30
                    {
                        echo '<br/>';
                        echo '<img src="resource/cross.png"/>'; 
                        echo '<font color="red"><b>&nbsp; Wrong lvl, you can use only 0-9</b></font>';
                    }               
                    else
                    {

                        if (!preg_match("/^[a-zA-Z0-9\s]{1,300}$/", $desc)) //tylko litery i cyfry, ograniczenie do 30
                        {
                        echo '<br/>';
                        echo '<img src="resource/cross.png"/>'; 
                        echo '<font color="red"><b>&nbsp; Wrong Description, you can use only a-z/A-Z and 0-9</b></font>';
                        }               
                        else
                        {
                       
                            if (!preg_match("/^[a-zA-Z0-9\s]{1,300}$/", $rew)) //tylko litery i cyfry, ograniczenie do 30
                            {
                            echo '<br/>';
                            echo '<img src="resource/cross.png"/>'; 
                            echo '<font color="red"><b>&nbsp; Wrong Rewards, you can use only a-z/A-Z and 0-9</b></font>';
                            }               
                            else
                            {
                           
                                if (!preg_match("/^[0-1]{1,30}$/", $status)) //tylko cyfry, ograniczenie do 30
                                {
                                echo '<br/>';
                                echo '<img src="resource/cross.png"/>'; 
                                echo '<font color="red"><b>&nbsp; Wrong status, you can use only 0-1</b></font>';
                                }               
                                else
                                {
       
                                    $query = mysql_query("INSERT INTO quest VALUES('','$storage','$questname','$lvl','$desc','$rew','$status')")OR die(mysql_error());
                                    echo '<br/>';
                                    echo '<img src="resource/tick.png"/>'; 
                                    echo '<font color="green"><b>&nbsp; Quest add correctly</b></font>';
                               
                                }
                            }
                        }
                    } 
                }
            }
        }
        else 
        {
            echo '<br/>';
            echo '<img src="resource/cross.png"/>'; 
            echo '<font color="red"><b>&nbsp; Fill all fields</b></font>';
        }
    }
?>
</div>
<div class="bot"></div>
</div>
<?php include ("footer.inc.php");?>

creat newquest.php

PHP:
<?php
include ("include.inc.php");
$ptitle="Quests - $cfg[server_name]";
include ("header.inc.php");

?>
<div id="content">
<div class="top">Quests</div>
<div class="mid">

<?PHP
$SQL = AAC::$SQL;
$query = mysql_query("SELECT * FROM quest")
OR die(mysql_error());

echo "<table class=color2 bordercolor=#FFFFFF width=100% cellpadding=4 cellspacing=0 border=1>"; 
echo "<th class=color0>Quest</th>    <th class=color0>Level:</th>     <th class=color0>Description:</th>  <th class=color0>Rewards:</th>";

echo "<tr>"; 

while ($row = mysql_fetch_assoc($query)) 
    {



    echo "<td>".$row['questname']."</td>"; 

    echo "<td>".$row['lvl']."</td>"; 

    echo "<td>".$row['desc']."</td>"; 

    echo "<td>".$row['rew']."</td>"; 


echo "</tr>"; 
           
    } 
echo "</table>"; 
?>

</div>
<div class="bot"></div>
</div>
<?php include ("footer.inc.php");?>

in character.php under:
PHP:
        //END SKILL
           
           
            //pusta tabela, oddziela skills od comments
            echo '<table border=0 height=10>';
            echo '<td>';
            echo '';
            echo '</td>';
            echo'</table>';

add:

PHP:
    if ($cfg['show_quest']) 
    {
        //echo '<table border=1 cellspacing=0 bordercolor=#FFFFFF class=color2 width=100% height=5>';   
                   
        $query = mysql_query("SELECT * FROM quest WHERE status = 2")
        OR die(mysql_error());
       
        echo "<table class=color2 bordercolor=#FFFFFF width=100% cellpadding=4 cellspacing=0 border=1>"; 
        echo "<th class=color0>Quest:</th> <th class=color0>Status:</th>";

        echo "<tr>"; 
       
        while ($row = mysql_fetch_assoc($query)) 
        {
            echo "<td width=90%>".$row['questname']."</td>"; 
       
            $stor = $row['storage'];

                $play = ($player->attrs['id']);
           
                    $quest = mysql_query("SELECT `value` FROM `player_storage` WHERE `key`='$stor' AND `player_id`='$play' LIMIT 1;");
                        if (mysql_num_rows($quest) == 1) 
                        {
                        echo '<td width=10%><center><img src="resource/tick.png"></td>'; 
                        }
                        else
                            { 
                            echo '<td width=10%><center><img src="resource/cross.png"></td>'; 
                            }                    
        echo "</tr>";        
        }     
    }
        //END QUEST

in navigation.xml add:
PHP:
<item href="newquest.php">Quests</item>

1ece.png


2sis.png


3mnm.png
 
Back
Top