Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Addons/Mods Graveyard (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=41)
-   -   Show who recently leveled up a given adoptable (http://www.mysidiaadoptables.com/forum/showthread.php?t=616)

kisazeky 04-04-2009 05:44 PM

Show who recently leveled up a given adoptable
 
What!? OMG ANOTHER MOD!!?

This one is kind of tricky so pay attention!!

---
[size=medium]
If you have installed my profile mod[/size]

Wherever in the code there is:
PHP Code:

$article_content $article_content."$voter "

change it to:

PHP Code:

$article_content $article_content."<a href='profile.php?owner=$voter'>$voter</a> "

This will link their name to their profile.

----

Step 1:

Run this query (this is the only easy part)

PHP Code:

ALTER vote_voters ADD (voteid INT NOT NULL AUTO_INCREMENT PRIMARY KEY

Step 2:


Open levelup.php and look for something like this code. It may vary if you have changed the "already leveled up" message.

PHP Code:

if($checkdate == $todaydate){
                
//We've gone this far, this means that we found a match because a date was returned
                //Cannot vote because we already voted today...
                
$article_title "You already voted for me today!";
                
$article_date date('Y-m-d');    
                
$article_content "You already voted for this adoptable today.  Please come back in 24 hours to level up this adoptable again."

Below it, put:

PHP Code:

$article_content=$article_content."<p>Recently leveled up by:</p>";

$query "SELECT * FROM vote_voters WHERE adoptableid = '".$id."' AND date = '".$todaydate."' ORDER BY voteid DESC LIMIT 20";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i $num) {

$voter=@mysql_result($result,$i,"username");

$article_content $article_content."$voter ";

$i++;



Step 3:
[size=medium]
This is if you have not installed my currency mod
[/size]

Find something like this bit of code (it will not be exact if you changed the level up message):

PHP Code:

            mysql_query("UPDATE owned_adoptables SET currentlevel='".$levelup."' WHERE uid='".$id."'");
            
mysql_query("UPDATE owned_adoptables SET imageurl='".$img."' WHERE uid='".$id."'");
            
$flag 1;
            
$currentlevel $levelup;
            }


            }    

            if(
$flag == 1){
            
$imageurl $img;
            }

            
$article_content "You just gave ".$name." 1 LevelUP point!<br><br><img src='".$imageurl."' border='0'><br>
            <b>"
.$name."'s Current Level: ".$currentlevel."</b><br><br>Be sure and come back tomorrow to rank ".$name." up again!"

Below it...insert this code:

PHP Code:

$article_content=$article_content."<p>Recently leveled up by:</p>";

$query "SELECT * FROM vote_voters WHERE adoptableid = '".$id."' AND date = '".$todaydate."' ORDER BY voteid DESC LIMIT 20";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i $num) {

$voter=@mysql_result($result,$i,"username");

$article_content $article_content."$voter ";

$i++;



[size=medium]If you have installed my currency mod then...[/size]

Find something similar to this code. The article content may vary if you changed the message.

PHP Code:

mysql_query("UPDATE `users` SET `money`='".$newbalance."' WHERE `username`='".$luser."'");
            
            
$article_content=$article_content"
            <p>You have earned 10 currency name for leveling up this pet.
            <br>You now have a total of "
.$newbalance." currency name."

Erase the "; at the end of your message for earning currency. Then below it, paste this:

PHP Code:

<p>Recently leveled up by:</p>";

$query = "SELECT FROM vote_voters WHERE adoptableid '".$id."' AND date '".$todaydate."' ORDER BY voteid DESC LIMIT 20";
$result = mysql_query($query);
$num = mysql_numrows($result);

//Loop out code
$i=0;
while (
$i < $num) {

$voter=@mysql_result($result,$i,"username");

$article_content = $article_content."$voter ";

$i++;


Step 4:

Find
PHP Code:

mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '','$ip','$id')"); 

Change it to
PHP Code:

mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '','$ip','$id', '')"); 

Then find
PHP Code:

mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '$username','','$id')"); 

again

and change it to
PHP Code:

mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '$username','','$id', '')"); 


Ashje 04-04-2009 05:50 PM

RE: Show who recently leveled up a given adoptable
 
Looks cool =)

kisazeky 04-04-2009 05:51 PM

RE: Show who recently leveled up a given adoptable
 
Do you think it's confusing Ashje?

Ashje 04-04-2009 05:56 PM

RE: Show who recently leveled up a given adoptable
 
Not really. If you read it carefully then it's fine. I have to go to a concert soon but I'll install it later. =)


All times are GMT -5. The time now is 02:27 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.