Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-27-2015, 09:21 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 132,982
Kyttias is on a distinguished road
Default

Probably! If the form doesn't work, try changing the action to the name of the current page?

Unfortunately, this is meant to work with my explore system, not one by other users... It should be easily modified, though? I haven't tried using other people's since mine fits my needs. (I'd rather only have on page, than have to make a new page for each zone.)

And um...yeah, some of that stuff isn't quite right in right order, hang on...

PHP Code:
//Normal page stuff
$document->add(new Comment("Lalala we're exploring."FALSE));

//Call the function that'll add the button to pick up a cat
$this->pickupPet("Fleet");

//This function generates the form
public function pickupPet($species){
    
$document $this->document;
    
$document->add(new Comment("
        <form id='pickup_pet' action='explore' name='pickup_pet' method='post' role='form'>
        <input id='pet_found' name='pet_found' type='hidden' value='
{$species}'>
        <button id='acquire' value='species' name='acquire' type='submit'>
        <center>Pick up this 
{$species}?</center>
        </button>
        </form>
        "
FALSE)); 
    return;


//When the page loads it'll check if there's post data
if($mysidia->input->post("pet_found")){
    
$mysidia Registry::get("mysidia");
    
$document $this->document;
    
$species $mysidia->input->post("pet_found");
    
$this->givePet($species);
    
$document->setTitle("Kitten Acquired!");            
    
$document->add(new Comment("You've collected a new {$species}!")); 
    
/* Might want to add a link here to continue exploring or go elsewhere? */
}
    
// This function is called in the function that only works if there's post data
public function givePet($species){
    
$mysidia Registry::get("mysidia");
    
$newadopt = new StockAdopt($species);
    
$newadopt->append($mysidia->user->username);
    return;

To fix it up any better than that, I'd have to see and test the whole page. @w@'
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 12-27-2015 at 10:09 PM.
Reply With Quote
Reply


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


All times are GMT -5. The time now is 01:51 AM.

Currently Active Users: 3835 (0 members and 3835 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636