View Single Post
  #4  
Old 03-21-2011, 09:44 AM
AlexC's Avatar
AlexC AlexC is offline
Moderator
 
Join Date: Dec 2009
Location: Canada
Posts: 753
Gender: Unknown/Other
Credits: 90,765
AlexC is an unknown quantity at this point
Default

Thank you for the myadopts page edit, I edited the page to my liking and it works wonderfully!

Here is my pound page.

Code:
<?php

include("inc/functions.php");

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

$id = $_GET["id"];
$aid = $_GET["aid"];
$type = $_GET["type"];
$name = $_GET["name"];
$currentlevel = $_GET["currentlevel"];

// Here we check if we have an ID that has been submitted or no

if($aid == "" or !is_numeric($id)) {
	// We did not enter in an id, or it is not a number
	$article_title = $poundtitle; 
	$article_content = $poundcontent;

	// If we are a guest, show a message that lets them know that they cannot adopt...
	if($isloggedin != "yes"){
		$article_content = $article_content.$poundguestcontent;
	}

	// Begin the output of all the adoptables to the user...
	$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='SYSTEM'";
	$result = runquery($query);
	
	$article_content .= "<form name='form1' method='get' action='poundpost.php'>
	<h3>The Rat Rescue</h3><table>";

	while($row = mysql_fetch_array($result)) {
		$aid=$row['aid']; 
		$type=$row['type'];
		$name=$row['name'];
		$currentlevel=$row['currentlevel'];
		$gender=$row['gender'];
        $adoptimage=getcurrentimage($aid); 

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

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

         $cost=@mysql_result($result,$i,"cost"); //The cost of adoption

         $i++;
         }
 
        $totalcost = $cost * $currentlevel;

	 	// Call a function to check if we have the proper privledge level to adopt this pet

			$article_content .= "<tr>
			<td><input type='radio' name='aid' id='aid' value='{$aid}' /></td>
			<td style='text-align: center'><img src='".$adoptimage."' /></td>
			<td><strong>{$name}</strong> <br> Cost: $totalcost
            <td>level: $currentlevel <br> Gender: <img src='picuploads/{$gender}.png'> </td></tr>";

	} // End the looping out of all adoptables...
	
	$article_content .= "</table>
	<h3>Care to adopt an abandoned rat?</h3>
			  <p>
                <input name='aid' type='hidden' id='aid' value='".$aid."'/>
                <input name='type' type='hidden' id='type' value='".$type."'/>
                <input name='name' type='hidden' id='name' value='".$name."'/>
				<input name='currentlevel' type='hidden' id='currentlevel' value='".$currentlevel."'>
			  </p>
			  <p>
				<input type='submit' name='Submit' value='Adopt Me'>
			</p>
	</form>";
} // This bracket ends the IF check for whether or not an ID was entered
else{
	// We have specified an ID of an adoptable we wish to adopt

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

	$id=$row['aid']; 
	$type=$row['type'];
	$name=$row['name'];
	$currentlevel=$row['currentlevel'];
	$gender=$row['gender'];
    $adoptimage=getcurrentimage($aid); 

	if($aid == $id){
		//The adoptable exists and is valid

		if($canadopt == "yes"){

			$article_title = "Adopting abandoned rat named ".$name;
			$article_content = $langa1."".$name.$langa2;

			$article_content = $article_content."<br><img src='".$adoptimage."' border='0'><br>
			<form name='form1' method='get' action='poundpost.php'>
			  <p>
				<input name='aid' type='hidden' id='aid' value='".$aid."'>
				<input name='type' type='hidden' id='type' value='".$type."'>
				<input name='name' type='hidden' id='name' value='".$name."'>
				<input name='currentlevel' type='hidden' id='currentlevel' value='".$currentlevel."'>
			  </p>
			  <p>
				<input type='submit' name='Submit' value='Adopt Me'>
			</p>
			</form>";
		}
		else{
			$article_title = $accden;
			$article_content = $adoptnoper;
		} // End Can Adopt ELSE
	}
	else {
		//The adoptable does not exist, nothing we can do...
		$article_title = $err_idnoexist;
		$article_content = $err_idnoexist_text;
	} // End adoptable does not exist ELSE
} // This bracket ends the else statements for whether or not an ID was entered


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

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

?>
I only edited it to change some of the words.

I tried the table and it worked wonderfully!

I tried removing the theme, it worked fine, but once I logged out, I got this message!


Warning: file_get_contents(templates/elements/template.html) [function.file-get-contents]: failed to open stream: No such file or directory in /home/gloometh/public_html/inc/functions.php on line 819

I think this is because it kept thinking elements was the default theme - can I set it to simple through my file manager?
Reply With Quote