SMF Shop

SMFShop => Beta additions => Modifications => Topic started by: Basil Beard on April 30, 2007, 07:30:43 am

Title: SMFPets Version 0.2
Post by: Basil Beard on April 30, 2007, 07:30:43 am
This is the thread for asking me questions and/or discussing my pet mod for SMFShop.

The pet mod is currently in BETA so please only use it at your own risk.

The current release of the pet mod is version 0.2. Anyone will 0.1 or 0.0 must uninstall and then reinstall to get this update. Sorry.
If you do uninstall, BACK UP YOUR PET DATA FIRST. Because it will be zapped if you do not.

If you asked a question on the old thread and it was never addressed, please ask again here because I probably didn't see it.

You can download version 0.2 here:

http://dev.dansoftaustralia.net/frs/shownotes.php?release_id=13
Title: Re: SMFPets Version 0.2
Post by: preddy25 on April 30, 2007, 11:40:08 am
woopee!
installation is a smooth , i backup all the pets images n pet files b4 the migration . and replace them back into the relevant folders , everything seems to be okay  except the old issue of pets pics not appearing in pets central , i previously solved that with some hacks on this board on 0.1.

which file should i look at ?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on April 30, 2007, 11:59:07 am
Extremely bizzare. That issue should've been fixed.  :-\
Title: Re: SMFPets Version 0.2
Post by: preddy25 on April 30, 2007, 12:15:15 pm
hmmm looks like my booboo...your code is correct, think i mixed up with the old .1 files into the new ones...
its just a problem where $boardurl is not declare in the function..i check your packages files and its correct!

hehee..thanks !

oh ya one more thing , you dont intend to include the kill pets function into later releases? i gotta put them back again now..
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on April 30, 2007, 01:10:10 pm
A kill function might be added later. More likely it would simply be done via an item.  :)
Title: Re: SMFPets Version 0.2
Post by: preddy25 on April 30, 2007, 01:21:47 pm
oh that would be cool..item ...Pet Poison...20k...lol

0.2 changes
Icon links to pets by posts. *Images have been fixed. *Pet leader board now exists. *Pet food has been given an update. *Other minor stuff, I think.

basil , wad do u mean by links pets by post?

and i m a little lost on this when u creating pet food item
"phrase to output upon use: (use xNAMEx for pet name, xHUNGERx for hunger level and xHAPPYx for happiness level"
what should i enter in the blank?

Title: Re: SMFPets Version 0.2
Post by: Honcho on April 30, 2007, 06:54:49 pm
(http://i83.photobucket.com/albums/j290/d237447q/dan.jpg)

Although this isn't probably a shop problem it seems to be occuring anytime I install a mod which uses the display template, but it occured while installing SMF Pets so I was wondering if any of you boffins could point me in the right direction

(http://i83.photobucket.com/albums/j290/d237447q/dan2.jpg)

any ideas?


Title: Re: SMFPets Version 0.2
Post by: Basil Beard on April 30, 2007, 10:31:09 pm
So many stuff effect display.template that they are bound to cross eachother. Just look inside the install script and find what changes are made to the display script and go from there.

If you notice, preddy, there is now a little blue paw icon by your posts that links to your pets. =)

Foodwise, say you put

xNAMEx first uses the bagel as a frisbee and then eats it. Its happiness is now xHAPPYx and its hunger is now xHUNGERx

And your pet was name "Bob" and had happiness and hunger 10. You would get

Bob first uses the bagel as a frisbee and then eats it. Its happiness is now 10 and its hunger is now 10
Title: Re: SMFPets Version 0.2
Post by: Honcho on April 30, 2007, 11:06:37 pm
I get this error now when I click on my Shop link:

Fatal error: Cannot redeclare check_pets() (previously declared in /homepages/20/d132504958/htdocs/kosforum/Sources/shop/Shop-Subs.php:127) in /homepages/20/d132504958/htdocs/kosforum/Sources/shop/Shop-Subs.php on line 173
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on April 30, 2007, 11:47:44 pm
Look in Shop-Subs. Maybe I accidentally added check_pets() function twice.  :(
Title: Re: SMFPets Version 0.2
Post by: Honcho on April 30, 2007, 11:54:33 pm
Look in Shop-Subs. Maybe I accidentally added check_pets() function twice.  :(

I sussed that out thank Basil.  Was that you or just a leftover from my previous installation of 0.0 and 0.1?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 01, 2007, 12:03:23 am
It very well could've been. Which would've meant an error with the uninstall rather that an error with the package itself.  :buck2:
Title: Re: SMFPets Version 0.2
Post by: preddy25 on May 01, 2007, 01:14:56 am
the uninstalls from the previous 0.0 n 0.1 were pretty sloppy..due to the hack i put in too much hacks from this forums myself..hheheh ;D...even though some mods and files were "successfully" removed , they were still there n traces of it in the files..

so anyone upgrading to 0.2 , its better to manually do a clean up of the files just to avoid alot of confusion i had earlier...but the pet breeds files and pets database should be backup before anything happens
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 01, 2007, 02:59:42 am
Well I mean, the uninstall should work because it simply reverses everything the install did. But if you changed anything around by yourself, then yeah, the uninstall wouldn't work. (Note that the uninstall should just remove the pet-engine.php and Shop-pets.php files and replace them, so you do not need to worry about changes made there)
Title: Re: SMFPets Version 0.2
Post by: Honcho on May 01, 2007, 05:43:49 am
Well everything's working great now, thanks guys!
Title: Re: SMFPets Version 0.2
Post by: Honcho on May 01, 2007, 07:46:02 pm
I've just noticed this:

On the Pet leaderboard the pets name is linked to: http://sandbox.nomicville.com/index.php?action=profile;u=1;sa=showPets

(http://i83.photobucket.com/albums/j290/d237447q/peterror.jpg)
Title: Re: SMFPets Version 0.2
Post by: discoponies on May 01, 2007, 09:24:51 pm
 :-\

Quote
Fatal error: Call to undefined function: load_pets() in /home/fhlinux172/n/nomoreblue.greenhillnetwork.co.uk/user/htdocs/Sources/shop/Shop-Pets.php on line 37
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 01, 2007, 09:44:42 pm
Pet names are linked to the pet page of the owner of the pet.  :)

What does your Shop-Subs file look like? load_pets should be there  :)
Title: Re: SMFPets Version 0.2
Post by: discoponies on May 01, 2007, 09:54:00 pm
Quote
<?php
/**********************************************************************************
* Shop-Subs.php                                                                   *
* General SMFShop subprocedures                                                   *
***********************************************************************************
* 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:: Shop-Subs.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.                                                  *
**********************************************************************************/

// Write the money in a suitable format.
// Casts the value to a float, and add the prefix and suffix
function formatMoney($money)
{
    global $modSettings;

    // Cast to float
    $money = (float) $money;
    // Return amount with prefix and suffix added
    return $modSettings['shopCurrencyPrefix'] . $money . $modSettings['shopCurrencySuffix'];
}

// Get an array of all selectable item images
// TODO: Clean this up a bit
function getImageList()
{
    global $sourcedir;

    // Start with an empty array
    $imageList = array();
    // Try to open the images directory
    if ($handle = opendir($sourcedir . '/shop/item_images'))
    {
        // For each file in the directory...
        while (false !== ($file = readdir($handle)))
        {
            // ...if it's a valid file, add it to the list
            if (!in_array($file, array('.', '..', 'blank.gif')))
                $imageList[] = $file;
        }
        // Sort the list
        sort($imageList);
        return $imageList;
    }
    // Otherwise, if directory inaccessible, show an error
    else
    {
        fatal_lang_error('shop_cannot_open_images');
    }
}

// Get an array of all the categories
function getCatList()
{
    global$db_prefix;
    // Start with an empty array
    $cats = array();
    // Get all the categories
    $result = db_query("
        SELECT id, name, count
        FROM {$db_prefix}shop_categories
        ORDER BY name ASC", __FILE__, __LINE__);
    // Loop through all the categories
    while ($row = mysql_fetch_assoc($result))
        // Let's add this to our array
        $cats[] = array(
            'id' => $row['id'],
            'name' => $row['name'],
            'count' => $row['count'],
        );
    mysql_free_result($result);
   
    // Return the array
    return $cats;
}

// Fix all the item category counts. Use this when the counts are incorrect
function recountItems()
{
    global $db_prefix;
   
    // Start with an empty count array
    $counts = array();
   
    // Get all the items
    $result = db_query("
        SELECT category
        FROM {$db_prefix}shop_items", __FILE__, __LINE__);
   
    // Loop through them
    while ($row = mysql_fetch_assoc($result))
        // Is it categorised at all?
        if ($row['category'] != 0)
            // Add one to the category's count. If it's not defined yet, set it to 1
            $counts[$row['category']] = (isset($counts[$row['category']]) ? $counts[$row['category']] + 1 : 1);
       
    mysql_free_result($result);
   
    // Loop through all the categories
    foreach ($counts as $key => $value)
        // Update this category's count
        db_query("
            UPDATE {$db_prefix}shop_categories
            SET count = {$value}
            WHERE id = {$key}", __FILE__, __LINE__);
            function check_Pets() {
    global $db_prefix, $sourcedir, $modSettings;
    $date = date('z');
    if ($modSettings['shop_pets_date'] != $date) {
        $diff = $date - $modSettings['shop_pets_date'];
        if ($diff < 0) {
            $diff = $diff + 365;
        }
        require($sourcedir . '/shop/pet_engine.php');
        if ($handle = opendir($sourcedir . "/shop/pets_breeds/")) {
            while (false !== ($file = readdir($handle))) {
                if (substr($file, -4) == '.php')
                {
                    // Get the breed name (file name without .php extension)
                    require($sourcedir . '/shop/pets_breeds/' . $file);
                }
            }
        }
        $result = db_query("SELECT * FROM {$db_prefix}shop_pets", __FILE__, __LINE__);
        while ($row = mysql_fetch_assoc($result)) {
            eval('$temp = new pet_' . $row['breed'] . ';');
            $temp->load_values($row['pet_id']);
            for ($i = 0; $i < $diff; $i++) {
                $temp->advance_day();
            }
            $temp->store_values();
        }
        $result = db_query("UPDATE {$db_prefix}settings SET value = {$date} WHERE variable = 'shop_pets_date'", __FILE__, __LINE__);
    }
    }
   
//Loads the pets up!
function load_pets() {
    global $sourcedir;
   
    require($sourcedir . '/shop/pet_engine.php');
    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');
                require($sourcedir . '/shop/pets_breeds/' . $file);
            }
        }
    }
}
recountItems();
?>
Is that all correct? I have no idea what should and shouldnt be there?

Also I just noticed this error appears when looking at a profile...
Quote
Parse error:  syntax error, unexpected $end in /home/fhlinux172/n/nomoreblue.greenhillnetwork.co.uk/user/htdocs/Sources/Profile.php on line 3591

And this when viewing the rest of the shop

Quote
Parse error:  syntax error, unexpected $end in /home/fhlinux172/n/nomoreblue.greenhillnetwork.co.uk/user/htdocs/Sources/shop/Shop-Subs.php on line 174
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 01, 2007, 11:36:21 pm
Clearly 0.2 did not install itself correctly. Or 0.0 and 0.1 did not uninstall themselves correctly and that messed up 0.2's installation. I'm inclined to think the latter because it worked fine when I just installed 0.2. But who knows. When you installed 0.2, did you get any errors? This is hard for me... because it worked for me... so should work for you :P
Title: Re: SMFPets Version 0.2
Post by: NFM on May 02, 2007, 12:44:40 am
Any other links to download 0.2 from?  The one you provided is timing out right now.
Title: Re: SMFPets Version 0.2
Post by: discoponies on May 02, 2007, 02:57:00 am
Ok, I did a fresh install....
Now it tells me this!

Quote
ERROR: The 'do' action you passed was not valid!
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 02, 2007, 04:37:17 am
I would assume that you are visiting top pets there, correct? Maybe I never put the update to actually fix top pets in the install. Like, I missed it. And then I installed it and it didn't work and I thought I fixed it  O0
Title: Re: SMFPets Version 0.2
Post by: NFM on May 03, 2007, 03:19:56 am
Okay...I got the link to work today.

Question...How do I create a pet?  I read the instructions but I don't understand what I need to change and what I shouldn't...and how do I create skills and so on...I'm SO lost.

 :buck2:
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 04, 2007, 10:18:20 pm
There is a folder called "starter pets" which contains 6 starter pets. You can either use those as they are, or look there for how to create pets. It has a number of skills, so that should help  :)
Title: Re: SMFPets Version 0.2
Post by: NFM on May 04, 2007, 11:53:05 pm
Why thank you!
Title: Re: SMFPets Version 0.2
Post by: Aes-Sedai on May 05, 2007, 10:23:47 am
Dunno why you locked the other one.

I know you've heard this before - but I think I need your help personally as all the solutions offered haven't worked.

Cliche: My images aren't showing up on Pet Central, but they show up in the Hatchery just fine.

I'm using SMF 1.1.2, Pets 0.1 with no real wish to upgrade, I have tried setting 'all files writable' and 'standard files writeable'. I have also tried the solutions offered in the first thread.

Just wondering someone could help me show them up?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 05, 2007, 11:18:46 am
Upgrade to 0.2. The issue is fixed there. I am sorry, but I do not want to offer support for previous versions, esp when the issue is with a problem I already fixed.  :buck2:
Title: Re: SMFPets Version 0.2
Post by: Aes-Sedai on May 05, 2007, 09:46:36 pm
I upgraded... it's running smoother however when I put my pet in 'training' it said to check back at the exact second I put it in training.

i.e Put it in at 2PM
"Your pet is in training! Check back at 2PM!"

Same date and all.

BUT the problem is my pet is stuck in training, and unlike Version 0.1 where you could pull him out by pressing 'level up' or 'train' I think it is? Well... you can't now.

There were no errors in installation, is there any way you can help?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 05, 2007, 10:57:35 pm
What level is your pet? You sure it isn't like, 2 PM tomorrow?
Title: Re: SMFPets Version 0.2
Post by: Aes-Sedai on May 06, 2007, 03:51:17 pm
Absolutely certain. And it's on Level 1, I put it in training for Level 2.

EDIT: Ah, it appears to be working now - must have been a minor glitch, it seems to be setting the course end time properly now!

Of course, dare I ask being such a newbie to this modification but how do the pets earn SP? Having only installed it a few days ago I have yet to understand how it works properly.
Title: Re: SMFPets Version 0.2
Post by: Joshsuxx on May 06, 2007, 09:27:24 pm
hey guys i got some questions about this mod:

Theres 16 pages, and like 3 official threads for this item, it's very confusing, and annoying.

I have downloaded the newest version of smf pets and smfshop, i am just wondering:

Is there any codes or scripts in pages back in other threads, or fixes, or anything that can make my tme with this mod more fun?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 06, 2007, 11:50:36 pm
Aes-Sedai: Let me know if the error appears again. It could just be an issue with low level pets or something. =)

Joshuxx: There is only one official thread. The first thread was created for me asking questions about making it a package. The second was for the first two versions of the mod. I did not have powers to move topics when this subboard was released, so I just choose to create a new topic for the latest update. Feel free to examine the old thread, I don't recall what all is there but its only a few pages. Its not like it would take you too long. 
Title: Re: SMFPets Version 0.2
Post by: littleone on May 07, 2007, 11:00:28 am
Got like hundreds of pages of this:

8: Undefined index: pets
File: /home/xxxxxxxxx/public_html/forum/Sources/Load.php
Line: 1160

Here are lines 1159 and 1160
//another pets modification
      'pets' => $profile['pets'],
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 07, 2007, 11:08:00 am
Yeah. I remember comming across a bug like that, but don't recall off the top of my head how I fixed it. Sorry.
Title: Re: SMFPets Version 0.2
Post by: littleone on May 07, 2007, 02:05:49 pm
change:
'pets' => $profile['pets'],

to
'pets' => &$profile['pets'],
Title: Re: SMFPets Version 0.2
Post by: littleone on May 07, 2007, 02:07:07 pm
8: Use of undefined constant pet_Blank_pet - assumed 'pet_Blank_pet'
File: /home/xxxxxxx/public_html/forum/Sources/shop/pets_breeds/Blank_pet.php
Line: 2

to fix this:

change:
if (!class_exists(pet_Blank_pet)) { //Make sure name matches php file

to
if (!class_exists('pet_Blank_pet')) { //Make sure name matches php file
Title: Re: SMFPets Version 0.2
Post by: akee on May 07, 2007, 10:44:03 pm
question..?


when we view the profile of our pets this shows up.

i didn't have the old version of the pet shop and i just installed it. i have reinstalled the files but still gets this.. hmm..?

http://sandbox.nomicville.com/index.php?action=profile;u=1;sa=showPets


also, if ever i will reinstall again, how will i back up the pets? thanks.
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 08, 2007, 10:51:48 am
o_0. I never actually link to my site with the mod. There is no way it should possible be linking there. (If I understand your problem correctly)
Title: Re: SMFPets Version 0.2
Post by: David on May 09, 2007, 05:42:18 pm
I'll take a stab at what the problem reported 2 posts above and by akee might be...

When members try to view pets in their profiles they get the following 2 errors from index.php?action=profile;u=1;sa=showPets or any other profile:

8: Undefined index: profile_show_pets_2
File: /home/****/Themes/default/languages/Shop.english.php (showPets sub template - eval?)
Line: 451

8: Undefined index: showPets
File: /home/****/Sources/Profile.php
Line: 329

 Thanks for all your hard work on this project.
Title: Re: SMFPets Version 0.2
Post by: NFM on May 10, 2007, 12:09:37 am
o_0. I never actually link to my site with the mod. There is no way it should possible be linking there. (If I understand your problem correctly)

It's happening on my forums too.  Linking to the same place...
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 10, 2007, 05:46:35 am
Most likely something happened where instead of copying and pasting the right file, I copied and pasted a link. Can you provide me with your profile.template.php and profile.php files?
Title: Re: SMFPets Version 0.2
Post by: NFM on May 11, 2007, 03:45:03 am
I'll try and get them tonight....I'm at work right now and even though it's a quick thing to do...it would take too long to copy them and paste them or zip them.

NFM
Title: Re: SMFPets Version 0.2
Post by: littleone on May 11, 2007, 04:55:02 am
Most likely something happened where instead of copying and pasting the right file, I copied and pasted a link. Can you provide me with your profile.template.php and profile.php files?

Its hard coded into the code.  I think its in the Pet Engine but I dont remember.
Title: Re: SMFPets Version 0.2
Post by: akee on May 14, 2007, 09:23:49 pm
problem..o.o''

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 cute yet, if his master asks him to be psychotic, he could slaughter you down ' at line 7
File: /home/ramen/public_html/forums/Sources/shop/pet_engine.php
Line: 305

uhmm.. it happened to me twice already. the first time is i deleted the whole files and reinstalled it again but again, it happened. T_T

help. thanks
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 14, 2007, 11:29:57 pm
Are you using the latest version? Becuase your problem has to do with apparent quote marks in the pet description--an issue I thought i fixed. <_<
Title: Re: SMFPets Version 0.2
Post by: akee on May 15, 2007, 11:52:37 pm
yes, im using the current version..
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 16, 2007, 06:08:26 pm
Hi.  :)  I just wanted to install pet 0.2. I'm using Shop 3 and test was successfull. But when I clicked install I got the error below. I'm using the default template and have a couple more mods installed, smf gallery for example. So I don't know what could be wrong.


Code: [Select]
Fatal error: packageinstall() [function.require]: Failed opening required '/home/++++++/public_html/forums/Packages/temp/./installScript.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/++++++/public_html/forums/Sources/Packages.php on line 552
Title: Re: SMFPets Version 0.2
Post by: David on May 16, 2007, 06:22:08 pm
In order to work on a package the package installer needs to make a temp directory within the Packages directory...it looks to me like it tried to do so but couldn't...you might try creating the temp directory via ftp and with it in place trying again to install the mod.

 I would also suggest that you go to:

 ACP>Packages>Options>Installation Options

...and fill in your ftp data then use Cleanup Permissions on that page and make all files writable...you would also do well to check via your ftp client that the CHMOD permissions really have changed to either 775 or 777...this should be done prior to installing any mod...after installation you can use the same system to lower the permissions on your files if you so wish.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 16, 2007, 06:44:53 pm
Thanks for the quick response. Well, I created a folder temp and tried again. This time it worked. But it seems that the first attempt worked also even when I got the fatal error. Because now I have all code parts installed twice. That's silly.  :-\
Title: Re: SMFPets Version 0.2
Post by: David on May 16, 2007, 06:47:26 pm
Just remember that SMF does advise you to back up your files and database prior to installing any mod...now you know why...most of us learn the hard way from time to time so you're in good company.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 16, 2007, 10:30:13 pm
Well, I use to make daily backups. As you mentioned, I learned it the hard way.  ;D


I removed the double code parts manually. However, then I had to notice that some files weren't installed, but still in the temp folder. I must say, I never had such a crazy package installation. Seems things are working now. I have just to find out how to use this mod. Got anyone else the idea, that the mod could be perfect to create "penthouse pets"? lol
Title: Re: SMFPets Version 0.2
Post by: David on May 16, 2007, 10:56:24 pm
 It's fun being a forum admin isn't it? Actually, and to be fair to Basil B, the mod isn't to blame for the problems you had. Your forum had file permissions issues by the looks of it and that threw the  package installer off.

 "Penthouse Pets" Tsk!  :angel:
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 16, 2007, 11:25:56 pm
I don't blame anyone.  :) The mod is a great job. I'm sure that my members will love it.  Not sure although if the file permissions are the problem because other packages got installed without problems.

Hey, works nice with the ph-pets. Just purchased a test fluffy-bunny called Lucille. She is wearing a read bikini. lol

Serious, I'm wondering, if all breeds are in a unlimited number available? Or can I limit the amount like a can do it with other stock items?
Title: Re: SMFPets Version 0.2
Post by: David on May 16, 2007, 11:55:05 pm
 The breeds are in unlimited supply as you don't go through the same system as with other items and thus don't add x number of each to the shop...the cost of each pet is, probably, your best limiter on their numbers. If you want more control than that you'd best put it to Basil B as a feature request.

 I'd take a bet with you that there would have been problems with future installs of other mods given the setup of your forum...the missing temp directory issue is a well known problem.

 Um "read bikini"...with my bad eyesight and without my glasses I'd have to get awfully close to read anything...
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 17, 2007, 12:14:12 am
 ;D I know what you mean, I'm wearing glasses too.

Thanks for the info. Okay, perhaps I should post it as feature request.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 19, 2007, 11:49:29 pm
Well, in general found out how things work. But I have 2 problems I can't solve. First, I'm using 2 of the starter pets. Bunny and Lion. They both have more than one skills as far as I can see.

$this->skills_cnt = 4;

And the required functions are also there. Nonetheless in the scroll down menu only 1 skill is showing. 


My second problem, I'm using SMF + Joomla bridge. When I trained a pet or tried to use a skill and then click the return link, I land on the link

forums/index.php?action=shop;do=pets

but the correct link would be

index.php?option=com_smf&Itemid=56&action=shop;do=pets

I'm no php programmer. So I would be happy about a hint how I can fix the links problem. Perhaps I have to edit some code?

Title: Re: SMFPets Version 0.2
Post by: David on May 20, 2007, 12:13:39 am
Seeing as this is only v0.2 of beta software I trust you're using it on a test site not a live one...thus you might try first removing the Joomla bridge and seeing if it works properly without that in place. I suspect that both your problems are related to the Joomla addition so you may well find that without it all is well.

 If it does work without Joomla bridging in place then we'd best hope that Basil B may have some thoughts about it and/or may consider adding support for Joomla bridging in a later version.

 If it still doesn't work properly with the Joomla bridge out of the way perhaps you'd try it on an unmodified and fresh test forum on a fresh database and thus see if there's some server issue playing with it...supposing it works in that setting then slowly add in the mods etc you wish to use and see if it keeps working...you should thus be able to pinpoint any problem add on.

 It's all part of beta testing...
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 20, 2007, 12:44:16 am
Thanks for your response. I don't think that the bridge causes the skills problem.

TechnoDragon reported the same problem. I think it's on page 5.

Code: [Select]
For some reason the pet mod will not read anything but the first skill...I have them set properly ....
http://www.daniel15.com/forum/index.php/topic,642.45.html

Seems he could solve the problem. Though I have no idea how.

[EDIT] Well, I could solve the skill issue. But I would still be happy about some help in the backlink matter. :)
Title: Re: SMFPets Version 0.2
Post by: David on May 20, 2007, 01:56:16 am
 Ah...that was with v0.1. I had thought all those problems were fixed in v0.2. You should use the pets files that are with v2.0...I mention this in case you are using the old ones. I put v0.2 on a fresh test site so there was no question of any left over issues from v0.1 Did your installation have v0.1 on it at some stage?
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 20, 2007, 03:24:21 am
No. I installed .2. And I just found this in my Shop-Pets.php

Code: [Select]
<th><a href="[b]http://sandbox.nomicville.com/index.php[/b]?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="[b]http://sandbox.nomicville.com/index.php[/b]?action=profile;u='.$row['ownerid'].';sa=showPets">'.$row['name'].'</a><br />the<br />'.$pet->breed.'</th>

Some hard coded links which are not mine. I don't think that they belong there.
Code: [Select]
sandbox.nomicville.com/index.
Title: Re: SMFPets Version 0.2
Post by: David on May 20, 2007, 03:29:30 am
Yep...that is covered in page 3 of this topic...Basil B. accidentally copied into the file a bit of code from his site with that hard-coded link in it. I presume that he will issue a new file as a replacement or a new version with that and other fixes etc.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 20, 2007, 04:07:36 am
Thanks alot for the hint.  :) Any idea where I can edit the Pet Central template? I find everything, but not that. Sorry, don't want to be pest.  ;D
Title: Re: SMFPets Version 0.2
Post by: David on May 20, 2007, 04:35:43 am
Actually answering questions makes me learn as I go too so it's no bad thing all round.

 There's no distinct, separate, Pet Central template...remember this software piggybacks on the shop...the hatchery and the Pet Central details etc are part in Shop-Pets.php and also use the shop inventory.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 20, 2007, 04:54:03 am
I was affraid that you would say that. Actually I have one of these ugly problems where everything looks okay in Firefox, but in IE it's oversized. It's only the Pet Central. The other tables are okay in both browsers. Okay, I will continue searching. Thank you anyway. 
Title: Re: SMFPets Version 0.2
Post by: David on May 20, 2007, 05:05:07 am
[whispers quietly] Anything that puts people off of using I.E. is probably best called a feature not a bug.[/whispers quietly]
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on May 20, 2007, 01:14:27 pm
[whispers quietly] Anything that puts people off of using I.E. is probably best called a feature not a bug.[/whispers quietly]

Some people don't like to annoy their users by making them switch browsers. Some people are just stubborn and don't want to change--and would probably be annoyed if their admin forced the change upon them by making the site unusable in IE. =P
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 20, 2007, 09:30:31 pm
I agree to Basil. Not to mention the fact that still 90 % of the visitors are using IE. Btw, I could fix all problems. Perhaps a tip for people who are using SMF+Joomla bridge.  Just take a look in Shop.english.php. The backlink is coded there in a textstring. You need to replace it with the link that's generated by Joomla. That should work.  :)
Title: Re: SMFPets Version 0.2
Post by: David on May 21, 2007, 07:56:15 am
 My findings are very different from yours...my SMF forum is the smallest in terms of user numbers of the forums I run and on it just under 5% of the users still use I.E. despite all the services there working with I.E. This percentage keeps on dropping as members are persuaded to try better browsers by the rest of the membership. Perhaps the membership does tend to be a little more browser saavy than the average Internet user.

 I don't deliberately break things as regards their working with I.E. (as some admins do) but nor would I go out of my way to make additional services work with it if they worked with other browsers and were standards compliant...thus I regard myself as agnostic rather than being an I.E. supporter as I would regard myself as being were I to put in extra effort to support a browser that is not standards compliant.

 I agree with quite a few of the people who have posted on browser development forums and who say that those who hide the fact that I.E. doesn't comply with the normal standards to which other browsers are coded and to which they do comply are doing a disservice not only to standards compliance but to users who would switch from I.E. were it to show as being broken by design more often.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 22, 2007, 01:26:00 am
Well, I think that probably different from site to site. Currently 80 % of the around 3,000 unique visites I have this month are using IE. Around 10 % are using Firefox.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 22, 2007, 04:34:57 am
Instead to delete pets manually in the database or to kill them, can't they just disapear when they reach a certain age? I mean actually the mod is telling how old pets are, but this info is practically useless. But when you know at the age of 30, 40 or whatever your pet disappears - lets say leaves the town to seek a new owner or it's  lost brother (lol) - then the age becomes importance.

In a way it sounds easy to code. But what do I know, php rookie that I am.  ;D
Title: Re: SMFPets Version 0.2
Post by: feildmaster on May 23, 2007, 09:05:39 am
Hey umm... How would I go about downloading the mod? I can't ever access the download.

Any help would be appreciated. =)
Title: Re: SMFPets Version 0.2
Post by: David on May 23, 2007, 09:16:03 am
 Daniel powers this forum using development versions of SMF so some problems may be due to that...in a way by using this forum we're testing it too...I seem to recall that he might be having some DNS issues too. Be patient and these will all be resolved.
Title: Re: SMFPets Version 0.2
Post by: feildmaster on May 23, 2007, 09:51:38 am
ok! Thx for the fast reply!
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 23, 2007, 10:09:38 am
I get tons of

Code: [Select]
Undefined index: showPets
File: /home/......../public_html/forums/Sources/Profile.php
Line: 328

Looks like it's already reported. Is there meanwhile a solution?
Title: Re: SMFPets Version 0.2
Post by: David on May 23, 2007, 10:17:58 am
I suppose you've done littleone's bug fix for sources/Load.php?

Quote
change:
'pets' => $profile['pets'],

to
'pets' => &$profile['pets'],

 Other than that and the pet breeds bug fix posted earlier we await developments.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 23, 2007, 10:30:09 am
Yes, but didn't help.

Btw, could you solve the problem you posted on site 3?

Code: [Select]
8: Undefined index: profile_show_pets_2
File: /home/****/Themes/default/languages/Shop.english.php (showPets sub template - eval?)
Line: 451

If not, take a look into Shop.english.php. There should be a string
$txt['profile_show_pets2'] = 'Member\'s Pets:';

just correct it to
$txt['profile_show_pets_2'] = 'Member\'s Pets:';

That should work.
Title: Re: SMFPets Version 0.2
Post by: David on May 23, 2007, 10:38:05 am
Thanks...I hadn't fixed it and will now be able so to do (I hope) thanks to you.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 23, 2007, 10:48:21 am
Anytime.  :)


Here a new one. I just wanted to feed my pet and got this

Code: [Select]
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 ' happy = happy + WHERE pet_id = 4 AND ownerid = 1' at line 1
File: /home/......./public_html/forums/Sources/shop/items/Food.php
Line: 83

Perhaps you have a idea what the reason could be.
Title: Re: SMFPets Version 0.2
Post by: David on May 23, 2007, 10:54:38 am
The only thing that springs immediately to mind is that there were some old food item versions around that wouldn't now work with the latest pets mod version...perhaps you'd make sure that you're using the one from the latest version's pack.

BTW...it's 3 in the morning here so even a night-owl like me needs some sleep...off to zzzzzz see you on the morrow.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 23, 2007, 10:57:00 am
Well, 4 in the night here.  ;D Good night. And thanks for your replies.
Title: Re: SMFPets Version 0.2
Post by: David on May 23, 2007, 06:18:26 pm
Always a pleasure.
Title: Re: SMFPets Version 0.2
Post by: Celdric on May 24, 2007, 02:09:55 am
Well, it was the wrong food package. Thanks for the tip.
Title: Re: SMFPets Version 0.2
Post by: Angel on May 26, 2007, 07:21:53 pm
hi, i am trying to install the pets mod on my forum, i am using the latest smf forum and shop versions. I have had no problems installing packages until now.

When i try to install the pets mod i get
"Some of the files the package manager needs to modify are not writable."

I have made all the directories writable and i have no idea how to make this work. Is there a way to install the pets mod manually ? or is there something else i can do. I would be grateful for any help, thankyou :)
Title: Re: SMFPets Version 0.2
Post by: David on May 26, 2007, 09:09:43 pm
While you've made the directories writable the files within them may not be at the right CHMOD setting...try using the in-built system in your forum to fix this.

ACP>Packages>Options

Add your FTP details then in Cleanup Permissions select "All files are writable"

Try installing the mod again and if you wish then after doing so you can use the same system to tighten the CHMOD settings of your files.

 If you still have problems then via FTP check to see that your files are at CHMOD 755 or 777 (depending on server settings).

 The above system should be used before installing any mod so as to get the files into the right CHMOD settings.

 If you still need to do a manual install of the mod please refer to:

http://docs.simplemachines.org/index.php?topic=402 (http://docs.simplemachines.org/index.php?topic=402)

and consider using:

http://server.daniel15.com/smf/package.php (http://server.daniel15.com/smf/package.php)

...to get the details of what you need to do.
Title: Re: SMFPets Version 0.2
Post by: Joshsuxx on May 27, 2007, 01:08:00 am
also remember too: if your members put   '  into their description, -E.G. =  i know what he's doing

It will completly kill the shop mod, you will need to go into PHPMYADMIN and remove the '

So until this is fixed, i don't see much use of having it, because now my shop is dying all the time because of it!

Any fix for this?
Title: Re: SMFPets Version 0.2
Post by: gs123 on May 28, 2007, 03:13:37 am
Anytime.  :)


Here a new one. I just wanted to feed my pet and got this

Code: [Select]
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 ' happy = happy + WHERE pet_id = 4 AND ownerid = 1' at line 1
File: /home/......./public_html/forums/Sources/shop/items/Food.php
Line: 83

Perhaps you have a idea what the reason could be.

I get the same error.  What do you mean by wrong package???? sorry for being a php noob~ In advance, thanks for the reply.  FYI, this is a fresh install of smfshop3 and pet 0.2.
Title: Re: SMFPets Version 0.2
Post by: feildmaster on May 28, 2007, 03:27:48 am
hmm... dunno.

wrong "food.php" is the only thing i can think of... anyway... I just made this and figured i could share it... if you all want...

Code: (Top Pet) [Select]
global $boardurl, $db_prefix, $scripturl;

$result = db_query("
SELECT name, level, age, ownerid, breed
FROM {$db_prefix}shop_pets
ORDER BY level
DESC LIMIT 0,1", __FILE__, __LINE__);

$StrongestPet= mysql_fetch_assoc($result);

$ForumMember = mysql_query("
SELECT realName
FROM {$db_prefix}members
WHERE ID_MEMBER = $StrongestPet[ownerid]");
$MemberName = mysql_fetch_assoc($ForumMember);

echo '
   <table width="100%" height="100%">
     <tr>
        <td align="center">'.$StrongestPet['name'].' the '.$StrongestPet[breed].'
        </td>
     </tr>
        <td align="center">
            <img src="'.$boardurl.'/Sources/shop/pet_images/'.$StrongestPet[breed].'.gif">
        </td>
     </tr>
     <tr>
        <td align="center">
             Level:'.$StrongestPet['level'].'
        </td>
     </tr>
     <tr>
     <tr>
       <td>
         Owner: <a href="'.$scripturl.'?action=profile;u='.$StrongestPet['ownerid'].'">'.$MemberName['realName'].'</a>
       </td>
     </tr>
</table>';

(click on attachment to view a preview.)... It requires people to have their pets images the same name as the breed...
Title: Re: SMFPets Version 0.2
Post by: Joshsuxx on May 28, 2007, 08:07:28 pm
Just thought i would show you guys some of our pets, they are  created by one of our members:

(http://img186.imageshack.us/img186/3439/ourpetsgz4.th.png) (http://img186.imageshack.us/my.php?image=ourpetsgz4.png)

http://img186.imageshack.us/my.php?image=ourpetsgz4.png
Title: Re: SMFPets Version 0.2
Post by: gs123 on May 29, 2007, 12:40:24 am
I think I nailed down where the problem is

         $result = db_query("UPDATE {$db_prefix}shop_pets SET hunger = hunger + {$item_info[1]}, happy = happy + {$item_info[2]} WHERE pet_id = {$_POST['petid']} AND ownerid = {$ID_MEMBER}", __FILE__, __LINE__);

The  {$item_info[1]} and  {$item_info[2]} comes out empty!!!

How do I set the values for those two?
Title: Re: SMFPets Version 0.2
Post by: gs123 on May 29, 2007, 01:55:39 am
I figured it out! You can edit those when you're adding the item!!  I tried to "Edit" the "Food" item and there wasn't an option to change that.
Title: Re: SMFPets Version 0.2
Post by: Matthew Gall on May 29, 2007, 11:27:47 pm
I Installed This On My Website (Inc A Backup) And I Can Access It Smoothly However When Another User Tries To Access The Pets Area Only It Force Log's Them Out And Will Not Let Them Buy Pets. Installation Was Smooth With No Problems However The pets.gif Images Was Not Included In The Installation Package.
Title: Re: SMFPets Version 0.2
Post by: feildmaster on May 30, 2007, 12:51:45 am
the installation only includes "Blank Pet".

You have to change the breed in pets_breeds and make more for each one.. follow the template.

and the only reason i can think of for the permissions is...

the database failed to install correctly...
Title: Re: SMFPets Version 0.2
Post by: Matthew Gall on May 30, 2007, 01:06:51 am
Database Installed Correctly - All Permissions OK
Title: Re: SMFPets Version 0.2
Post by: feildmaster on May 30, 2007, 01:34:47 am
check your mysql... wait.. let me get a better look at .2...

lets see, it doesn't let u buy if you don't have more than the price in your pocket... hmm... but the log out.. that doesn't make any sense... sorry, can't help u. Oo
Title: Re: SMFPets Version 0.2
Post by: gs123 on May 30, 2007, 08:47:12 am
First, I like to say! Thanks for this mod!! It's freeking awesome!! that said, is there a manual doc anywhere?
Title: Re: SMFPets Version 0.2
Post by: gs123 on May 30, 2007, 08:48:18 am
First, I like to say! Thanks for this mod!! It's freeking awesome!! that said, is there a manual doc anywhere?

as of now, I'm kind of learning by trial/error.

As of now, I'm not sure how much you should feed a day.  And what that numbers actually mean like hunger.
Title: Re: SMFPets Version 0.2
Post by: David on May 30, 2007, 09:08:11 am
 This mod is in beta development so a manual would be rather unlikely...I don't mean this unkindly but I'd never put a beta mod on a live forum...use it on a test forum and aid development by all means. Generally software isn't ready for live use until it's up to v1.0 or above so the version number says a lot to you.

 The best way to see what it does is to try things out and learn as you go...as you've been doing.
Title: Re: SMFPets Version 0.2
Post by: feildmaster on May 31, 2007, 02:00:19 am
and hunger does down 1-2 a day, u can feed it as much as you want... there is currently no limit..

umm... w/e else i can prolly find out n tell u... >.>
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on June 06, 2007, 12:35:11 am
Hunger and Happiness drop by a couple each day, with a min of zero. Skills cannot be used if either stat is below five, so you need to keep everything up.

Sorry I havn't had much time to work on this recently. Could someone just make a list of the current bugs people have been having(like the quotes screwing up the whole pet system), and I will try to get on it?
Title: Re: SMFPets Version 0.2
Post by: Joshsuxx on June 06, 2007, 12:21:14 pm
Hunger and Happiness drop by a couple each day, with a min of zero. Skills cannot be used if either stat is below five, so you need to keep everything up.

Sorry I havn't had much time to work on this recently. Could someone just make a list of the current bugs people have been having(like the quotes screwing up the whole pet system), and I will try to get on it?

only thing i can think of at the moment is what you just said, except it doesn't screw up the pet system, it completely kills the shop, until you go into phpmyadmin and remove the quote manually mate.
Title: Re: SMFPets Version 0.2
Post by: Xarcell on June 12, 2007, 04:33:19 am
I have to say that this mod sounds extremely interesting....
Title: Re: SMFPets Version 0.2
Post by: Xarcell on June 13, 2007, 06:23:00 am
I tried this item and so far it's very cool. I hope you continue to develop it.

Have you thought about adding more things, like:

Condition: 1-10  = ("antibotics kit" shop item to fix)
Hygiene: 1-10 ("grooming kit" shop item to fix)

I also have a problem, but maybe I'm not doing it right. I'm trying to use a "cage", but get this message:

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.





Title: Re: SMFPets Version 0.2
Post by: AbsoluteBreeze on June 21, 2007, 06:26:05 pm
This looks like a great addon :)

Any chance of a new download link?

Title: Re: SMFPets Version 0.2
Post by: David on June 21, 2007, 06:30:26 pm
For now I'll post the file below:
Title: Re: SMFPets Version 0.2
Post by: AbsoluteBreeze on June 21, 2007, 06:34:11 pm
Thank you David :)
Title: Re: SMFPets Version 0.2
Post by: David on June 21, 2007, 06:39:27 pm
My pleasure...I've probably got copies of almost all, if not all, of the missing files so if anyone needs them (including Daniel obviously) I'll post them as required.
 
 Server/drive problems are an absolute nightmare so I'm sure we'll all do all we can to help during this period while Daniel gets past his exams and has time to work on his site(s) again.
Title: Re: SMFPets Version 0.2
Post by: Daniel15 on June 23, 2007, 11:56:29 am
The dev.dansoftaustralia.net site will be back soon... I purchased a dedicated server for all my sites (anyone notice that this site is faster now? :D), and will be setting it up again (from scratch, though - You'll need to reupload all your stuff again).

Server/drive problems are an absolute nightmare so I'm sure we'll all do all we can to help during this period while Daniel gets past his exams and has time to work on his site(s) again.
Exams are all over now (until the end-of-year ones) :).
As for the hard drive failure, there's not much I can do. Recovery would probably be too expensive for me. I just need to get over it and move on ;).
Title: Re: SMFPets Version 0.2
Post by: David on June 23, 2007, 05:43:49 pm
 I could probably give some tips about servers...like making sure you use only drives that are rated for server use and that any backup that remains connected physically or electrically to the live system isn't a backup at all (at best it's a mirror but not a backup)...ideally have it go off site too.

 Most important though is to give a congratulation on good grades that I trust is appropriate?

 BTW hard drive failure like that usually costs, on average, upwards of $2,000 to fix via drive recovery companies so your decision to abandon such considerations was inevitable IMHO.

 Onwards and upwards...and the site is faster.
Title: Re: SMFPets Version 0.2
Post by: AbsoluteBreeze on June 26, 2007, 04:16:35 pm
It appears that the pets mod is open to a little security problem (highlighted in the SMF error log).

The desc field is sent to SQL without being cleansed - I guess this means it might be open to SQL injection. I haven't tested the name field.

Apostrophes and possibly smiley codes in description cause SMF security to report hacking attempts.

This morning I woke up to my error log showing......
Quote
Hacking attempt...
UPDATE shop_pets
SET name = 'Plopsy',
level = 1,
curap = 1,
maxap = 1,
happy = 9,
`desc` = 'Fluffy just like it's owner ;0)',
hunger = 8,
age = 1,
training = 1,
trainingend = '07176012305',
ownerid = 4926
WHERE pet_id = 14
File: /home/testuser/public_html/forum/Sources/shop/pet_engine.php
Line: 305
Title: Re: SMFPets Version 0.2
Post by: Celdric on June 27, 2007, 12:49:49 am
Quote
I get the same error.  What do you mean by wrong package? sorry for being a php noob~ In advance, thanks for the reply.  FYI, this is a fresh install of smfshop3 and pet 0.2.

I just notice your reply GS123. There are 2 food packages available. One of them isn't working. At the time when I installed the pet mod it was in the fresh install package. I had to search the pet threads here for the correct one. Sorry, I can't remember where I found it.
Title: Re: SMFPets Version 0.2
Post by: Celdric on June 27, 2007, 12:58:50 am
Quote
This mod is in beta development so a manual would be rather unlikely...I don't mean this unkindly but I'd never put a beta mod on a live forum...use it on a test forum and aid development by all means. Generally software isn't ready for live use until it's up to v1.0 or above so the version number says a lot to you.

David, somehow I have the feeling the ped mod will stay beta for ever. How else could be that so important issues like removing pets or the problem with the ' key in pet names are still continuing? At least I couldn't find any solutions. It's not meant rude and I neither blame anyone. This is a great mod, it just seems that the project is abandoned.
Title: Re: SMFPets Version 0.2
Post by: David on June 27, 2007, 02:28:50 am
 I understand what you mean...the development of it has been a long road for sure and it's not anywhere near the end yet. Basil Beard (BB from now on) has had to learn as he goes along (I know that from reading his postings) he also has other commitments one way or another. I've worked with professional programmers in the past and many of those started off doing projects such as this in order to have something to learn on.

 I suppose the reason why I have a feeling that it will keep moving forward is that when we were all suffering the problems in v0.1 people thought that wouldn't get fixed yet here we are with v0.2 and, by comparison, few and minor problems. I'm not seeking to minimise the issues with v0.2 but v0.1 was way worse.

 BB did give a sort of mini roadmap for future development in a posting a while back and suggested that he was a good way along that path prior to issuing another version...that said he's never said that the project would become an official and approved one...actually he's cast doubt on that happening.

 I'm doing my best not to put words in BB's mouth as it were...just giving a digest, as I see it, of some of what he's said...no doubt he'll put me right if needs be.

 So...you may be right...the project may never get out of beta, but I do think it's rather premature to reach any conclusion on it at this point and am hopeful as to a new version coming out sometime relatively soon with bug fixes as well as new features (in a past posting of mine that was in reply to BBs request for member wish lists I made mine a maintainance release with bug fixes and no new features so from that you can, I hope, tell that I'd rather see bug free relable code slowly grow than leaving bugs in place and adding feature count.)

 I haven't given up on BB or his mod just yet...let's see what he has to say for himself about it should he happan on your posting and this reply.

 Having suffered from a mistake I made in using other beta code on a different forum (a phpBB one) I stand by what I said about not using it on a live/production forum...to do otherwise is to take big risks with the forum integrity. That mistake hurt so I hope I've saved others from something similar by speaking up about it.

 Maybe your posting will spur BB on to prove you wrong...I doubt you or I will mind that one little bit if it happens.
Title: Re: SMFPets Version 0.2
Post by: AbsoluteBreeze on June 27, 2007, 03:01:12 am
Many people could argue that windows XP isn't truly out of BETA :) - that doesn't mean the product is dead.

Pets source is open for people to see/modify and fix.

I want this product and if that means getting my hands dirty then so be it. I'm not saying I am going to fix everything - but  I'll try and help where I can.

Title: Re: SMFPets Version 0.2
Post by: David on June 27, 2007, 03:54:26 am
Quote
XP isn't truly out of ALPHA
...fixed it for you
Title: Re: SMFPets Version 0.2
Post by: AbsoluteBreeze on June 27, 2007, 05:56:34 am
Sorry - your right I meant ALPHA ;D

Whoever coded this (i'm still new here) has got a great product off the ground and I would like to say that I am not criticising - just pointing out some things that could be improved either by the original author or by the community.

I've been looking over this script and it really needs some attention.... probably more than I can offer.

The immediate thing that is problematic is that *all* $_GETS are being pushed straight into SQL query's. That opens the door for SQL injection.

For instance..

Shop-Pets.php - lines 56 - 58
Code: [Select]
elseif (isset($_GET['pet'])) {
$result = db_query("SELECT breed FROM {$db_prefix}shop_pets WHERE pet_id = {$_GET['pet']}", __FILE__, __LINE__);


That code is taking a variable $_GET['pet'] from the URL and squirting it directly into mysql,

The thing I noticed about it is that its a number - so lets convert it to a number(integer) first at the top of the function.

Code: [Select]
$_GET['pet'] = (int) $_GET['pet'];

As for non numbers (pet names etc) then other methods exist to clean them.

stripslashes($_POST['name']) should perhaps be used in place of $_POST['name'] on its own - or even in some cases htmlspecialchars($_POST['name'])

Luckily SMF does have a little protection for this... however it does mean that its easy to trip the script over and to lockup someones petshop.

Im not the most perfect programmer - so please don't take what I am saying as gospel, however I would suggest looking into sanitization methods.
Title: Re: SMFPets Version 0.2
Post by: theintensity on June 27, 2007, 09:35:54 am
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?
Title: Re: SMFPets Version 0.2
Post by: Celdric on June 28, 2007, 01:54:18 am
Thanks for your reply, David.  :)  I agree to the most of your points. Well, let me add something. We are always talking about a "pet" mod. But in my opinion it's an universal mod. You can use it to create numerous characters or items instead of just pets.

For example you could make the rabbit to a Ferrari and the food to gasoline and depending on it's level the car could earn prize monies for you. Or you can create little virtual girl/boyfriends which have the kids to care. Or instead pets you can use the mod to offer houses that members can buy and have to maintain.

Or you could create forums jobs using the mod. Well, short you can use it for numerous purposes.  As for me, I'm using the pet mod on my adult board to offer kind of Penthouse pets, you know what I mean. lol

Anyway, there practically no limits in my opinon. That's what makes the mod so great.  O0
Although I wish the mod would be easier to costumize and that there would be more interesting skills.
Title: Re: SMFPets Version 0.2
Post by: Daethian on June 29, 2007, 01:58:21 am
When I click Basil's link I get 404? Where can I download??
Title: Re: SMFPets Version 0.2
Post by: David on June 29, 2007, 02:06:06 am
Try reading the rest of the topic before you post a query...I uploaded the file you need as an attachment to one of my posts...probably on page 7 of this topic or thereabouts.
Title: Re: SMFPets Version 0.2
Post by: 5cakids on June 30, 2007, 08:58:58 am
Where can I download this mod please exactly what I was looking for
Title: Re: SMFPets Version 0.2
Post by: David 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.
Title: Re: SMFPets Version 0.2
Post by: 5cakids 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
Title: Re: SMFPets Version 0.2
Post by: David 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.
Title: Re: SMFPets Version 0.2
Post by: inkstains 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!";

}
}
}
?>

Title: Re: SMFPets Version 0.2
Post by: Dr.Vista 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:
Title: Re: SMFPets Version 0.2
Post by: feildmaster 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.
Title: Re: SMFPets Version 0.2
Post by: puma on August 14, 2007, 08:10:22 pm
i like SMFPets will better than p3tz.
 ;)
Title: Re: SMFPets Version 0.2
Post by: Basil Beard 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?

Title: Re: SMFPets Version 0.2
Post by: feildmaster 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...)
Title: Re: SMFPets Version 0.2
Post by: Basil Beard 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?
Title: Re: SMFPets Version 0.2
Post by: tick 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 />";
Title: Re: SMFPets Version 0.2
Post by: Basil Beard 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.
Title: Re: SMFPets Version 0.2
Post by: tick on September 04, 2007, 06:21:15 am
So how would I go about fixing this
Title: Re: SMFPets Version 0.2
Post by: Basil Beard 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.
Title: Re: SMFPets Version 0.2
Post by: breezy on September 05, 2007, 03:17:23 am
I have read the topic backwards and forwards, but I still do not see where its stated where the link is actually located in one of the PHP files.  If someone can point me to which file i can find it I believe I can fix it myself or at least make an attempt at it or get someone who can.  Thanks!!! 

Ok.. nevermind on this one.. I found it.  It's in the shop_pets php file.
Title: Re: SMFPets Version 0.2
Post by: breezy on September 05, 2007, 05:57:31 am
hmm... dunno.

wrong "food.php" is the only thing i can think of... anyway... I just made this and figured i could share it... if you all want...

Code: (Top Pet) [Select]
global $boardurl, $db_prefix, $scripturl;

$result = db_query("
SELECT name, level, age, ownerid, breed
FROM {$db_prefix}shop_pets
ORDER BY level
DESC LIMIT 0,1", __FILE__, __LINE__);

$StrongestPet= mysql_fetch_assoc($result);

$ForumMember = mysql_query("
SELECT realName
FROM {$db_prefix}members
WHERE ID_MEMBER = $StrongestPet[ownerid]");
$MemberName = mysql_fetch_assoc($ForumMember);

echo '
   <table width="100%" height="100%">
     <tr>
        <td align="center">'.$StrongestPet['name'].' the '.$StrongestPet[breed].'
        </td>
     </tr>
        <td align="center">
            <img src="'.$boardurl.'/Sources/shop/pet_images/'.$StrongestPet[breed].'.gif">
        </td>
     </tr>
     <tr>
        <td align="center">
             Level:'.$StrongestPet['level'].'
        </td>
     </tr>
     <tr>
     <tr>
       <td>
         Owner: <a href="'.$scripturl.'?action=profile;u='.$StrongestPet['ownerid'].'">'.$MemberName['realName'].'</a>
       </td>
     </tr>
</table>';

(click on attachment to view a preview.)... It requires people to have their pets images the same name as the breed...
Does this code go in a PHP file of it's own or is it in addition to?
Title: Re: SMFPets Version 0.2
Post by: breezy on September 05, 2007, 06:02:32 am
OK.. when creating new pets, do I change  the following code lines to something different?  I would think you would have different ones per pet.  And if so which file corresponds with the pet breed?   We tried this on a site and changed the two lines thinking that it should correspond with the type of pet and it errored out.

Code: [Select]
<?php

if (!class_exists('pet_Bunny')) { //Make sure name matches php file

class pet_Bunny extends petTemplate //Make sure name matches php file

function load_breed()
Title: Re: SMFPets Version 0.2
Post by: breezy on September 05, 2007, 08:25:34 am
I have read the topic backwards and forwards, but I still do not see where its stated where the link is actually located in one of the PHP files.  If someone can point me to which file i can find it I believe I can fix it myself or at least make an attempt at it or get someone who can.  Thanks!!! 

Ok.. nevermind on this one.. I found it.  It's in the shop_pets php file.
 

OK.. I just thought I was done with this.  When I updated the link to reflect my site, it gave a 404 error and says the file showpets can not be found.
Title: Re: SMFPets Version 0.2
Post by: jjyy2006 on September 13, 2007, 12:57:14 am
hello!! i'm new here ,i got an error  when I  feed my pet and got this message:

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 ' happy = happy + 1 WHERE pet_id = 2 AND ownerid = 1' at line 1
File: /home/arsforum/public_html/forum/Sources/shop/items/Food.php
Line: 83

i don't know how to fix it,please help me. Thanks

Title: Re: SMFPets Version 0.2
Post by: jjyy2006 on September 14, 2007, 05:31:09 pm
The only thing that springs immediately to mind is that there were some old food item versions around that wouldn't now work with the latest pets mod version...perhaps you'd make sure that you're using the one from the latest version's pack.

BTW...it's 3 in the morning here so even a night-owl like me needs some sleep...off to zzzzzz see you on the morrow.

i install is newest version 0.2 but still got same error ,where to download the new food.php?
Title: Re: SMFPets Version 0.2
Post by: J-xToF on September 17, 2007, 05:34:46 am
Maybe there should be a thread where people could share their pets, we other users could add those pets in their shop.
Im not too creative in those pet stuff lol.
And the original pictures of the starter pets is sure really plain. =[
ha! ill try to get some nicer pics.. maby some cartoon gifs.

I would also like to ask to an addition.
I would like the pet to be displayed in the post profile. (under avatar etc)
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on September 17, 2007, 07:31:41 am
To clear up a question someone asked me, I have no problems if someone wants to pick up this project and add improvements and what not, as long as common sense is used I am properly credited for what I did and you don't actually sell my code.

Quote
OK.. when creating new pets, do I change  the following code lines to something different?  I would think you would have different ones per pet.  And if so which file corresponds with the pet breed?   We tried this on a site and changed the two lines thinking that it should correspond with the type of pet and it errored out.
Code: [Select]
<?php

if (!class_exists('pet_Bunny')) { //Make sure name matches php file

class pet_Bunny extends petTemplate //Make sure name matches php file

function load_breed()

Saw you wanted a pet called "Bunny". Then you would use

Code: [Select]
<?php

if (!class_exists('pet_Bunny')) { //Make sure name matches php file

class pet_Bunny extends petTemplate //Make sure name matches php file

function load_breed()

and call the pet file Bunny.php

If you wanted a pet "Ninja" you would change the above code to
Code: [Select]
<?php

if (!class_exists('pet_Ninja')) { //Make sure name matches php file

class pet_Ninja extends petTemplate //Make sure name matches php file

function load_breed()

and call in Ninja.php.

Basically, it works the same way as it does for items =)
Title: Re: SMFPets Version 0.2
Post by: inkstains on September 17, 2007, 03:39:08 pm
so are you no longer working on smfpets basil? that's a shame, i was looking forward to battling these little bastards and any other improvements. it's been a cool mod cheers for all your hard work.
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on September 17, 2007, 11:51:25 pm
I am not abandoning the project, I just realize I havn't touched it in a couple of months, realize that I likely won't touch it for a while longer, and wanted to give anyone who wanted to a green light to do more stuff with it. Someone had pmed me to ask if they could upgrade the code, so thats why I was clearing that up here.  O0
Title: Re: SMFPets Version 0.2
Post by: J-xToF on September 18, 2007, 12:26:45 pm
Actually it was me, as people were looking for this mod at smf community and the only 1 available is this one.
I know nothing of php but i might start learning some. 

But you need a lot of creativity creating those pets.  =/

Something i would like to ask about the pet skills, they dont actually do something do they?
Its just a random skill name and description right? (so i yes that means that i can put any random skills that comes up in my imagination)
Title: Re: SMFPets Version 0.2
Post by: inkstains on September 18, 2007, 01:35:12 pm
Actually it was me, as people were looking for this mod at smf community and the only 1 available is this one.
I know nothing of php but i might start learning some. 

But you need a lot of creativity creating those pets.  =/

Something i would like to ask about the pet skills, they dont actually do something do they?
Its just a random skill name and description right? (so i yes that means that i can put any random skills that comes up in my imagination)

the pets skill actually does do stuff. depending on how the pets skills are setup and how much AP the pet has as well as it's current level will effect which skill the pet can use

say a pet had a MAXAP and CURAP of 6 with a current level of 2 enabling them to use the below two skills which have an cost of 2 and 4 AP respectively. to use.the first skill below  would generate a random amount of shop credits for the owner of the pet and you could make up a short description of what the pet did to enact the owner receiving the store credits.

Code: [Select]
 
        function use_skill_1() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(1,125);
$result = db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return "{$this->name} broke into grumpys store dropping loot all the way back to his den which you pick up scoring yourself ".formatMoney($value)."";
}

so the owner of the pet would receive a message like:

"pets name" broke into grumpys store dropping loot all the way back to his den which you pick up scoring yourself  "random shop credit amount"

the pets CURAP is now 4 and the user has received a  "random amount of credits"

now lets say the user enacted the below skill

Code: [Select]
function use_skill_2() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(1,20);
$result = db_query("UPDATE {$db_prefix}members SET karmaGood = karmaGood + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return "you taught {$this->name} a valuable life lesson and recieved ".($value)." karma for your good deed";
        }

they would recieve a message like:

you taught "pets name" a valuable life lesson and received  "random amount of" karma for your good deed

now the pets CURAP would be zero and the user has received a random amount of karma

if the pet is not in training it is time to put the pet in training. with training your pets CURAP is refilled and depending on level gained may increase the pets MAXAP as well.

then the cycle begins over again once training is complete users use the skills available depending on the pets level CURAP and so on and so forth.

so basically you can set up skills that do just about anything you want they could be skills that add to the total time the user has been online or change their custom title you can make the skills not accessible until a certain level or you can make them all accessible at once with each one just requiring more AP than the previous

sorry for the long winded explanation but best to explain it all, mind you this is just as i understand it i've probably missed something or whatever but that's the basic gist of it. to my understanding.

also i'm gonna throw up a pet pack i put together later i just have to package it all up.



EDIT: also change AP over to SP as i think that was changed in SMFPets 0.2
Title: Re: SMFPets Version 0.2
Post by: J-xToF on September 18, 2007, 08:41:19 pm
Quote
so basically you can set up skills that do just about anything you want they could be skills that add to the total time the user has been online or change their custom title you can make the skills not accessible until a certain level or you can make them all accessible at once with each one just requiring more AP than the previous

Hmm now i get it. But as i dont know how to code, all my pets have the same skills  >_<
Same skill effects but different workings lol.


Quote
also i'm gonna throw up a pet pack i put together later i just have to package it all up.
Yay thanks.  =]
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on September 20, 2007, 10:48:19 am
If you want a skill to do something, like with items, feel free to ask here and maybe one of us can code up teh skill for you.  O0
Title: Re: SMFPets Version 0.2
Post by: Alundra on September 28, 2007, 09:42:14 am
when i try to use the skills it says its a hacking attempt....how do i fix that?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on September 28, 2007, 01:23:57 pm
Probably something wrong with the skill. A quote ' in something being put in the database, i'd guess.
Title: Re: SMFPets Version 0.2
Post by: Alundra on September 29, 2007, 05:45:28 am
lol
everything was working yesterday....now today the shop says "An Error Has Occurred! Hacking attempt..."

whats it mean, what could be causing it, and how can i fix it?
Title: Re: SMFPets Version 0.2
Post by: inkstains on September 29, 2007, 07:16:12 am
just to clarify, can you access the shop or does it give that error?

if you get that error when you access the shop then someone may have just added an apostrophe in a pets name or description in which case you'll need to access through phpmyadmin and remove the apostrophe

else if you can access the shop and everything in it but when you use a certain skill it errors you would need to post your pets php file so someone can check it to see what's wrong with it.
Title: Re: SMFPets Version 0.2
Post by: Alundra on September 29, 2007, 09:55:17 am
cant access the shop either

"He's a happy little ducky ;)"
is my pets description, no one else can buy one yet lol

is that whats causing it?

what file do i go into, and why do apostrophe's do so much damage?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on September 30, 2007, 01:18:27 am
probably the semi-colon. Something must be wrong with the code that deals with bad tags. So like, same issue as the ' sign problem. Can anyone who is good with that kind of stuff look at it and propose a fix?  :buck2:
Title: Re: SMFPets Version 0.2
Post by: Alundra on September 30, 2007, 01:44:05 am
yeah for real

and can someone tell me how to fix that?!
cause i cant do it by myself :S
Title: Re: SMFPets Version 0.2
Post by: Alundra on October 02, 2007, 11:19:08 am
everyones complaining to me that the shop doesnt work
can someone PLEASE help me before my head explodes?!

lol
everything was working yesterday....now today the shop says "An Error Has Occurred! Hacking attempt..."

whats it mean, what could be causing it, and how can i fix it?

cant access the shop either

"He's a happy little ducky ;)"
is my pets description, no one else can buy one yet lol

is that whats causing it?

what file do i go into, and why do apostrophe's do so much damage?


yeah for real

and can someone tell me how to fix that?!
cause i cant do it by myself :S

pleeeeeeeeeeeeeeeeeeeeeeeeeeeeease!!
Title: Re: SMFPets Version 0.2
Post by: inkstains on October 03, 2007, 04:17:51 pm
you'll have to access phpMyAdmin through your control panel and edit the database. you'll need to go to the smf_shop_pets table and then edit the apostrophe out of the name or description or wherever it is.
Title: Re: SMFPets Version 0.2
Post by: Alundra on October 04, 2007, 06:09:54 am
i couldnt find a way to edit it...so i just emptied it lol

is their any way to disable the description?!
Title: Re: SMFPets Version 0.2
Post by: Str8up-Nate on October 10, 2007, 03:56:59 pm
maybe its just me or is there a way to like fight the other pets?
if not could someone help me code it?
Title: Re: SMFPets Version 0.2
Post by: sc2 on October 10, 2007, 09:25:58 pm
I would like to have them fight other pets as well. THey will need new database fields like HP, attack power, defense power, etc. I am a noob to PHP but it seems like with some work it could be done. I'll give it a go when I get some time!
Title: Re: SMFPets Version 0.2
Post by: Alundra on October 12, 2007, 09:39:26 am
i think getting the coding right is FAR more important than extensions to the mod
Title: Re: SMFPets Version 0.2
Post by: Celdric on October 15, 2007, 02:12:48 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?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on October 15, 2007, 03:35:49 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.
Title: Re: SMFPets Version 0.2
Post by: inkstains on October 15, 2007, 04:30:10 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.

+1

what a rude f@^&
Title: Re: SMFPets Version 0.2
Post by: Alundra 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
Title: Error with SMFPets Version 0.2
Post by: zsw007 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.
Title: Re: SMFPets Version 0.2
Post by: feildmaster 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.
Title: error with SMFPets Version 0.2...HELP
Post by: zsw007 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 ^
Title: Re: SMFPets Version 0.2
Post by: Geolion1 on November 09, 2007, 12:46:56 pm
How can I add breeds and stuff?
Or change the price?
Title: Re: SMFPets Version 0.2
Post by: Celdric 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.




Title: Re: SMFPets Version 0.2
Post by: Alundra on November 26, 2007, 05:13:58 am
dude SOMEONE PLEASE FIX IT OMG PLEEEEEEEASE!!!!

 :'( :'( :'( :'( :'( :'( :'( :'( :'(
Title: Re: SMFPets Version 0.2
Post by: zsw007 on November 27, 2007, 08:27:34 am
dude SOMEONE PLEASE FIX IT OMG PLEEEEEEEASE!!!!

 :'( :'( :'( :'( :'( :'( :'( :'( :'(
Title: Re: SMFPets Version 0.2
Post by: Ubivis 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 :)
Title: Re: SMFPets Version 0.2
Post by: tugori 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:
Title: Re: SMFPets Version 0.2
Post by: Ubivis 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 :)
Title: Re: SMFPets Version 0.2
Post by: exigent 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.
Title: Re: SMFPets Version 0.2
Post by: JusPlay77 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
Title: Re: SMFPets Version 0.2
Post by: Rezet 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 %)
Title: Re: SMFPets Version 0.2
Post by: JusPlay77 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)
Title: Re: SMFPets Version 0.2
Post by: assasinkilla on March 02, 2008, 02:11:40 pm
Can someone explain fully detailed what is this all about
You buy a pet... And?
Title: Re: SMFPets Version 0.2
Post by: JusPlay77 on March 11, 2008, 12:00:27 am
Powered by SMF 1.1.4
Powered by SMFShop 3.0 (Build 12)
SMFPets Version 0.2

I had problems with it prior, so I uninstalled it, and manually installed it so I know that it was done correctly with no errors from the Package Manager. 

Scenario:  Everything is working as far as the way it should look, the permissions, and the ability to add pets to the Pet Hatchery.. Here are some screenshots:

Pet Central: (http://img72.imageshack.us/img72/1716/petscentralcn1.jpg)
Pet Hatchery: (http://img183.imageshack.us/img183/9329/petshatcheryby3.jpg)
Pets Leaderboard: (http://img183.imageshack.us/img183/2495/petsleaderboardzz0.jpg)

Problem: I do not have any pets, yet when I try to purchase a pet, I get the following error:
(http://img183.imageshack.us/img183/3168/petserroroy4.jpg)

Solution Attempts:  I tried to use a Cage (item from shop), but I get the following:

(http://img510.imageshack.us/img510/7018/petscageerrorvg8.jpg)
And if I click Use Item anyways, I get the following:
(http://img512.imageshack.us/img512/2185/petscageerror2ju9.jpg)
When I go back to my Inventory, the cage is of course gone, and when I go back to the Hatchery, I still cannot purchase a pet.




So I cant purchase pets, and I can't increase my MAX-PETS allowed.. Any solutions?
Title: Re: SMFPets Version 0.2
Post by: JusPlay77 on March 18, 2008, 08:38:13 pm
I am sorry to say that this mod has a long way to go, and I am discontinuing the use of it until a new version is released (if ever as it seems that most of the developers on this forum are inactive)

I had a fresh install on a new forum (only mods added were SMFShop, SMFShop Stats, SMF Pets 0.2).  Everything installed fine and looked great.. I used the original pets that came with it (no custom ones).. and was able to purchase a pet and train it. 

However, the same problems occurred that I faced on my forum:


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 hometown.',
hunger = 8,
age = 1,
training ' at line 7
File: /home/content/x/x/x/xxxxxxxxxxx/html/smf/Sources/shop/pet_engine.php
Line: 305

This is true for both forums. 

--

I hope that someone does try to develop an SMFPets Version 0.3 with the above bugs fixed.
Title: Re: SMFPets Version 0.2
Post by: Swannie on March 23, 2008, 11:23:08 am
ok I install the new mod from a fresh install
and my Pet Hatchery is empty?

I did upload some pets in the directory for it too
why isn't it showing.

And should I see something in the admin to set up the pets
only thing I see in admin is the two items in the shop food and cage.

Thanks for your help
I tried to search for a document on how this mod works but hard to find in all the post
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on March 27, 2008, 11:26:35 am
I was going to rant, but then I realized that it really isn't fair to you guys. None of you are really griping like people did before. You  are just being like "This mod is broken" to which I respond "Lol yeah thats why its in beta and version 0.2  :D".

The current status of things remains as follows: The only thing I get out of doing this is personal satisfaction. Because of that, I will only work on this when I A) feel like working on in and B) have the time. I'm in college right now, so not only rarely have the time to work on projects like this, when I do have the time I feel like doing other stuff.

So feel free to keep on asking questions, answering questions, pointing out bugs, and fixing bugs but it still remains that I am well aware of the state this mod is in and really don't care. If someone wants to take my code and run with it, please go right ahead. I'd love to see a working version as much as anyone =) 
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 27, 2008, 12:44:11 pm
What are you guys talking about? Go to my forum below and you'll see. Works perfectly fine. Thanks for the sweet mod!
(My forum is down below in my sig. Plz sign up! Esp. Basil, if he has the time. If not, its ok. :) )
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 28, 2008, 03:39:15 am
Does anyone know how to show the pets in your sig? Someone wrte the code already, but I cant find his post...
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on March 28, 2008, 04:19:43 am
If I had to wager a guess, Ricardo-san, I would say different versions of PHP. Because yeah, everything pretty much works fine for me as well.  :P
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 28, 2008, 04:33:46 am
...and just as I said it, here comes a problem. i can buy up to three cages, but after that, it displays the same error message as JusPlay77. Queer...
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on March 28, 2008, 06:51:40 am
So I think I recall putting some limiting factor in. That you should be able to edit when you add the cage as an item. That way, you can allow your members to have extra pets, but not too many extra pets.  :P
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 28, 2008, 11:10:24 am
Cool, I'll check it out. I don't recall that option when I made the cage item, i might have to go in the script and manually change it. :P
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 28, 2008, 11:41:42 am
It appears that you set the cage to one-use only:
   
Code: [Select]
function getUseInput()
{
global $db_prefix, $ID_MEMBER, $item_info;

$result = db_query("SELECT maxpets FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
if ($row['maxpets'] >= $item_info[1]) {
return "You already have too many pets to use this item. Using it will just result in item loss.";
}
If I delete the if/else statement I could get unlimited pets. But how about 10 cages...? Change $item_info[1] to $item_info[10]? Would this work?  :idiot2:
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 28, 2008, 11:52:32 am
Darn that doesn't work...I think I have to create two new functions. Dang. More work... :tickedoff:
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 28, 2008, 11:58:08 am
Got it! I'll use if/else statment. If info1, then add info2. Then the quert checks for info10. I'll post the code here when I'm done. ;D
Title: Re: SMFPets Version 0.2
Post by: Ricardo-san on March 28, 2008, 12:31:25 pm
Sorry can't find where to put it...any help?
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on March 28, 2008, 02:10:47 pm
Um no, assuming I coded the item right, which might not be the case. I'm too lazy to check, you should be able to select how many max pets a cage allows when you first add the cage as an item. That is where the "item_info[1]" gets set. Last I checked, SMF shop supports four of these variables per item, sorted in $item_info[1] through $item_info[4]. If for some reason I messed up how the item is added, just change $item_info[1] to 10 if you want to hardcode the change to 10 pets.
Title: Re: SMFPets Version 0.2
Post by: Basil Beard on April 28, 2008, 04:52:33 am
So I decided to sit down and start working on this again -- see if I could fix some bugs and what not.

The problem is, I can't replicate the bugs on my own copy of the mod. I've tried naming/decribing my pet with quotes, semi-colons and other such things that were causing people trouble. And it didn't give me any errors. So yeah, new policy if you want me to ever potentially fix a bug (still no promises I will do so it a timely manner, but the chances will be improved) -- send me a personal message here with all important/relevant information (like what version of PHP and SMF you are running). Posting in the forum is fine, as it allows others to respond as well, but PM's will allow me to figure out what needs to be fixed in a less cluttered manner =)
Title: Re: SMFPets Version 0.2
Post by: libra_86930 on May 30, 2008, 01:38:46 am
hi, is there any instructions on how to manually install this mod? I tried installing it by package but it gave me the message'FTP Information Required ,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.'

and when I input my info it just reloaded but the password space is blank. I couldnt have put in the wrong pass, I tried it a lot of times but still the same
Title: Re: SMFPets Version 0.2
Post by: bgwebmistress on June 15, 2008, 10:54:26 am
hi, is there any instructions on how to manually install this mod? I tried installing it by package but it gave me the message'FTP Information Required ,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.'

and when I input my info it just reloaded but the password space is blank. I couldnt have put in the wrong pass, I tried it a lot of times but still the same

I am getting the same thing myself....
Title: Re: SMFPets Version 0.2
Post by: RileyHarper on June 20, 2008, 10:02:16 am
Hi,

I think I may have a problem with my pet hatchery, the only thing I can edit on it is the pet's name. I was wondering if that is correct, when I installed it showed no errors but I don't know where I'm supposed to add/edit my pets. Please help, thank you.

-Ril
Title: Re: SMFPets Version 0.2
Post by: Aruta on June 24, 2008, 03:46:54 am
hi, is there any instructions on how to manually install this mod?

The zip file includes "install_SMF1-1.xml". All the instructions are in there.

----

I have a problem i cant seem to fix. I checked the thread but i couldnt find this one. After a clean install i keep getting the following errors in the errorlog. The errors apear after viewing the pet hatchery. (index.php?action=shop;do=pets).

8: Trying to get property of non-object
File:
/public/sites/forum.silverrose.nl/Sources/shop/pet_engine.php
Line: 169

8: Undefined offset: 3
File:
/public/sites/forum.silverrose.nl/Sources/shop/pet_engine.php
Line: 169

Im running a fresh install of smf 1.1.5 with shop 3.0 and pets 0.2
I did however restore some old database entries, but i did reset the pet count and maximums in smf_members.
Strange thing is that these errors only seem to pop up when my account visits Pet Central. Other users dont seem to have this problem.

Any help will be very welcome!
Title: Re: SMFPets Version 0.2
Post by: Toups on July 08, 2008, 06:47:39 am
Greetings, great mod for the shop you made here, works great.  The only problem I'm having is on the Pet Leaderboard, when you click on someone's pet there it tries to go to ?action=profile;u=2;sa=showPets but not on the forum's page.  It tries to go to http://sandbox.nomicville.com/index.php?action=profile;u=2;sa=showPets instead of my website.. Any fix for this?
Title: Re: SMFPets Version 0.2
Post by: Aruta on July 08, 2008, 08:54:09 am
Greetings, great mod for the shop you made here, works great.  The only problem I'm having is on the Pet Leaderboard, when you click on someone's pet there it tries to go to ?action=profile;u=2;sa=showPets but not on the forum's page.  It tries to go to http://sandbox.nomicville.com/index.php?action=profile;u=2;sa=showPets instead of my website.. Any fix for this?

Yup. Its in this thread somewhere.
Title: Re: SMFPets Version 0.2
Post by: Toups on July 12, 2008, 01:01:49 am
Just wondering if anyone has written any new pet breeds codes or new pet skills.  I'll be trying to write some over the next few days that I'll share here if they actually work.  Would love to see anyone's new pet skills or complete pets if anyone has made some!
Title: Re: SMFPets Version 0.2
Post by: Nascar on August 17, 2008, 04:51:40 pm
I get this error at the Show Pets function in the profile:

Fatal error: Call to undefined function showPets() in /home/simmarcu/public_html/Sources/Profile.php on line 403


Everything else works fine.
Title: Re: SMFPets Version 0.2
Post by: cheshirex on August 27, 2008, 12:25:10 am
Hi there -

I seem to be having some trouble installing this mod.  The package manager keeps telling me that some of the files are not writable, and for whatever reason - connecting via ftp server through smf has never worked for me (always tells me that the folder I'm trying to access doesn't exist).  I'm a coder by no means, so I'm resisting doing a manual install for fear of seriously messing something up.  Any ideas on what I can do to install this package?
Title: Re: SMFPets Version 0.2
Post by: mich0psp on September 03, 2008, 04:29:57 am
OK... after some cussing and fiddling on my part, the pets are working. I was able to get the breeds I wanted in there and the images I wanted to use...

But when I click on my pet's name from the leader board page, it takes me to http://sandbox.nomicville.com/index.php?action=profile;u=1;sa=showPets and tells me that the page isn't there.

What file (and where) do I need to edit to make it go to my forum?

Here's what it needs to be:
http://forum.pspnpixels.net/index.php?action=profile;u=1;sa=showPets
(and I checked that link and it does work)

EDIT: Fixed now. In case anyone else has this same problem it's in the Shop-Pets.php file. I just did a search for sandbox.nomicville.com and replaced it with forum.pspnpixels.net All is well.  :)
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 03, 2008, 10:46:33 pm
Hi i just installed the pets mod and all went well.
I like to know how do i add the pets to this mod now?.

Thanks :D
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 04, 2008, 04:39:22 am
I found it.. nevermind... but i do have errors

after buying pet food and trying to feed my pet i get this error

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 ' happy = happy + WHERE pet_id = 3 AND ownerid = 5' at line 1
File: /home/website/public_html/Forum/Sources/shop/items/Food.php
Line: 83

any ideas what i can do to fix this please?..
Title: Re: SMFPets Version 0.2
Post by: ozman69 on September 05, 2008, 10:36:53 am
Not sure how much of an answer I'll get since the author of this mod hasn't posted in months, but here goes.

I just installed the shop mod 3.0 and had no problems.  Then I went to install the pets mod 0.2 and got test failed on:

./Themes/default/Profile.template.php
and
./Sources/Profile.php

I don't think the profile.template one will be that big of an issue to resolve using the package parsers info on what needs to be modified, but there is no mention of profile.php at all.  I'm pretty sure the conflicting mod is the ultimate profiler that I installed a few months ago.  While I do enjoy that mod, I was willing to uninstall it to see if it was the problem, but I got multiple errors on the test uninstall, so I'm kind of between a rock and a hard place as to if I can even use this mod. 

If anyone has any information or help, it would be greatly appreciated.

Oz
Title: Re: SMFPets Version 0.2
Post by: Chinaren on September 06, 2008, 05:03:00 pm
I found it.. nevermind... but i do have errors

after buying pet food and trying to feed my pet i get this error

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 ' happy = happy + WHERE pet_id = 3 AND ownerid = 5' at line 1
File: /home/website/public_html/Forum/Sources/shop/items/Food.php
Line: 83

any ideas what i can do to fix this please?..

I'm also getting this error.  Any ideas?  Before my pet starves to death!!  :buck2:
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 07, 2008, 03:09:45 am
Greetings, great mod for the shop you made here, works great.  The only problem I'm having is on the Pet Leaderboard, when you click on someone's pet there it tries to go to ?action=profile;u=2;sa=showPets but not on the forum's page.  It tries to go to http://sandbox.nomicville.com/index.php?action=profile;u=2;sa=showPets instead of my website.. Any fix for this?
For those who are getting redirected to :
http://sandbox.nomicville.com/index.php?action=profile;u=

SOLUTION: go to forum/Sources/shop/Shop-Pets.php


* open up Shop-Pets.php with your editor..
*look for http://sandbox.nomicville.com/index.php?action=profile;u=
(NOTE: this will be listed twice around line: 212 and 220)

* REPLACE BOTH lines with: http://YOURWEBSITE.com/index.php?action=profile;u=

If your website resides inside of a subfolder, then it must be listed as: http://YOURWEBSITE.com/websubfolder/index.php?action=profile;u=

My was listed like this: http://MYWEBSITE.com/ace1564/index.php?action=profile;u=

Ihope this helps most that was seeking the answer...
Title: Re: SMFPets Version 0.2
Post by: Nascar on September 07, 2008, 04:07:28 pm
I get this error at the Show Pets function in the profile:

Fatal error: Call to undefined function showPets() in /home/simmarcu/public_html/Sources/Profile.php on line 403


Everything else works fine.
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 08, 2008, 08:11:16 pm
I found it.. nevermind... but i do have errors

after buying pet food and trying to feed my pet i get this error

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 ' happy = happy + WHERE pet_id = 3 AND ownerid = 5' at line 1
File: /home/website/public_html/Forum/Sources/shop/items/Food.php
Line: 83

any ideas what i can do to fix this please?..

I'm also getting this error.  Any ideas?  Before my pet starves to death!!  :buck2:


For this error follow these instructions.

* Go to your shop administration...
* next click add/edit/delete items
* next from the drop down menu select pet food
* next fill in all information
* where you see : Amount to increase hunger by(high * hunger is actually good =P):
* type in 10
* where you see: Amount to increase happiness by:
* type in 10
* where you see:  Phrase to output upon use: (use xNAMEx for pet name, xHUNGERx for hunger level and xHAPPYx for happiness level)
* type in xNAMEx
* now click add an item

YOURE DONE! :)

hope this helped out all those looking for this answer...
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 09, 2008, 10:08:50 pm
I get this error at the Show Pets function in the profile:

Fatal error: Call to undefined function showPets() in /home/simmarcu/public_html/Sources/Profile.php on line 403


Everything else works fine.


Can you post your profile.php file please..
Title: Re: SMFPets Version 0.2
Post by: Nascar on September 11, 2008, 05:03:03 pm
I installed this mod manually, so maybe I missed a edit that is cousing this error.

Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 12, 2008, 06:07:42 am
I installed this mod manually, so maybe I missed a edit that is cousing this error.




the profile i needed is profile.php not txt
located in /Sources
Title: Re: SMFPets Version 0.2
Post by: Nascar on September 13, 2008, 03:50:50 pm
You can't upload php files to this site.

The file IS Profile.php, but changed to Profile.txt. Just change it back to php your self ;)
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 13, 2008, 09:59:02 pm
ok working on it for ya now...
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 14, 2008, 10:36:22 pm
ok now, Nascar check this file:
source/shop/Shop-Subs.php

is this function there ? all of it ?

Quote
function check_Pets() {
   global $db_prefix, $sourcedir, $modSettings;
   $date = date('z');
   if ($modSettings['shop_pets_date'] != $date) {
      $diff = $date - $modSettings['shop_pets_date'];
      if ($diff < 0) {
         $diff = $diff + 365;
      }
      require($sourcedir . '/shop/pet_engine.php');
      if ($handle = opendir($sourcedir . "/shop/pets_breeds/")) {
         while (false !== ($file = readdir($handle))) {
            if (substr($file, -4) == '.php')
            {
               // Get the breed name (file name without .php extension)
               require($sourcedir . '/shop/pets_breeds/' . $file);
            }
         }
      }
      $result = db_query("SELECT * FROM {$db_prefix}shop_pets", __FILE__, __LINE__);
      while ($row = mysql_fetch_assoc($result)) {
         eval('$temp = new pet_' . $row['breed'] . ';');
         $temp->load_values($row['pet_id']);
         for ($i = 0; $i < $diff; $i++) {
            $temp->advance_day();
         }
         $temp->store_values();
      }
      $result = db_query("UPDATE {$db_prefix}settings SET value = {$date} WHERE variable = 'shop_pets_date'", __FILE__, __LINE__);
   }
   }
   
//Loads the pets up!
function load_pets() {
   global $sourcedir;
   
   require($sourcedir . '/shop/pet_engine.php');
   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');
            require($sourcedir . '/shop/pets_breeds/' . $file);
         }
      }
   }
}
Title: Re: SMFPets Version 0.2
Post by: Nascar on September 15, 2008, 09:55:37 pm
It's there
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 18, 2008, 10:51:15 pm
Nascar
check your profile template to see if this is there

Quote
//BEGIN SMFShop Pets Mod
            function template_showPets()
            {
            global $context, $settings, $options, $scripturl, $modSettings, $txt;

            echo '
               <table border="0" width="85%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
                  <tr class="titlebg">
                     <td colspan="3" height="26">
                        &nbsp;<img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" />&nbsp;', $txt['profile_show_pets_2'], '
                     </td>
                  </tr>';
         
            // Only show pets if they have some!
            if (!empty($context['pets']))
            {
               echo '</table>';
               // For every pet, shows the pet!
               foreach ($context['pets'] as $pet) {
                  echo $pet->view_Pet();         
               }
            }
            // No posts? Just end the table with a informative message.
            else
               echo '
                  <tr class="windowbg2">
                     <td>
                        This member has no pets!
                     </td>
                  </tr>
               </table>';
            }
         //END SMFShop Pets Mod
Title: Re: SMFPets Version 0.2
Post by: dorzaa on September 19, 2008, 05:24:14 am
I can change pet pic when it level up?
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 19, 2008, 10:29:23 am
I can change pet pic when it level up?
01

Are you asking can you change the pics after you have leveled up?

or do you want to change your pets pics ?
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 20, 2008, 01:48:07 am
Nascar
I setup a family site using petmod did same installation but get the same errors as you i cant seem to find answers here so i went to sleepy-arcade (http://sleepy-arcade.ath.cx/dev/portal.php?action=arcade;sa=leaders)

I seem to get alot of my answers there.. thanks to wdm2005 and others....  give it a try..

If i get an answer soon i will post it here for you as well.
Title: Re: SMFPets Version 0.2
Post by: Slots on September 22, 2008, 03:06:25 pm
Hey all.
It think this mod is rather neat, and wouldn't mind it on my forum. The only thing is that when I try to install it, it comes with one error.
Code: [Select]
18.  Execute Modification  ./Sources/Load.php  Test failed
Would this be a conflict with one of my other mods? Or is there something I have to prepare before installing this mod?
Title: Re: SMFPets Version 0.2
Post by: Slots on September 25, 2008, 02:53:04 pm
bump
Title: Re: SMFPets Version 0.2
Post by: Ace1564 on September 25, 2008, 07:26:43 pm
Hey all.
It think this mod is rather neat, and wouldn't mind it on my forum. The only thing is that when I try to install it, it comes with one error.
Code: [Select]
18.  Execute Modification  ./Sources/Load.php  Test failed
Would this be a conflict with one of my other mods? Or is there something I have to prepare before installing this mod?


what mods you installed?
Title: Re: SMFPets Version 0.2
Post by: JKarlaveagen on September 26, 2008, 02:35:44 am
....erm...why not just slip in a manual edit in load.php?
Title: Re: SMFPets Version 0.2
Post by: Slots on September 29, 2008, 09:18:26 pm
....erm...why not just slip in a manual edit in load.php?

Ok, how would I do that?

Hey all.
It think this mod is rather neat, and wouldn't mind it on my forum. The only thing is that when I try to install it, it comes with one error.
Code: [Select]
18.  Execute Modification  ./Sources/Load.php  Test failed
Would this be a conflict with one of my other mods? Or is there something I have to prepare before installing this mod?

Quite a few... That's why I thought there may be a conflict.

what mods you installed?
Title: Re: SMFPets Version 0.2
Post by: dshsshdsagsdsa on November 01, 2008, 08:48:43 am
Load failed for me too....
Title: Re: SMFPets Version 0.2
Post by: zakwan on November 27, 2008, 10:21:45 pm
I got error on installing!

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 failed
18.    Execute Modification    ./Sources/Load.php    Test successful
19.    Execute Modification    ./Themes/default/languages/index.english.php    Test successful
20.    Execute Modification    ./Themes/default/Display.template.php    Test successful

Installed

1.     phpBB3_Login_Fix     1.0     [ Uninstall ]
2.    TinyPortal    1.063    [ Uninstall ]
3.    Advanced AJAX Shoutbox    1.21    [ Uninstall ]
4.    SMFChess    1.1    [ Uninstall ]
5.    Ultimate Profile    0.8.5    [ Uninstall ]
6.    MoodManager Light    3.0    [ Uninstall ]
7.    SMFShop    3.0    [ Uninstall ]
8.    Shop Item: Profile Image    0.1    [ Uninstall ]
9.    Shop Item: Change Display Name CSS    1.0    [ Uninstall ]
Title: Re: SMFPets Version 0.2
Post by: Aruta on November 27, 2008, 10:39:07 pm

mmh. Perhaps its a conflict with "Shop Item: Profile Image" mod.

Not a big problem anyway. Pets will probably still work, but they wont show up in the user profiles.

You can offcourse manually edit your profile.php after you install the pet mod. You have to add:

Code: [Select]
//Begin Shop-Pets Mod
//Show the pets owned by the member
function showPets($memID)
{
global $txt, $user_info, $scripturl, $modSettings, $db_prefix;
global $context, $user_profile, $ID_MEMBER, $sourcedir;

loadLanguage('Shop');

$result = db_query("
SELECT *
FROM {$db_prefix}shop_pets
WHERE ownerid = $memID", __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['pets'][$row['pet_id']] = $temp;
}
}

//Loads the pets up!
function load_pets() {
global $sourcedir;

require($sourcedir . '/shop/pet_engine.php');
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');
require($sourcedir . '/shop/pets_breeds/' . $file);
}
}
}
}

Somewhere before a line that at least looks like this:

Code: [Select]
foreach ($context['posts'] as $counter => $dummy)
$context['posts'][$counter]['can_delete'] &= $context['posts'][$counter]['delete_possible'];
}

Title: Re: SMFPets Version 0.2
Post by: zakwan on November 27, 2008, 11:46:41 pm
Thanks for the fast support..
Solved my problem..
Title: Re: SMFPets Version 0.2
Post by: chris345 on November 29, 2008, 09:05:03 am
anyway to make this work with smf 2.0 beta 4...?
Title: Re: SMFPets Version 0.2
Post by: sakpank on December 23, 2008, 03:49:39 am
anyone have idea to show pet image in poster profile instead viewpet button?

I try to use "SMFShop Inventory Post Modification" as a guide but no luck. this is harder then my php skill. XD
Title: Re: SMFPets Version 0.2
Post by: kuwakchai on December 30, 2008, 02:49:15 pm
thanks for the nice mod!

i got a question. i would like to increase pet's happiness instead of increase karma when using the skill. i try edit the pet template but no luck. hope anyone kind enough to show me how to do it. :)
Title: Re: SMFPets Version 0.2
Post by: perplexed on January 20, 2009, 02:58:45 am
I don't know if anyone has seen this but it's quite a phenomenon

http://dragcave.net

Basically it involves stealing dragon eggs, clicking on them a lot until they hatch - or die if you don't click enough.  And then when they grow up you can breed them and create more eggs.

People go a bit crazy over this lol

Anyway, it would be good if the Pets mod could offer something similar to this hatching/maturing/breeding idea between members' pets.

I can't code anything so I will leave it up to the experts but I think it would be pretty cool if it could be achieved - not just dragons but any kind of pet.


Title: Re: SMFPets Version 0.2
Post by: Imagine on February 26, 2009, 10:54:03 am
Anyone willing to try and convert this to work with SMF 2.0 RC1?

I've tried, but I don't quite understand the new database structure yet.
Title: Re: SMFPets Version 0.2
Post by: marcus on March 03, 2009, 10:53:13 am
Hello, I like so much download the SMFPets, but the site be off line or just I can't enter in the site. I like do you upload in another site.

Thank's
Title: Re: SMFPets Version 0.2
Post by: Lord_Lethris on March 03, 2009, 07:57:15 pm
I too am intregued by this mod, but cannot find it anyware.
Title: Re: SMFPets Version 0.2
Post by: Lord_Lethris on March 13, 2009, 08:41:27 pm
Aaaaaand that killed this thread  >:(
Title: Re: SMFPets Version 0.2
Post by: Imagine on March 14, 2009, 02:13:07 am
I too am intregued by this mod, but cannot find it anyware.

http://dev.dansoftaustralia.net/frs/download.php/12/SMFPets0-2.zip
Title: Re: SMFPets Version 0.2
Post by: senkusha on April 15, 2009, 01:01:54 am
Hi all!

I went back to 1.1.8, and I got the mod installed.  I have just one question:  Where do I configure it?  I don't see any links in the admin section for SMFPets.

Please help!  thanks!


I figured it out.  Apparently, the mod didn't install via the package manager, so I installed it manually.  Great job.

I do have one other question though:  Is this MOD being actively developed?

After reading the 17 pages of this thread, the answer I came to is: no, it's not.

Can somebody do me a favor please?  Create a list of known bugs.  I can probably fix most of them, however, creating a new package, I have yet to master.
Title: Re: SMFPets Version 0.2
Post by: Arwym on April 18, 2009, 11:10:31 am
I've been trying to convert it to SMF2.0 RC1 myself, but there are still bugs I haven't figured out.  If I make it work before somebody else does, I'll let you know.

I cannot promise anything, though.
Title: Re: SMFPets Version 0.2
Post by: frost on April 23, 2009, 10:59:10 am
8: Undefined index: shop_pets_date
File: /hsphere/local/home/gwydionf/thirdworldnetwork.org/Sources/shop/Shop-Subs.php
Line: 131



Code: [Select]
global $db_prefix, $sourcedir, $modSettings;
$date = date('z');
if ($modSettings['shop_pets_date'] != $date) {
$diff = $date - $modSettings['shop_pets_date'];
if ($diff < 0) {
$diff = $diff + 365;
}


I've worked all the other bugs out. This one has me going grey. Any suggestions?
Title: Re: SMFPets Version 0.2
Post by: Arwym on May 12, 2009, 10:22:00 am
Finally made it work on SMF 2.0 RC1.  :D  Still need to try a few things, make sure I'm following coding guidelines, fix typos, make the HTML tables look better, etc.

I'll come back when I have something ready.  ^^  If anyone shows interest.
Title: Re: SMFPets Version 0.2
Post by: bipsmith on November 11, 2009, 10:59:25 am
I AM SOOO INTERESTED IN THIS!
Title: Re: SMFPets Version 0.2
Post by: Chocobohead on January 02, 2010, 11:03:43 pm
The idea mentioned before of being able to breed and spar and age -- as well as being able to SELL indiv pets in the Trade Center -- is really something this mod deserves. It's really a fantastic idea, and there are obviously many, many of us who want to use this for more.

I wish I could put in for it, I am slowly learning PHP just to try, but for now, I wanted to make a short list of a few things that would POSSIBLY be able to be added as items to buy ( I don't know, but maybe? )

1.  The ability to breed one pet to another, and come up with a 'baby'

2. the ability to SELL pets in the Trade Center between members --- this in some ways is the most important, I think, to some of us.

3. the ability to spar/fight and increase the pets value  ( the "happiness level" might be tweaked? )

Take a look at a site like Pony island or Mweor. Thats what I am thinking of .....

If anyone comes up with any possibilities, I'll test drive them and post the results here, and thanks in advance! And basil did say, if anyone else wants to do something with this, please do ... 


Title: Re: SMFPets Version 0.2
Post by: Chocobohead on January 02, 2010, 11:28:22 pm

actually all that would be needed to sell is to be able to have the pets go to inventory ................
Title: Re: SMFPets Version 0.2
Post by: rock91 on March 18, 2010, 10:02:21 am
Why isn't this working for SMF 2.0 RC3?
Title: Re: SMFPets Version 0.2
Post by: Aulus on April 28, 2010, 08:07:57 pm
Why isn't this working for SMF 2.0 RC3?

Ya i need this too )=
Title: Re: SMFPets Version 0.2
Post by: CKWT on May 02, 2010, 08:28:12 am
I've installed this and it works nice.. but I cannot change the image on the Pet.. is this normal?

It only goes to the Blank.

Any help?
Title: Re: SMFPets Version 0.2
Post by: Onizuka on June 05, 2010, 02:01:45 am
excuse me !!

I want to show pet's image on display in post..

Somebody help me T T
Title: Re: SMFPets Version 0.2
Post by: CKWT on June 05, 2010, 03:44:05 am
I've installed this and it works nice.. but I cannot change the image on the Pet.. is this normal?

It only goes to the Blank.

Any help?

I found it, I had to copy the other Pets examples to the real Pets folder
Title: Re: SMFPets Version 0.2
Post by: ismail9 on July 31, 2010, 06:00:37 am
SmfPets for SMF 2 RC3,  when ?
Title: Re: SMFPets Version 0.2
Post by: Katzujari on August 08, 2010, 04:18:26 pm
Instale el SMF Shop e intenté instalar este mod tambien, pero tras pedirme el acceso al FTP me tira un error yluego de es ya no me deja intalarlo (ni tratar de instalar)
Title: Re: SMFPets Version 0.2
Post by: The Wizard on July 25, 2012, 01:55:51 am
Hello:

I think this pet mod would be cool and my users would just love it to death.

I have a SMF 2.0.2 test board and have been trying to make the pet mod work on it.

I have rewritten the package info file for Pet 2.0 to make it work with the package manager. I dropped all the 1.x stuff so do try this on a 1.x board.

I reworked as much of the install_smf1-1.xml file as I can. Attached is my zip file on what I have done so far.

I still have not figured out how to recode the profile.template.php file so if you know how please post the changes.

When I do run what the changes I have made I get the following error -

Quote
Fatal error: Call to undefined function db_query() in /home/content/05/9199905/html/Paradise/Packages/temp/installScript.php on line 16

I would really love to see this in action. So please help!

Thanks

Wiz