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 06-26-2013, 06:34 PM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 15,229
pachoofoosh is on a distinguished road
Default Donations Bug

(Sorry if this is posted in the wrong place! ^^;)

I've noticed a small bug when editing my site.

On the donate.php page, if you enter your own username and a cash amount (for instance, 1,000 of the site currency), it will give you that cash amount without first subtracting it from your total amount. So, for example, if the user has 1,000 cash, they could enter their own username and 'donate' 500 cash to themselves. Instead of still having 1,000 cash, they now have 1,500 cash.
Reply With Quote
  #2  
Old 06-27-2013, 01:55 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,531
Hall of Famer is on a distinguished road
Default

umm interesting, I never checked this but it could be true. Are you sure this is affecting Mys v1.3.3 and the earlier versions?
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 06-27-2013, 03:05 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,695
Abronsyth is on a distinguished road
Default

I just tested it, running 1.3.3 and tried donating 200 currencies to myself. I had 435 currencies before 'donating' and ended up with 635 afterwards, so it is affecting 1.3.3!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #4  
Old 06-28-2013, 08:42 PM
Infernette Infernette is offline
CODE CODE CODE CODE CODE
 
Join Date: Jan 2013
Location: Where I live? I live home.
Posts: 164
Gender: Female
Credits: 23,616
Infernette is on a distinguished road
Default

That is a big problem! I guess I should wait until the new update after all so this will be fixed :)
__________________
No, I have no idea what I'm doing. But it works. Barely.
Reply With Quote
  #5  
Old 06-29-2013, 01:35 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,531
Hall of Famer is on a distinguished road
Default

I see, so this has been confirmed to be a glitch. I am terribly sorry about it, will post a fix for the problem in 1-2 days. Shouldnt be difficult though.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #6  
Old 07-01-2013, 01:55 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,531
Hall of Famer is on a distinguished road
Default

Here is a simple fix, try it if you are interested. Just copy/paste whatever is inside the code block to your donate.php file, make sure to overwrite the old contents:

PHP Code:
<?php

class DonateController extends AppController{

    private 
$view;
    private 
$subController;

    public function 
__construct(){
        
parent::__construct("member");
    }
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$document->setTitle($mysidia->lang->title);
        
        if(
$mysidia->input->post("recipient") and is_numeric($mysidia->input->post("amount"))){
            
$recipient preg_replace("/[^a-zA-Z0-9\\040]/"""$mysidia->input->post("recipient"));
            
$amount preg_replace("/[^0-9]/"""$mysidia->input->post("amount"));
            
$recipient = new Member($recipient);
            
             if(
$amount 0){
                
$document->setTitle($mysidia->lang->fail);
                
$document->addLangvar($mysidia->lang->negative);
            }
            elseif(
$mysidia->user->money $amount){
                
$document->setTitle($mysidia->lang->fail);
                
$document->addLangvar($mysidia->lang->funds);
            }
            elseif(
$recipient->username == $mysidia->user->username){
                
$document->setTitle($mysidia->lang->fail);
                
$document->addLangvar("Cannot donate to yourself!");
           } 
            else{
                
$mysidia->user->donate($recipient$amount);
                
$document->setTitle($mysidia->lang->success);
                
$document->add(new Comment("You've just donated {$amount} of {$mysidia->settings->cost} to <a href='profile/{$recipient->username}'>{$recipient->username}</a>. "));
                
$document->add(new Comment("You'll be redirected back to the donation page within 3 seconds. Click "));
                
$document->add(new Link("donate""here "));
                
$document->add(new Comment("if your browser does not automatically redirect you."));
                
header("Refresh:3; URL='donate'");
            }
            return;
        }

        
$document->add(new Comment("This page will allows you to donate your money to other users. "));
        
$document->add(new Comment("You currently have {$mysidia->user->getcash()} {$mysidia->settings->cost} left."));
        
$document->add(new Paragraph(new Comment("")));

        
$donateForm = new FormBuilder("donateform""donate""post");
        
$donateForm->buildComment("Donate to: "FALSE)
                   ->
buildTextField("recipient")
                   ->
buildComment("Amount to donate: "FALSE)
                   ->
buildTextField("amount")
                   ->
buildButton("Donate""submit""submit");
        
$document->add($donateForm);    
    }
}
?>
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 07-01-2013, 03:35 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,695
Abronsyth is on a distinguished road
Default

Tested it HoF, and it's working as it ought to be now, thank you!

Hope you're doing well, by the way.
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #8  
Old 07-02-2013, 12:08 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,531
Hall of Famer is on a distinguished road
Default

You are very welcome, glad it worked. I am a bit sick lately, but will get better soon. ^^
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #9  
Old 07-02-2013, 02:27 PM
Ruinily Ruinily is offline
Member
 
Join Date: Mar 2011
Location: England
Posts: 185
Gender: Female
Credits: 22,688
Ruinily is on a distinguished road
Default

Um, is that fix for the newest coding? Because its not working on mine at all lol... And the coding looks different. Is there any chance of a fix for Mysidia Adoptables v1.3.2? ^_^' Or shall I just disable it?
__________________

Chocolate butterfly cat pudding. o.o


And since even the programming on this forum doesnt like me anymore heres my sites address. XD
http://felkyocreatures.com/index.php
Reply With Quote
  #10  
Old 07-02-2013, 05:05 PM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 15,229
pachoofoosh is on a distinguished road
Default

I replaced my donate.php with that and it worked perfectly. Thanks a bunch! :D
Reply With Quote
Reply

Tags
bug, donate, error

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 03:53 PM.

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