Module: User Thank/Flame

Posted by J. David Smith 
Problems with 'Top Users' and 'Thank or Flame'
February 07, 2009 05:49PM
I have installed both the Thank and Flame mod and the Top Users mod and seem to be having a problem with the thank and flame returning the below message when checking the top users:

"Warning: Invalid argument supplied for foreach() in /home/swapsies/public_html/Forum/mods/user_thank_flame/user_thank_flame.php on line 192

Warning: Cannot modify header information - headers already sent by (output started at /home/swapsies/public_html/Forum/mods/user_thank_flame/user_thank_flame.php:192) in /tmp/tpl-emerald-header-6cd5198a106a9d83f675950b24b72a31.php-stage2 on line 5"

Any ideas welcome, its got me. Tried removing all files and started again only to return to the same point.
Re: Problems with 'Top Users' and 'Thank or Flame'
February 08, 2009 09:47AM
It looks like the module creates the custom profile field "mod_user_thanks" incorrectly. In the code I see that it autocreates the field with "html_disabled" = 1. That will break the data that is stored in that field.

To fix it: go to the admin interface -> Custom profiles.
There, edit the "mod_user_thanks" field.
Remove the checkbox that disabled HTML for the field.
Save the field settings.

This should be fixed in the module code to make this work correctly for new installations.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Problems with 'Top Users' and 'Thank or Flame'
February 08, 2009 09:57AM
Sorry for posting in the incorrect place.

OK, Thanks, that removed that error but now its returning this multiple times:

Warning: Invalid argument supplied for foreach() in /home/swapsies/public_html/Forum/mods/user_thank_flame/user_thank_flame.php on line 142

If i click on the Top Users link at the top of the page i get:

Warning: Invalid argument supplied for foreach() in /home/swapsies/public_html/Forum/mods/user_thank_flame/user_thank_flame.php on line 192

Im confused as i havent edited the code
Re: Problems with 'Top Users' and 'Thank or Flame'
February 08, 2009 10:04AM
These are all warnings for which I cannot tell you if these are to be expected or not. Like the messages already tell: these are warning messages, not errors. These can be an indication of a programming error, but it could also be that the programmer of the code did not write fully strict PHP code here. In that case, the functionality would be okay, but the script could still yield warnings like this. Unfortunately, I am not too familiar with this module, so I cannot tell you what is the case here. If the module is working correctly functionally speaking, then disabling the warnings in PHP could be the "solution" (my opinion is that code should never yield warnings, but opinions differ on the subject).

Let's hope the original author can kick in to comment on the warnings that you are seeing.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: User Thank/Flame
February 08, 2009 10:46AM
Well i have the thank and flame and rating up on the profiles but the actual thank or flame buttons dont seem to be there.

I guess when you say disable the warnings you mean within the php file and not a setting in the admin pages?

I all for warnings being displayed but not to users, should be directed back to the admin or top level user.

Thank you for looking at this as its not one of your many mods.

I'm slowly getting to grips with this PHP, jump in at the deep end is my motto. lol
Re: Module: User Thank/Flame
August 31, 2009 09:19AM
Dear i have try your module.
And it work fine execting that a message appear when updating the messages with a new thank/flame.

Possible hack attempt detected. The posted form data was rejected.

But the data is save. and when we update the message list , it work.

I have ask for support to PHORUM TEAM and they reply to me :

Maurice Makaay :

That is due to the new CSRF protection in the latest version of Phorum. Please try adding {POST_VARS} in the template for the thank/flame form (if there is one). Of if the form is generated from print/echo statements in code, then add $PHORUM['DATA']['POST_VARS'] in it.

Do you know what this means in your module ?

I have not understand all files of your mod .....

Thank you in advance for your answer !
Best regards
Re: Module: User Thank/Flame
September 14, 2009 08:11AM
i'm having the same issue with "Possible hack attempt detected. The posted form data was rejected. " too

btw:
if someone uses threaded or hybrid view, you have to add the lines from read.tpl to read_hybrid.tpl and read_threads.tpl of the template (phorum/templates/emerald) too, in order to display the thank/flame bar
Re: Module: User Thank/Flame
September 19, 2009 05:13AM
Hello Zeduc

For correct the problem of possible hack...

You have to go to the bar.tpl file

and put a post vars after the beginning of the form.

eg;

<form action="" method="post">
{POST_VARS}

It will work like this
Best regards
noe
Re: Module: User Thank/Flame
October 03, 2009 09:55AM
I think there is a bug within the tf_list($list) function. (which is responsible for calculating ratings for each user @ forum list).

[code="php"]
foreach($list as $item) {
foreach($item['meta']['message_ids'] as $mid) {
....
}
}
return $list;
[/code]

This only works as long as the user has posted more than 1 message in total. Otherwise there is no ['meta']['message_ids'] array for the user and nothing to "foreach". -> resulting in Invalid argument supplied for foreach()....
Re: Module: User Thank/Flame
October 17, 2009 10:16AM
it's working for someone?
i have a lot of user_thank_flame\user_thank_flame.php on line 142 errors and nothing works
i barely understand the installation file
if it works for someone i'll be happy for some help
thanks!
Sorry, only registered users may post in this forum.

Click here to login