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 03-13-2011, 06:35 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 45,923
RoconzaArt is an unknown quantity at this point
Default can't delete adoptable

I made a adoptable and now I want to remove but I can't and it's made three duplicates and not one is removable.

PHP Code:
<?php

include("inc/functions.php");
$admin true;

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

if($isloggedin == "yes"){

$group getgroup();
$cancp cancp($group);

if(
$cancp == "yes"){

// We are allowed in the Admin CP because our usergroup Can CP
// Since we are allowed in the Admin CP, we'll need a way to tell
// which setting we are editing...

$set $_GET["set"];
$do $_GET["do"];
$more $_GET["more"];
$evenmore $_GET["evenmore"];

// **********************************************************************
// Begin our if / elseif / else block to determine what we're up to...
// **********************************************************************

if($set == ""){

//No setting selected, so show the Admin CP welcome screen, credits, etc

$article_title "Welcome to your Admin CP";
$article_content "Welcome to your Admin CP.  Here's where you can manage your site, change the site's content,
add or edit adoptables, manage advertisements, etc.  Please use the links at the top of the Admin CP to change the setting you want to.<br><br>
This site is powered by the <a href='http://www.mysidiaadoptables.com' target='_blank'>Mysidia Adoptable</a>.
Need help using this script?  You can either visit this script's <a href='http://www.mysidiaadoptables.com/download.php' target='_blank'>Product Page</a> or
visit the <a href='http://www.mysidiaadoptables.com/forum/' target='_blank'>Mysidia Adoptables Support Forums</a> to get help and support.
<br><br>Mysidia Adoptables Staff Team:
<br>Project Leader: Hall of Famer
<br>Coders: Arianna, Annatar, Kaeliah, Bloodrun
<br>Artists: Enddayne
<br><br>Special thanks and contributions from:
<br>Pokemontrainergigi, Fadillzzz, BMR, Teshia
<br><br>Script Copyright 2011 Mysidia Adoptables<br>Redistribution Prohibited<br><a href='http://www.mysidiaadoptables.com' target='_blank'>http://www.mysidiaadoptables.com</a>"
;

//End for the set = "" bit
else if($set == "adopts"){

// **********************************************************************
// This is the main place where adoptables are created and edited...
// First we need to see if we can access this portion of the ACP...
// Then we begin our if / elseif / else block for the do variable
// **********************************************************************    

$canedit cando($group"canmanageadopts");

if(
$canedit == "yes"){

//Our usergroup can edit adoptables, so begin our switch case for do

    
if($do == ""){
    
    
//We haven't selected a setting...

    
$article_title "Add / Edit / Manage Adoptables";
    
$article_content "Here you can add or edit the adoptables that are available to your site's visitors.  Please choose an option below...<br><br>
    <a href='admin.php?set=adopts&do=new'>Add a new adoptable</a><br><br>
    <a href='admin.php?set=adopts&do=addlevel'>Add A New Level to an Adoptable</a><br>
    <a href='admin.php?set=adopts&do=editlevels'>Edit Existing Levels or Images</a><br><br>
    <a href='admin.php?set=adopts&do=uploadimg'>Upload a new Adoptable Image</a><br>
    <a href='admin.php?set=adopts&do=manageimg'>Manage or Delete Images</a>"
;
    
    }
    else if(
$do == "new"){


    
//We are creating a new adoptable here...

    
$dynimages getadmimages();

    
$article_title "Create a new adoptable";
    
$article_content "This page allows you to create a new adoptable that will be available to your site's visitors.
    Please fill in the form below and hit the <i>Create Adoptable</i> button below when you're ready to create the adoptable.
<form name='form1' method='post' action='nadopt.php'>
  <p><u><strong>Create A New Adoptable:</strong></u></p>
  <p><strong>Basic Information: </strong></p>
  <p>Adoptable Name: 
    <input name='name' type='text' id='name'>
    <br>
  (This may contain only letters, numbers and spaces) </p>
  <p>Adoptable Description:</p>
  <p>
    <textarea name='description' cols='45' rows='4' id='description'></textarea> 
  </p>
    <p>Price:
    <input name='cost' type='text' id='cost'>
  </p>
  <p>Adoptable's Egg (First) Image: 
    <input name='imageurl' type='text' id='imageurl'>
    <br>
    (Use a full image path, beginning with http://)
  </p>
  <p>OR select an existing image: 
    <select name='existingimageurl' id='existingimageurl'>
      <option value='none' selected>No Existing Image</option>"
.$dynimages."
    </select>
</p>
  <hr>
  <p><strong>Adoption Information and Conditions:</strong></p>
  <p>When can this adoptable be adopted?</p>
  <p>
    <input name='cba' type='radio' value='always'> 
  Always<br>
  <input name='cba' type='radio' value='promo'>
Only when users use this promo code: 
<input name='promocode' type='text' id='promocode'>
<br>
(Promo codes may contain letters and numbers only.  Adoptables using promo codes will be hidden on the adoption screen.) <br>
<input name='cba' type='radio' value='conditions'>
Only when the following conditions are met: (Check the check box next to a condition to enable it)</p>
  <p>
    <input name='freqcond' type='checkbox' id='freqcond' value='enabled'> 
    The adoptable has not been adopted more than 
    <input name='number' type='text' id='number' size='6' maxlength='6'>
times.</p>
  <p>
    <input name='datecond' type='checkbox' id='datecond' value='enabled'> 
    The date is: 
    <input name='date' type='text' id='date'> 
    (For the date, use this format: Year-Month-Day. So, as an example: 2009-06-28)</p>
  <p>
    <input name='maxnumcond' type='checkbox' id='maxnumcond' value='enabled'> 
  The user does not have more than 
  <input name='morethannum' type='text' id='morethannum' size='5' maxlength='5'> 
  of this type of adoptable</p>
  <p>
    <input name='usergroupcond' type='checkbox' id='usergroupcond' value='enabled'> 
    The user is a member of the following usergroup: 
    <select name='usergroups' id='usergroups'>
      <option value='none' selected>No Group Selected</option>"
;
      
// We need to stop here and fetch our usergroups...

    
$query "SELECT * FROM ".$prefix."groups";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$groupname=@mysql_result($result,$i,"groupname");
    
$groupid=@mysql_result($result,$i,"gid");
    
    
$article_content $article_content."<option value='".$groupid."'>".$groupname."</option>";    

    
$i++;
    }

      
   
$article_content $article_content."</select></p>
 
  <hr>
  <p><strong>Alternate Outcomes Settings:</strong></p>
  <p>This section allows you to set if you want to enable alternate outcomes. This setting allows you to specify what the chances are of a user getting an alternate or special version of this adoptable. Check the checkbox below to enable this feature and then fill out the information below.. </p>
  <p><strong>
    <input name='alternates' type='checkbox' id='alternates' value='enabled'>
</strong>Enable Alternate Outcomes </p>
  <p>Alternate Outcomes Selection Information:</p>
  <p>Start using the alternate outcome at level number: 
    <input name='altoutlevel' type='text' id='altoutlevel' size='6' maxlength='6'>
    <br>
    (Use Level 0 to have the alternate outcome be used from birth. This will not affect the first / egg image.) </p>
  <p>The alternate outcome has a chance of 1 in 
    <input name='altchance' type='text' id='altchance' size='6' maxlength='6'>
 of being selected.<br>
 (Here you can select the chance that the alternate images for this adoptable are used. So, for an equal chance of using say male or female images, put 2 in the box to have a 1 out of 2 or 50% chance of using the alternate image. If you want to have the alternate images be rare images, use a higher number, like 100 for a 1 out of 100 chance of using the alternates.)</p>
  <p>
  <p>The Gender Ratio of your adoptable is 
  <input name='genderratio' type='text' id='genderratio' size='6' maxlength='6'> 
  <p>
  <p><strong>Evolution Settings:</strong></p>
  <p>This section allows you to set if you want to enable evolution for your adoptable. </p>
  <p><strong>
    <input name='evolution' type='checkbox' id='evolution' value='yes'>
    </strong>Enable Evolution</p>
  <p>Adoptable evolution Information:</p>
  <p>This adoptable evolves at lv: 
    <input name='evolutionlevel' type='text' id='evolutionlevel' size='6' maxlength='6'>
  </p>
    <br> 
  <p>The evolution form is:
    <input name='evolutionform' type='text' id='evolutionform' size='20' maxlength='20'>
    <br>  
  </p>
  <p>
<input type='submit' name='Submit' value='Create This Adoptable'> 
  </p>
  <p>&nbsp; </p>
</form>"
;  
    

    } 
//End the create a new adoptable form
    
else if($do == "addlevel"){

    if(
$more == ""){

    
$article_title "Add a new level to an adoptable";
    
$article_content "This page allows you to add a new level to an adoptable.  You may add as many levels to an adoptable as
    you wish.  Simply select the adoptable from the drop down list below and hit Submit to get started.
    <form name='form1' method='get' action='admin.php'><p><select name='more' id='more'>
    <option value='select' selected>Select an Adoptable...</option>"
;

    
//Now we select from the database and get a list of all the adoptables we have created thus far...

    
$i 0;
    
$num 0;

    
$query "SELECT * FROM ".$prefix."adoptables";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$adoptable=@mysql_result($result,$i,"type");

    
$article_content $article_content."<option value='".$adoptable."'>".$adoptable."</option>";
    

    
$i++;
    }

    
$article_content $article_content."</select></p><p>
      <input name='set' type='hidden' id='set' value='adopts'>
      <input name='do' type='hidden' id='do' value='addlevel'>
      <input type='submit' name='Submit' value='Submit'></p></form>"
;

    }
    else{

    
// We have an adoptable who we are working with...
    // First let us see if the adoptable actually exists...
    // If it does not, that means someone was playing with the query strings......bad...

    
$i 0;
    
$num 0;

    
$query "SELECT * FROM ".$prefix."adoptables WHERE type='".$more."'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){
    
    
//A record was found in the database, so the adoptable exists
    //Let's see if alternate images are enabled or disabled...

    //Loop out code
    
$i=0;
    while (
$i 1) {

    
$alt=@mysql_result($result,$i,"alternates");

    
$i++;
    }
    
    
$alternatez "DISABLED";
    
    if(
$alt == "enabled"){
    
$alternatez "ENABLED";
    }



    
//Let us see how many levels of this adoptable already exist...

    
$i 0;
    
$num 0;

    

    
$query "SELECT * FROM ".$prefix."levels WHERE adoptiename='".$more."'";
    
$result runquery($query);
    
$numlevels mysql_numrows($result); //This is the number of levels that exist for this adopt
    

    
if($numlevels == ""){
    
$numlevels 0//If nothing is returned, assume no levels exist already...
    
}

    
$editing $numlevels//The current level we are creating...
      
$currentlevel $editing 1;

    
//We need to see how many clicks were required for the previous level

    
$query "SELECT * FROM ".$prefix."levels WHERE adoptiename = '$more' and thisislevel = '$currentlevel'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i 1) {

    
$prevlevelclicks=@mysql_result($result,$i,"requiredclicks");
    
    
$i++;
    }    

    if(
$prevlevelclicks == ""){
    
$prevlevelclicks 0;
    }

    
$dynimages getadmimages();    


    
$article_title "Create a New Level";
    
$article_content "This page will allow you to create a new level for ".$more.".  Right now there are 
    <b>"
.$numlevels."</b> levels that exist for ".$more.".  That means that you are creating <b>Level ".$editing."</b> for ".$more."
    right now.<br><br><b><u>To create the level, fill out the form below:</u></b>
    
    <form name='form1' method='post' action='newlevelpost.php'>
  <p><u>Primary Image URL:</u></p>
  <p>Hosted Image: 
    <input name='primaryhosted' type='text' id='primaryhosted'>
</p>
  <p>OR Select an Existing Image:</p>
  <p>
    <select name='primarylocal' id='primarylocal'>
      <option value='none' selected>Use Remote Image</option>"
.$dynimages."</select> 
  </p>
  <p><u>Alternate  Image URL:</u> </p>
  <p>The alternate image URLs will only be used if you enabled alternate images for this adoptable type AND the user randomly draws the alternate images.</p>
  <p>Alternate Images are <strong>"
.$alternatez."</strong> for this adoptable. </p>
  <p>Hosted Image:
    <input name='althosted' type='text' id='althosted'>
</p>
  <p>OR Select an Existing Image:</p>
  <p>
    <select name='altlocal' id='altlocal'>
      <option value='none' selected>Use Remote Image</option>"
.$dynimages."
    </select>
</p>
  <p><u>Required Clicks: </u></p>
  <p>How many clicks are required to reach this level?</p>
  <p>
    <input name='reqclicks' type='text' id='reqclicks' size='6' maxlength='6'> 
  </p>
  <p>The previous level required <strong>"
.$prevlevelclicks."</strong> clicks, so the number you enter here should be larger than <strong>".$prevlevelclicks ."</strong>. </p>
  <p><u>Reward:</u></p>
  <p>You can choose to reward the user because their adoptable reached this level. </p>
  <p>
    <input name='isreward' type='checkbox' id='isreward' value='yes'> 
    Give the user a reward </p>
  <p>Enter a promo code in the box below that will be the user's reward. This can be used to give the user access to a new exclusive adoptable using the Promo Code system. </p>
  <p>Reward Code / Promo Code: 
    <input name='rewardcode' type='text' id='rewardcode'>
    <br>
    (This can only contain letters and numbers) </p>
  <p>
    <input name='adoptiename' type='hidden' id='adoptiename' value='"
.$more."'>
    <input name='islevel' type='hidden' id='islevel' value='"
.$editing."'>
    <input name='prevclix' type='hidden' id='prevclix' value='"
.$prevlevelclicks."'>
    <input type='submit' name='Submit' value='Create Level'>
  </p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</form>"
;

    


    }
    else{
    
$article_title "An error has occurred";
    
$article_content "It appears that the adoptable you selected does not exist in the database.  If it does exist, please
    contact <a href='http://www.mysidiaadoptables.com/forum' target='_blank'>Mysidiaadoptables Scripts</a> and let us know that an error has occurred."
;
    }


    } 
//End the process for adding a new level

    
//End the add new level do setting
    
else if($do == "uploadimg"){

    
// We are uploading a new adoptable image to the site...

    
$article_title "Upload a new image";
    
$article_content "This page allows you to upload a new adoptable image to the server.  You may upload .gif or .jpg images no greater than 150 KB using the form below.
    Uploaded images will be selectable from the drop down list of images when working with adoptables.<br>
    <form enctype='multipart/form-data' method='post' action='admuploadpic.php'>
  <p>Friendly  Name: 
    <input name='ffn' type='text' id='ffn'>
</p>
  <p>Enter a name for this image that will appear in the image drop down box for this image. This is here so you can remember what this image is. A good name would be something like <strong>Dog Adoptable Level 3</strong> so you remember what the image is.</p>
  <p>File to Upload: <input name='uploadedfile' type='file'></p>
  <p>
    <input type='submit' name='Submit' value='Upload File'> 
   </p>
</form>"
;


// End the upload new image do setting
else if($do == "editlevels"){

// Editing LEVELS for adoptables...

if($more == ""){

// We haven't selected an adoptable whose levels to edit yet...

    
$article_title "Edit an adoptable's levels";
    
$article_content "Here you can edit levels and images for existing adoptables.  Please select the adoptable whose levels you wish to edit.<br>

    <form name='form1' method='get' action='admin.php'><p><select name='more' id='more'>
    <option value='select' selected>Select an Adoptable...</option>"
;

    
//Now we select from the database and get a list of all the adoptables we have created thus far...

    
$i 0;
    
$num 0;

    
$query "SELECT * FROM ".$prefix."adoptables";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$adoptable=@mysql_result($result,$i,"type");

    
$article_content $article_content."<option value='".$adoptable."'>".$adoptable."</option>";
    

    
$i++;
    }

    
$article_content $article_content."</select></p><p>
      <input name='set' type='hidden' id='set' value='adopts'>
      <input name='do' type='hidden' id='do' value='editlevels'>
      <input type='submit' name='Submit' value='Submit'></p></form>"
;


}
else{

// We're working with an adoptable and its levels...

// First we check if the adoptable exists or not...

    
$query "SELECT * FROM ".$prefix."adoptables WHERE type='".$more."'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){

    
//Loop out code
    
$i=0;
    while (
$i 1) {

    
$adoptabletype=@mysql_result($result,$i,"type");
    
$eggimage=@mysql_result($result,$i,"eggimage");
    

    
$i++;
    }

    if(
$evenmore == "" or !is_numeric($evenmore)){

    
// We are showing the table with all of the levels

    
$article_title "Editing Levels for ".$adoptabletype." adoptables";
    
$article_content "This page allows you to view and edit the levels and images for existing adoptables of this type.
    There are restrictions on what can be edited or deleted as deleting the wrong thing or changing the wrong setting could severely break your adoptables.
    Changing an adoptable level image here will change it for all users with an adoptable of that type at that image.  Listed below are all of the levels for this adoptable type.  
    <br><br>
    <table width='680' border='1'>
  <tr>
    <td width='58'><strong>Level:</strong></td>
    <td width='240'><strong>Image:</strong></td>
    <td width='100'><strong>Alt Image: </strong></td>
    <td width='107'><strong>Clicks Required: </strong></td>
    <td width='108'><strong>Reward Given: </strong></td>
    <td width='33'><strong>Edit:</strong></td>
  </tr>"
;

// Select all of the images / levels for this adoptable

    
$query "SELECT * FROM ".$prefix."levels WHERE adoptiename='".$more."' ORDER BY thisislevel ASC";
    
$result runquery($query);
    
$num mysql_numrows($result);


    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$thisislevel=@mysql_result($result,$i,"thisislevel");
    
$requiredclicks=@mysql_result($result,$i,"requiredclicks");
    
$primaryimage=@mysql_result($result,$i,"primaryimage");
    
$alternateimage=@mysql_result($result,$i,"alternateimage");
    
$reward=@mysql_result($result,$i,"rewarduser");

    
$altdisplay "<img src='templates/icons/no.gif'>";
    
    if(
$alternateimage != ""){
    
$altdisplay "<img src='".$alternateimage."'>";
    }

    
$rewarddisplay "<img src='templates/icons/no.gif'>";
    
    if(
$reward == "yes"){
    
$rewarddisplay "<img src='templates/icons/yes.gif'>";
    }

    
$article_content $article_content."<tr>
    <td><center>"
.$thisislevel."</center></td>
    <td><center><img src='"
.$primaryimage."'></center></td>
    <td><center>"
.$altdisplay."</center></td>
    <td><center>"
.$requiredclicks."</center></td>
    <td><center>"
.$rewarddisplay."</center></td>
    <td><center><a href='admin.php?set=adopts&do=editlevels&more="
.$adoptabletype."&evenmore=".$thisislevel."'><img src='templates/icons/cog.gif' border=0></a></center></td>
  </tr>"
;

    
$i++;
    }

$article_content $article_content."</table><br>
<b><a href='admin.php?set=adopts&do=addlevel&more="
.$more."'><img src='templates/icons/add.gif' border=0> Add a new level to this adoptable type.</a></b>";

    }
    else{

    
// We are editing a specific level

    
$query "SELECT * FROM ".$prefix."levels WHERE adoptiename='".$more."' and thisislevel='".$evenmore."'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){

    
//Loop out code
    
$i=0;
    while (
$i 1) {

    
$thisislevel=@mysql_result($result,$i,"thisislevel");
    
$requiredclicks=@mysql_result($result,$i,"requiredclicks");
    
$primaryimage=@mysql_result($result,$i,"primaryimage");
    
$alternateimage=@mysql_result($result,$i,"alternateimage");
    
$reward=@mysql_result($result,$i,"rewarduser");
    
$promocode=@mysql_result($result,$i,"promocode");

    if(
$alternateimage == ""){
    
$alternateimage "templates/icons/no.gif";
    }

    
$i++;
    }

    
$remark "<input name='reward' type='checkbox' id='reward' value='yes'>";

    if(
$reward == "yes"){
    
$remark "<input name='reward' type='checkbox' id='reward' value='yes' checked>";
    }

    
$prmark "<input name='promocode' type='text' id='promocode'>";

    if(
$prmark != ""){
    
$prmark "<input name='promocode' type='text' id='promocode' value='".$promocode."'>";
    }

    
$dynimages getadmimages();

    
$article_title "Editing level ".$thisislevel." for ".$more;
    
$article_content "Here you can edit this level for this adoptable.<br><form name='form1' method='post' action='admpost.php'>
  <p><b><u>Primary Image for This Level:</u></b></p>
  <p><img src='"
.$primaryimage."'></p>
  <p>Change Image To: 
    <select name='primimg' id='primimg'>
      <option value='nochange' selected>Do Not Change</option>"
.$dynimages."
    </select>
  </p>
  <p><b><u>Alternate Image for This Level:</u></b></p>
  <p><img src='"
.$alternateimage."'></p>
  <p>Change Image To:
    <select name='altimg' id='altimg'>
      <option value='nochange' selected>Do Not Change</option>"
.$dynimages."
    </select>
</p>
  <p>
    "
.$remark."
Reward the user for reaching this level</p>
  <p>Use the following promo code as the reward:</p>
  <p>
    "
.$prmark."
  </p><p>  
  <strong>Required Clicks</strong><br>
    <input name='klikks' type='checkbox' id='klikks' value='yes'> Change the number of required clicks. It is currently at <strong>"
.$requiredclicks."</strong><br>
    <input name='newklikks' type='text' id='newklikks'>
    <input name='page' type='hidden' id='page' value='editadoptlevel'>
    <input name='type' type='hidden' id='type' value='"
.$more."'>
    <input name='thisislevel' type='hidden' id='thisislevel' value='"
.$evenmore."'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Submit Edits'>
</p>
</form>"
;
    

    }
    else{

    
$article_title "Adoptable Level Not Found";
    
$article_content "The level appears to be invalid.  Please go back and try again.";

    }

    }


    }
    else{

    
$article_title "Adoptable Not Found";
    
$article_content "An adoptable with the specified name was not found.  Please go back and make sure you selected a valid adoptable.";
    
    }

}

// END the edit levels page...
else if($do == "edit"){

// We are expecting an adoptable to be submitted here already...
// Now we check if it exists...

    
$query "SELECT * FROM ".$prefix."adoptables WHERE type='".$more."'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$adoptabletype=@mysql_result($result,$i,"type");
    
$description=@mysql_result($result,$i,"description");
    
$eggimage=@mysql_result($result,$i,"eggimage");
    
$whenisavail=@mysql_result($result,$i,"whenisavail");

    
$i++;
    }

    if(
$whenisavail != "always" and $whenisavail != ""){
    
$availtxt "<b>This adoptable currently has adoption restrictions on it.</b>";
    }
    else{
    
$availtxt "This adoptable currently does not have adoption restrictions on it.";
    }

    
$dynimages getadmimages();

    
// Output the form to the user...

    
$article_title "Editing ".$more;
    
$article_content "<img src='".$eggimage."'><br>This page allows you to edit ".$more.".  Use the form below to edit (or delete) ".$more.".<br>
    <form name='form1' method='post' action='admpost.php'>
  <p><u><strong>Egg Image: </strong></u></p>
  <p>If you wish to change the egg image for this adoptable, you may do so below. </p>
  <p>Select a New Egg Image: 
    <select name='select'>
      <option value='nochange' selected>Do Not Change</option>"
.$dynimages."
        </select>
</p>
  <p><u><strong>Adoptable Freeze and Delete Settings: </strong></u></p>
  <p>
    <input name='delete' type='checkbox' id='delete' value='yes'>
    <strong>I want to delete or freeze this adoptable </strong></p>
  <p>What sort of delete do you wish to perform for this adoptable?</p>
  <p>
    <input name='deltype' type='radio' value='freeze'> 
    Freeze Deletion - This will not delete the adoptable, but will freeze it to all new adoptions by members of your site. You can undo this by checking the <em>Remove all adoption conditions from this adoptable</em> checkbox the next time you edit this adoptable. </p>
  <p>
    <input name='deltype' type='radio' value='soft'> 
    Soft Delete (Adoptable Retirement) - This option will do a soft delete of this adoptable from your system. Selecting this option will remove the egg image level for this adoptable from your system. Any users who have this type of adoptable as an egg will have them automatically leveled up to Level 1 for this adoptable type. This option closes the adoptable to new adoptions, but will not affect users who already adopted this creature. Note that once you do a soft delete you will no longer be able to edit the levels associated with that adoptable, so think about this carefully. </p>
  <p>
    <input name='deltype' type='radio' value='hard'>
Hard Deletion (Purge) - This option will permanentally delete this adoptable from your site. Any users currently using this adoptable will have it deleted by the system. All levels for this adoptable will be purged. <strong>This cannot be undone! </strong></p>
  <p><u><strong>Adoptable Adoption Conditions: </strong></u></p>
  <p>"
.$availtxt."</p>
  <p>
    <input name='resetconds' type='checkbox' id='resetconds' value='yes'> 
    <strong>Remove all adoption conditions from this adoptable. </strong>- This will remove all restrictions on the adoption of this creature, including promo codes.</p>
  <p>
    <input name='resetdate' type='checkbox' id='resetdate' value='yes'> 
  Reset only the date condition for this adoptable to the following value:</p>
  <p>    <input name='date' type='text' id='date'> 
  (Ex: 2009-06-28)</p>
  <p>This setting allows you to change the date that an adoptable is available to a new date. This is handy if you only want the adoptable to be available certain times in a given year.
    <input name='page' type='hidden' id='page' value='editanadopt'>
    <input name='type' type='hidden' id='type' value='"
.$more."'>
</p>
  <p>
    <input type='submit' name='Submit' value='Submit Changes'> 
  </p>
</form>"
;
    


    }
    else{

    
// Adoptable doesn't exist...

    
$article_title "Adoptable Does Not Exist";
    
$article_content "The specified adoptable does not exist in the database.  Try going back and trying again.";

    }


// END the edit an adoptable's egg page...
else if($do == "manageimg"){

// This page manages images...

$article_title "Image Management";
$article_content "This page allows you to manage and delete all of the images that you have uploaded to your server.
You can select the image you wish to delete by selecting it with the button next to it.  Once you delete an image, it's gone, but you can always reupload it.
Please note that if you delete an image that is in use by any of your members or adoptables this may break their adoptables.<br>
<form name='form1' method='post' action='admpost.php'>"
;

// Begin the database image pull...

    
$query "SELECT * FROM ".$prefix."filesmap";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$iid=@mysql_result($result,$i,"id");
    
$wwwpath=@mysql_result($result,$i,"wwwpath");
    
    
$article_content $article_content."<p><img src='".$wwwpath."'></p><p>
    <input name='iid' type='radio' value='"
.$iid."'> Delete This Image 
  </p>
  "
;    

    
$i++;
    }

$article_content $article_content."<p>    
    <input name='page' type='hidden' id='page' value='delimg'>
<input type='submit' name='Submit' value='Submit'>
  </p>
</form>"
;


}
}
else{

$article_title "Access Denied";
$article_content "Your usergroup does not seem to have the permission to edit the adoptables settings...";


//This bracket ends the check of whether or not this user can access the adopts portion of the ACP


//This bracket ends the "adopts" if / else block...
else if($set == "content"){

// Check if we have permissions to access here...

$canedit cando($group"canmanageadopts");

if(
$canedit == "yes"){

// We can edit pages!

if($do == ""){

//Not working on a specific page...

$article_title "Page and Content Editor";
$article_content "Here you can edit the content that appears on your site.  Here you can edit your home page, terms of service page, and more.  You can also create new pages as needed below.
<br><br><b><a href='admin.php?set=content&do=new'><img src='templates/icons/add.gif' border=0> Add a new page</a></b><p><b><u>Your Existing Pages:</u></b></p>
<table width='575' border='1'>
  <tr>
    <td width='150'><strong>Page URL: </strong></td>
    <td width='175'><strong>Page Title: </strong></td>
    <td width='32'><strong>Edit:</strong></td>
    <td width='51'><strong>Delete:</strong></td>
  </tr>"
;

$query "SELECT * FROM ".$prefix."content";
    
$result runquery($query);
    
$num mysql_numrows($result);

    while (
$i $num) {

    
$ourpage=@mysql_result($result,$i,"page");
    
$title=@mysql_result($result,$i,"title");

    if(
$ourpage == "index" or $ourpage == "tos"){
    
$showdelete "";
    }
    else{
    
$showdelete "<center><a href='admin.php?set=content&do=delete&more=".$ourpage."'><img src='templates/icons/delete.gif' border=0></a></center>";
    }

    
$article_content $article_content."<tr>
    <td>"
.$ourpage."</td>
    <td>"
.$title."</td>
    <td><center><a href='admin.php?set=content&do=edit&more="
.$ourpage."'><img src='templates/icons/cog.gif' border=0></a></center></td>
    <td>"
.$showdelete."</td>
  </tr>
"
;

    
$i++;
    
    }


$article_content $article_content."</table>";

}
else if(
$do == "new"){

$article_title "Create a new page";
$article_content "Here you can create a new page for your site.  You can use the buttons above the textarea below to insert BBCODE into the form.
<br><form name='form1' method='post' action='admpost.php'>
  <p>Page URL: 
    <input name='pageurl' type='text' id='pageurl'><br>
<br><u>Pages will appear at:</u><br> http://www."
.$domain."".$scriptpath."/<b>pages.php?page=pageurl</b>  
<br>The page url may contain letters and numbers only and may not include spaces.
</p>
  <p>Page Title: 
    <input name='pagetitle' type='text' id='pagetitle'>
</p>
  <p>Page Content: </p>
  <p><input type=\"button\" value=\"Bold\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[b]Bold Text Here[/b]'\">
<input type=\"button\" value=\"Italics\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[i]Italic Text Here[/i]'\"> 
<input type=\"button\" value=\"Underline\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[u]Underlined Text Here[/u]'\">
<input type=\"button\" value=\"URL / Link\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[url=http://www.yoursite.com]Link text goes here[/url]'\">
<input type=\"button\" value=\"Image\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[img]http://www.somesite.com/images/someimage.gif[/img]'\">
<input type=\"button\" value=\"Links a Text\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[urlsame=]Linked Text Here[/urlsame]'\">
<input type=\"button\" value=\"Striking Format\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[s]Strike Text Here[/s]'\">
<input type=\"button\" value=\"Youtube Video\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[youtube]http://www.youtube.com/videoname[/youtube]'\">
<input type=\"button\" value=\"User Profile\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[profile]Username[/profile]'\">
<input type=\"button\" value=\"Image Maps\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[imgmap]http://www.urlhere.com/[/imgmap]'\">
<input type=\"button\" value=\"Map Locations\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[map][where=#,#,#,#=http://www.firstlinkhere.com/][wherecirc=#,#,#=http://www.secondinkhere.com/][/map]'\">




    <br><textarea name='pagecontent' cols='45' rows='10' id='pagecontent'></textarea> 
  </p>
  <p>
    <input name='page' type='hidden' id='page' value='pages'>
    <input name='type' type='hidden' id='type' value='newpage'>
    <input type='submit' name='Submit' value='Create New Page'>
  </p>
</form>
</p>"
;

}
else if(
$do == "delete"){

// Delete a page...

if($more != "index" and $more != "tos"){

    
$query "DELETE FROM ".$prefix."content WHERE page='".$more."'";
    
runquery($query);

    
$article_title "Page Deleted Successfully";
    
$article_content "The page with the name <b>".$more."</b> has been deleted.<br><br><a href='admin.php'>ACP Home</a>";
    }
    else{
    
$article_title "Error";
    
$article_content "The page you tried to delete is a special page and cannot be deleted. <br><br> <a href='admin.php?set=content'>Return to the Pages Editor</a>";
    }

}
else if(
$do == "edit"){

$article_title "Edit a Page";

if(
$more != ""){

$article_content "Here you can edit an existing page:<br>";

//Select the page info from the database...

    
$pageinfo getsitecontent($more);
    
$pagetitle $pageinfo[title];
    
$pagecontent $pageinfo[content];

    
$pagetitle stripslashes($pagetitle);
    
$pagecontent stripslashes($pagecontent);


if(
$pagetitle != "" or $pagecontent != ""){

$article_content $article_content="Here you can edit an existing page.  Use the text editor below to change the page title or content.
You may use some limited BBCodes in the box below.<br><form name='form1' method='post' action='admpost.php'>
  <p><b><u>Currently Editing Page:</u> "
.$more."</b>
    <input name='pageurl' type='hidden' id='pageurl' value='"
.$more."'>
</p>
  <p>Page Title: 
    <input name='pagetitle' type='text' id='pagetitle' value='"
.$pagetitle."'>
</p>
  <p>Page Content: </p>
  <p><input type=\"button\" value=\"Bold\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[b]Bold Text Here[/b]'\">
<input type=\"button\" value=\"Italics\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[i]Italic Text Here[/i]'\"> 
<input type=\"button\" value=\"Underline\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[u]Underlined Text Here[/u]'\">
<input type=\"button\" value=\"URL / Link\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[url=http://www.yoursite.com]Link text goes here[/url]'\">
<input type=\"button\" value=\"Image\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[img]http://www.somesite.com/images/someimage.gif[/img]'\">
<input type=\"button\" value=\"Links a Text\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[urlsame=]Linked Text Here[/urlsame]'\">
<input type=\"button\" value=\"Striking Format\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[s]Strike Text Here[/s]'\">
<input type=\"button\" value=\"Youtube Video\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[youtube]http://www.youtube.com/videoname[/youtube]'\">
<input type=\"button\" value=\"User Profile\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[profile]Username[/profile]'\">
<input type=\"button\" value=\"Image Maps\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[imgmap]http://www.urlhere.com/[/imgmap]'\">
<input type=\"button\" value=\"Map Locations\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[map][where=#,#,#,#=http://www.firstlinkhere.com/][wherecirc=#,#,#=http://www.secondinkhere.com/][/map]'\">



    <br><textarea name='pagecontent' cols='45' rows='10' id='pagecontent'>"
.$pagecontent."</textarea> 
  </p>
  <p>
    <input name='page' type='hidden' id='page' value='pages'>
    <input name='type' type='hidden' id='type' value='editpage'>
    <input type='submit' name='Submit' value='Edit Page Content'>
  </p>
</form>
"
;
}
else{
$article_title "Page does not exist";
$article_content "<p>Page does not exist!</p>";
}
}
else{

$article_title "Page does not exist";
$article_content "<p>Page does not exist!</p>";

}
}

}
else{

$article_title "Access Denied";
$article_content "Your usergroup does not seem to have the permission to edit the site content settings...";

}



// End the set=content block ... start a new setting here...
else if($set == "users"){



$canedit cando($group"canmanageusers");

if(
$canedit == "yes"){

// We are managing users...

if($do == "edit"){

    
$user $more;
    
    
$query "SELECT * FROM ".$prefix."users WHERE username = '".$user."'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){

    
//The user actually exists, so allow us to edit them...
    
$article_title "User Editor - Editing ".$user."'s Account";
    
$article_content "Here you can edit the user's account using the form below.<br>";

    
$i=0;
    while (
$i 1) {

    
$email=@mysql_result($result,$i,"email");
    
$usergroup=@mysql_result($result,$i,"usergroup");

    
$i++;
    }


    
//************************************************************************************************
    // BEGIN THE FORM
    //************************************************************************************************

    
$article_content $article_content."<form name='form1' method='post' action='admpost.php'>
  <p>
    <input name='delete' type='checkbox' id='delete' value='yes'> 
  <img src='templates/icons/delete.gif'> Delete This User. <strong>This cannot be undone!</strong></p>
  <p>Assign New Password: 
    <input name='pass1' type='password' id='pass1'>
</p>
  <p>Passwords may contain letters and numbers only. Leave the box blank to keep the current password.</p>
  <p>
    <input name='emailpwchange' type='checkbox' id='emailpwchange' value='yes'> 
    Email the user the new password (Only takes effect if setting a new password) </p>
  <p>Change Email Address: 
    <input name='email' type='text' id='email' value='"
.$email."'>
</p>
  <p>
    <input name='bantrade' type='checkbox' id='bantrade' value='yes'> 
    Ban this user's rights to trade adoptables </p>
<p><u>"
.$user."'s Current Usergroup:</u> Group ".$usergroup."</p>
  <p>Change "
.$user."'s Usergroup To:<br>
    <select name='level' id='level'>
      <option value='nochange' selected>Do not change</option>"
;
      
// We need to stop here and fetch our usergroups...

    
$query "SELECT * FROM ".$prefix."groups";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$groupname=@mysql_result($result,$i,"groupname");
    
$groupid=@mysql_result($result,$i,"gid");
    
    
$article_content $article_content."<option value='".$groupid."'>Group ".$groupid." :: ".$groupname."</option>";    

    
$i++;
    }

$article_content $article_content."</select>
  </p>

  <p>    <input name='page' type='hidden' id='page' value='users'>
    <input name='username' type='hidden' id='username' value='"
.$user."'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Submit'>
</p>
</form>"
;

    }
    else{
    
$article_title "User Does Not Exist!";
    
$article_content "You cannot edit this user because they do not exist!";

    }

    }

 else if(
$do == "adoptables"){
    if(
$more == ""){
          
$article_title "Manage Adoptables";
        
$article_content "This page allows you to manage each adoptable owned by users registered on your site. Only admins who can edit users and usergroups can carry out this task.
        Use the table below to edit existing adoptables, or click the link below to create a new adoptable for a user.<br><br>
    <b><a href='admin.php?set=users&do=adoptables&more=new'><img src='templates/icons/add.gif' border=0> Create a New Owned Adoptables</a></b><p></p><table width='680' border='1'><tr>
    <td><strong>Adoptables ID:</strong></td>
    <td><strong>Adoptables Type: </strong></td>
    <td><strong>Adoptables Name: </strong></td>
    <td><strong>Adoptables Owner: </strong></td>
    <td><strong>Adoptables Gender: </strong></td>
    <td><strong>Edit:</strong></td>
    <td><strong>Delete:</strong></td>
    </tr>"
;

 
// Get the adoptables from the database...

    
$query "SELECT * FROM ".$prefix."owned_adoptables";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

            
$aid=@mysql_result($result,$i,"aid");
            
$type=@mysql_result($result,$i,"type"); 
            
$name=@mysql_result($result,$i,"name");
            
$totalclicks=@mysql_result($result,$i,"totalclicks");
            
$currentlevel=@mysql_result($result,$i,"currentlevel"); 
            
$usealternates=@mysql_result($result,$i,"usealternates");
            
$isfrozen=@mysql_result($result,$i,"isfrozen");
            
$owner=@mysql_result($result,$i,"owner");
            
$gender=@mysql_result($result,$i,"gender");

    
$editimage "<a href='admin.php?set=users&do=adoptables&more=edit&evenmore=".$aid."'><img src='templates/icons/cog.gif' border=0></a>";
    
$deleteimage "<a href='admin.php?set=users&do=adoptables&more=delete&evenmore=".$aid."'><img src='templates/icons/delete.gif' border=0></a>";
    

    
// Finally we can show this table to the user...

    
$article_content $article_content."<tr>
    <td>"
.$aid."</td>
    <td>"
.$type."</td>
    <td><div align='center'>"
.$name."</div></td>
    <td><div align='center'>"
.$owner."</div></td>
    <td><div align='center'>"
.$gender."</div></td>
    <td><div align='center'>"
.$editimage."</div></td>
    <td><div align='center'>"
.$deleteimage."</div></td>
  </tr>"
;
    
    

    
$i++;
    }

    
$article_content $article_content."</table>";
    
    }   

else if(
$more == "new"){

         
// We are now creating a new adoptable 
         
$article_title "Create an adoptable for a user";
         
$article_content "This page allows you to create a new adoptable for a given user on your site.
         Please fill in the form below and hit the <i>Create Adoptable</i> button below when you're ready to create this adoptable.
         <form name='form1' method='post' action='cadopt.php'>
         <p><u><strong>Create A New Adoptable For a User:</strong></u></p>
         <p><strong>Basic Information: </strong></p>
         <p>Adoptable Type: 
         <input name='type' type='text' id='type'>
         <br>
         <p>Adoptable Name: 
         <input name='name' type='text' id='name'>
         <br>
         <p>Adoptable Owner: 
         <input name='owner' type='text' id='owner'>
         <br>
         <p>Adoptable Clicks: 
         <input name='clicks' type='text' id='clicks'>
         <br>
         <p>Adoptable Level: 
         <input name='level' type='text' id='level'>
         <br>
         <p>Use Alternative?
         <input name='usealternates' type='text' id='usealternates'>
         <br>
         <p>Adoptable Gender
         <input name='gender' type='text' id='gender'>
         <br>
         <p>
         <input type='submit' name='Submit' value='Create This Adoptable'> 
         </p>
         <p>&nbsp; </p>
         </form>"
;
      }   

      else if(
$more == "edit"){
          
// We are editing an existing owned adoptable.
          // $evenmore is the adoptable ID...
      
          
$aid $evenmore;
 
          
$query "SELECT * FROM ".$prefix."owned_adoptables WHERE aid='$aid'";
          
$result runquery($query);
          
$num mysql_numrows($result);
  
          if(
$num 0){
          
// This owned adoptable exists, so fetch some basic information...   

          
$article_title "Owned Adoptables Editor - Editing ".$aid."'s Data";
          
$article_content "Here you can edit this owned adoptable using the form below.<br>";

          
//Loop out code
          
$i=0;
            while (
$i 1) {

            
$aid=@mysql_result($result,$i,"aid");
            
$type=@mysql_result($result,$i,"type"); 
            
$name=@mysql_result($result,$i,"name");
            
$totalclicks=@mysql_result($result,$i,"totalclicks");
            
$currentlevel=@mysql_result($result,$i,"currentlevel"); 
            
$usealternates=@mysql_result($result,$i,"usealternates");
            
$isfrozen=@mysql_result($result,$i,"isfrozen");
            
$owner=@mysql_result($result,$i,"owner");
            
$gender=@mysql_result($result,$i,"gender");

            
$i++;
            }

          
$article_content $article_content."<form name='form1' method='post' action='eadopt.php'>
          <p>Change Adoptable's Type: 
          <input name='type' type='text' id='type' value='"
.$type."'>
          </p>
          <p>Change Adoptable's Name: 
          <input name='name' type='text' id='name' value='"
.$name."'>
          </p>
          <p>Change Adoptable's Owner: 
          <input name='owner' type='text' id='owner' value='"
.$owner."'>
          </p>
          <p>Change Adoptable's total clicks: 
          <input name='totalclicks' type='text' id='totalclicks' value='"
.$totalclicks."'>
          </p>
          <p>Change Adoptable's current level: 
          <input name='currentlevel' type='text' id='currentlevel' value='"
.$currentlevel."'>
          </p> 
          <p>Change Adoptable's gender: 
          <input name='gender' type='text' id='gender' value='"
.$gender."'>
          </p> 
          <input name='aid' type='hidden' id='aid' value='"
.$aid."'>
          <p>
          <input type='submit' name='Submit' value='Submit'>
          </p>
          </form>"
;
        } 
      } 
 
     else if(
$more == "delete"){
        
$aid $evenmore;

        
// We are deleting an owned adoptable...

        
$query "DELETE FROM ".$prefix."owned_adoptables WHERE aid='".$evenmore."'";
        
runquery($query);

        
$article_title "Adoptable Deleted";
        
$article_content "This owned adoptable has been deleted successfully.";
    

        } 

  }  


    else if(
$do == "groups"){

    
//******************************************************************************************************
    // USERGROUP MANAGEMENT PAGE HERE >>>
    //******************************************************************************************************
    
    
if($more == ""){

    
// No action specified for the usergroups, so show some basic information...

    
$article_title "Manage Usergroups";
    
$article_content "This page allows you to manage the usergroups available to you and your site's users.  
    Usergroups are a powerful feature as they determine who can access what parts of the site and which functions they can use.
    Here you can create and manage administrative user groups, artist user groups, donator user groups, custom user groups, and more.
    Use the table below to edit existing usergroups, or click the link below to create a custom usergroup.<br><br>
    <b><a href='admin.php?set=users&do=groups&more=new'><img src='templates/icons/add.gif' border=0> Create a New Usergroup</a></b><p></p><table width='680' border='1'><tr>
    <td><strong>Group ID:</strong></td>
    <td><strong>Group Name: </strong></td>
    <td><strong>Can Adopt Pets: </strong></td>
    <td><strong>Can Use PM System: </strong></td>
    <td><strong>Can Access Admin CP: </strong></td>
    <td><strong>Edit:</strong></td>
    <td><strong>Delete:</strong></td>
  </tr>"
;

    
// Get the usergroups from the database...

    
$query "SELECT * FROM ".$prefix."groups";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$groupname=@mysql_result($result,$i,"groupname");
    
$groupid=@mysql_result($result,$i,"gid");
    
$canadopt=@mysql_result($result,$i,"canadopt");
    
$canpm=@mysql_result($result,$i,"canpm");
    
$cancpx=@mysql_result($result,$i,"cancp");

    if(
$canadopt == "yes"){
    
$canadoptimg "<img src='templates/icons/yes.gif'>";
    }
    else{
    
$canadoptimg "<img src='templates/icons/no.gif'>";
    }

    if(
$canpm == "yes"){
    
$canpmimg "<img src='templates/icons/yes.gif'>";
    }
    else{
    
$canpmimg "<img src='templates/icons/no.gif'>";
    }

    if(
$cancpx == "yes"){
    
$cancpimg "<img src='templates/icons/yes.gif'>";
    }
    else{
    
$cancpimg "<img src='templates/icons/no.gif'>";
    }

    if(
$groupname == "rootadmins" or $groupname == "registered"){
    
$editimage "";
    
$deleteimage "";
    }
    else{
    
$editimage "<a href='admin.php?set=users&do=groups&more=edit&evenmore=".$groupid."'><img src='templates/icons/cog.gif' border=0></a>";
    
$deleteimage "<a href='admin.php?set=users&do=groups&more=delete&evenmore=".$groupid."'><img src='templates/icons/delete.gif' border=0></a>";
    
    }

    
// Finally we can show this table to the user...

    
$article_content $article_content."<tr>
    <td>"
.$groupid."</td>
    <td>"
.$groupname."</td>
    <td><div align='center'>"
.$canadoptimg."</div></td>
    <td><div align='center'>"
.$canpmimg."</div></td>
    <td><div align='center'>"
.$cancpimg."</div></td>
    <td><div align='center'>"
.$editimage."</div></td>
    <td><div align='center'>"
.$deleteimage."</div></td>
  </tr>"
;
    
    

    
$i++;
    }

    
$article_content $article_content."</table>";
    
    }
    else if(
$more == "new"){

    
// Show the user a form to make a new usergroup...

    
if($evenmore == ""){

    
// We are showing a form to make a new usergroup...

    
$article_title "Make a New Usergroup";
    
$article_content "This page allows you to make a new usergroup.  Type in the desired name of the new usergroup in the box below to get started.
    Your usergroup will be created based on the registered usergroup's template.  You can then edit the group's settings as desired.<br>
<form name='form1' method='get' action='admin.php'>
  <p>New Usergroup Name:</p>
  <p>
    <input name='evenmore' type='text' id='evenmore'>
    <input name='set' type='hidden' id='set' value='users'>
    <input name='do' type='hidden' id='do' value='groups'>
    <input name='more' type='hidden' id='more' value='new'>
</p>
  <p>
    <input type='submit' name='Submit' value='Create New Usergroup'>
  </p>
</form>"
;

    }
    else{

    
// We are actually making the usergroup in the DB...

    // First we check that a group with that name doesn't already exist...

    
$query "SELECT * FROM ".$prefix."groups WHERE groupname='$evenmore'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){
    
    
// Group already exists, so show error...

    
$article_title "Error";
    
$article_content "A group already exists with the name specified.  Please <a href='admin.php?set=users&do=groups&more=new'>go back</a> and choose a different group name.";
    
    }
    else{

    
// Create the usergroup...

    
runquery("INSERT INTO ".$prefix."groups VALUES ('', '$evenmore', 'yes','yes','no','no', 'no', 'no','no','no')");

    
$article_title "Group Created Successfully";
    
$article_content "A usergroup with the name ".$evenmore." has been created successfully.  Please <a href='admin.php?set=users&do=groups'>click here</a> to return to the group manager and edit this group.";

    }


    }
    

    }
    else if(
$more == "edit"){

    
// We are editing an existing usergroup...
    // $evenmore is the group ID...

    
$query "SELECT * FROM ".$prefix."groups WHERE gid='$evenmore'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){

    
// The group exists, so fetch some basic group information...

    /////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////

    // WE ARE EDITING A SINGLE USERGROUP, NOT TO BE CONFUSED WITH THE CODE
    // ABOVE TO SHOW ALL THE USERGROUPS IN A TABLE...

    /////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////
    
    
    //Loop out code
    
$i=0;
    while (
$i 1) {

    
$groupname=@mysql_result($result,$i,"groupname");
    
$groupid=@mysql_result($result,$i,"gid");
    
$canadopt=@mysql_result($result,$i,"canadopt");
    
$canpm=@mysql_result($result,$i,"canpm");
    
$cancpx=@mysql_result($result,$i,"cancp");
    
$cma=@mysql_result($result,$i,"canmanageadopts");
    
$cmc=@mysql_result($result,$i,"canmanagecontent");
    
$cmads=@mysql_result($result,$i,"canmanageads");
    
$cms=@mysql_result($result,$i,"canmanagesettings");
    
$cmu=@mysql_result($result,$i,"canmanageusers");

    if(
$canadopt == "yes"){
    
$canadoptimg "<input name='canadopt' type='checkbox' id='canadopt' value='yes' checked> ";
    }
    else{
    
$canadoptimg "<input name='canadopt' type='checkbox' id='canadopt' value='yes'> ";
    }

    if(
$canpm == "yes"){
    
$canpmimg "<input name='canpm' type='checkbox' id='canpm' value='yes' checked>";
    }
    else{
    
$canpmimg "<input name='canpm' type='checkbox' id='canpm' value='yes'>";
    }

    if(
$cancpx == "yes"){
    
$cancpimg "<input name='cancp' type='checkbox' id='cancp' value='yes' checked>";
    }
    else{
    
$cancpimg "<input name='cancp' type='checkbox' id='cancp' value='yes'>";
    }

    if(
$cma == "yes"){
    
$cmaimg "<input name='canmanageadopts' type='checkbox' id='canmanageadopts' value='yes' checked>";
    }
    else{
    
$cmaimg "<input name='canmanageadopts' type='checkbox' id='canmanageadopts' value='yes'>";
    }

    if(
$cmc == "yes"){
    
$cmcimg "<input name='canmanagecontent' type='checkbox' id='canmanagecontent' value='yes' checked>";
    }
    else{
    
$cmcimg "<input name='canmanagecontent' type='checkbox' id='canmanagecontent' value='yes'>";
    }

    if(
$cmads == "yes"){
    
$cmadsimg "<input name='canmanageads' type='checkbox' id='canmanageads' value='yes' checked>";
    }
    else{
    
$cmadsimg "<input name='canmanageads' type='checkbox' id='canmanageads' value='yes'>";
    }

    if(
$cms == "yes"){
    
$cmsimg "<input name='canmanagesettings' type='checkbox' id='canmanagesettings' value='yes' checked>";
    }
    else{
    
$cmsimg "<input name='canmanagesettings' type='checkbox' id='canmanagesettings' value='yes'>";
    }

    if(
$cmu == "yes"){
    
$cmuimg "<input name='canmanageusers' type='checkbox' id='canmanageusers' value='yes' checked>";
    }
    else{
    
$cmuimg "<input name='canmanageusers' type='checkbox' id='canmanageusers' value='yes'>";
    }
    

    
$i++;
    }

    
$article_title "Editing ".$groupname." usergroup";
    
$article_content "Here you can edit the settings for the ".$groupname." usergroup.  Use the checkboxes below to
    specify what parts of your site members of this group may access.  A checked value is a YES value.<br>
    <form name='form1' method='post' action='admpost.php'>
  <p><strong><u>User Settings:   </u></strong></p>
  <p>
    "
.$canadoptimg."
  Users May Adopt Pets</p>
  <p>
    "
.$canpmimg."
Users May Use PM System / Message System </p>
  <p><strong><u>Admin Settings: </u></strong></p>
  <p>
    "
.$cancpimg."
  Users May Access the Admin CP (Required for any of the checkboxes below to take effect) </p>
  <p>
    "
.$cmaimg."
    Users May Create / Edit / Delete Adoptables and Upload Adoptable Images</p>
<img src='templates/icons/warning.gif'> <b>WARNING:</b> Allowing users to access the adoptables settings also allows users to upload files to your server.  
Mysidia Adoptables Adoptables restricts the type of files a user may upload to this server, however enabling a user to upload even image files should only be given to users you trust as all images uploaded to your server count towards your web host's total storage quota for your account.<br><br>
  <p>
    "
.$cmcimg."
Users May Create / Edit / Delete site pages and content</p>
  <p>
    "
.$cmadsimg."
Users May Create / Edit / Delete sitewide advertisements</p>
  <p>
    "
.$cmsimg."
Users May Change / Alter site settings</p>
  <p>
    "
.$cmuimg."
Users May Edit / Delete / Alter user accounts and passwords</p>
  <p><img src='templates/icons/warning.gif'> <b>WARNING:</b> Allowing users to access the user accounts portion of the Admin CP may allow them to delete admin accounts, so only give this privledge to users you trust. 
    <input name='page' type='hidden' id='page' value='groups'>
    <input name='groupid' type='hidden' id='groupid' value='"
.$groupid."'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Edit Usergroup'> 
  </p>
</form>"
;


    }
    else{

    
$article_title "Invalid Group Specified";
    
$article_content "The group specified does not appear to exist in the database.  <a href='admin.php?set=users&do=groups'>Click Here</a> to return to the groups manager.</a>";

    }
    

    }
    else if(
$more == "delete"){

    
// We are deleting a usergroup...

    
$query "DELETE FROM ".$prefix."groups WHERE gid='".$evenmore."'";
    
runquery($query);

    
$article_title "Usergroup Deleted";
    
$article_content "The usergroup has been deleted successfully.";
    

    }
    else{

    
$article_title "Error";
    
$article_content "Error.  Action does not exist!";

    }



    }
    else if(
$do == "delete"){
    
//We are deleting a user from the system...
    
    
deleteuser($more);
    
$article_title "User Deleted";
    
$article_content "The user has been deleted from the database successfully.  <a href='admin.php?set=users'>Click Here</a> to return to the user manager.";

    }
    else{
    
//No action, show the users table
    
$article_title "Manage Users";
    
$article_content "This page allows you to manage your site's users.  Use the table below to manage users.  If you know the name of a user you want to edit you can type their name in the search box
    below to quickly edit them.<br><form name='form1' method='get' action='admin.php'>
  <p>Edit User: 
    <input name='more' type='text' id='more'>
    <input name='set' type='hidden' id='set' value='users'>
    <input name='do' type='hidden' id='do' value='edit'>
    <input type='submit' name='Submit' value='Edit User'>
  </p></form><b><a href='admin.php?set=users&do=adoptables'><img src='templates/icons/fr.gif' border=0> Manage User's Owned Adoptables</a></b><br> 
  </p><b><a href='admin.php?set=users&do=groups'><img src='templates/icons/fr.gif' border=0> Manage Usergroups and Permissions</a></b><br><table width='302' border='1'>
  <tr>
    <td width='100'><strong>Username:</strong></td>
    <td width='60'><strong>Email:</strong></td>
    <td width='60'><strong>Usergroup:</strong></td>
    <td width='32'><strong>Edit:</strong></td>
    <td width='50'><strong>Delete:</strong></td>
  </tr>"
;

//Begin the output from the database to show the users...

$query "SELECT * FROM ".$prefix."users ORDER BY uid DESC";
$result runquery($query);
$num mysql_numrows($result);

$rowsperpage 20;
$totalpages ceil($num $rowsperpage);

if(
is_numeric($more) and $more != ""){
$currentpage $more;
}
else{
$currentpage 1;
}

if (
$currentpage $totalpages) {  
$currentpage $totalpages;  
}
if (
$currentpage 1) {   
$currentpage 1;  

$offset = ($currentpage 1) * $rowsperpage;  

$query "SELECT * FROM ".$prefix."users ORDER BY uid DESC LIMIT $offset$rowsperpage";
$result runquery($query);
$num2 mysql_numrows($result);

//Loop out code
$i=0;
while (
$i $num2) {

$id=@mysql_result($result,$i,"uid");
$username=@mysql_result($result,$i,"username");
$email=@mysql_result($result,$i,"email");
$level=@mysql_result($result,$i,"usergroup");


$article_content $article_content."
<tr>
    <td><b><a href='profile.php?user="
.$username."' target='_blank'>".$username."</a></b></td>
    <td><a href='mailto:"
.$email."'>".$email."</a></td>
    <td><center>"
.$level."</center></td>
    <td><center><a href='admin.php?set=users&do=edit&more="
.$username."'><img src='templates/icons/cog.gif' border=0></a></center></td>
    <td><center><a href='admin.php?set=users&do=delete&more="
.$username."'><img src='templates/icons/delete.gif' border=0></a></center></td>
  </tr>"
;

$i++;
}



$article_content $article_content."</table><br>";


if(
$currentpage 1) {
$newpage $currentpage 1;
$article_content $article_content."<a href='admin.php?set=users&more=".$newpage."'>Previous Page</a> ";
}
if(
$currentpage $totalpages) {
$newpage $currentpage 1;
$article_content $article_content."<a href='admin.php?set=users&more=".$newpage."'>Next Page</a> ";
}

    
    }

}
else{

$article_title "Access Denied";
$article_content "Your usergroup does not seem to have the permission to edit the user based settings...";

}



// End the users=content block ... start a new setting here...
else if($set == "settings"){

//*********************************************************************************
// HERE IS THE CODE THAT MANAGES CHANGING BASIC SITE SETTINGS...
//*********************************************************************************

$canedit cando($group"canmanagesettings");

if(
$canedit == "yes"){

if(
$do == ""){

// No setting was specified, so show the user their choices...

$article_title "Site Settings";
$article_content "Here you can manage the settings for your site.  Click on a setting below to view or change its current configuration.<br><br>
<b><u>Site Settings:</u></b><br>
<a href='admin.php?set=settings&do=basic'>View or Edit Basic Site Settings</a><br>
<a href='admin.php?set=settings&do=themes'>View or Edit Theme and Template Settings</a><br>
<a href='admin.php?set=settings&do=links'>View or Edit Site Navigation Links</a><br>
<a href='admin.php?set=settings&do=gd'>View or Edit Adoptable Signature Image Settings / GD Settings</a><br><br>"
;

// Start plugin hooks...

$article_content $article_content."<b><u>Plugin Settings:</u></b><br>
Listed here are all of the plugins that are using hooks to interface with the Mysidia Adoptables Admin CP.
Clicking on a link below will redirect you to a page generated by the respecive plugin where you can change plugin-specific settings.<br><br>"
;

    
$query "SELECT * FROM ".$prefix."acp_hooks";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$linktext=@mysql_result($result,$i,"linktext");
    
$linkurl=@mysql_result($result,$i,"linkurl");
    
$pluginname=@mysql_result($result,$i,"pluginname");

    
    
    
$article_content $article_content."<a href='".$linkurl."'>".$linktext."</a> - Generated by the <b>".$pluginname."</b> plugin.";    

    
$i++;
    }
    }
    else{
    
$article_content $article_content."<b>There are currently no plugin hooks present.</b>";
    }

}
else if(
$do == "basic"){

// We are editing the basic site settings, such as title, etc...

$article_title "Basic Site Settings";
$article_content "This page allows you to edit the basic settings for your Mysidia Adoptables installation.  
Fill out the form below to change the settings.  Settings which need further explanation will have more information next to their area on the form.<br>
<form name='form1' method='post' action='admpost.php'>
<p>Site Name:       <input name='sitename' type='text' id='sitename' value='"
.grabanysetting("sitename")."'></p>
<p>Site Title:         <input name='browsertitle' type='text' id='browsertitle' value='"
.grabanysetting("browsertitle")."'></p>
<p>Currency Name:    <input name='cost' type='text' id='cost' value='"
.grabanysetting("cost")."'></p>
<p>Start Money:        <input name='startmoney' type='text' id='startmoney' value='"
.grabanysetting("startmoney")."'></p>
<p>Site Slogan:        <input name='slogan' type='text' id='slogan' value='"
.grabanysetting("slogan")."'></p>
<p>Admin Email:        <input name='admincontact' type='text' id='admincontact' value='"
.grabanysetting("admincontact")."'></p>
<p>Mail From:        <input name='systememail' type='text' id='systememail' value='"
.grabanysetting("systememail")."'> </p>
<p>Trade Enabled:   <input name='enabletrades' type='text' id='enabletrades' value='"
.grabanysetting("enabletrades")."'> </p>
<p>Trade offer Cost:  <input name='tradeoffercost' type='text' id='tradeoffercost' value='"
.grabanysetting("tradeoffercost")."'> </p>
<p>Trade Completion Cost:   <input name='tradecost' type='text' id='tradecost' value='"
.grabanysetting("tradecost")."'> </p>
<p>Breeding Wait:   <input name='breedinginterval' type='text' id='breedinginterval' value='"
.grabanysetting("breedinginterval")."'> </p>
<p>Breeding Level:    <input name='breedinglevel' type='text' id='breedinglevel' value='"
.grabanysetting("breedinglevel")."'> </p>
<p>Levelup Money:    <input name='rewardmoney' type='text' id='rewardmoney' value='"
.grabanysetting("rewardmoney")."'> </p>

    <input name='page' type='hidden' id='page' value='basicsettings'>
  <p><input type='submit' name='Submit' value='Change Settings'></p>
</form>"
;

}
else if(
$do == "links"){

// We are editing the links for this site...

if($more == ""){

// We are not editing a specific link

$article_title "Link Editor";
$article_content "Here you can edit the navigation links for your site.  You may add, edit or delete links here on this page.  This makes customizing your site and link text very easy.
<br><br><b><a href='admin.php?set=settings&do=links&more=new'><img src='templates/icons/add.gif' border=0> Add a new link</a></b><p><b><u>Your Existing Links:</u></b></p>
<table width='575' border='1'>
  <tr>
    <td width='150'><strong>Link URL: </strong></td>
    <td width='175'><strong>Link Text: </strong></td>
    <td width='32'><strong>Edit:</strong></td>
    <td width='51'><strong>Delete:</strong></td>
  </tr>"
;

    
$query "SELECT * FROM ".$prefix."links ORDER BY id ASC";
    
$result runquery($query);
    
$num mysql_numrows($result);

    while (
$i $num) {

    
$linktext=@mysql_result($result,$i,"linktext");
    
$linkurl=@mysql_result($result,$i,"linkurl");
    
$lid=@mysql_result($result,$i,"id");

    if(
$lid 6){
    
$showdelete "";
    }
    else{
    
$showdelete "<center><a href='admin.php?set=settings&do=links&more=delete&evenmore=".$lid."'><img src='templates/icons/delete.gif' border=0></a></center>";
    }

    
$article_content $article_content."<tr>
    <td>"
.$linkurl."</td>
    <td>"
.$linktext."</td>
    <td><center><a href='admin.php?set=settings&do=links&more=edit&evenmore="
.$lid."'><img src='templates/icons/cog.gif' border=0></a></center></td>
    <td>"
.$showdelete."</td>
  </tr>
"
;

    
$i++;
    
    }


$article_content $article_content."</table>";



}
else if(
$more == "edit"){

// We are editing a specific link...
// Select from the database where the link is...

    
$query "SELECT * FROM ".$prefix."links WHERE id='".$evenmore."'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    while (
$i 1) {

    
$linktext=@mysql_result($result,$i,"linktext");
    
$linkurl=@mysql_result($result,$i,"linkurl");
    
$lid=@mysql_result($result,$i,"id");

    
$linktext stripslashes($linktext);

    
$i++;
    }

    if(
$lid == $evenmore){

    
// The link exists, so let's edit it...

    
if($lid 6){
    
    
// Special link, so we cannot change the location...

    
$lurlform "<input name='linkurl' type='text' id='linkurl' value='".$linkurl."' readonly='readonly'>";

    }
    else{
    
$lurlform "<input name='linkurl' type='text' id='linkurl' value='".$linkurl."'>";
    }

    
$article_title "Editing a Link";
    
$article_content "Here you can edit a link that you have previously created.  
    You may edit the link text here.  In addition, you may modify the link's URL if the link is not a special link.<br>
    <form name='form1' method='post' action='admpost.php'>
  <p>Link Text: 
    <input name='linktext' type='text' id='linktext' value='"
.$linktext."'>
</p>
  <p>Type the text that will appear for the new link. </p>
  <p>Link URL: 
    "
.$lurlform.
  </p>
  <p>Type the location of where this link will lead. This can either be a local file location, such as index.php, or this can be a link to an outside webpage. If linking to an outside webpage, your Link URL must begin with http://.
    <input name='page' type='hidden' id='page' value='editlink'>
    <input name='linkid' type='hidden' id='linkid' value='"
.$evenmore."'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Edit Link'> 
  </p>
</form>"
;

    }
    else{

    
$article_title "Link Not Found";
    
$article_content "The link could not be found in the database.  Please go back and try again.";

    }

}
else if(
$more == "delete"){

// We are deleting a link...
// Just run a straight-up delete query on the link...

$query "DELETE FROM ".$prefix."links WHERE id='".$evenmore."'";
runquery($query);

$article_title "Link Deleted Successfully";
$article_content "Your link has been deleted successfully.  <a href='admin.php?set=settings&do=links'>Click Here</a> to return to the link manager.";

}
else if(
$more == "new"){

// We are creating a new link...
// Show the form to make the link...

$article_title "Create a New Link";
$article_content "This page allows you to create a new link that will appear in your site's navigation.  
Use the form below to create a new link.<br><form name='form1' method='post' action='admpost.php'>
  <p>Link Text: 
    <input name='linktext' type='text' id='linktext'>
</p>
  <p>Type the text that will appear for the new link. </p>
  <p>Link URL: 
    <input name='linkurl' type='text' id='linkurl'> 
  </p>
  <p>Type the location of where this link will lead. This can either be a local file location, such as index.php, or this can be a link to an outside webpage. If linking to an outside webpage, your Link URL must begin with http://.
    <input name='page' type='hidden' id='page' value='newlink'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Add Link'> 
  </p>
</form>
<img src='templates/icons/warning.gif'> <b>Template Warning:</b> Adding more links than your current template was designed to handle may cause issues with the way your site looks.  
If you notice that some links do not appear on your site, appear in the wrong place, or are otherwise causing problems, it is probably because you have more links than your current theme allows for.
If this is the case you can either delete some links or change your site's template to one that supports more links."
;

}
else{

$article_title "Invalid Action Specified";
$article_content "The action specified is invalid.  Please go back and try again.";

}


}
else if(
$do == "themes"){

// Theme based settings...

if($more == "" or $more == "sel"){

// Grab all of our themes...

$article_title "Theme Manager";
$article_content "This page allows you to change the theme for your website.  Themes allow you to style your website.  
You can select a theme to use from the dropdown list below or you can install a new theme to your site using the theme installation form below.
To get more themes please visit the <a href='http://www.mysidiaadoptables.com/forum' target='_blank'>Mysidia Adoptables Support Forums</a>.<br>
<br><b><u>Select a Theme:</u></b><br><form name='form1' method='get' action='admin.php'>
  <p>
    <select name='more' id='more'>
      <option value='sel' selected>Select a Theme...</option>"
;

    
$query "SELECT * FROM ".$prefix."themes";
    
$result runquery($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

    
$themeid=@mysql_result($result,$i,"id");
    
$themename=@mysql_result($result,$i,"themename");


    if(
$themename == ""){
    
$themename "Unnamed Theme :: ".$themeurl."";
    }
    
    
$article_content $article_content."<option value='".$themeid."'>".$themename."</option>";    

    
$i++;
    }

$article_content $article_content."<input name='set' type='hidden' id='set' value='settings'>
    <input name='do' type='hidden' id='do' value='themes'>
</p>
  <p>
    <input type='submit' name='Submit' value='Use This Theme'>
</p>
</form><b><u>Install a Theme:</u></b><br><br><form name='form1' method='post' action='admpost.php'>
  <p>Theme Name: 
    <input name='themename' type='text' id='themename'>
</p>
  <p>Type a name to use for this theme. This should be something to help you remember what this theme looks like.</p>
  <p>Theme URL: 
    <input name='themeurl' type='text' id='themeurl'> 
  </p>
  <p>This is the path to the theme's HTML file on your server. Usually the theme author will give you this value to paste into this box.
    <input name='page' type='hidden' id='page' value='newtheme'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Install Theme'> 
  </p>
</form>"
;

}
else{

// We are changing the theme...

// Pull up the inputted theme's info...

    
$query "SELECT * FROM ".$prefix."themes WHERE id='".$more."'";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num 0){

    
//Loop out code
    
$i=0;
    while (
$i 1) {

    
$themeurl=@mysql_result($result,$i,"themeurl");

    
// Update the theme URL in the DB...

    
$query "UPDATE ".$prefix."settings SET value='".$themeurl."' WHERE name='themeurl'";
    
runquery($query);

    
$article_title "Theme Updated Successfully";
    
$article_content "The theme has been changed successfully!  <a href='admin.php?set=settings'>Click Here</a> to change the site settings.</a>";
    

    
$i++;
    }

    }
    else{

    
$article_title "Invalid Theme Selected";
    
$article_content "It appears that the theme you selected is invalid or does not exist.  Please go back and try selecting another theme.";

    }

}

}
else if(
$do == "gd"){

// The GD image settings and BBCode settings...

$gdstatus grabanysetting("gdimages");
$altbbstatus grabanysetting("usealtbbcode");

// Form fanagaling here...

$gdform "<input name='enablegd' type='checkbox' id='enablegd' value='yes'>";

if(
$gdstatus == "yes"){
$gdform "<input name='enablegd' type='checkbox' id='enablegd' value='yes' checked>";
}

$altform "<input name='altbb' type='checkbox' id='altbb' value='yes'>";

if(
$altbbstatus == "yes"){
$altform "<input name='altbb' type='checkbox' id='altbb' value='yes' checked>";
}

// Output content...

$article_title "Signature Settings";
$article_content "This page allows you to change settings related to how the script handles adoptable signature images generated by the BBCode generator.
<form name='form1' method='post' action='admpost.php'>
  <p>
    "
.$gdform.
  Enable GD Signature Images for GIF files</p>
  <p>If you enable GD Signature Images for GIF files then all adoptables that use GIF files for their images will have their signature images modified by the GD image library before being output by the system. Enabling this setting will put the adoptable's name and owner on the image for the adoptable that is served by this server. Please note that if GD is not installed or enabled on this server this setting will not take effect and all images will fall back to the default method of showing signature images.</p>
  <p>
    "
.$altform."
Enable Alternate Friendly Signature BBCode</p>
  <p>If you enable this setting then an additional set of BBCode will be shown for all adoptables that will convert URLs such as /siggy.php?id=20 to URLs such as /get/20.gif. You should only enable this if you have uploaded and edited the modified .htaccess file so that users can access the pets at their friendly URLs. If you have not uploaded the .htaccess file required for this then users who use the alternate BBCodes will not have their signature images work properly.
    <input name='page' type='hidden' id='page' value='gd'>
</p>
  <p>
    <input type='submit' name='Submit' value='Change Settings'>
</p>
</form>"
;

}
else if(
$do == "somethingelseagain"){

}
else{

$article_title "The setting does not exist.";
$article_content "Error.  The specified setting does not exist!";

}

}
else{

$article_title "Access Denied";
$article_content "Your usergroup does not seem to have the permission to edit the user based settings...";



}

// End the settings content block .. start a new setting here...
else if($set == "ads"){

// We are managing the ads for the site...

$canedit cando($group"canmanageads");

if(
$canedit == "yes"){

///////////////////////////////////////////////////////////////////////////////////////////////////////
// BEGIN AD MANAGEMENT - MOST OF THIS IS STRAIGHT FROM MAX VOLUME'S ACP - YAY - LESS WORK...
///////////////////////////////////////////////////////////////////////////////////////////////////////

     
if($do == ""){

    
$article_title "Ad Management";
    
$article_content $article_content."Here you can manage your ad campaigns.  Listed below are all the ads currently running on your website.
    <p></p><b><a href='admin.php?set=ads&do=newad'><img src='templates/icons/add.gif' border=0> Create a new ad</a></b><br><br>
    <b><u>Current Ad Campaigns:</u></b><br><br>"
;
    
    
$query "SELECT * FROM ".$prefix."ads";
    
$result runquery($query);
    
$num mysql_numrows($result);

    if(
$num == 0){
    
$article_content $article_content."You currently do not have any ads running on your website.";
    }
    else{
    
$article_content $article_content."<table width='680' border='1'>
  <tr>
    <td width='151'>Ad Name: </td>
    <td width='140'>Page:</td>
    <td width='75'>Impressions:</td>
    <td width='75'><p>Actual<br>
      Impressions:</p>
    </td>
    <td width='74'>Date:</td>
    <td width='40'>Status:</td>
    <td width='31'>Edit: </td>
    <td width='42'>Delete:</td>
  </tr>"
;


    
$i=0;
    while (
$i $num) {

    
$id=@mysql_result($result,$i,"id");
    
$adname=@mysql_result($result,$i,"adname");
    
$page=@mysql_result($result,$i,"page");
    
$impressions=@mysql_result($result,$i,"impressions");
    
$actualimpressions=@mysql_result($result,$i,"actualimpressions");
    
$date=@mysql_result($result,$i,"date");
    
$status=@mysql_result($result,$i,"status");

    
$adname stripslashes($adname);
    
$page stripslashes($page);

    if(
$status == "active"){
    
$statusicon "<center><img src='templates/icons/yes.gif'></center>";
    }
    else{
    
$statusicon "<center><img src='templates/icons/no.gif'></center>";
    }

    
$article_content $article_content." <tr>
    <td>"
.$adname."</td>
    <td>"
.$page."</td>
    <td>"
.$impressions."</td>
    <td>"
.$actualimpressions."</td>
    <td>"
.$date."</td>
    <td>"
.$statusicon."</td>
    <td><center><a href='admin.php?set=ads&do=editad&more="
.$id."'><img src='templates/icons/cog.gif' border=0></a></center></td>
    <td><center><a href='admin.php?set=ads&do=deletead&more="
.$id."'><img src='templates/icons/delete.gif' border=0></a></center></td>
  </tr>"
;

    

    
$i++;
    }


$article_content $article_content."</table>";
    

    }

    }
    else if(
$do == "newad"){

    
$article_title "Create a new ad";
    
$article_content "Here you can create a new ad campaign for your website.  You can either create a sitewide ad, or you can restrict an ad to a specific page or make a certain page have a blank ad.
This is useful for premium pages or pages that do not have content so AdSense ads won't be shown there if you so choose.  HTML is enabled for the ad system.  Remember that if you want your ad centered you should use the &lt;center&gt; and &lt;/center&gt; HTML tags to achieve this.<br>

    <form name='form1' method='post' action='admpost.php'>
  <p>Ad Code:</p>
  <p>
    <textarea name='adtext' cols='50' rows='4' id='adtext'></textarea>
</p>
  <p>Ad Campaign Name (Optional, but handy): 
    <input name='adname' type='text' id='adname'>
</p>
  <p>Page to run this ad on: 
    <input name='pagerun' type='text' id='pagerun'>
  </p>
  <p>The page setting allows you to run the ad on a specific page only. <b>To run the ad on a single page, enter the page URL in the box above.</b>  To run the ad on your entire site please leave the page setting blank.</p>
  <p>Max Impressions Allowed: 
    <input name='impressions' type='text' id='impressions' size='10' maxlength='8'>
</p>
  <p>If you wish to run the ad for only a certain amount of impressions fill in the max impressions allowed box. Leave the box blank or set to 0 to run the ad indefinentally. When the maximum amount of impressions has been reached, the ad will become inactive and will no longer be shown. 
    <input name='page' type='hidden' id='page' value='newad'>
    
  </p>
  <p>
    <input type='submit' name='Submit' value='Start Ad Campaign'> 
    <input type='reset' name='Reset' value='Reset Form'>
  </p>
</form>"
;
    

    }
    else if(
$do == "deletead"){

    
//Run the delete SQL query...
    
$query "DELETE FROM ".$prefix."ads WHERE id='".$more."'";
    
runquery($query);

    
$article_title "Ad Deleted Successfully";
    
$article_content "Your ad has been deleted successfully.  <a href='admin.php?set=ads'>Click Here</a> to manage the ads.";

    }
    else if(
$do == "editad"){

    
$article_title "Edit an Existing Ad";

    
//Run the SQL queries to get the ad info and populate the form.....    

    
$query "SELECT * FROM ".$prefix."ads WHERE id = '".$more."' LIMIT 1";
    
$result = @runquery($query);
    
$num = @mysql_numrows($result);

    if(
$num 0){

    
//Loop out code
    
$i=0;
    while (
$i 1) {

    
$value=@mysql_result($result,$i,"text");
    
$value stripslashes($value);
    
$aid=@mysql_result($result,$i,"id");
    
$actualimpressions=@mysql_result($result,$i,"actualimpressions");
    
$impressions=@mysql_result($result,$i,"impressions");
    
$adname=@mysql_result($result,$i,"adname");
    
$pagerun=@mysql_result($result,$i,"page");
    
$adname stripslashes($adname);
    
$i++;
    }
    }
    else{
    die(
"Ad does not exist!");
    }


    
$article_content $article_content "<form name='form1' method='post' action='admpost.php'>
  Here you can edit an existing advertisement.<br><br><p>Ad Code:</p>
  <p>
    <textarea name='adtext' cols='50' rows='4' id='adtext'>"
.$value."</textarea>
</p>
  <p>Ad Campaign Name (Optional, but handy): 
    <input name='adname' type='text' id='adname' value='"
.$adname."'>
</p>
  <p>Page to run this ad on: 
    <input name='pagerun' type='text' id='pagerun' value='"
.$pagerun."'>
  </p>
  <p>The page setting allows you to run the ad on a specific band's profile page only. <b>To run the ad on a single band's page, enter their access url in the box above.</b>  To run the ad on your entire site please leave the page setting blank.</p>
  <p>Max Impressions Allowed: 
    <input name='impressions' type='text' id='impressions' size='10' maxlength='8' value='"
.$impressions."'>
</p>
  <p>If you wish to run the ad for only a certain amount of impressions fill in the max impressions allowed box. Leave the box blank or set to 0 to run the ad indefinentally. When the maximum amount of impressions has been reached, the ad will become inactive and will no longer be shown. 
    <input name='aid' type='hidden' id='aid' value='"
.$more."'>
    <input name='aimp' type='hidden' id='aimp' value='"
.$actualimpressions."'>
    <input name='page' type='hidden' id='page' value='editad'>
    
  </p>
  <p>
    <input type='submit' name='Submit' value='Edit Ad Campaign'> 

    <input type='reset' name='Reset' value='Reset Form'>
  </p>
</form>"
;

}
}
else{

$article_title "Access Denied";
$article_content "Your usergroup does not seem to have the permission to edit the advertisement settings...";


}

// End the ads setting block...start a new setting here...
}
else{
$article_title "Access Denied";
$article_content "Access Denied";
}

}
else{

$article_title "Access Denied";
$article_content "Access Denied";

}

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

echo showpage($article_title$article_content$date);

?>
__________________

Last edited by RoconzaArt; 03-13-2011 at 07:41 PM.
Reply With Quote
  #2  
Old 03-13-2011, 08:08 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,881
Hall of Famer is on a distinguished road
Default

umm I see. When Arianna's breeding script was integrated into Mys v1.2.0, it automatically created a lv.0 entry in table prefix_levels. Because of this, we had to get rid of one of the lv.0 rows or it would end up looking like this from Mys v1.2.0 beta:



So yeah, we fixed this glitch in the official release of Mys v1.2.0. However, it seems that the url linking to adoptables deletion page is missing from here. The adoptables deletion script is still available, its just not directly accessible at this moment. All you have to do is to visit the following link below:

http://www.youradoptablessite/admin.php?set=adopts&do=edit&more=XXX

Simply change the 'youradoptablessite' part to your script path, and the highlighted XXX to the adoptables type you are deleting, and it should work out for you just fine. I will add back link to allow admins to delete adoptables in Mys v1.2.1. Sorry about that.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 03-13-2011, 08:28 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 45,923
RoconzaArt is an unknown quantity at this point
Default

wait ok, thanks HOF.


Will there be a fix for this?
__________________

Last edited by RoconzaArt; 03-13-2011 at 08:38 PM.
Reply With Quote
  #4  
Old 03-13-2011, 08:44 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,881
Hall of Famer is on a distinguished road
Default

Yes there is going to be one, I will try to fix this by Mys v1.2.1.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 03-13-2011, 08:49 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 45,923
RoconzaArt is an unknown quantity at this point
Default

It does not work for me. I don't think I understand how to do this.

http://www.mysidiaadoptables.com/for...7&pictureid=69
__________________
Reply With Quote
  #6  
Old 03-13-2011, 09:02 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,881
Hall of Famer is on a distinguished road
Default

umm can you show me your database tables prefix_adoptables and prefix_levels? I will see what goes wrong with your site.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 03-13-2011, 09:25 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 45,923
RoconzaArt is an unknown quantity at this point
Default

fadillzzz also installed three mods for me.

http://i1134.photobucket.com/albums/...m/09442db2.png


http://i1134.photobucket.com/albums/...m/f8b2781a.png
__________________

Last edited by RoconzaArt; 03-13-2011 at 09:27 PM.
Reply With Quote
  #8  
Old 03-13-2011, 10:07 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,881
Hall of Famer is on a distinguished road
Default

Oh sorry Roconza, I was asking you to show me the contents in your tables. It seems to me that you have several rows in your table prefix_levels, Id like to see what went wrong.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #9  
Old 03-13-2011, 10:20 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 45,923
RoconzaArt is an unknown quantity at this point
Default

http://i1134.photobucket.com/albums/...n/fa388606.png
http://i1134.photobucket.com/albums/...n/13c10303.png
__________________
Reply With Quote
  #10  
Old 03-13-2011, 10:23 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,881
Hall of Famer is on a distinguished road
Default

umm I see, you need to manually delete two of the three rows in your prefix_levels table. I have no idea why you have this many lv.0 rows, it never happened to me...
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
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
How do I delete an adoptable level? gloryKAT Questions and Supports 3 09-02-2013 12:57 AM
Not able to delete a pet species Cremuex Levier Questions and Supports 4 04-03-2013 10:07 AM
Can I delete a level? dulop Questions and Supports 3 05-31-2012 10:39 AM
Help? How do you delete... KaceKuma Feedback and Suggestions 2 09-26-2011 12:37 AM
Soft Delete Problem SilverDragonTears Questions and Supports 9 07-29-2011 04:18 PM


All times are GMT -5. The time now is 10:01 AM.

Currently Active Users: 9678 (0 members and 9678 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