Remove Adoptables from adopt.php?

Forum
Last Post
Threads / Messages

Tequila

The Grim One
Staff member
Dev Staff
Joined
Jan 21, 2009
Messages
1,312
Points
0
Location
Souther Tier, New York State
Mysidian Dollar
68,306
Is there a way to remove the adoptable creatures from the adopt.php page without harming the script? I use a .HTML page for the adoptables so that it looks nicer, and users have been bypassing it (violating my site's ToS in process).
 
well it would be simple but difficult at the same time...

but it could be done...

If no one wants to step up i can do a quick simple kind of alteration for it
 
Rsmiley said:
well it would be simple but difficult at the same time...

but it could be done...

If no one wants to step up i can do a quick simple kind of alteration for it

That would be nice. I just want it to redirect to my .HTML page instead of letting them adopt through the .PHP page.
 
I'd very much like this as well. Even though all my links point to the html page, I'm afraid users might somehow see the verticle-ness of the .php equivalent. D:
 
Ok.

In adopt.php find:

PHP:
// 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:
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. :)
 
Or just find the out-put section and delete the out-put code and place a message saying "Go to the .html Page" or something. =)
 
I did it so the names wouldn't come out. You can always make a back up and try anyway...

I lol'd at how easily Brandon solves our problems. That's what I love about Rusnak Scripts, the great support.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,132
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top