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
  #11  
Old 02-19-2017, 05:58 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,727
Chaos77777 is on a distinguished road
Default

I'm looking on StackExchange for different methods to kill posts. None are working for me so far though. Almost had one with using cookies, but it wouldn't let me go back to the page at all again lol
Reply With Quote
  #12  
Old 02-20-2017, 10:19 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,385
kristhasirah
Default

tried on a fresh install of mysidia, and the glitch is there, for some reason is ignoring the Session and just send a confirmation code, and keeps giving you adopts, so the glitch is not part of the random code i posted
__________________
Reply With Quote
  #13  
Old 02-20-2017, 04:35 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,727
Chaos77777 is on a distinguished road
Default

I spent hours trying different methods to fix that. Someone who actually knows what they're doing will have to step in. But at least people will be aware of the glitch
Reply With Quote
  #14  
Old 04-03-2017, 11:45 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,727
Chaos77777 is on a distinguished road
Default

Bump O_o I'm really hoping someone knows how to fix this one
Reply With Quote
  #15  
Old 04-04-2017, 08:36 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,385
kristhasirah
Default

add this
PHP Code:
                        $mysidia->session->terminate("adopt"); 
to the adoptsview.php before the first return;

if I dont make sense this is how it should look:
PHP Code:
            $document->addLangvar("{$name} with clicks so that they grow!");
                        
$mysidia->session->terminate("adopt");
            return;
        } 
for me this is working and trow an error if the user refresh the page =) hope this will help you too
Reply With Quote
  #16  
Old 04-06-2017, 01:53 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,727
Chaos77777 is on a distinguished road
Default

You are awesome, lol and such a simple code too..
Reply With Quote
  #17  
Old 04-06-2017, 02:24 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,385
kristhasirah
Default

glad is woking for you too ^^
Reply With Quote
  #18  
Old 04-06-2017, 07:54 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,727
Chaos77777 is on a distinguished road
Default

Perhaps you can help me with one more thing. I can't see what I did wrong. I have it set up to cost 500 every time someone guesses at an adopt (with the chance to get a cheap adopt up to a rare one) It works fine up to a certain point. It'll deduct the 500 if the user has it and give the adopt. However, if the user doesn't have the 500, it'll pop up saying "Not enough money"..... but still give them the adopt lmao. I'm assuming it's a simple fix, but I can only try different ways of setting it up on my own for so many hours before I cave in and decide I need help.

PHP Code:
<?php

class AdoptView extends View{
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
        if(
$mysidia->input->post("submit")){
            
            if(
$mysidia->user->money 499){
            
$aid $this->getField("aid")->getValue();
            
$name $this->getField("name")->getValue();
            
$eggImage $this->getField("eggImage")->getValue();
            
$image = new Image($eggImage);
            
$image->setLineBreak(TRUE);    
            
$mysidia->user->changecash(-500); 
            
            
$document->setTitle("{$name} adopted successfully");            
            
$document->add($image);
            
$document->addLangvar("Congratulations!  You just adopted {$name}. You can now manage {$name} on the ");
            
$document->add(new Link("myadopts""Myadopts Page."));
            
$document->add(new Comment(""));
            
$document->add(new Link("myadopts/manage/{$aid}""Click Here to Manage {$name}"));
            
$document->add(new Comment(""));
            
$document->add(new Link("myadopts/bbcode/{$aid}""Click Here to get BBCodes/HTML Codes for {$name}"));
            
$document->add(new Comment(""));
            
$document->addLangvar("Be sure and");
            
$document->add(new Link("levelup/{$aid}""feed "));
            
$document->addLangvar("{$name} with clicks so that they grow!");
            
$mysidia->session->terminate("adopt");  
            return;
            
            }
            else{
            echo 
"<script type='text/javascript'>alert('You do not have enough money!')</script>";
            }}
        
        
        
$document->setTitle($mysidia->lang->title);
        
$document->addLangvar((!$mysidia->user->isloggedin)?$mysidia->lang->guest:$mysidia->lang->member);          
        
$adoptForm = new Form("form""adopt""post");
        
$adoptTitle = new Comment("Available Species");
        
$adoptTitle->setHeading(3);
        
$adoptForm->add($adoptTitle);
        
$adoptTable = new Table("table"""FALSE);
         
        
        
         
     
   
    
$adoptform "<form name='form1' method='post' action='$adopt'> <table id='adoptdark' name='adopt' class='adopt'>"
    
$common 0;  
    
$uncommon rand(1,50);    
    
$rare rand(1,100);    
    
$veryrare rand(1,200); 
    
$endangered rand(1,300);    

    if (
$uncommon==&& $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Uncommon' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }    
    else if (
$rare==&& $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Rare' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }        
    else if (
$veryrare==1  && $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Very Rare' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }   
    else if (
$endangered==1  && $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Endangered' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }      
    else{    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Common' ORDER BY RAND() LIMIT 1";    
    }    
    
$stmt $mysidia->db->query($query);   
     
        while(
$row $stmt->fetchObject()) { 

            
$adoptform .= "<td width='25%' VALIGN='center'><div align=center><img src='../../picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div><div align=center></td>"
         
        } 
     
     
    
$common 0;  
    
$uncommon rand(1,50);    
    
$rare rand(1,100);    
    
$veryrare rand(1,200); 
    
$endangered rand(1,300);    

    if (
$uncommon==&& $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Uncommon' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }    
    else if (
$rare==&& $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Rare' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }        
    else if (
$veryrare==1  && $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Very Rare' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }   
    else if (
$endangered==1  && $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Endangered' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }      
    else{    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Common' ORDER BY RAND() LIMIT 1";    
    }    
    
$stmt $mysidia->db->query($query);   

    while(
$row $stmt->fetchObject()) { 

            
$adoptform2 .= "<td width='25%' VALIGN='center'><div align=center><img src='../../picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div></td>"

             
   }  
    
    
$common 0;  
    
$uncommon rand(1,50);    
    
$rare rand(1,100);    
    
$veryrare rand(1,200); 
    
$endangered rand(1,300);    

    if (
$uncommon==&& $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Uncommon' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }    
    else if (
$rare==&& $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Rare' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }        
    else if (
$veryrare==1  && $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Very Rare' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }   
    else if (
$endangered==1  && $onlyone==0){    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Endangered' ORDER BY RAND() LIMIT 1";  
$onlyone 1;    
    }      
    else{    
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='Common' ORDER BY RAND() LIMIT 1";    
    }    
    
$stmt $mysidia->db->query($query);   

    while(
$row $stmt->fetchObject()) { 

            
$adoptform3 .= "<td width='25%' VALIGN='center'><div align=center><img src='../../picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div></td>"
        }
        
$document->add(new Comment("{$adoptform}{$adoptform2}{$adoptform3}"));  
        
        
        
$adoptForm->add($adoptTable);        
        
$adoptSubtitle = new Comment("Adopt");
        
$adoptSubtitle->setHeading(3);
        
$adoptForm->add($adoptSubtitle);
        
$adoptForm->add(new Comment("Adoptable Name: "FALSE));
        
$adoptForm->add(new TextField("name"));
        
$adoptForm->add(new Comment(""));
        
$adoptForm->add(new Button("Adopt Me""submit""submit"));
        
$document->add($adoptForm); 
        }
}
?>
Reply With Quote
  #19  
Old 04-06-2017, 08:35 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,385
kristhasirah
Default

I cant test the code rigth now but maybe this post by kyttias can help you:
http://www.mysidiaadoptables.com/for...51&postcount=6

The post is for limiting the owned eggs but i know it can help you ^^ if you move your code like the one in the post the user wont see the adopts, if you still want to show the eggs but make the user unable to adopt, you need to copy the random code and paste it in the else you dont have money, but removefrom radio to value and the newbutton adopt me, submit.
If i dont make sense and you can wait a little tomorrow i will post how i did it :)
Reply With Quote
  #20  
Old 04-06-2017, 08:57 PM
Chaos77777 Chaos77777 is offline
Member
 
Join Date: Jan 2017
Posts: 43
Gender: Male
Credits: 3,727
Chaos77777 is on a distinguished road
Default

Yeah, I see how that works, unfortunately there's a bug around that. (I like to find odd problems with coding) If you have enough money, then open that page, it'll show the eggs. Then, in another tab, spend that money. In the first tab, you can still see the eggs, even though you don't have enough money lol then back to square one :(
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 02:01 AM.

Currently Active Users: 9030 (0 members and 9030 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