View Single Post
  #5  
Old 03-10-2009, 05:35 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 18,023
BMR777 is on a distinguished road
Default RE: Remove Adoptables from adopt.php?

Ok.

In adopt.php find:

PHP Code:
// Get our content for the adoptables page
if($isloggedin == "yes" and $aID == ""){

$article_title "Available Adoptables";
$article_date date('Y-m-d');
$article_content "Below are all the available adoptables.  To adopt a creature simply click on the creature's name.<center>";

$query "SELECT * FROM adoptables";
$result mysql_query($query);
$num mysql_numrows($result);



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

$aID=@mysql_result($result,$i,"uid");
$name=@mysql_result($result,$i,"name");
$imageurl=@mysql_result($result,$i,"imageurl");
$memberlevel=@mysql_result($result,$i,"memberlevel");
$description=@mysql_result($result,$i,"description");

//Begin our content output...
$article_content=$article_content."<p align='center'><b><a href='adopt.php?aID=".$aID."'>".$name.":</a></b></p>
<p align='center'><a href='adopt.php?aID="
.$aID."'><img src='".$imageurl."' border='0'></a> </p>
<p align='center'><a href='adopt.php?aID="
.$aID."'>Adopt ".$name."</a></p>";


$i++;
}

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


$article_title stripslashes($article_title);
$article_content stripslashes($article_content);



}
else if (
$isloggedin == "no" and $aID == ""){
// Guest is viewing the available adoptables

$article_title "Available Adoptables (Viewing as Guest)";
$article_date date('Y-m-d');
$article_content "Below are all the available adoptables.  To adopt a creature you must be a member of this site.  Please <a href='login.php'>login</a> or <a href='register.php'>register</a> to get your very own free adoptable.  
You can also browse the available adoptables as a guest.<center>"
;

$query "SELECT * FROM adoptables";
$result mysql_query($query);
$num mysql_numrows($result);



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

$aID=@mysql_result($result,$i,"uid");
$name=@mysql_result($result,$i,"name");
$imageurl=@mysql_result($result,$i,"imageurl");
$memberlevel=@mysql_result($result,$i,"memberlevel");
$description=@mysql_result($result,$i,"description");

//Begin our content output...
$article_content=$article_content."<p align='center'><b><u>".$name.":</u></b></p>
<p align='center'><img src='"
.$imageurl."' border='0'></p>
<p align='center'><a href='login.php'>Please Login to Adopt "
.$name."</a></p>";


$i++;
}

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


$article_title stripslashes($article_title);
$article_content stripslashes($article_content);


Replace with:

PHP Code:
if($aID == ""){
header("Location: http://www.yoursite.com/adopt.htm");

Modify the URL in the above code to point to your HTML page on your server where you want users to be redirected. :)
Reply With Quote