Firefox PHP

Module: User Tagging

Posted by Maurice Makaay 
Re: Module: User Tagging
December 04, 2009 09:56AM
Hi Marice,

Thanks for the reply, the contents of the $user['admin'] variable is a character, for the three user records I am testing with I get D, d, and k
Re: Module: User Tagging
December 04, 2009 09:58AM
did you check it in the database?


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: User Tagging
December 04, 2009 10:14AM
Hi Thomas,

Yes I have checked the database, assuming that the $user['admin'] variable is populated from the admin column then the column definition is tinyint and obviously all values are numeric.
Re: Module: User Tagging
December 04, 2009 05:28PM
So it seems that some code is setting the admin field incorrectly and I can assure you that it is not the core Phorum code.

Try disabling modules to see what module is breaking the admin field for you.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: User Tagging
December 05, 2009 10:55AM
Hi Maurice,

I have tracked the problem down. As suggested I have disabled all other modules to ensure that I am only looking at the phorum core code and the user tagging module.

In the user_tagging.php the calling function to user_tagging_process_rule is passing through $message['author'] this value appears to contain only the username, which would explain the characters I was getting as they are the first letter of the username.
I have tweeked the code the call $user = phorum_api_user_get($message['user_id'], TRUE); and pass $user as the second parameter into the process_rule function and all is working as expected, just a little slower than it should..
Re: Module: User Tagging
December 05, 2009 11:50AM
Exactly on what line do you see $message['author'] in user_tagging.php? It does not occur in my version of the script.

Additionally, I still don't see how the admin field would get the first letter of the author name in it because of this module. This module only inspects the contents of the admin field and never sets it.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 1 time(s). Last edit at 12/05/2009 11:57AM by Maurice Makaay.
Re: Module: User Tagging
December 05, 2009 09:34PM
Hi Maurice,

Line 79 was the offending line of code. I just checked that against the latest version variable should be $message['user']..

I inherited the forum of another person who had made some mods, strange that the problem only appeared when the forum was copied between servers.

Thanks for your help and the time you spent on this. It's much appreciated.
Re: Module: User Tagging
December 05, 2009 11:24PM
I'm glad that you found it. The problem already sounded like some code was either hacked up or not up-to-date. I hope all the rest will be a smooth ride from here.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: User Tagging
June 18, 2010 09:45PM
Maurice, this is an awesome module, thanks for creating it!

I made an addition to it, and am posting it in case you or anyone finds useful. I added a match for when a user_id is found in a ban list (or not in a ban list). I sometimes use the the ban list on user_id option to temporarily ban misbehaving users from posting, and recently thought it would be useful to make the user tagging recognize these. I attached the hack as diff files in the ban_list.zip.

-phil.

mmakaay: delete the attached diff, it is now part of the release package



Edited 1 time(s). Last edit at 06/19/2010 11:33AM by Maurice Makaay.
Re: Module: User Tagging
June 19, 2010 11:37AM
Thanks for the idea and patch.
I included it in version 1.0.7 of the module.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login