Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Nursery problem (http://www.mysidiaadoptables.com/forum/showthread.php?t=3991)

kristhasirah 02-04-2013 01:31 AM

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??


All times are GMT -5. The time now is 12:21 AM.

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