Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-04-2013, 01:31 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,433
kristhasirah
Default 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 by kristhasirah; 02-04-2013 at 10:59 AM. Reason: edited the code
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Nursery Page Abronsyth Suggestions and Feature Requests 2 01-20-2013 09:17 AM


All times are GMT -5. The time now is 12:58 PM.

Currently Active Users: 9793 (0 members and 9793 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636