Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.1.x Mods

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-23-2011, 05:14 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 37,832
fadillzzz is an unknown quantity at this point
Default Secure Random Adoption Process

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
PHP Code:
<?php
tag put this code
PHP Code:
session_start(); // This is important! 
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

PHP Code:
$query "SELECT * FROM ".$prefix."adoptables"
with this
PHP Code:
$query "SELECT * FROM ".$prefix."adoptables WHERE whenisavail = 'always' ORDER BY RAND() LIMIT 1"// Only shows 1 random adoptables 
3. Put this code on line 98
PHP Code:
$_SESSION['id'] = $aid// This is what we use to transfer the aid value 
4. Then on line 119 find this code
PHP Code:
    $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>"
And replace it with this
PHP Code:
$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>"

5. After that, remove these 2 lines from the file (line 115 & 116)
PHP Code:
$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>"
We're done with adopt.php, let's continue with editing doadopt.php
1. Open your doadopt.php, on line 2 just below the
PHP Code:
<?php
tag put this code
PHP Code:
session_start(); // This is important! 
2. Find this code on line 65 -75
PHP Code:
$id $_GET["id"]; 
And replace it with
PHP Code:
if($_GET["id"] == ""){
$id $_SESSION['id'];
}elseif(
$_GET["id"] != ""){
$id $_GET["id"];

3. Find this code
PHP Code:
if($isloggedin == "yes"){ 
And before that line add this
PHP Code:
if($promocode != ""){ 

4.
And then before this
PHP Code:
// **********************************************************************
// Begin Template Definition
// ********************************************************************** 
Add this code
PHP Code:
}else{
$article_title $accden;
$acticle_content "Enter error message here";


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)

Last edited by fadillzzz; 01-28-2011 at 01:10 PM.
Reply With Quote
 


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
Adoption Problems Kamalya Questions and Supports 8 01-27-2013 02:15 PM
Secure Random Adoption V2 fadillzzz Mys v1.2.x Mods 7 02-28-2012 02:57 PM
Random Adoption nitrogen Questions and Supports 4 05-10-2009 10:10 AM
Random 5 is not realy random! RipJawWolfFang Questions and Supports 9 04-30-2009 07:03 AM


All times are GMT -5. The time now is 07:17 PM.

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