Mysidia Adoptables Support Forum  

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

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-07-2016, 02:31 PM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 51,398
tahbikat is on a distinguished road
Default Allow users to delete an adoptable

I'm attempting to make a feature where users can release a pet to the wild, which basically just means permanently deleting it.

I've just copied and modified my pets' bio functions in their myadopts.php and myadoptsview.php to look like below. In class_ownedadoptables.php, I just have a blank public function "doReleasePet()" because I'm honestly just scared to try experimenting with deleting things. :P Afraid I'll end up deleting a whole database table or something lol. Can someone help me out? ;-; Am I going in the right direction at least?

myadopts.php
PHP Code:
public function releasepet(){
    
$mysidia Registry::get("mysidia");        
    if(
$mysidia->input->post("submit")){            
        
$this->adopt->doReleasePet();
    }
    
$this->setField("adopt"$this->adopt);        
    
$this->setField("image"$this->image);            

myadoptsview.php
PHP Code:
public function releasepet(){
    
$mysidia Registry::get("mysidia");
    
$adopt $this->getField("adopt");        
    
$image $this->getField("image");        
    
$document $this->document;
    
    if(
$mysidia->input->post("submit")){
        
$document->setTitle("Successfully Released Pet");
        
$document->add($image);
        
$document->add(new Comment("<br/>You've successfully released your creature to the wild, where it will live out the rest of its days. "));
        return;
    }
    
    
$document->setTitle("Release ".$adopt->getName());
    
$document->add($image);
    
$document->addLangvar("<br/>You can release {$adopt->getName()} to the wilderness here. Are you sure you want to do this?<br/>");
    
    
$releaseButton = new FormBuilder("releasebutton""""post");
    
$releaseButton->buildButton("Release!""submit""submit");
    
$document->add($releaseButton);           

class_ownedadoptables's doReleasePet()
PHP Code:
public function doReleasePet(){


Reply With Quote
 

Thread Tools
Display Modes

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 02:06 PM.

Currently Active Users: 417 (0 members and 417 guests)
Threads: 4,080, Posts: 32,024, 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