Author Topic: SMFPets Version 0.2  (Read 161512 times)

Offline 5cakids

Re: SMFPets Version 0.2
« Reply #120 on: June 30, 2007, 08:58:58 am »
Where can I download this mod please exactly what I was looking for

Offline David

Re: SMFPets Version 0.2
« Reply #121 on: June 30, 2007, 09:13:12 am »
Please read the rest of the topic before posting a query...I answered this one yesterday as well from another member...se page 7 of this topic where I posted a copy of the file you want.

Offline 5cakids

Re: SMFPets Version 0.2
« Reply #122 on: June 30, 2007, 09:32:12 am »
Please read the rest of the topic before posting a query...I answered this one yesterday as well from another member...se page 7 of this topic where I posted a copy of the file you want.

I am sorry I found it. That is my fault. Where can I find how to make the default pets appear, I am so lost and very excited :) Sorry also when I click on the pets name (I added a breed on accident it takes me to an off site and the off site is down  This site http://sandbox.nomicville.com/index.php?action=profile;u=1;sa=showPets
« Last Edit: June 30, 2007, 09:37:00 am by 5cakids »

Offline David

Re: SMFPets Version 0.2
« Reply #123 on: June 30, 2007, 12:03:43 pm »
Last bit first...if you read the topic you'll find the error you've reported discussed at length. There isn't a proper fix for it as it's a bug in v0.2.

 It's 4 in the morning here so I'm just too tired to write a long explanation of how to add pets...that too is likely to be in past postings here but if you haven't found it by the time I surface again tomorrow and nobody else answers I'll try to write you an explanation then.

Offline inkstains

Re: SMFPets Version 0.2
« Reply #124 on: July 30, 2007, 09:45:59 pm »
heres a poison item for anyone who's interested

it basically kills a users pet. this action is non-reversible.


just save the code in a file called Poison.php also attached to this post is a poison bottle item image with a transparent background.

Code: [Select]
<?php
/**********************************************************************************
* SMFShop item                                                                    *
***********************************************************************************
* SMFShop: Shop MOD for Simple Machines Forum                                     *
* =============================================================================== *
* Software Version:           SMFShop 3.0 (Build 12)                              *
* $Date:: 2007-01-18 19:26:55 +1100 (Thu, 18 Jan 2007)                          $ *
* $Id:: Steal.php 79 2007-01-18 08:26:55Z 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 (!defined('SMF'))
die('Hacking attempt...');

class 
item_Poison extends itemTemplate
{
function getItemDetails()
{
$this->authorName 'Inkstains';
$this->authorWeb 'http://nurcharecords.com';
$this->authorEmail 'scrawl@nurcharecords.com';

$this->name 'Pet Poison';
$this->desc 'Put your pet down!';
$this->price 50;

$this->require_input true;
$this->can_use_item true;
}

function getUseInput()
{
global $db_prefix$ID_MEMBER;
                
$result db_query("SELECT numpets FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__);
$row mysql_fetch_assoc($result);
if ($row['numpets'] == 0) {
return "You have no pets. Using this item will simply cause it to fail and you to lose money.";
}
$string .= "<select name = 'petid'>";
$result db_query("SELECT * FROM {$db_prefix}shop_pets WHERE ownerid = {$ID_MEMBER}"__FILE____LINE__);
while ($row mysql_fetch_assoc($result)) {
$string .= "<option value = '{$row['pet_id']}'>{$row['name']}</option>";
}
$string .= "</select>";
return "<b><br />This is a permanent non-reversible action</b> if you would like to continue please select which pet you would like to poison: <br /><br />".$string;
}

function onUse()
{
global $db_prefix$ID_MEMBER$item_info;

if (!isset($_POST['petid'])) {
return "I told you it would fail!";
}
else {
$result db_query("DELETE FROM {$db_prefix}shop_pets WHERE pet_id = {$_POST['petid']} AND ownerid = {$ID_MEMBER}"__FILE____LINE__);
return "Your pet eats the poison and dies!";

}
}
}
?>

« Last Edit: July 31, 2007, 01:40:30 am by inkstains »

Offline Dr.Vista

Re: SMFPets Version 0.2
« Reply #125 on: August 12, 2007, 06:06:52 am »
how do i make this work,i installed the mod then i went to the shop their was a blank spot their were the pets are supposed to be :tickedoff:  :knuppel2: :idiot2:

Offline feildmaster

Re: SMFPets Version 0.2
« Reply #126 on: August 12, 2007, 11:50:01 am »
it's because its a blank pet, in dreamweaver or some other editing program... just make new ones following the template of the blank one.

Offline puma

Re: SMFPets Version 0.2
« Reply #127 on: August 14, 2007, 08:10:22 pm »
i like SMFPets will better than p3tz.
 ;)

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #128 on: August 14, 2007, 10:23:22 pm »
Sorry I havn't done much here in awhile guys. I have been working on other coding projects. I'll try to find some time to clean up the code and deal with any questions people have sometime soon. Maybe even start doing some more actual work on it, who knows.

Quote
I love this mod.  The younger kids on my site do as well.

I noticed something today though that has me baffled.  The pets should be no more than 20 days old, and sometime between Sunday evening and now, they all miraculously aged to  389 - 391 days.   

Does anyone have any ideas on this?

IIRC, the pets age via a script that calculates the difference between the current date and the last time pets aged. I might have made an error with my date function, or some fluke might have hapened with the php code. I donno. Did they all get really hungry?

Arrrrr!

Offline feildmaster

Re: SMFPets Version 0.2
« Reply #129 on: August 15, 2007, 12:54:38 am »
ah... because they age per page view, yeah... I had that problem too. I fixed mine by changing the code a bit... (can't remember what i changed). But I got rid of SMFPets... (gona make my own...)

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #130 on: August 20, 2007, 12:46:25 pm »
Something strange musta been happening. Because they shouldn't age per page view any more than once a day. Has anyone else been having this problem?
Arrrrr!

Offline tick

Re: SMFPets Version 0.2
« Reply #131 on: September 02, 2007, 05:33:30 am »
has any one come across this and know of a fix for it. 
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's master.',
hunger = 9,
age = 1,
training = ' at line 7
File: /home/pogobook/public_html/modules/smf/Sources/shop/pet_engine.php
Line: 305
  That happens when ever I try to go to the shop.   here is line 305 from that file


Code: [Select]
<th colspan='1' width='10%'>".$txt['pets_train']."</th>

<td colspan='2'>".$this->trainMenu()."</td></tr>

                305        <tr><th colspan='1' width='10%'>".$txt['pets_rename']."</th>

<td colspan='2'>".$this->renameMenu()."</td>

<th colspan='1' width='10%'>".$txt['pets_describe']."</th>

<td colspan='2'>".$this->describeMenu()."</td></tr></table><br />";

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #132 on: September 04, 2007, 04:51:04 am »
It has to do with having a single quote in your pets name. That breaks query. Its a bug that I keep meaning to fix/thing I fixed by never actually fixing.
Arrrrr!

Offline tick

Re: SMFPets Version 0.2
« Reply #133 on: September 04, 2007, 06:21:15 am »
So how would I go about fixing this

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #134 on: September 04, 2007, 09:19:36 am »
Use PHP Myadmin or something like that to manually remove the quote from the description or name.
Arrrrr!