Show who recently leveled up a given adoptable

Forum
Last Post
Threads / Messages
Status
Not open for further replies.

kisazeky

Member
Member
Joined
Mar 14, 2009
Messages
44
Points
0
Mysidian Dollar
11,537
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:
$article_content = $article_content."$voter ";

change it to:

PHP:
$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:
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:
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:
$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:
			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:
$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:
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:
<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:
mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '','$ip','$id')");

Change it to
PHP:
mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '','$ip','$id', '')");

Then find
PHP:
mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '$username','','$id')");
again

and change it to
PHP:
mysql_query("INSERT INTO vote_voters VALUES ('$todaydate', '$username','','$id', '')");
 
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. =)
 
Status
Not open for further replies.

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top