Author Topic: SMFPets is Finally Here (0.1 out)  (Read 106035 times)

Offline inkstains

Re: SMFPets is Finally Here (0.1 out)
« Reply #90 on: March 17, 2007, 11:07:34 am »
Everytime I try to upload a file into the breed directory, I get a an error telling me that the fiel could not be uploaded...

Quote
move /home/ghostte/tmp/cpanel.TMP.7BUrZsxEcWppvgLU, /home/ghostte/public_html/Sources/shop/pet_images/blank1.gif failed: Permission denied
C:\Documents and Settings/owner/\My Documents\blank1.gif (blank1.gif): upload failed
.

Thats the error message...I tried to upload something just inside the shop and it worked, the same with uploaded the same gif into the root and it went through...

Also when I try to create a new file for a new pet I get this error
Quote
[a fatal error or timeout occurred while processing this directive]

I know I have all the access permissions since I am the only one allowed into the cpanel, so I am not sure what could be causing this problem..

Also what I meant about the skills, was the skills that everyone is placing up, where would they be placed..Sorry if I sound stupid about the subject, but my PHP skills are like -10..I am learning though..... :'(

Once again, I am sorry for being such a pain!!

don't quote me because i am still learing myself

your first problem could be the permissions on the actual pet_images folder in your file manager on cpanel you can click the folder name then go edit permissions and change it from there (but i'd wait till one of the other guys responds on that one)

as for skills they go into pet_breeds folder i'm fair sure the package comes with a blank that you can edit and it's fairly self explanatory though the addition of extra skills is probably something you need a little bit more knowledge about php etc but i imagine people with more experience will post more as they develop them, Basil Beard already posted one up earlier in this thread.


Offline inkstains

Re: SMFPets is Finally Here (0.1 out)
« Reply #91 on: March 17, 2007, 12:13:43 pm »
EDIT: TechnoDragon has kindly added to this to make it show/not show depending on pet ownership i'd recommend you use that instead just scroll down for the post


Not sure if anyone else will want to do this but thought i'd throw it up

to add a link to a members profile pets section as shown in the image below




locate Display.template.php

search for

Code: [Select]
// Don't show the profile button if you're not allowed to view the profile.
if ($message['member']['can_view_profile'])
echo '
<a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';


and directly below add this

Code: [Select]
if ($message['member']['can_view_profile'])
echo '
<a href="', $message['member']['href'], ';sa=showPets">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/pets.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';



i've attached the image i used for the icon but you can replace it with whatever you want just upload it to the default themse images/icons folder and change the name in the code to correspond to your image name

hope this is of help i know it could have saved me a little time





« Last Edit: March 17, 2007, 01:52:03 pm by inkstains »

Offline TechnoDragon

Re: SMFPets is Finally Here (0.1 out)
« Reply #92 on: March 17, 2007, 12:17:11 pm »
thats actually a very good idea...now if I can only figure out a way to only have it show if they actually have pets...
Don't tell me to get into shape...I have a shape...It is round!


Offline inkstains

Re: SMFPets is Finally Here (0.1 out)
« Reply #93 on: March 17, 2007, 12:26:24 pm »
I don't see why you couldn't do that you'd just need to add a check_pets query or something I'm still novice so I'll have a look but i'm not sure how it would work but yeh i'll have a go unless someone else can offer the answer.

Offline TechnoDragon

Re: SMFPets is Finally Here (0.1 out)
« Reply #94 on: March 17, 2007, 12:27:21 pm »
working on the code right now...give me about 10 minutes! ok, maybe 30 LOL
Don't tell me to get into shape...I have a shape...It is round!


Offline TechnoDragon

Re: SMFPets is Finally Here (0.1 out)
« Reply #95 on: March 17, 2007, 01:15:25 pm »
OK, here's the skinny:

in Load.php find:
Code: [Select]
$row['options'] = array();
$user_profile[$row['ID_MEMBER']] = $row;
}
mysql_free_result($request);
add below that:
Code: [Select]
//Load the pet data
$request2 = db_query("
SELECT COUNT(*) AS pets, ownerid
FROM {$db_prefix}shop_pets
WHERE ownerid IN ('" . implode("', '", $loaded_ids) . "')
GROUP BY ownerid", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request2))
$user_profile[$row['ownerid']]['pets'] = $row['pets'];
mysql_free_result($request2);

then find:
Code: [Select]
'post_group' => $profile['post_group'],
add below:
Code: [Select]
//another pets modification
'pets' => &$profile['pets'],

then in the display template.php find the code you suggested and add this below instead:
Code: [Select]
//finally a pets button
if ($message['member']['can_view_profile']){
if($message['member']['pets'] > 0){
echo '
<a href="', $message['member']['href'], ';sa=showPets">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/pets.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';
}
}

this will only show the link to the members pets in profile on two conditions:
     1. person can view profiles
     2. member actually has a pet

there you go...ENJOY!
« Last Edit: March 17, 2007, 01:17:20 pm by TechnoDragon »
Don't tell me to get into shape...I have a shape...It is round!


Offline inkstains

Re: SMFPets is Finally Here (0.1 out)
« Reply #96 on: March 17, 2007, 01:39:37 pm »
beauty nice stuff TechnoDragon that's a lot cleaner


heres a skill i just finished it's fairly basic but might save someone else the hassle of doing it

it's a modification on the skill Basil Beard posted earlier and the increase karma item

Code: [Select]
<?php
if (!class_exists(pet_Test_pet)) { //Make sure name matches php file
class pet_Test_pet extends petTemplate //Make sure name matches php file
function load_breed() {
$this->breed 'Test - Eastern Cottontail'//The name of the breed(Use _ instead of whitespace or else Baby Jesus will cry)
$this->breed_desc 'Enter Description'//The description of the breed.
    
$this->price 10//The price to purchase one of these pets
    
$this->breed_img 'image.gif'//The img file of the breed
    
$this->skills_cnt 1//The number of skills the pet can use

    //Sample skill. For each addtional skill, increase the index by one.(So your next skill would be $this->skill[1])
$this->skill[0] = new skill;       //Required for making new skills. 
$this->skill[0]->name "Skill Name";   //Name of skill
$this->skill[0]->level_learn 1;  //Level the pet learns the skill
$this->skill[0]->level_max 2;    //Level the pet masters the skill
$this->skill[0]->cost 1;         //Cost, in skill points, of the skill.
}

//This will increase the members good karma by a random value between 1 and 10
        
function use_skill_0() {
global $db_prefix$ID_MEMBER;
$value mt_rand(1,10);
$result db_query("UPDATE {$db_prefix}members SET karmaGood = karmaGood + {$value} WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__);
return "{$this->name} successfully increased your Karma by ".($value)." for you";
        }

}
}
?>
« Last Edit: March 17, 2007, 01:43:08 pm by inkstains »

Offline inkstains

Re: SMFPets is Finally Here (0.1 out)
« Reply #97 on: March 17, 2007, 02:08:18 pm »
one more skill to increase total time logged in

Code: [Select]
<?php
if (!class_exists(pet_Test2_pet)) { //Make sure name matches php file
class pet_Test2_pet extends petTemplate //Make sure name matches php file
function load_breed() {
$this->breed 'Test2 - Eastern Cottontail'//The name of the breed(Use _ instead of whitespace or else Baby Jesus will cry)
$this->breed_desc 'Enter Description'//The description of the breed.
    
$this->price 10//The price to purchase one of these pets
    
$this->breed_img 'image.gif'//The img file of the breed
    
$this->skills_cnt 1//The number of skills the pet can use

    //Sample skill. For each addtional skill, increase the index by one.(So your next skill would be $this->skill[1])
$this->skill[0] = new skill;       //Required for making new skills. 
$this->skill[0]->name "Skill Name";   //Name of skill
$this->skill[0]->level_learn 1;  //Level the pet learns the skill
$this->skill[0]->level_max 2;    //Level the pet masters the skill
$this->skill[0]->cost 1;         //Cost, in skill points, of the skill.
}

//just edit the random number values to change the amount of time to increase by
        
function use_skill_0() {
global $db_prefix$ID_MEMBER;
$value mt_rand(13200,43200);
$result db_query("UPDATE {$db_prefix}members SET totalTimeLoggedIn = totalTimeLoggedIn + {$value} WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__);
return "{$this->name} successfully increased your Total Time Logged In by ".($value)." seconds for you";
}

}
}
?>

it'd be good to be able to present the increased amount in days hours minutes seconds instead of just a string of seconds anyone know how to do that? i'm still a php baby
« Last Edit: March 17, 2007, 02:18:01 pm by inkstains »

Offline inkstains

Re: SMFPets is Finally Here (0.1 out)
« Reply #98 on: March 17, 2007, 02:29:22 pm »
Sorry to post so many just figure if it saves someone time, though there not exactly complicated to do.

anyways heres the last one i'll post it'll increase the members post count at a value between 1 and 50 or whatever you chose to set it to

Code: [Select]
<?php
if (!class_exists(pet_Test3_pet)) { //Make sure name matches php file
class pet_Test3_pet extends petTemplate //Make sure name matches php file
function load_breed() {
$this->breed 'Test3 - Eastern Cottontail'//The name of the breed(Use _ instead of whitespace or else Baby Jesus will cry)
$this->breed_desc 'Enter Description'//The description of the breed.
    
$this->price 10//The price to purchase one of these pets
    
$this->breed_img 'image.gif'//The img file of the breed
    
$this->skills_cnt 1//The number of skills the pet can use

    //Sample skill. For each addtional skill, increase the index by one.(So your next skill would be $this->skill[1])
$this->skill[0] = new skill;       //Required for making new skills. 
$this->skill[0]->name "Skill Name";   //Name of skill
$this->skill[0]->level_learn 1;  //Level the pet learns the skill
$this->skill[0]->level_max 2;    //Level the pet masters the skill
$this->skill[0]->cost 1;         //Cost, in skill points, of the skill.
}

//just change the random values to alter the amount of posts the member can get
        
function use_skill_0() {
global $db_prefix$ID_MEMBER;
$value mt_rand(1,50);
$result db_query("UPDATE {$db_prefix}members SET posts = posts + {$value} WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__);
return "{$this->name} successfully increased your Post Count by ".($value)." for you";
}

}
}
?>

Offline Basil Beard

Re: SMFPets is Finally Here (0.1 out)
« Reply #99 on: March 18, 2007, 01:03:01 am »
Actually Technodragon, it would probably be even cleaner to just load the numpets (I think thats what I called it) from the members database. But thats still some very nice code there. I'll probably include it in v 0.2 =)
Arrrrr!

Offline TechnoDragon

Re: SMFPets is Finally Here (0.1 out)
« Reply #100 on: March 18, 2007, 01:23:30 am »
ROFL

I didn't realize about the numpets, I could change that around if you like?  Thank you...I am always trying to figure out small ways to improve everything i use or help others do the same!

as an update...The combat portion has not been forgotten, we are just trying to finalize the current beta version of my mod before we proceed on any new features(we found that we are getting into an infinite loop where we finish, figure out something new, then keep coding.  We HAD to pick a point to stop otherwise we would never release it! ROFL)
Don't tell me to get into shape...I have a shape...It is round!


Offline Lady Ambrosia

Re: SMFPets is Finally Here (0.1 out)
« Reply #101 on: March 18, 2007, 01:54:33 am »
I'm just being patient about the combat part of the mod, as I'm only using the mod on my test forum, I want to create pets and skills before allowing my members to play around (aren't I mean?).  Plus get myself more familiar with the mod (I always like doing that just incase something goes crazy on my part, and it usually does).

I do have a small suggestion, although it's not needed right at this minute ;)  What about making categories for the pets, for example:
Quote
Dragons
Then have different types and colors of dragons listed under this category

Cats
Then have different types of cats (from house cat to wild cats) and colors under this category

Just an idea for later versions of the Pet Shop.  OH and I found more animal icons that people can use for their little pets:
http://www.iconarchive.com/  (don't freak they have gif files you can use too)
http://www.clipart.co.uk/index.shtml

Maybe those will help some one who needs images for pets :D
Ambrosia's Castle - My Personal Site
The Dark Castle - My Forum
Avatar by:  Me

Offline GhostWriter

Re: SMFPets is Finally Here (0.1 out)
« Reply #102 on: March 18, 2007, 05:35:19 am »


don't quote me because i am still learing myself

your first problem could be the permissions on the actual pet_images folder in your file manager on cpanel you can click the folder name then go edit permissions and change it from there (but i'd wait till one of the other guys responds on that one)

as for skills they go into pet_breeds folder i'm fair sure the package comes with a blank that you can edit and it's fairly self explanatory though the addition of extra skills is probably something you need a little bit more knowledge about php etc but i imagine people with more experience will post more as they develop them, Basil Beard already posted one up earlier in this thread.



I tried what you said inkstains and still the same thing happens and all the permissions are set at the highest level they can be...I don't know what else it could be...Gues I should just ask, Basil Beard, since it's your project do you know what could be causing the errors I am getting when I try and upload an image into the pet_image directory and when I try to create a new file?

Offline majestic

Re: SMFPets is Finally Here (0.1 out)
« Reply #103 on: March 18, 2007, 02:52:27 pm »
I've looked through this thread..but I haven't found the answer, so maybe I'm blind. How do you get rid of your pet? What if you don't want it anymore? Is there a place to delete? or to go to the exact file of that person's pet and delete it?...thanks

Offline TechnoDragon

Re: SMFPets is Finally Here (0.1 out)
« Reply #104 on: March 18, 2007, 03:35:21 pm »
Currently the only way to remove a members pet in directly through the database...
Don't tell me to get into shape...I have a shape...It is round!