SilverDragonTears
03-28-2012, 04:50 AM
This script will allow your users to select all adopts that are unfrozen and not adults.
First you need to make a new file (I call mine embed.php)
Then copy and paste:
<?php
include("functions/functions.php");
include("functions/functions_users.php");
include("functions/functions_adopts.php");
include("classes/class_pagination.php");
include("css/pagination.css");
include("inc/lang.php");
//***************//
// START SCRIPT //
//***************//
$id = $_GET["id"];
$act = $_GET["act"];
$more = $_GET["more"];
if($isloggedin == "yes"){
if($act == ""){
$article_title = "Embed";
$article_content .= "<br>
This will allow you to select all your available dragon's codes.<br>";
$article_content .= "<textarea rows='20' cols='80'>";
$query = "SELECT * FROM {$prefix}owned_adoptables,
{$prefix}adoptables,
{$prefix}levels WHERE {$prefix}owned_adoptables.owner = '{$loggedinname}'
AND {$prefix}adoptables.type = {$prefix}owned_adoptables.type
AND {$prefix}levels.thisislevel = {$prefix}owned_adoptables.currentlevel
AND {$prefix}levels.adoptiename = {$prefix}adoptables.type
ORDER BY {$prefix}owned_adoptables.totalclicks";
$rowsperpage = 10;
$pagination = new Pagination($adopts, $query, $rowsperpage, "http://{$domain}{$scriptpath}/myadopts.php");
$pagination->setPage($_GET[page]);
$query = "SELECT * FROM {$prefix}owned_adoptables,
{$prefix}adoptables,
{$prefix}levels WHERE {$prefix}owned_adoptables.owner = '{$loggedinname}'
AND {$prefix}adoptables.type = {$prefix}owned_adoptables.type
AND {$prefix}levels.thisislevel = {$prefix}owned_adoptables.currentlevel
AND {$prefix}levels.adoptiename = {$prefix}adoptables.type
ORDER BY {$prefix}owned_adoptables.totalclicks";
$stmt = $adopts->query($query);
while($row = $stmt->fetchObject()){
if($row->usealternates == 'yes') $image = $row->alternateimage;
else $image = $row->primaryimage;
if($row->currentlevel == 0) $image = $row->eggimage;
if($image=='') $image = $row->primaryimage;
if($row->currentlevel >= '6') {
$article_content .= "";
}
else if($row->isfrozen == 'yes') {
$article_content .= "";
} else{
$article_content .= "http://taleofdragons.net/get/{$row->aid}.gif (http://taleofdragons.net/levelup.php?id={$row->aid})";
}
}
$article_content .= "</textarea>";
}
}
else{
$article_title = $accden;
$article_content = $reqlogin;
} // End is logged in check else
//***************//
// OUTPUT PAGE //
//***************//
echo showpage($article_title, $article_content, $date);
?>At line 59 you will need to change the number according to your highest level of adopt.
if($row->currentlevel >= '6') {Then just add the file you created to your links.
I think some parts may be unnecessary but it works for me.
First you need to make a new file (I call mine embed.php)
Then copy and paste:
<?php
include("functions/functions.php");
include("functions/functions_users.php");
include("functions/functions_adopts.php");
include("classes/class_pagination.php");
include("css/pagination.css");
include("inc/lang.php");
//***************//
// START SCRIPT //
//***************//
$id = $_GET["id"];
$act = $_GET["act"];
$more = $_GET["more"];
if($isloggedin == "yes"){
if($act == ""){
$article_title = "Embed";
$article_content .= "<br>
This will allow you to select all your available dragon's codes.<br>";
$article_content .= "<textarea rows='20' cols='80'>";
$query = "SELECT * FROM {$prefix}owned_adoptables,
{$prefix}adoptables,
{$prefix}levels WHERE {$prefix}owned_adoptables.owner = '{$loggedinname}'
AND {$prefix}adoptables.type = {$prefix}owned_adoptables.type
AND {$prefix}levels.thisislevel = {$prefix}owned_adoptables.currentlevel
AND {$prefix}levels.adoptiename = {$prefix}adoptables.type
ORDER BY {$prefix}owned_adoptables.totalclicks";
$rowsperpage = 10;
$pagination = new Pagination($adopts, $query, $rowsperpage, "http://{$domain}{$scriptpath}/myadopts.php");
$pagination->setPage($_GET[page]);
$query = "SELECT * FROM {$prefix}owned_adoptables,
{$prefix}adoptables,
{$prefix}levels WHERE {$prefix}owned_adoptables.owner = '{$loggedinname}'
AND {$prefix}adoptables.type = {$prefix}owned_adoptables.type
AND {$prefix}levels.thisislevel = {$prefix}owned_adoptables.currentlevel
AND {$prefix}levels.adoptiename = {$prefix}adoptables.type
ORDER BY {$prefix}owned_adoptables.totalclicks";
$stmt = $adopts->query($query);
while($row = $stmt->fetchObject()){
if($row->usealternates == 'yes') $image = $row->alternateimage;
else $image = $row->primaryimage;
if($row->currentlevel == 0) $image = $row->eggimage;
if($image=='') $image = $row->primaryimage;
if($row->currentlevel >= '6') {
$article_content .= "";
}
else if($row->isfrozen == 'yes') {
$article_content .= "";
} else{
$article_content .= "http://taleofdragons.net/get/{$row->aid}.gif (http://taleofdragons.net/levelup.php?id={$row->aid})";
}
}
$article_content .= "</textarea>";
}
}
else{
$article_title = $accden;
$article_content = $reqlogin;
} // End is logged in check else
//***************//
// OUTPUT PAGE //
//***************//
echo showpage($article_title, $article_content, $date);
?>At line 59 you will need to change the number according to your highest level of adopt.
if($row->currentlevel >= '6') {Then just add the file you created to your links.
I think some parts may be unnecessary but it works for me.