Quote:
Originally Posted by shiningheart
This code rocks, but I have a problem. Is there a way that when the person views the other person's profile, it can also the list their pets? Because if some people don't have anywhere to post their pets, how are they going to advertise them and get more clicks? So I was wondering if you could give me the code so I can add the pets to it.
|
Yes, actually, lol I forgot that I removed that part out, what you need to do is, go to your profile2.php and,
place this:
PHP Code:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner = '".$user."'";
$result = mysql_query($query);
$numpets = mysql_numrows($result);
Right after this:
PHP Code:
if($yahoo == ""){
$yahoo = "No YIM Information Given";
}
$i++;
}
Then where ever you want the pets to show up, place this into that section (note, the section will look something like $article_content, $about_me, etc.. etc):
PHP Code:
<b>Number Of Pets Owned:</b> ".$numpets."<br><br>
<b><u>".$usersname."'s Pets:</u></b><br><br>
Then, go to the end of the section you placed that bit of code in, (the end of the section will be marked with ";) and immediately after that, place this:
PHP Code:
if($numpets > 0){
$i=0;
while ($i < $numpets) {
$aid=@mysql_result($result,$i,"aid");
$image = getcurrentimage($aid);
$article_content = $article_content."<a href='levelup.php?id=".$aid."'><img src='".$image."' border='0'></a>";
$i++;
}
}
else{
$article_content = $article_content."This user currently does not have any pets.";
}
You have to make sure you do not place that bit of quote in a section, or else you will get an error.