This mod is intended for people who already or wanted to have a random adoption process on their adoptables site.
This mod will use Session Value instead of the GET method to transfer the id of an adoptables from adopt.php to doadopt.php
That way people won't be able to manipulate the id of an adoptables to another id to get the adoptables they want.
You can use POST method but they can change it using the text editor. So with this mod, they have no idea how to do that.
NOTE:Please make a backup of your files before installing this mod!
Now, let's move on!
1. Open your adopt.php file, on line 2 just below the
tag put this code
2.(Skip this step if your site already limit the adopt.php to only show 1 random adoptables)
Go to line 86, replace this code
with this
3. Put this code on line 98
4. Then on line 119 find this code
And replace it with this
5. After that, remove these 2 lines from the file (line 115 & 116)
We're done with adopt.php, let's continue with editing doadopt.php
1. Open your doadopt.php, on line 2 just below the
tag put this code
2. Find this code on line 65 -75
And replace it with
3. Find this code
And before that line add this
4. And then before this
Add this code
NOTE:Don't forget to edit the "Enter error message here" text
That's it you're done! Now people will completely get unchangeable random adoptables!
If there's any error you encounter after installing this mod, please let me know! (This is my first mod)
This mod will use Session Value instead of the GET method to transfer the id of an adoptables from adopt.php to doadopt.php
That way people won't be able to manipulate the id of an adoptables to another id to get the adoptables they want.
You can use POST method but they can change it using the text editor. So with this mod, they have no idea how to do that.
NOTE:Please make a backup of your files before installing this mod!
Now, let's move on!
1. Open your adopt.php file, on line 2 just below the
PHP:
<?php
PHP:
session_start(); // This is important!
Go to line 86, replace this code
PHP:
$query = "SELECT * FROM ".$prefix."adoptables";
PHP:
$query = "SELECT * FROM ".$prefix."adoptables WHERE whenisavail = 'always' ORDER BY RAND() LIMIT 1"; // Only shows 1 random adoptables
PHP:
$_SESSION['id'] = $aid; // This is what we use to transfer the aid value
PHP:
$article_content = $article_content."<p><b><a href='adopt.php?id=".$aid."'><img src='templates/icons/add.gif' border=0> Adopt ".$type."</a></b></p>";
PHP:
$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='promocode' type='hidden' id='promocode' value='".$promocode."'>
</p>
<p>
<input type='submit' name='Submit' value='Adopt Me'>
</p>
</form>";
PHP:
$article_content = $article_content."<p><b><u><a href='adopt.php?id=".$aid."'>".$type.":</a></u></b></p>
<p><a href='adopt.php?id=".$aid."'><img src='".$eggimage."' border='0'></a></p>";
1. Open your doadopt.php, on line 2 just below the
PHP:
<?php
PHP:
session_start(); // This is important!
PHP:
$id = $_GET["id"];
PHP:
if($_GET["id"] == ""){
$id = $_SESSION['id'];
}elseif($_GET["id"] != ""){
$id = $_GET["id"];
}
PHP:
if($isloggedin == "yes"){
PHP:
if($promocode != ""){
4. And then before this
PHP:
// **********************************************************************
// Begin Template Definition
// **********************************************************************
PHP:
}else{
$article_title = $accden;
$acticle_content = "Enter error message here";
}
That's it you're done! Now people will completely get unchangeable random adoptables!
If there's any error you encounter after installing this mod, please let me know! (This is my first mod)
Last edited: