Mysidia Adoptables Support Forum  

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

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 04-07-2011, 05:43 PM
AlexC's Avatar
AlexC AlexC is offline
Moderator
 
Join Date: Dec 2009
Location: Canada
Posts: 753
Gender: Unknown/Other
Credits: 97,722
AlexC is an unknown quantity at this point
Default

Code:
<?php

include("inc/functions.php");

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

$id = $_GET["id"];
$promocode = $_GET["promocode"];
$_SESSION["allow"] = 1;
// Here we check if we have an ID that has been submitted or no

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

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

	// Begin the output of all the adoptables to the user...
	$query = "SELECT * FROM ".$prefix."adoptables";
	$result = runquery($query);
	
	$article_content .= "<form name='form1' method='get' action='doadopt.php'>
	<h3>Available Adoptables</h3><table>";

	while($row = mysql_fetch_array($result)) {
		$aid=$row['id']; //The adoptable's ID
		$type=$row['type'];
		$description=$row['description'];
		$eggimage=$row['eggimage'];

		// Call a function to check if we have the proper privledge level to adopt this pet
		if($promocode == ""){
			$promocode = "none";
		}

		$canadopt = canadopt($aid, "showing", $promocode, $row); // Feed an adoptable ID and showing, to show the adopt to guests...

		if($canadopt == "yes"){
			//If we can adopt the adoptable, show the image and adoption link...
			$article_content .= "<tr>
			<td><input type='radio' name='id' id='id' value='{$aid}' /></td>
			<td style='text-align: center'><img src='".$eggimage."' /></td>
			<td><strong>{$type}</strong> - {$row['cost']} {$GLOBALS['settings']['cost']}.<br />{$description}</td></tr>";
		}
	} // End the looping out of all adoptables...
	
	$article_content .= "</table>
	<h3>Adopt</h3>
			  <p>Adoptable Name: <input name='name' type='text' id='name' />
				<input name='promocode' type='hidden' id='promocode' value='".$promocode."'>
			  </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."adoptables WHERE id='$id' LIMIT 1";
	$result = runquery($query);
	$row = mysql_fetch_array($result);

	$aid = $row['id'];
	$type=$row['type'];
	$description=$row['description'];
	$eggimage=$row['eggimage'];

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

		$canadopt = canadopt($aid, "adopting", $promocode, $row); 

		if($canadopt == "yes"){

			$article_title = "Adopting ".$type;
			$article_content = $langa1."".$type.$langa2;

			$article_content = $article_content."<br><img src='".$eggimage."' border='0'><br>
			<form name='form1' method='get' action='doadopt.php'>
			  <p>Adoptable Name: 
				<input name='name' type='text' id='name'>
				<input name='id' type='hidden' id='id' value='".$id."'>
				<input name='promocode' type='hidden' id='promocode' value='".$promocode."'>
			  </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);

?>
here is the adopt.php. man, troubleshooting is very hard.
Reply With Quote
 

Thread Tools
Display Modes

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
Images not showing? katsRme Feedback and Suggestions 15 08-19-2012 06:08 PM
I'm showing up more then once AlkseeyaKC Questions and Supports 21 08-28-2011 02:52 AM
images not showing dragonqueen Questions and Supports 7 05-22-2010 10:11 PM
Not Showing Name SJC Questions and Supports 4 04-21-2009 05:03 AM
Certain adoptables not showing Killgore Questions and Supports 5 02-22-2009 04:58 PM


All times are GMT -5. The time now is 11:34 PM.

Currently Active Users: 5299 (0 members and 5299 guests)
Threads: 4,081, Posts: 32,043, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636