Module: User Thank/Flame
Posted by J. David Smith
|
Problems with 'Top Users' and 'Thank or Flame' February 07, 2009 05:49PM |
Registered: 17 years ago Posts: 13 |
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.
"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 |
Admin Registered: 22 years ago Posts: 8,532 |
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
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 |
Registered: 17 years ago Posts: 13 |
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
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 |
Admin Registered: 22 years ago Posts: 8,532 |
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
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 |
Registered: 17 years ago Posts: 13 |
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
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 |
Registered: 17 years ago Posts: 24 |
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
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 |
Registered: 18 years ago Posts: 7 |
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
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 |
Registered: 17 years ago Posts: 24 |
|
Re: Module: User Thank/Flame October 03, 2009 09:55AM |
Registered: 21 years ago Posts: 50 |
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()....
[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 |
Registered: 16 years ago Posts: 4 |
Sorry, only registered users may post in this forum.


