Author Topic: SMFPets Version 0.2  (Read 158200 times)

Honcho

  • Guest
Re: SMFPets Version 0.2
« Reply #15 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


Offline discoponies

Re: SMFPets Version 0.2
« Reply #16 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

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #17 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  :)
Arrrrr!

Offline discoponies

Re: SMFPets Version 0.2
« Reply #18 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
« Last Edit: May 01, 2007, 10:04:47 pm by discoponies »

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #19 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
Arrrrr!

Offline NFM

Re: SMFPets Version 0.2
« Reply #20 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.

Offline discoponies

Re: SMFPets Version 0.2
« Reply #21 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!

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #22 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
Arrrrr!

Offline NFM

Re: SMFPets Version 0.2
« Reply #23 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:

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #24 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  :)
Arrrrr!

Offline NFM

Re: SMFPets Version 0.2
« Reply #25 on: May 04, 2007, 11:53:05 pm »
Why thank you!

Offline Aes-Sedai

Re: SMFPets Version 0.2
« Reply #26 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?

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #27 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:
Arrrrr!

Offline Aes-Sedai

Re: SMFPets Version 0.2
« Reply #28 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?

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #29 on: May 05, 2007, 10:57:35 pm »
What level is your pet? You sure it isn't like, 2 PM tomorrow?
Arrrrr!