Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.1.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2011, 07:51 AM
Sasoragon's Avatar
Sasoragon Sasoragon is offline
Beginniner Coder :D
 
Join Date: Jan 2011
Location: In the Myadopts Support Forums
Posts: 29
Gender: Female
Credits: 7,137
Sasoragon is on a distinguished road
Default User Points & Ranks/Levels

User points and Ranks~

This mod will give users another form of "points" to collect. The more points you have, the higher your User Rank will be. Points can be collected by leveling your own or other people's adoptables.

First, enter the MySQL Database. Under "_users", add another column at the bottom that looks like this:

Code:
Field:         Type:        Null:
points         int(20)      Yes
Now. Go to register.php

Find the code that looks somewhat like this: (Mine will probably be a little different than yours)

PHP Code:
//All checks are done, actually create the user's account on the database

    
$date date('Y-m-d');

    
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','500','100','','','','','Unknown')");

    
//Now that we have created the user, let's log them in...

    
$status dologin($username$pass1); 
Well, at the end of the INSERT INTO mysql_query, add another ,'50' at the end of it. (On mine it would be behind the 'Unknown'.)

Once you've changed that, go to levelup.php.

Now find where it says:

PHP Code:
                  // Start Rewards
                  
                  // ************************************************  
                  
                  
                  //Get currency on level up
                  
                  
$query "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
                  
$result mysql_query($query);
                  
$num mysql_numrows($result);
                  
                  
$i 0;
                  while (
$i 1) {
                      
$dollar = @mysql_result($result$i"dollar");
                                            
// Change this number 10 to the number of currency you want users to earn on level up  
                      
$amount rand(5,15);
                      
$newbalance $dollar $amount;
                      
                      
$i++;
                  }
                  
                  
mysql_query("UPDATE `adopts_users` SET `dollar`='" $newbalance "' WHERE `username`='$loggedinname'");
                  
                  
                  
$article_content $article_content "<div align='center'><br />You have earned "$amount ." Dollars for leveling up this Adoptable. <br />You now have  " $newbalance " Dollars.</div>";
        

    } 
Replace all of that with this:

PHP Code:
                  // Start Rewards
                  
                  // ************************************************  
                  
                  
                  //Get currency on level up
                  
                  
$query "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
                  
$result mysql_query($query);
                  
$num mysql_numrows($result);
                  
                  
$i 0;
                  while (
$i 1) {
                      
$dollar = @mysql_result($result$i"dollar");
                      
$points = @mysql_result($result$i"points");
                                            
// Change this number 10 to the number of currency you want users to earn on level up  
                      
$amount rand(515);
                      
$pointamount rand(515);
                      
$newbalance $dollar $amount;
                      
$newpointbalance $points $pointamount;
                      
                      
$i++;
                  }
                  
                  
mysql_query("UPDATE `adopts_users` SET `dollar`='" $newbalance "' WHERE `username`='$loggedinname'");
                  
mysql_query("UPDATE `adopts_users` SET `points`='" $newpointbalance "' WHERE `username`='$loggedinname'");
                  
                  
                  
$article_content $article_content "<div align='center'><br />You have earned "$amount ." Dollars and ".$pointamount." Points for leveling up this Adoptable. <br />You now have  " $newbalance " Dollars and ".$newpointbalance." Points.</div>";
    

    

    } 
That way, people will earn points as well when leveling up an adoptable.

(You can also make it so that users earn points by logging in, posting in the shoutbox, viewing pages, when sending PM's, etc. Maybe later I'll add to this profile saying how to add those stuff as well. )

After that, open up profile.php.

Find where is says this:

PHP Code:
    $i=0;
    while (
$i 1) {

    
$usersname=@mysql_result($result,$i,"username");
    
$usersgroup=@mysql_result($result,$i,"usergroup");
    
$website=@mysql_result($result,$i,"website");
    
$aim=@mysql_result($result,$i,"aim");
    
$yahoo=@mysql_result($result,$i,"yahoo");
    
$msn=@mysql_result($result,$i,"msn");
    
$membersince=@mysql_result($result,$i,"membersince"); 
Add this to the bottom of it:

PHP Code:
        $points=@mysql_result($result,$i,"points"); 
Now scroll down and find where it says this:

PHP Code:
    $article_title $userdisp."'s Profile:";
    
$article_content "<b><u>".$lang_basic_info."".$usersname.":</u></b><br><br>
    <img src='templates/icons/web.gif'> "
.$website."<br>
    <img src='templates/icons/aim.gif'> "
.$aim."<br>
    <img src='templates/icons/msn.gif'> "
.$msn."<br>
    <img src='templates/icons/yahoo.gif'> "
.$yahoo."<br>
    <img src='templates/icons/title.gif'> <a href='messages.php?act=newpm&user="
.$usersname."'>Send ".$usersname." a Private Message</a><br>
    <br><b><u>"
.$usersname."'s Stats:</b></u><br><br>
    <b>Member Since:</b> "
.$membersince."<br>
    <b>Number Of Pets Owned:</b> "
.$numpets."<br>
    <b><u>"
.$usersname."'s Pets:</u></b><br><br>"
Directly above that, paste this:

PHP Code:

        
// Begin defining the user's Rank..

        
$rankval 0;
        
$rank = -1;

        while (
$rankval $points) {

        
$rankval $rankval 50;
       
// Change the + 50 to however many points you want the user to have before going up a rank.

        
$rank++;

        } 
Now go underneath .$usersname.'s Stats (it's still under profile.php) and paste this in:

PHP Code:
        <b>Amount of Points:</b".$points."<br>
        <
b>".$usersname."'s Rank:</b> ".$rank."<br><br> 

Aaand... That's about it! This was my first Mod, so sorry about it not being a big one. Hopefully once I get better at PHP, my Mods will also get bigger and better.
__________________
These smilies... are epic sauce.
Favorite smiley:
= :OHSH*TALION:

Now working on:
Daycare Mod. 40% Complete.

Grand Opening: :D
Reply With Quote
  #2  
Old 02-23-2011, 08:33 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 37,863
fadillzzz is an unknown quantity at this point
Default

I don't know why I haven't thought of this yet.
This is awesome!
Reply With Quote
  #3  
Old 02-23-2011, 10:23 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 492,185
Hall of Famer is on a distinguished road
Default

This looks really nice Sasoragon, glad to see you are making quality PHP scripts now. ^^ Keep this up and you may receive Premium Membership soon.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 02-23-2011, 05:47 PM
Sasoragon's Avatar
Sasoragon Sasoragon is offline
Beginniner Coder :D
 
Join Date: Jan 2011
Location: In the Myadopts Support Forums
Posts: 29
Gender: Female
Credits: 7,137
Sasoragon is on a distinguished road
Default

D'aww, thanks Fadill, Hoffie.

This idea randomly popped into my head when I was (supposed to be) studying yesterday. I thought it would make a cool feature, so I decided to test out coding it.
__________________
These smilies... are epic sauce.
Favorite smiley:
= :OHSH*TALION:

Now working on:
Daycare Mod. 40% Complete.

Grand Opening: :D
Reply With Quote
  #5  
Old 02-23-2011, 09:35 PM
PTGigi's Avatar
PTGigi PTGigi is offline
Crazily Friendly~HoF
 
Join Date: Jul 2009
Location: Somewhere >.>
Posts: 370
Gender: Female
Credits: 31,228
PTGigi
Default

Oh hey MM2+ has something like this already Lol same field name too X3
__________________


"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo
My Adoptables|Nuzlocke Webcomic
Reply With Quote
  #6  
Old 02-24-2011, 06:43 AM
The Codfin Keeper's Avatar
The Codfin Keeper The Codfin Keeper is offline
A Codfin draws near!
 
Join Date: Jan 2011
Location: Either CT or the Slug's house
Posts: 91
Gender: Male
Credits: 13,547
The Codfin Keeper is on a distinguished road
Default

Quote:
Originally Posted by Sasoragon View Post
D'aww, thanks Fadill, Hoffie.

This idea randomly popped into my head when I was (supposed to be) studying yesterday. I thought it would make a cool feature, so I decided to test out coding it.

EDIT: Gah, my post was posted twice. Since I can't find the delete button, could a mod please delete this post? :P
Just hit Edit, then Delete. :3

Nice mod, I'll use it, if I can find a possible use for it on my site. xD

/shot
__________________

Yacker
Quote:
Originally Posted by Mankey Pokemon Card when another one is on top of it
([33) Ka\______
Does 40 damage\___
counter on Mankey. \______
Reply With Quote
  #7  
Old 02-24-2011, 07:53 PM
Sensacionsk8 Sensacionsk8 is offline
Member
 
Join Date: Feb 2011
Posts: 18
Gender: Male
Credits: 3,153
Sensacionsk8 is on a distinguished road
Default

how to have the point obtained is for the owner of adoptable
Reply With Quote
  #8  
Old 02-27-2011, 07:54 PM
Sasoragon's Avatar
Sasoragon Sasoragon is offline
Beginniner Coder :D
 
Join Date: Jan 2011
Location: In the Myadopts Support Forums
Posts: 29
Gender: Female
Credits: 7,137
Sasoragon is on a distinguished road
Default

Gigi - GREAT MINDS THINK ALIKE?

And yus, thanks TCK. I managed to delete it.

Sensa - I don't quite understand what you mean. The points are obtained by clicking adoptables. :3
__________________
These smilies... are epic sauce.
Favorite smiley:
= :OHSH*TALION:

Now working on:
Daycare Mod. 40% Complete.

Grand Opening: :D
Reply With Quote
  #9  
Old 02-27-2011, 08:02 PM
DragonTamerChris's Avatar
DragonTamerChris DragonTamerChris is offline
The Yoshi Member
 
Join Date: Jan 2011
Location: Somewhere
Posts: 106
Gender: Male
Credits: 7,919
DragonTamerChris is on a distinguished road
Default

Quote:
Originally Posted by Sensacionsk8 View Post
how to have the point obtained is for the owner of adoptable
I wouldn't like that. Then some people would make their adoptable give someone 1 point and then another adoptable they might make it 7 points. Plus that's a bit too much customization for your adopts to me.
Reply With Quote
  #10  
Old 02-28-2011, 09:19 AM
Sensacionsk8 Sensacionsk8 is offline
Member
 
Join Date: Feb 2011
Posts: 18
Gender: Male
Credits: 3,153
Sensacionsk8 is on a distinguished road
Default

Quote:
Originally Posted by DragonTamerChris View Post
I wouldn't like that. Then some people would make their adoptable give someone 1 point and then another adoptable they might make it 7 points. Plus that's a bit too much customization for your adopts to me.
with a simple program you get all possible experience, that's why I liked that the clicker earn points, but in the end and solve it ^ ^
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
game for points Nemesis Suggestions and Feature Requests 3 10-24-2013 01:29 AM
levels exdiogene Questions and Supports 6 10-11-2009 07:04 AM
Experience points SleepWalker Suggestions and Feature Requests 2 08-20-2009 12:39 PM
Max levels again LilPixie Questions and Supports 14 07-22-2009 08:39 AM
Adopted by certain user levels... densaugeo Questions and Supports 11 04-21-2009 04:33 PM


All times are GMT -5. The time now is 09:53 PM.

Currently Active Users: 684 (0 members and 684 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636