but i never edited the file....
<?php/*********************************************************************************** Shop-Inventory.php ** Inventory stuff (view inventory, use item, view other's inventory) ** -- This is not called directly. The code in here is used in Shop.php -- ************************************************************************************* SMFShop: Shop MOD for Simple Machines Forum ** =============================================================================== ** Software Version: SMFShop 3.0 (Build 12) ** $Date:: 2007-01-21 17:14:42 +1100 (Sun, 21 Jan 2007) $ ** $Id:: Shop-Inventory.php 94 2007-01-21 06:14:42Z daniel15 $ ** Software by: DanSoft Australia (http://www.dansoftaustralia.net/)** Copyright 2005-2007 by: DanSoft Australia (http://www.dansoftaustralia.net/)** Support, News, Updates at: http://www.dansoftaustralia.net/ ** ** Forum software by: Simple Machines (http://www.simplemachines.org) ** Copyright 2006-2007 by: Simple Machines LLC (http://www.simplemachines.org) ** 2001-2006 by: Lewis Media (http://www.lewismedia.com) ************************************************************************************* This program is free software; you may redistribute it and/or modify it under ** the terms of the provided license as published by Simple Machines LLC. ** ** This program is distributed in the hope that it is and will be useful, but ** WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY ** or FITNESS FOR A PARTICULAR PURPOSE. ** ** See the "license.txt" file for details of the Simple Machines license. ** The latest version of the license can always be found at ** http://www.simplemachines.org. ***********************************************************************************/// If this script isn't called by SMF, it's bad!if (!defined('SMF')) die('Hacking attempt...'); load_pets();// Viewing your petsif ($_GET['do'] == 'pets'){ $context['linktree'][] = array( 'url' => $scripturl . '?action=shop;do=pet', 'name' => $txt['pets_yourpet'], ); // Check to see if the user has a pet $result = db_query(" SELECT COUNT(numpets) FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__); $row = mysql_fetch_assoc($result); if ($row['COUNT(numpets)'] == 0) { $context['shop_buy_message'] = sprintf($txt['pets_no_pet'], $scripturl); } elseif (isset($_GET['pet'])) { $result = db_query("SELECT breed FROM {$db_prefix}shop_pets WHERE pet_id = {$_GET['pet']}", __FILE__, __LINE__); $row = mysql_fetch_assoc($result); eval('$temp = new pet_' . $row['breed'] . ';'); $temp->load_breed(); $temp->load_values($_GET['pet']); if ($temp->ownerid == $ID_MEMBER) { if ($_GET['type'] == 'train') { $context['shop_buy_message'] = $temp->train_pet(); } elseif ($_GET['type'] == 'rename' && isset($_POST['newname'])) { $temp->rename_pet($_POST['newname']); $context['shop_buy_message'] = sprintf($txt['pets_new_name'], $_POST['newname']); } elseif ($_GET['type'] == 'describe' && isset($_POST['newname'])) { $temp->redesc_pet($_POST['newname']); $context['shop_buy_message'] = sprintf($txt['pets_new_desc'], $_POST['newname']); } elseif ($_GET['type'] == 'skills' && isset($_POST['skill'])) { $context['shop_buy_message'] = $temp->use_skill($_POST['skill']); } $temp->store_values(); } else { $context['shop_buy_message'] = $txt['pets_not_yours']; } $context['shop_buy_message'] .= "<br />".sprintf($txt['pets_return_link'], $scripturl); } else { $context['shop_buy_message'] = "<b>".$txt['pets_your_pets']."</b><br />"; $result = db_query(" SELECT * FROM {$db_prefix}shop_pets WHERE ownerid = {$ID_MEMBER}", __FILE__, __LINE__); while ($row = mysql_fetch_assoc($result)) { require($sourcedir . '/shop/pet_engine.php'); require($sourcedir . '/shop/pets_breeds/' . $row['breed'] . '.php'); eval('$temp = new pet_' . $row['breed'] . ';'); $temp->load_values($row['pet_id']); $context['shop_buy_message'] .= $temp->view_Pet_owner(); } } // The shop action $context['shop_do'] = 'pet'; // Set the page title $context['page_title'] = $txt['shop'] . ' - ' . $txt['shop_pet_page']; // Use the inventory template $context['sub_template'] = 'message';}elseif ($_GET['do'] == 'hatchery'){ $context['linktree'][] = array( 'url' => $scripturl . '?action=shop;do=hatchery', 'name' => $txt['pets_hatchery'], ); $context['shop_buy_message'] = ""; if (!isset($_POST['newname'])) { if ($handle = opendir($sourcedir . "/shop/pets_breeds/")) { while (false !== ($file = readdir($handle))) { if (substr($file, -4) == '.php') { // Get the name (file name without .php extension) $name = basename($file, '.php'); $code = ' if (class_exists(\'pet_' . $name . '\')) { $pet = new pet_' . $name . '; $pet->load_breed(); return true; } else return false;'; if (eval($code) !== FALSE) { $context['shop_buy_message'] .= "<table width='75%' cellpadding='5' cellspacing='0' border='1'> <tr><th colspan='6'>".$pet->breed."</th></tr> <tr><td colspan='1' rowspan='3' width='10%'><img border='0' width='120' height='120' src='".$boardurl."/Sources/shop/pet_images/".$pet->breed_img."' alt='".$pet->breed."' /> <th colspan='1' width='20%'>".$txt['pets_breed']."</th> <td colspan='1'>".$pet->breed."</td> <th colspan='1' width='20%'>".$txt['pets_cost']."</th> <td colspan='2'>".$pet->price."</td></tr> <tr><th colspan='1'>".$txt['pets_description']."</th> <td colspan='5'>".$pet->breed_desc."</td></tr> <tr><td colspan='6'><form method='post' action='".$scripturl."?action=shop;do=hatchery;breed=".$name."'> {$txt['pets_find_name']} <input type='text' name='newname' value='Pet Name'> <input type='submit' value='".sprintf($txt['pets_buy'], $pet->breed)."'></form></td></tr> </table><br />"; } } } } } else { $result = db_query("SELECT numpets, maxpets, money FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__); $row = mysql_fetch_assoc($result); if ($row['numpets'] < $row['maxpets']) { $breed = $_GET['breed']; $code = ' $pet = new pet_' . $breed . '; return true;'; if (eval($code) !== false) { $pet->load_breed(); if ($row['money'] > $pet->price) { $name = $_POST['newname']; $result = db_query("INSERT INTO {$db_prefix}shop_pets (`name`, `breed`, `desc`, `level`, `curap`, `maxap`, `age`, `happy`, `hunger`, `training`, `trainingend`, `ownerid`) VALUES ('{$name}', '{$breed}', 'No descrption', 1, 1, 1, 0, 10, 10, 0, 0, {$ID_MEMBER})", __FILE__, __LINE__); $result = db_query("UPDATE {$db_prefix}members SET money = money - {$pet->price}, numpets = numpets + 1 WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__); $context['shop_buy_message'] = sprintf($txt['pets_adpot'],$pet->breed); } else { $context['shop_buy_message'] = $txt['pets_cost_too_much']; } } else { die(); } } else { $context['shop_buy_message'] = $txt['pets_too_many']; } } // The shop action $context['shop_do'] = 'hatchery'; // Set the page title $context['page_title'] = $txt['shop'] . ' - ' . $txt['pets_hatchery']; // Use the inventory template $context['sub_template'] = 'message';}elseif ($_GET['do'] == 'toppets'){ $context['linktree'][] = array( 'url' => $scripturl . '?action=shop;do=toppets', 'name' => $txt['pets_toppets'], ); $result = db_query("SELECT name, breed, level, age, ownerid FROM {$db_prefix}shop_pets ORDER BY level DESC LIMIT 15", __FILE__, __LINE__); $context['shop_buy_message'] = $txt['pets_top_pets_blurb']; $context['shop_buy_message'] .= "<table width='75%' cellpadding='5' cellspacing='0' border='1'> <tr><th>Name</th><th>Breed</th><th>Owner</th><th>Age</th><th>Level</th></tr>"; while ( $row = mysql_fetch_assoc($result) ) { $result_2 = db_query("SELECT memberName from {$db_prefix}members WHERE ID_MEMBER = {$row['ownerid']}", __FILE__, __LINE__); $row_2 = mysql_fetch_assoc($result_2); $breed = $row['breed']; $code = ' $pet = new pet_' . $breed . '; return true;'; if (eval($code) !== false) { $pet->load_breed(); if ($row['ownerid'] == $ID_MEMBER) { $context['shop_buy_message'] .= '<tr style = "font-style: italic"> <th><a href="http://sandbox.nomicville.com/index.php?action=profile;u='.$row['ownerid'].';sa=showPets">'.$row['name'].'</a><br />the<br />'.$pet->breed.'</th> <th><img border="0" width="80" height="80" src="'.$boardurl.'/Sources/shop/pet_images/'.$pet->breed_img.'" alt="'.$pet->breed.'" title="'.$pet->breed_desc.'" /></th> <th>'.$row_2['memberName'].'</th> <th>'.sprintf($txt['pets_days'], $row['age']).'</th> <th>'.$row['level'].'</th></tr>'; } else { $context['shop_buy_message'] .= '<tr> <th><a href="http://sandbox.nomicville.com/index.php?action=profile;u='.$row['ownerid'].';sa=showPets">'.$row['name'].'</a><br />the<br />'.$pet->breed.'</th> <th><img border="0" width="80" height="80" src="'.$boardurl.'/Sources/shop/pet_images/'.$pet->breed_img.'" alt="'.$pet->breed.'" title="'.$pet->breed_desc.'" /></th> <th>'.$row_2['memberName'].'</th> <th>'.sprintf($txt['pets_days'], $row['age']).'</th> <th>'.$row['level'].'</th></tr>'; } } } $context['shop_buy_message'] .= '</table>'; $context['shop_do'] = 'toppets'; // Set the page title $context['page_title'] = $txt['shop'] . ' - ' . $txt['pets_toppets']; // Use the inventory template $context['sub_template'] = 'message';} ?>