MyBB-Plugins Forums
Problem with donating - wrong parameter given - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: Archived Forums (http://forums.mybb-plugins.com/Forum-Archived-Forums)
+--- Forum: MyBB 1.6.x (http://forums.mybb-plugins.com/Forum-MyBB-1-6-x)
+---- Forum: NewPoints (http://forums.mybb-plugins.com/Forum-NewPoints)
+---- Thread: Problem with donating - wrong parameter given (/Thread-Problem-with-donating-wrong-parameter-given)

Pages: 1 2


Problem with donating - wrong parameter given - Schocker - 05-31-2012

To start with, I have already Googled the error a few times, but didn't find anything to help me. If it was already solved - sorry!

I got a bug report from user today, he said that after donating to one of the users an error appears at the top of the page. I confirmed it - the message pops up after redirection to newpoints.php and I have no idea on what was it caused by - I didn't change any NewPoints-related settings recently.
I am using NewPoints 1.9.3 and Shop 1.5 (with Lottery 1.4 also installed), I would upgrade already, but my host is experiencing some FTP problems right now.

Screenshot:
http://screencast.com/t/TLapdPfNu

Thanks in advance!


RE: Problem with donating - wrong parameter given - Diogo Parrinha - 05-31-2012

What's the amount mentioned in the PM sent to the receiver?


RE: Problem with donating - wrong parameter given - Schocker - 05-31-2012

From what I have seen, it doesn't really matter - I've sent 1 point, 10 points, 12, 17, 19, 63, 127, 512, 1024 points; the error was displayed in every situation. Not that it has any impact on the action - the points are deducted from my account and added to selected account's balance, it works as it should. The error just doesn't look good, especially given the fact, that my forum relies on NewPoints since its beginning (it's actually a PBF game), and it started appearing today, without any changes in the settings.

Do you need additional information or a test account?

Edit: The error appears even when accessing newpoints.php directly.


RE: Problem with donating - wrong parameter given - Diogo Parrinha - 05-31-2012

Well I asked you that because it matters, I am not asking for the sake of it. Besides that, I also need you to check if your PHP version has been updated and if your PHP configuration has been changed since yesterday.

Sorry if I sound rude, that's not what I mean.


RE: Problem with donating - wrong parameter given - Schocker - 05-31-2012

(05-31-2012, 07:57 AM)Pirata Nervo Wrote: Sorry if I sound rude, that's not what I mean.

No, you didn't sound rude, I could have put my message in wrong words, sorry. I am just puzzled about this error, as I've never had to deal with a similar one, and so I don't know what information You may need to help me.

The PHP configuration was not upgraded, it's still 5.3.8. The settings of it do not seem to be changed. I have no idea, if it can have anything to do with it, but my hosting experienced a DDoS attack two days ago. I'll try to update to NewPoints 1.9.4 today, as the FTP is working again and updating won't hurt.


RE: Problem with donating - wrong parameter given - Diogo Parrinha - 06-01-2012

I still do not know the contents of the PM...


RE: Problem with donating - wrong parameter given - Schocker - 06-01-2012

I've copied it from the page source (my forum is in Polish):
Code:
Witaj, do Twojego konta została dodana darowizna w wysokości 1 
<img align="top" alt="AM" src="http://chipeurope.pl/msa/images/icons/newam.png">
<br>
. Powód:
<blockquote>
<cite>Cytat:</cite>
8)
</blockquote>

But the problems occurs also when accessing newpoints.php directly, i.e. on the info page.


RE: Problem with donating - wrong parameter given - Diogo Parrinha - 06-01-2012

Where's supposed to be the points amount?


RE: Problem with donating - wrong parameter given - Schocker - 06-01-2012

Right before the image - where the "1" is.


RE: Problem with donating - wrong parameter given - Diogo Parrinha - 06-02-2012

So that's the correct amount? 1 point? You shouldn't get that error but this will fix it:
Replace: (inc/plugins/newpoints.php)
PHP Code:
function newpoints_format_points($points)
{
    global 
$mybb;
    
    return 
$mybb->settings['newpoints_main_curprefix'].number_format($pointsintval($mybb->settings['newpoints_main_decimal'])).$mybb->settings['newpoints_main_cursuffix'];


With:
PHP Code:
function newpoints_format_points($points)
{
    global 
$mybb;
    
    return 
$mybb->settings['newpoints_main_curprefix'].number_format((float)$pointsintval($mybb->settings['newpoints_main_decimal'])).$mybb->settings['newpoints_main_cursuffix'];