Author Topic: SMFPets Version 0.2  (Read 162057 times)

Offline Alundra

Re: SMFPets Version 0.2
« Reply #165 on: October 15, 2007, 11:32:06 am »
LOL!!


why not let someone else look at it?
like someone who coded SMF?
i mean, ill post it if you wont cause i want this to work :D
i love it :D :D :D :D :D :D

Offline zsw007

Error with SMFPets Version 0.2
« Reply #166 on: October 25, 2007, 10:46:15 am »
Sorry i didn't look through all of the pages(i didn't have time to). But i was just trying this on my test forum to make sure that it dosn't mess my fourm up, and i got an error trying to go to Pet Central.

Code: [Select]
Fatal error: Cannot redeclare class in /home/www/test-forums.awardspace.com/SMF/Sources/shop/Shop-Pets.php on line 91
any ideas why? i want o make sure everything works out on my test forum for me to use it on my real forum.
Quote from: zsw007
im not an expert yet,sorry

Applaud me if you like my post(which means i helped you), i like Applauds :P

Offline feildmaster

Re: SMFPets Version 0.2
« Reply #167 on: October 26, 2007, 01:11:01 pm »
One or more of your class files are the same name... You have to have different names for each.

Offline zsw007

error with SMFPets Version 0.2...HELP
« Reply #168 on: October 27, 2007, 05:38:27 am »
One or more of your class files are the same name... You have to have different names for each.

but i never edited the file....


Code: [Select]
<?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 pets
if ($_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';
}

?>


this is the file ^
« Last Edit: October 27, 2007, 10:11:59 pm by zsw007 »
Quote from: zsw007
im not an expert yet,sorry

Applaud me if you like my post(which means i helped you), i like Applauds :P

Offline Geolion1

Re: SMFPets Version 0.2
« Reply #169 on: November 09, 2007, 12:46:56 pm »
How can I add breeds and stuff?
Or change the price?

Offline Celdric

Re: SMFPets Version 0.2
« Reply #170 on: November 26, 2007, 02:42:23 am »
Quote
Use PHP Myadmin or something like that to manually remove the quote from the description or name.

What an arrogant advice. Since month many people please here to fix some distgusting bugs. May be one should forget this buggy mod at all?

You're right. Maybe you should forget about a buggy 0.2 version of a mod that hasn't been officially released in any capacity because it is a 0.2 version and thus has bugs. Because honestly, I could care less about the people who are selfish enough to download and install the beta version of a mod, and then act like it is their God given right to get someone to fix the bugs in said beta version. And if that someone doesn't fix the bug, their are "arrogant" and "disgusting". If you care that much, fix the bugs yourself. If you don't care that much, quit bugging me and go play with actual mods that have been officially released.


Well, its still a buggy mod, if a beta or not. I'm wondering why it was published at all? A final version was appearently never planned and the current version is useless, if not dangerous because of its buggy coding.
So why is it still available here? Strange. But, as you said by yourself, you couldn't care less.





Offline Alundra

Re: SMFPets Version 0.2
« Reply #171 on: November 26, 2007, 05:13:58 am »
dude SOMEONE PLEASE FIX IT OMG PLEEEEEEEASE!!!!

 :'( :'( :'( :'( :'( :'( :'( :'( :'(

Offline zsw007

Re: SMFPets Version 0.2
« Reply #172 on: November 27, 2007, 08:27:34 am »
dude SOMEONE PLEASE FIX IT OMG PLEEEEEEEASE!!!!

 :'( :'( :'( :'( :'( :'( :'( :'( :'(
Quote from: zsw007
im not an expert yet,sorry

Applaud me if you like my post(which means i helped you), i like Applauds :P

Ubivis

  • Guest
Re: SMFPets Version 0.2
« Reply #173 on: December 03, 2007, 09:33:17 pm »
A fix is really simple:

open -> pet_engine.php

find:

Code: [Select]
//Change a pets name
function rename_pet($newname = 'No Name') {
$this->name = $newname;
}

//Change a pets description
function redesc_pet($newdesc = 'No Desc') {
$this->desc = $newdesc;
}

replace with:

Code: [Select]
//Change a pets name
function rename_pet($newname = 'No Name') {
$this->name = htmlspecialchars($newname, ENT_QUOTES);
}

//Change a pets description
function redesc_pet($newdesc = 'No Desc') {
$this->desc = htmlspecialchars($newdesc, ENT_QUOTES);
}


After this change,
' will be saved as &#039;
< will be saved as &lt

and so on :)
« Last Edit: December 03, 2007, 09:35:34 pm by Ubivis »

Offline tugori

Re: SMFPets Version 0.2
« Reply #174 on: December 07, 2007, 03:16:35 am »
Could you add a preview picture? Or can someone show me his site using this mod? Sounds interesting  :smitten:

Ubivis

  • Guest
Re: SMFPets Version 0.2
« Reply #175 on: December 07, 2007, 03:29:01 am »
try this link: http://www.manalink.de/index.php?action=shop;do=toppets

But this Mod is really earl alpha, there is a lot to be fixed, improved and developed :)

Offline exigent

Re: SMFPets Version 0.2
« Reply #176 on: January 11, 2008, 02:09:46 pm »
Hey, I'm getting an error when installing this - it's asking for my FTP info and then giving me an error 500 internal server error. I'm running SMF 1.1.4.

Offline JusPlay77

Re: SMFPets Version 0.2
« Reply #177 on: February 07, 2008, 09:53:00 am »
I get the following:

Quote
Some of the files the package manager needs to modify are not writable. This needs to be changed by logging into FTP and using it to chmod or create the files and folders. Your FTP information may be temporarily cached for proper operation of the package manager.

EDIT: N/M Fixed that problem.. but now I have another one:

Quote
Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Code    installScript.php    
2.    Extract Tree    ./Sources/shop/pets_breeds    
3.    Extract Tree    ./Sources/shop/pet_images    
4.    Extract Tree    ./Sources/shop/starter_pets    
5.    Extract File    ./Sources/shop/Shop-Pets.php    
6.    Extract File    ./Sources/shop/pet_engine.php    
7.    Extract File    ./Sources/shop/items/Cage.php    
8.    Extract File    ./Sources/shop/items/Food.php    
9.    Extract File    ./Themes/default/default/images/icons/pets.gif    
10.    Execute Modification    ./Sources/ManagePermissions.php    Test successful
11.    Execute Modification    ./Themes/default/Profile.template.php    Test successful
12.    Execute Modification    ./Themes/default/languages/ManagePermissions.english.php    Test successful
13.    Execute Modification    ./Themes/default/languages/Shop.english.php    Test successful
14.    Execute Modification    ./Themes/default/Shop.template.php    Test successful
15.    Execute Modification    ./Sources/shop/Shop.php    Test successful
16.    Execute Modification    ./Sources/shop/Shop-Subs.php    Test successful
17.    Execute Modification    ./Sources/Profile.php    Test successful
18.    Execute Modification    ./Sources/Load.php    Test failed
19.    Execute Modification    ./Themes/default/languages/index.english.php    Test successful
20.    Execute Modification    ./Themes/default/Display.template.php    Test successful
« Last Edit: February 07, 2008, 10:44:51 pm by JusPlay77 »

Offline Rezet

Re: SMFPets Version 0.2
« Reply #178 on: February 08, 2008, 07:23:26 am »
Can't find how to rule my pet(I don't see TRAIN button or something like this)! Could you give me your link on your pet panel. I think script installed wrong.

P.S. Pets it's good. Take care of them is interesting, but it will became boring at few monthes. I mean, we need more actions to have happy users! It'll be cool if pets can playing games with each other or you can send them to the ring or race challenge.

Sorry for my English %)
« Last Edit: February 09, 2008, 11:04:21 pm by Rezet »
We always glad to see you in Siberia!

Offline JusPlay77

Re: SMFPets Version 0.2
« Reply #179 on: February 28, 2008, 12:39:06 pm »
SMF 1.1.4
SMFPets Version 0.2

I currently own 1 pet, but when I try to buy more pets I get this error:

Quote
You are not allowed any more pets!!!

So I bought a Pet Cage, and when I try to use it I get this error:

Quote
This item requires further input. Please complete the fields below, and then press "Use Item"
You already have too many pets to use this item. Using it will just result in item loss.

I click Use Item and I then get:

Quote
Told you so!

Back to your Inventory

Then I go back to Pet Hatchery and try to buy a pet, and get this error:

Quote
You are not allowed any more pets!!!



\-----------------------------------------------\



I removed the pet cage from the shop, and re-added it to see if that would fix it.. It did not.. Any other suggestions? 

This fix is essential since there is no option to sell the pets once you bought them.  (Poison is cool, but it's a really pricey way to change pets)
« Last Edit: February 28, 2008, 02:30:28 pm by JusPlay77 »