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)
-   -   Page with Tradable Pets? (http://www.mysidiaadoptables.com/forum/showthread.php?t=2402)

AlexC 09-17-2011 02:35 PM

Page with Tradable Pets?
 
I was wondering if there is a small php code I can enter into a page that will display a list of all the pets available for trade on the site?

I wanted to set up a "marketplace" so to speak, since the site is mostly based off member breeding and so forth. Members can create their own Ratteries and so on~ I want people to be able to just look through a (perhaps randomly organized) page with all of the currently trade-able rats on it, see if anything strikes their fancy and so on.

EDIT: if anyone can help me figure out how to enable the alternate bbcode, that would be wonderful.

SilverDragonTears 09-17-2011 05:38 PM

you can call all the owned adopts that are "fortrade" in the database and show them on a page...

SilverDragonTears 09-17-2011 05:44 PM

also you should add the alternative bbcode to your site =( I can't post them on my forum.

AlexC 09-17-2011 06:09 PM

I honestly have no idea how to do that, I'm not some php genius. xD And I will do that, I just had to reinstall the script due to lingering coding effects, so some of the features I had set up haven't been reactivated.

SilverDragonTears 09-17-2011 06:11 PM

I can code something for you =) Just give me awhile.

AlexC 09-17-2011 06:13 PM

thanks, that would be wonderful! <33

Do you know how to enable the alt bbc? I clicked the selection in the admin area, but it says I need to do something with the .htaccess thing, and I'm not sure. Is there a thread saying how?

SilverDragonTears 09-17-2011 06:17 PM

go into your control panel of your site server or FTP to edit the .htaccess file. Make sure it is named .htaccess

Then tell me what it says in that file (copy and paste it)

AlexC 09-17-2011 06:20 PM

Code:

RewriteEngine On


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^get/([0-9]+).gif$ /adoptables200/siggy.php?id=$1 [L]

This is all it says.

SilverDragonTears 09-17-2011 06:25 PM

Ok remove adoptables200 and put the folder that your adopt script is in. If it is in the root folder remove adoptables200 so it looks like:

Code:

/siggy.php?id=$1 [L]

AlexC 09-17-2011 06:31 PM

I did remove the folder part and now it's just:

Code:

RewriteEngine On


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^get/([0-9]+).gif$ /siggy.php?id=$1 [L]

but when I put the alternate BBCode into my siggy or testing it here, it's still not showing up. D:

SilverDragonTears 09-17-2011 06:31 PM

I now see it on my forum. You also need to change how the codes show on your site. Open siggy.php and find the codes where it echos out... you need to remove the " from it.

Past your siggy.php here and I'll fix it for you.

AlexC 09-17-2011 06:33 PM

Code:

<?php

include("inc/functions.php");

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

// We need to grab an adoptable ID

$id = $_GET["id"];

// Check that ID exists and is valid

if(is_numeric($id)){

// The ID appears to be valid, so double check...


$result = runquery("SELECT * FROM ".$prefix."owned_adoptables WHERE aid='$id'") ;
$row = mysql_fetch_array($result);

if($row['aid'] == $id){

// The adoptable exists, so let's try and show the image

$usingimage = "no";

$image = getcurrentimage($id);

        // Let's see if the server has support for GD or not
        // Also to use fancy images the image must be a gif and fancy images must be enabled...

        $usegd = grabanysetting("gdimages");
        $imageinfo = @getimagesize($image);
        $imagemime = $imageinfo["mime"]; // Mime type of the image file, should be a .gif file...

        if(function_exists('imagegif') and $usegd == "yes" and $imagemime == "image/gif")
        {

        $usingimage = "yes"; //Turn the template system off

        // BEGIN NEW CODE

        list($width, $height, $row['type'], $attr) = getimagesize($image); // The size of the original adoptable image

        // Begin the fancy outputs...

        // Lets create the new target image, with a size big enough for the text for the adoptable

        $newheight = $height + 72;

        if($newwidth < 250){
        $newwidth = 250;
        }
        else{
        $newwidth = $width;
        }

      $img_temp = imagecreatetruecolor($newwidth, $newheight);


      $alphablending = true; 


            // Lets create the image and save its transparency 
      $img_old = @imagecreatefromgif($image); 
      imagealphablending($img_old, true); 
      imagesavealpha($img_old, true);
 
    // Lets copy the old image into the new image with 
    // the given size 
    ImageCopyResampled( 
        $img_temp, 
        $img_old, 
        0, 0, 0, 0, 
        $width, 
        $height, 
        $width, 
        $height 
    ); 
 
       
        $textheight = $width + 2;

        $image = $img_temp;

        $bgi = imagecreatetruecolor($newwidth, $newheight);

        $color = imagecolorallocate($bgi, 51, 51, 51);


        $str1 = "Name: ".$row['name'];
        $str2 = "Owner: ".$row['owner'];
        $str3 = "Click Here to Feed Me!";
        $str4 = "More Adopts at:";
        $str5 = "www.".$domain;


        imagestring ($image, 12, 0, $textheight,  $str1, $color);
        imagestring ($image, 12, 0, $textheight + 13,  $str2, $color);
        imagestring ($image, 12, 0, $textheight + 26,  $str3, $color);
        imagestring ($image, 12, 0, $textheight + 42,  $str4, $color);
        imagestring ($image, 12, 0, $textheight + 55,  $str5, $color);

        $background = imagecolorallocate($image, 0, 0, 0); 
      ImageColorTransparent($image, $background); 
 
        header("Content-Type: image/GIF");
        ImageGif ($image);
        imagedestroy($image);
        imagedestroy($img_temp);
        imagedestroy($img_old);
        imagedestroy($bgi);

        }
        else{
       
        // We are going to try and get this image the old fashioned way...
        // Define a list of allowed file extentions...

        $extList = array();
        $extList['gif'] = 'image/gif';
        $extList['jpg'] = 'image/jpeg';
        $extList['jpeg'] = 'image/jpeg';
        $extList['png'] = 'image/png';

        //Define the output file type
        $contentType = 'Content-type: '.$extList[ $imageinfo['extension'] ];

        if($imageinfo['extension'] =! "image/gif" and $imageinfo['extension'] =! "image/jpeg" and $imageinfo['extension'] =! "image/png"){

        // The file type is NOT ALLOWED
        die("Hacking Attempt!");

        }
        else{

        // File type is allowed, so proceed
        // Try and read the file in

        $status = "";

        header ($contentType);
        $status = readfile($image);

        if($status == "" or $status == "false" or $status == "FALSE"){

        // Reading the file failed, so show an error...       
        header ("text/plain");
        die("Readfile appears to be disabled on your host.");

        }
       


        }

        }


}
else{

// Bogus ID

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;


}
}
else{

// Bogus ID

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;

}

?>

Thank you so much for all your help on this... ;-; I suck so much at coding.

SilverDragonTears 09-17-2011 06:36 PM

are you sure that's your siggy.php?

AlexC 09-17-2011 06:38 PM

I think so. I opened siggy.php.

Code:

<?php

include("inc/functions.php");

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

// We need to grab an adoptable ID

$id = $_GET["id"];

// Check that ID exists and is valid

if(is_numeric($id)){

// The ID appears to be valid, so double check...


$result = runquery("SELECT * FROM ".$prefix."owned_adoptables WHERE aid='$id'") ;
$row = mysql_fetch_array($result);

if($row['aid'] == $id){

// The adoptable exists, so let's try and show the image

$usingimage = "no";

$image = getcurrentimage($id);

        // Let's see if the server has support for GD or not
        // Also to use fancy images the image must be a gif and fancy images must be enabled...

        $usegd = grabanysetting("gdimages");
        $imageinfo = @getimagesize($image);
        $imagemime = $imageinfo["mime"]; // Mime type of the image file, should be a .gif file...

        if(function_exists('imagegif') and $usegd == "yes" and $imagemime == "image/gif")
        {

        $usingimage = "yes"; //Turn the template system off

        // BEGIN NEW CODE

        list($width, $height, $row['type'], $attr) = getimagesize($image); // The size of the original adoptable image

        // Begin the fancy outputs...

        // Lets create the new target image, with a size big enough for the text for the adoptable

        $newheight = $height + 72;

        if($newwidth < 250){
        $newwidth = 250;
        }
        else{
        $newwidth = $width;
        }

      $img_temp = imagecreatetruecolor($newwidth, $newheight);


      $alphablending = true; 


            // Lets create the image and save its transparency 
      $img_old = @imagecreatefromgif($image); 
      imagealphablending($img_old, true); 
      imagesavealpha($img_old, true);
 
    // Lets copy the old image into the new image with 
    // the given size 
    ImageCopyResampled( 
        $img_temp, 
        $img_old, 
        0, 0, 0, 0, 
        $width, 
        $height, 
        $width, 
        $height 
    ); 
 
       
        $textheight = $width + 2;

        $image = $img_temp;

        $bgi = imagecreatetruecolor($newwidth, $newheight);

        $color = imagecolorallocate($bgi, 51, 51, 51);


        $str1 = "Name: ".$row['name'];
        $str2 = "Owner: ".$row['owner'];
        $str3 = "Click Here to Feed Me!";
        $str4 = "More Adopts at:";
        $str5 = "www.".$domain;


        imagestring ($image, 12, 0, $textheight,  $str1, $color);
        imagestring ($image, 12, 0, $textheight + 13,  $str2, $color);
        imagestring ($image, 12, 0, $textheight + 26,  $str3, $color);
        imagestring ($image, 12, 0, $textheight + 42,  $str4, $color);
        imagestring ($image, 12, 0, $textheight + 55,  $str5, $color);

        $background = imagecolorallocate($image, 0, 0, 0); 
      ImageColorTransparent($image, $background); 
 
        header("Content-Type: image/GIF");
        ImageGif ($image);
        imagedestroy($image);
        imagedestroy($img_temp);
        imagedestroy($img_old);
        imagedestroy($bgi);

        }
        else{
       
        // We are going to try and get this image the old fashioned way...
        // Define a list of allowed file extentions...

        $extList = array();
        $extList['gif'] = 'image/gif';
        $extList['jpg'] = 'image/jpeg';
        $extList['jpeg'] = 'image/jpeg';
        $extList['png'] = 'image/png';

        //Define the output file type
        $contentType = 'Content-type: '.$extList[ $imageinfo['extension'] ];

        if($imageinfo['extension'] =! "image/gif" and $imageinfo['extension'] =! "image/jpeg" and $imageinfo['extension'] =! "image/png"){

        // The file type is NOT ALLOWED
        die("Hacking Attempt!");

        }
        else{

        // File type is allowed, so proceed
        // Try and read the file in

        $status = "";

        header ($contentType);
        $status = readfile($image);

        if($status == "" or $status == "false" or $status == "FALSE"){

        // Reading the file failed, so show an error...       
        header ("text/plain");
        die("Readfile appears to be disabled on your host.");

        }
       


        }

        }


}
else{

// Bogus ID

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;


}
}
else{

// Bogus ID

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;

}

?>

Copied from my site - defiently siggy.php

SilverDragonTears 09-17-2011 06:40 PM

OOps... paste your myadopts.php for me =)

AlexC 09-17-2011 06:44 PM

Code:

<?php

include("inc/functions.php");

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

$id = $_GET["id"];
$act = $_GET["act"];
$more = $_GET["more"];

if($isloggedin == "yes")
{
        if($act == "")
        {
                $article_title = "Your Adoptables";
                $article_content = "<table>
                                                                <tr>
                                                                        <th></th><th>Name and Type</th><th>Image</th><th>Clicks</th>
                                                                </tr>";
                // We need to get all of the user's adoptables from the database and display them...
                $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";
                $result = runquery($query);

                while($row = mysql_fetch_array($result))
                {
                        if($row['usealternates'] =='yes')
                        {
                                $image = $row['alternateimage'];
                        }
                        else
                        {
                                $image = $row['primaryimage'];
                        }
                        if($row['currentlevel'] == 0)
                        {
                                $image = $row['eggimage'];
                        }
                        if($image=='')
                        {
                                $image = $row['primaryimage'];
                        }
                        $article_content .= "<tr>
                                                                        <td><img src='picuploads/{$row['gender']}.png'></td>
                                                                        <td><em>{$row['name']}</em> the {$row['type']}</td>
                                                                        <td><a href='myadopts.php?act=manage&id={$row['aid']}'><img src='{$image}'></a></td>
                                                                        <td>{$row['totalclicks']}</td>
                                                                </tr>";
                }
                $article_content .= "</table>";
        }
        elseif($act == "manage")
        {
                // We are managing a specific adoptable
               
                if(!is_numeric($id))
                {
                        $article_title = $err_idnoexist;
                        $article_content = $err_idnoexist_text;
                }
                else
                {
                        // See if the adoptable actually exists...

                        $query = "SELECT * FROM {$prefix}owned_adoptables WHERE owner='{$loggedinname}' and aid='{$id}'";
                        $result = runquery($query);
                        $row = mysql_fetch_array($result);

                        // Check that the adoptable exists for real, or show an error...

                        if($row['aid'] == $id)
                        {
                                // The adoptable does exist, so we show the image and junk to the user...

                                $image = getcurrentimage($id);

                                $article_title = "Managing {$row['name']}";
                                $article_content = "<img src='{$image}'><br /><br />This page allows you to manage {$row['name']}.  Click on an option below to change settings.<br /><br />
                                                                        <b><a href='levelup.php?id={$id}'><img src='templates/icons/add.gif' border=0> Level Up {$row['name']}</a><br />
                                                                        <a href='myadopts.php?act=stats&id={$id}'><img src='templates/icons/stats.gif' border=0> Get Stats for {$row['name']}</a><br />
                                                                        <a href='myadopts.php?act=bbcode&id={$id}'><img src='templates/icons/bbcodes.gif' border=0> Get BBCodes / HTML Codes for {$row['name']}</a><br />
                                                                        <a href='myadopts.php?act=rename&id={$id}'><img src='templates/icons/title.gif' border=0> Rename {$row['name']}</a><br />
                                                                        <a href='myadopts.php?act=trade&id={$id}'><img src='templates/icons/trade.gif' border=0> Change Trade Status {$row['name']}</a><br />
                                                                        <a href='myadopts.php?act=freeze&id={$id}'><img src='templates/icons/freeze.gif' border=0> Freeze or Unfreeze {$row['name']}</a><br />
                                                                        <a href='myadopts.php?act=pound&id={$id}'><img src='templates/icons/delete.gif' border=0> Pound {$row['name']}</a></b>";
                        }
                        else
                        {
                                $article_title = $err_idnoexist;
                                $article_content = $err_idnoexist_text;
                        }
                }
        } // End the MANAGE action code
        elseif($act == "stats")
        {
                // We are getting the stats for the adoptable
                // Check that an ID was submitted...
                if(is_numeric($id))
                {
                        // Now we see if the adoptable actually exists...

                        $query = "SELECT * FROM {$prefix}owned_adoptables WHERE owner='{$loggedinname}' and aid='{$id}'";
                        $result = runquery($query);
                        $row = mysql_fetch_array($result);
                       
                        if($row['aid'] == $id)
                        {
                                // The adoptable exists, so we show the stats for it...

                                $image = getcurrentimage($id);
                                $nextlevelexists = getnextlevelexists($type, $currentlevel);

                                // If a higher level exists, get that level's information...

                                if($nextlevelexists == "true")
                                {
                                        $nextlevel = $currentlevel + 1;

                                        $query = "SELECT * FROM {$prefix}levels WHERE adoptiename='{$type}' and thisislevel='{$nextlevel}'";
                                        $result = runquery($query);
                                        $requiredclicks=@mysql_result($result,0,"requiredclicks"); //The adoptable's ID

                                } // End grab next level info...

                                // Determine what to show for next level:

                                if($nextlevelexists == "true" and $nextlevel != "")
                                {
                                        // See how many more clicks to go

                                        $ctg = $requiredclicks - $row['totalclicks'];

                                        $nloutput = "{$nextlevel}<br />Clicks Required for Level Increase: {$ctg}";
                                }
                                else
                                {
                                        $nloutput = "This adoptable is at its maximum level";
                                }

                                $article_title = "{$row['name']}'s Statistics:";
                                $article_content = "<img src='{$image}'><br /><br />
                                                                        <b>Total Clicks: {$row['totalclicks']}<br />
                                                                        Gender: <img src='picuploads/{$row['gender']}.png'><br />
                                                                        Trade Status: {$row['tradestatus']}<br />
                                                                        Current Level: {$row['currentlevel']}<br />
                                                                        Next Level: {$nloutput}<br /></b>";

                                // Voters Information...

                                $article_content .= "<h2>{$row['name']}'s Voters:</h2><br />
                                                                        {$lang_voters_explain}<br /><br />
                                                                        <table width='450' border='1'>
                                                                                <tr>
                                                                                        <td width='129'><strong>Username:</strong></td>
                                                                                        <td width='156'><strong>Date Voted: </strong></td>
                                                                                        <td width='82'><strong>Profile:</strong></td>
                                                                                        <td width='55'><strong>PM:</strong></td>
                                                                                </tr>";

                                // Select the voters from the DB

                                $query = "SELECT * FROM {$prefix}vote_voters WHERE adoptableid='{$id}' ORDER BY date DESC LIMIT 10";
                                $result = runquery($query);

                                while ($row = mysql_fetch_array($result))
                                {
                                        if($row['username'] == "")
                                        {

                                                $row['username'] = "Guest";

                                        }
                                        if($row['username'] == "Guest")
                                        {
                                                $article_content .= "
                                                                                <tr>
                                                                                        <td><div align='left'>Guest</div></td>
                                                                                        <td><div align='left'>{$row['date']}</div></td>
                                                                                        <td><div align='center'></div></td>
                                                                                        <td><div align='center'></div></td>
                                                                                </tr>";
                                        }
                                        else
                                        {
                                                $article_content .= "
                                                                                <tr>
                                                                                        <td><div align='left'>{$row['username']}</div></td>
                                                                                        <td><div align='left'>{$row['date']}</div></td>
                                                                                        <td><div align='center'><a href='profile.php?user={$row['username']}' target='_blank'><img src='templates/buttons/profile.gif' border=0></a></div></td>
                                                                                        <td><div align='center'><a href='messages.php?act=newpm&user={$row['username']}' target='_blank'><img src='templates/buttons/pm.gif' border=0></a></div></td>
                                                                                </tr>";
                                        }
                                }
                                $article_content .= "</table><br />";
                        }
                        else
                        {
                                $article_title = $err_idnoexist;
                                $article_content = $err_idnoexist_text;
                        }
                }
                else
                {
                        $article_title = $err_idnoexist;
                        $article_content = $err_idnoexist_text;
                }
        } // End the STATS code
        elseif($act == "bbcode")
        {
                if(is_numeric($id))
                {
                        // Now we see if the adoptable actually exists...

                        $query = "SELECT * FROM {$prefix}owned_adoptables WHERE owner='{$loggedinname}' and aid='{$id}'";
                        $result = runquery($query);
                        $row = mysql_fetch_array($result);
                       
                        if($row['aid'] == $id)
                        {
                                $altbb = grabanysetting("usealtbbcode");

                                // Adoptable exists, so show the BBCode:

                                $article_title = "Codes for {$name}";
                                $article_content = "{$lang_bbcode_explain}<br />
                                                                        <p><u>Forum Codes / BBCode: </u></p>
                                                                        <p>
                                                                                <textarea name='textarea' cols='50' rows='4'>
                                                                                        }]http://www.{$domain}{$scriptpath}/si...#39;aid']}
                                                                                </textarea>
                                                                        </p>";

                                if($altbb == "yes")
                                {
                                        // Use the seo friendly alternate bbcodes...

                                        $article_content .= "
                                                                        <p><u>Alternate BBCodes (Use if the above do not work on a forum): </u></p>
                                                                        <p>
                                                                                <textarea name='textarea' cols='50' rows='4'>
                                                                                        }]http://www.{$domain}{$scriptpath}/ge...d']}.gif\"
                                                                                </textarea>
                                                                        </p>";
                                }
                               
                                $article_content .= "<p><u>HTML Code</u>:</p>
                                                                        <p>
                                                                                <textarea name='textarea' cols='50' rows='4'>
                                                                                        <a href=\"http://www.{$domain}{$scriptpath}/levelup.php?id={$row['aid']}\" target=\"_blank\">
                                                                                                <img src=\"http://www.{$domain}{$scriptpath}/siggy.php?id={$row['aid']}\" border=0>
                                                                                        </a>
                                                                                </textarea> 
                                                                        </p>";
                        }
                        else
                        {
                                $article_title = $err_idnoexist;
                                $article_content = $err_idnoexist_text;
                        }
                }
                else
                {
                        $article_title = $err_idnoexist;
                        $article_content = $err_idnoexist_text;
                }
        } // End the BBCODE generation for the adoptable...
        elseif($act == "rename")
        {
                // We are renaming an adoptable

                if(is_numeric($id))
                {
                        // Now we see if the adoptable actually exists...

                        $query = "SELECT * FROM {$prefix}owned_adoptables WHERE owner='{$loggedinname}' and aid='{$id}'";
                        $result = runquery($query);
                        $row = mysql_fetch_array($result);

                        if($row['aid'] == $id)
                        {
                                $image = getcurrentimage($id);

                                if($row['isfrozen'] != "yes")
                                {
                                        if($more == "")
                                        {
                                                $article_title = "Rename {$row['name']}";
                                                $article_content = "<img src='{$image}'><br />{$lang_rename}{$row['name']}{$lang_rename2}<br />
                                                                                        <form name='form1' method='get' action='myadopts.php'>
                                                                                                <p>Adoptable Name:
                                                                                                        <input name='more' type='text' id='more'>
                                                                                                        <input name='id' type='hidden' id='id' value='{$id}'>
                                                                                                        <input name='act' type='hidden' id='act' value='rename'>
                                                                                                </p>
                                                                                                <p>
                                                                                                        <input type='submit' name='Submit' value='Rename Adoptable'>
                                                                                                </p>
                                                                                        </form>";
                                        }
                                        else
                                        {
                                                // We are renaming the adoptable

                                                // The adoptable exists, so now we can rename it...

                                                $query = "UPDATE {$prefix}owned_adoptables SET name='{$more}' WHERE aid='{$id}' and owner='{$loggedinname}'";
                                                runquery($query);

                                                $article_title = $lang_rename_success_title;
                                                $article_content = "<img src='{$image}'><br />{$lang_rename_success}{$more}.
                                                                                        You can now manage {$more} on the <a href='myadopts.php?act=manage&id={$id}'>My Adopts</a> page";
                                        }
                                }
                                else
                                {
                                        // We cannot rename a frozen adoptable...

                                        $article_title = $lang_frozen_title;
                                        $article_content = "{$lang_frozen}<a href='manage.php?act=freeze&id={$id}&more=unfreeze'>unfreeze</a> {$lang_frozen2}";
                                }
                        }
                        else
                        {
                                $article_title = $err_idnoexist;
                                $article_content = $err_idnoexist_text;
                        }
                }
                else
                {
                        $article_title = $err_idnoexist;
                        $article_content = $err_idnoexist_text;
                }

        }
        elseif($act == "trade")
        {
                // We are setting the trade status for an adoptable...

                if(is_numeric($id))
                {
                        // Now we see if the adoptable actually exists...

                        $query = "SELECT * FROM {$prefix}owned_adoptables WHERE owner='{$loggedinname}' and aid='{$id}'";
                        $result = mysql_query($query);
                        $row = mysql_fetch_array($result);

                        if($row['aid'] == $id)
                        {
                                $image = getcurrentimage($id); // Get the image for the adopt...

                                if($more == "")
                                {
                                        $article_title = "Setting trade status for {$row['name']}";
                                        $article_content = "Are you sure you wish to change the trade status of this adoptable?
                                                                                <center><b><a href='myadopts.php?act=trade&id={$id}&more=confirm'>Yes I'd like to change its trade status</a></b><br /><br />
                                                                                <b><a href='myadopts.php'>Nope I change my mind! Go back to the previous page.</a></b></center><br />";
                                }
                                elseif($more == "confirm")
                                {                       
                                        $article_title = "Change trade status successfully";
                                        if($row['tradestatus'] == "fortrade")
                                        {
                                                $query = "UPDATE {$prefix}owned_adoptables SET tradestatus='notfortrade' WHERE aid='{$id}' and owner='{$loggedinname}'";
                                                runquery($query);
                                                $article_content = "The adoptable's trade status is now Not for Trade";
                                        }               
                                        elseif($row['tradestatus'] == "notfortrade")
                                        {
                                                $query = "UPDATE {$prefix}owned_adoptables SET tradestatus='fortrade' WHERE aid='{$id}' and owner='{$loggedinname}'";
                                                runquery($query);
                                                $article_content = "The adoptable's trade status is now For Trade";
                                        }
                                        else
                                        {
                                                $article_title = "Something is very very wrong";
                                                $article_content = "Please check phpmyadmin to see if the settings are correct, or report your issue to Mysidia Adoptables support forum";
                                        }
                                }
                                else
                                {
                                        $article_title = "Invalid Action";
                                        $article_content = "Invalid Action Specified";
                                }
                        }
                        else
                        {
                                $article_title = $err_idnoexist;
                                $article_content = $err_idnoexist;
                        }
                }
                else
                {
                        $article_title = $err_idnoexist;
                        $article_content = $err_idnoexist_text;
                }
        }
        elseif($act == "freeze")
        {
                // We are freezing an adoptable here...

                if(is_numeric($id))
                {
                        // Now we see if the adoptable actually exists...

                        $query = "SELECT * FROM {$prefix}owned_adoptables WHERE owner='{$loggedinname}' and aid='{$id}'";
                        $result = runquery($query);
                        $row = mysql_fetch_array($result);

                        if($row['aid'] == $id)
                        {
                                $image = getcurrentimage($id); // Get the image for the adopt...

                                if($more == "")
                                {
                                        if($row['isfrozen'] == "yes")
                                        {
                                                $status = "<img src='templates/icons/freeze.gif'> Frozen<br />";
                                                $go = "<a href='myadopts.php?act=freeze&id={$id}&more=unfreeze'><img src='templates/icons/unfreeze.gif' border=0> Unfreeze This Adoptable</a>";
                                        }
                                        else
                                        {
                                                $status = "<img src='templates/icons/unfreeze.gif'> Not Frozen<br />";
                                                $go = "<a href='myadopts.php?act=freeze&id={$id}&more=freeze'><img src='templates/icons/freeze.gif' border=0> Freeze This Adoptable</a>";
                                        }

                                        $article_title = $lang_freeze_title;
                                        $article_content = "<img src='{$image}'><br /><b>{$row['name']}'s Current Status: {$status}</b><br />
                                                                                {$lang_freeze}<br /><br /><b>{$go}</b><br /><br />
                                                                                {$lang_freeze_warning}";
                                }
                                else
                                {
                                        // We are actually freezing or unfreezing the adopt...

                                        if($more == "freeze")
                                        {
                                                $frz = "yes";
                                                $article_title = "{$row['name']} Frozen Successfully";
                                        }
                                        elseif($more == "unfreeze")
                                        {
                                                $frz = "no";
                                                $article_title = "{$row['name']} Unfrozen Successfully";
                                        }

                                        $query = "UPDATE {$prefix}owned_adoptables SET isfrozen='{$frz}' WHERE aid='{$id}' and owner='{$loggedinname}'";
                                        runquery($query);

                                        $article_content = "Action Complete. You may now manage {$row['name']} on the <a href='myadopts.php?act=manage&id={$id}'>My Adopts</a> page";
                                }
                        }
                        else
                        {
                                $article_title = $err_idnoexist;
                                $article_content = $err_idnoexist_text;
                        }
                }
                else
                {
                        $article_title = $err_idnoexist;
                        $article_content = $err_idnoexist_text;
                }
        }
        elseif($act == "pound")
        {
                if(is_numeric($id))
                {
                        // Now we see if the adoptable actually exists...

                        $query = "SELECT * FROM {$prefix}owned_adoptables WHERE owner='$loggedinname' and aid='$id'";
                        $result = runquery($query);
                        $row = mysql_fetch_array($result);

                        if($row['aid'] == $id)
                        {
                                $image = getcurrentimage($id); // Get the image for the adopt...

                                if($more == "")
                                {
                                        $article_title = "Pound {$row['name']}";
                                        $article_content = "<img src='{$image}'><br />{$lang_pound}<br /><br />{$lang_pound_warning}<br /><br />
                                                                                <center><b><a href='myadopts.php?act=pound&id={$id}&more=confirm'>
                                                                                <img src='templates/icons/delete.gif' border=0> Pound {$name} - I dont want it anymore!
                                                                                <img src='templates/icons/delete.gif' border=0></a></b><br /><br />
                                                                                <b><a href='myadopts.php'><img src='templates/icons/yes.gif' border=0>
                                                                                DO NOT Pound {$name}! <img src='templates/icons/yes.gif' border=0></a></b></center><br />";
                                }
                                elseif($more == "confirm")
                                {
                                        // Actually run the execution

                                        $query = "UPDATE {$prefix}owned_adoptables SET owner='SYSTEM' WHERE aid='{$id}'";
                                        runquery($query);

                                        $article_title = $lang_pound_title_complete;
                                        $article_content = $lang_pound_complete;
                                }
                                else
                                {
                                        $article_title = "Invalid Action";
                                        $article_content = "Invalid Action Specified";
                                }
                        }
                        else
                        {
                                $article_title = $err_idnoexist;
                                $article_content = $err_idnoexist_text;
                        }
                }
                else
                {
                        $article_title = $err_idnoexist;
                        $article_content = $err_idnoexist_text;
                }
        }
        else
        {
                // No valid action specified :: show an error

                $article_title = $lang_invalid_action_title;
                $article_content = $lang_invalid_action;
        }
}
else
{

        $article_title = $accden;
        $article_content = $reqlogin;

} // End is logged in check else


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

echo showpage($article_title, $article_content, $date);

?>

myadopts.php~ sorry if I'm a little slow to reply, I'm watching Star Trek, doing my homework and working on a list for the help page on the site.

SilverDragonTears 09-17-2011 06:52 PM

Ok this is a bit different from my script b.c I'm using a different version. I'd need to see your table structure..

AlexC 09-17-2011 06:56 PM

This is the newest script. I have to go at the moment, thank you for your help - I will find what the problem is tomorrow.

AlexC 09-17-2011 08:26 PM

So what do I need to fetch and from where? Sorry, I'm slow tonight.

SilverDragonTears 09-17-2011 08:31 PM

I'm really not sure =/ it may be something in your tables... you can give me access or take a pic of your table... owned_adoptables.... the structure and a sample entry

AlexC 09-17-2011 08:35 PM

I'll take a snapshot of my owned_adoptables.

AlexC 09-17-2011 08:38 PM

http://tinypic.com/r/35mo00x/7 Here is a photo~

SilverDragonTears 09-17-2011 08:44 PM

This stumps me. I can't figure out where to fix that at on the newer version. I'm sure HoF or someone can help =(

AlexC 09-17-2011 08:48 PM

alright, I'll just have to leave it for now, I guess. How is the trade page coming along?

SilverDragonTears 09-17-2011 08:51 PM

Actually you know you can just go to search.php and type in a type and it will show user's pet and info? I added in an image for my pets... it's basically the same I just added in a bit of code to make only adopts that are actually for trade show up instead of all of them

AlexC 09-17-2011 08:53 PM

I know that, but I just want it to be a page where it displays all of the rats for sale. The site is very collection/breed focused~

SilverDragonTears 09-17-2011 08:54 PM

That's what mine does.... If you had a page that showed every single one on one page that could take quite a bit of loading.

AlexC 09-17-2011 08:54 PM

Well, can you give me the code then, or show me the modifications?

SilverDragonTears 09-17-2011 08:56 PM

Register on my site and see if you like the way it's set up

AlexC 09-17-2011 08:57 PM

alright, I'll have a look.

AlexC 09-17-2011 09:03 PM

I had a look, that's nicely done - I'm not sure if it's exactly what I'm looking for, but if nobody can figure it out, I guess I'll probably just settle for the search feature. Out of courosity, you aren't willing to show me or share with me how you did that clicking page wold you?

SilverDragonTears 09-17-2011 09:08 PM

Clicking Page?

AlexC 09-17-2011 09:10 PM

The nursery page?

SilverDragonTears 09-17-2011 09:15 PM

Code:

<center><table>
<th>Nursery<br>

<?php

mysql_connect("localhost", "YOUR-DATABASE-USERNAME", "YOUR-DATABASE-PASSWORD");
mysql_select_db("YOUR-DATABASE") or die(mysql_error());
?>
      <tr>
        <td VALIGN="top" >

<?

// Retrieve all the adopts from the table
$result = mysql_query("SELECT * FROM adopts_owned_adoptables WHERE isfrozen = 'no' LIMIT $start, 50")
or die(mysql_error()); 

while($row = mysql_fetch_array( $result )) {
// Print out the contents of the entry
echo "<a href=\"http://YOUR-SITE-URL/levelup.php?id=" .$row['aid'] . "\" target=\"view\"><img src=\"http://YOUR-SITE-URL/get/".$row['aid'].".gif\" title=\"" .$row['owner'] . "\"></a> ";

}
?>
</td>
        </tr>
        <tr>
                <td>
<?php
for($i=1; $i<=$pages; $i++) {
        echo '<a href="?p=' . $i . '">[' . $i . ']</a> ';
}
?>
                </td>
        </tr>
    </table>

<iframe name="view" id="view" scrolling="no"  width="100%" height="600px" frameborder="0">


AlexC 09-17-2011 09:17 PM

Can I add a variation of that to my site? I wouldn't mind somewhere that the members could view some random rats and help them grow. ^.^

SilverDragonTears 09-17-2011 09:19 PM

Of course =) If you would make me a sprite for my site in return?

AlexC 09-17-2011 09:21 PM

sure! How many/what type. I do pixeling with shading, most animals are fine. I would be willing to do a few if you could do a market page for me as well.

All stages, eggs as well I'm assuming? How many stages are there?

SilverDragonTears 09-17-2011 09:24 PM

There are 4 egg stages, 1 baby stage, and an adult. Male/Female of baby & adult is fine if you'd like. Something that would go well with our "Misty Woods" theme? Ideas?

Yes, I'll help you with that =)

AlexC 09-17-2011 09:25 PM

I'll message you some ideas.

kitty08 10-17-2011 02:44 AM

You can also use the search page and get them ;)


All times are GMT -5. The time now is 02:13 AM.

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