PDA

View Full Version : Remove Adoptables from adopt.php?


Tequila
03-09-2009, 08:55 AM
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).

Rsmiley
03-09-2009, 11:59 AM
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

Tequila
03-09-2009, 01:54 PM
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.

Quillink
03-10-2009, 12:06 AM
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:

BMR777
03-10-2009, 05:35 PM
Ok.

In adopt.php find:

// 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:

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. :)

Ashje
03-11-2009, 03:30 AM
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. =)

Tequila
03-11-2009, 08:35 AM
Thanks for that Brandon. Works great.

I thought about doing what Ashje said, but wanted to make sure that I wouldn't screw the code up.

Ashje
03-13-2009, 12:30 AM
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.

Tequila
03-13-2009, 08:28 AM
Your right Ashje. I've edited it so the name doesn't show, but they can find out from how I have my images hosted...