Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - discoponies

Pages: [1]
1
Modifications / Re: SMFPets Version 0.2
« 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!

2
Modifications / Re: SMFPets Version 0.2
« 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

3
Modifications / Re: SMFPets Version 0.2
« 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

4
General SMFShop Discussion / Re: SMFPets is Finally Here (0.1 out)
« on: April 27, 2007, 07:29:58 am »
Well just so everyone knows. I installed the system again. It was because somebody used a ' in their pet description... well I think it was. Because once removed it was fine.

Oh well, very good mod, I have customised to make it about Chao (I run a Sonic fan site), so overall, I like ^^

5
General SMFShop Discussion / Re: SMFPets is Finally Here (0.1 out)
« on: April 26, 2007, 09:37:49 pm »
So If I reinstall it afresh and make sure it is clear that you shouldt use quotations etc... then it will be fine?

6
General SMFShop Discussion / Re: SMFPets is Finally Here (0.1 out)
« on: April 26, 2007, 08:24:15 am »
I put my pet into training... and since the time it has come out of training I have been given this message when trying to access any part o the shop...

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 'm waiting till i can by a Hero Chao to balance him out...',hunger =' at line 7File: /home/fhlinux172/n/nomoreblue.greenhillnetwork.co.uk/user/htdocs/Sources/shop/pet_engine.phpLine: 298

Any ideas what to fix? Cos Im confused because I have NO idea why it would have issue with the line....

            WHERE pet_id = {$this->id}", __FILE__, __LINE__);

I tried bother versions of the pet engine file (0.0 and 0.1) and it still points out that speficic line with that speciifc code in the file.

Pages: [1]