Author Topic: SMFPets Version 0.2  (Read 161703 times)

Offline Chinaren

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

Offline Ace1564

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

Offline Nascar

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

Offline Ace1564

Re: SMFPets Version 0.2
« Reply #213 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...
« Last Edit: September 10, 2008, 08:34:43 am by Ace1564 »

Offline Ace1564

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

Offline Nascar

Re: SMFPets Version 0.2
« Reply #215 on: September 11, 2008, 05:03:03 pm »
I installed this mod manually, so maybe I missed a edit that is cousing this error.


Offline Ace1564

Re: SMFPets Version 0.2
« Reply #216 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
« Last Edit: September 12, 2008, 07:48:24 am by Ace1564 »

Offline Nascar

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

Offline Ace1564

Re: SMFPets Version 0.2
« Reply #218 on: September 13, 2008, 09:59:02 pm »
ok working on it for ya now...

Offline Ace1564

Re: SMFPets Version 0.2
« Reply #219 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);
         }
      }
   }
}
« Last Edit: September 15, 2008, 08:01:38 pm by Ace1564 »

Offline Nascar

Re: SMFPets Version 0.2
« Reply #220 on: September 15, 2008, 09:55:37 pm »
It's there

Offline Ace1564

Re: SMFPets Version 0.2
« Reply #221 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
« Last Edit: September 19, 2008, 06:07:04 am by Ace1564 »

Offline dorzaa

Re: SMFPets Version 0.2
« Reply #222 on: September 19, 2008, 05:24:14 am »
I can change pet pic when it level up?

Offline Ace1564

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

Offline Ace1564

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

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.
« Last Edit: September 21, 2008, 12:55:34 am by Ace1564 »