
05-29-2009, 10:32 AM
|
Member
|
|
Join Date: Mar 2009
Posts: 106
Credits: 15,691
|
|
RE: series of questions
Quote:
Originally Posted by BMR777
For the "The user does not have more than X of this adoptable" part, it may still be letting you adopt the pet because the user does not have more than X of the adoptable.
For instance, if you set the value to 1 it will check if the user currently has more than 1 of this adoptable, and if true it will deny the adoption. So, 1 is not more than 1, it is simply 1. If you want them to have only 1 of the adoptable, try setting the value to 0 and that should force it to allow only 1 adoption. :)
Hope it helps,
Brandon
|
ok thanks[hr]
Quote:
Originally Posted by trollis76
3. You can copy the stats.php file, and then name the file to "random.php" for an example.
Then you delete this part:
Code:
$article_content = $lang_stats_explain."<h2>".$lang_top10."</h2>".$lang_top10_exp."<br><br><table width='680' border='1'>
<tr>
<td width='288'><strong>Adoptable Image: </strong></td>
<td width='130'><strong>Adoptable Name: </strong></td>
<td width='93'><strong>Owned By: </strong></td>
<td width='82'><strong>Total Clicks: </strong></td>
<td width='53'><strong>Current Level: </strong></td>
</tr>";
// Loop out code...
$query = "SELECT * FROM ".$prefix."owned_adoptables ORDER BY totalclicks DESC LIMIT 10";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < $num) {
$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$owner=@mysql_result($result,$i,"owner");
$currentlevel=@mysql_result($result,$i,"currentlevel");
$totalclicks=@mysql_result($result,$i,"totalclicks");
$img = getcurrentimage($aid);
$article_content = $article_content."<tr>
<td><center><a href='levelup.php?id=".$aid."'><img src='".$img."' border=0></a></center></td>
<td><center>".$name."</center></td>
<td><center><a href='profile.php?user=".$owner."'>".$owner."</a></center></td>
<td><center>".$totalclicks."</center></td>
<td><center>".$currentlevel."</center></td>
</tr>";
$i++;
}
And turn this:
Code:
$query = "SELECT * FROM ".$prefix."owned_adoptables ORDER BY RAND() LIMIT 5 OFFSET ".$offset."";
Into this:
Code:
$query = "SELECT * FROM ".$prefix."owned_adoptables ORDER BY RAND() LIMIT 100 OFFSET ".$offset."";
[hr]
Oh, and if you want to delete the random adoptables from the stats.php, you delete this part:
Code:
$article_content = $article_content."</table><br><h2>".$lang_randomadopts."</h2>".$lang_randomtext."<br><br><table width='680' border='1'>
<tr>
<td width='288'><strong>Adoptable Image: </strong></td>
<td width='130'><strong>Adoptable Name: </strong></td>
<td width='93'><strong>Owned By: </strong></td>
<td width='82'><strong>Total Clicks: </strong></td>
<td width='53'><strong>Current Level: </strong></td>
</tr>";
// Loop out code...
$num = 0;
$query = "SELECT * FROM ".$prefix."owned_adoptables ORDER BY totalclicks DESC LIMIT 10";
$result = mysql_query($query);
$num = mysql_numrows($result);
$gennum = $num;
if($num > 5){
$gennum = $num - 5;
}
$offset = rand(0,$gennum);
$query = "SELECT * FROM ".$prefix."owned_adoptables ORDER BY RAND() LIMIT 5 OFFSET ".$offset."";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < $num) {
$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$owner=@mysql_result($result,$i,"owner");
$currentlevel=@mysql_result($result,$i,"currentlevel");
$totalclicks=@mysql_result($result,$i,"totalclicks");
$img = getcurrentimage($aid);
$article_content = $article_content."<tr>
<td><center><a href='levelup.php?id=".$aid."'><img src='".$img."' border=0></a></center></td>
<td><center>".$name."</center></td>
<td><center><a href='profile.php?user=".$owner."'>".$owner."</a></center></td>
<td><center>".$totalclicks."</center></td>
<td><center>".$currentlevel."</center></td>
</tr>";
$i++;
}
|
May i ask? why is my news on index page was shown on random.php?
check it here : http://www.zhiichiro.0fees.net/adoptables/random.php[hr]
i really can't understand "The adoptable has not been adopted more than ** times."
is it means that if i put 20 on it, only 20 adoptables are available, and when 20 users adopt one, it will be unavailable?
|