Nursery problem

Forum
Last Post
Threads / Messages

kristhasirah

Member
Member
Joined
Jan 22, 2010
Messages
197
Points
16
Location
In middle of the nothingness
Mysidian Dollar
20,995
Click Exchange help

Im using the 1.3.2 script
I used the Stats.php random 5 adopts code to make my click exchange, and added the code to not show the already clicked adoptables that HoF posted for the old script.

i edited the code, changed part of it using the part of the code of the levelup.php, i no longer get the error, but the already clicked adoptables keep showing up =( i cant make a code from scratch i really have no idea how to make it, im only good at making small edits, and copy/paste... my brain is dead i was awake until 2:30 AM trying to figure out what im doing wrong... i have tried different forms/edits/changes and still can't make the already clicked adopts to stop showing ;-;

this is the code:
Code:
<?php

require("inc/init.php");

//***************//
//  START SCRIPT //
//***************//

$mysidia->page->settitle("<h1>Click Exchange</h1>");
$mysidia->page->addcontent("<p><br><h3>25 Random Adoptables</h3>Here are 25 random pokeponies that you can click on and level.  The owner of these adoptables will be able to see that you clicked on their adoptable, so they may in turn return the favor.<br><br><table>");

// Loop out code...
$query = "SELECT * FROM ".constant("PREFIX")."owned_adoptables, ".constant("PREFIX")."adoptables, ".constant("PREFIX")."levels WHERE "
          .constant("PREFIX")."adoptables.type = ".constant("PREFIX")."owned_adoptables.type AND ".constant("PREFIX")."levels.thisislevel = ".constant("PREFIX")."owned_adoptables.currentlevel AND ".constant("PREFIX")."levels.adoptiename = ".constant("PREFIX")."adoptables.type"
          ." ORDER BY RAND() DESC LIMIT 25";
$stmt = $mysidia->db->query($query); 

//Loop out code
$counter = 0;
while($adopt = $stmt->fetchObject()){
      $date = new DateTime;
	  $ip = secure($_SERVER['REMOTE_ADDR']);
	  $where_clause = ($isloggedin == "yes")
                ?"adoptableid='{$mysidia->input->get("id")}' and username = '{$mysidia->user->username}' and date = '{$date->format('Y-m-d')}'"
				:"adoptableid='{$mysidia->input->get("id")}' and ip = '{$ip}' and date = '{$date->format('Y-m-d')}'";
      $voters = $mysidia->db->select("vote_voters", array(), $where_clause)->fetchColumn();	
            if(is_numeric($voters->void)){
            
       // The adoptable has been clicked by the user, so we will not load this data
       continue;
      }
   

   if($adopt->currentlevel == 0) $image = $adopt->eggimage; 
   elseif($adopt->usealternates == 'yes') $image = $adopt->alternateimage; 
   else $image = $adopt->primaryimage;
   $adoptimage = "<a href='levelup.php?id={$adopt->aid}'><img src='{$image}' border=0></a>";
 
 $mysidia->page->addcontent("<tr>$adoptimage</tr>"); 
 
$counter++;
    if($counter >= 25){
       // Already loaded ten adoptables, time to break out of the loop.    
       break;
}     
}   

$mysidia->page->addcontent("<br><form><input type='button' onClick='history.go(0)' value='Refresh'></table></form>");


//***************//
//  OUTPUT PAGE  //
//***************//

$mysidia->output(); 

?>


and also i want to know what i need to add to stop showing the adults and frozen adopts??
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top