Module: User Thank/Flame
Posted by J. David Smith
|
Re: Module: User Thank/Flame June 19, 2008 11:05AM |
Admin Registered: 22 years ago Posts: 8,532 |
The problem with meta data is that it is stored in a serialized array in a single db field. There is no way in which you can search on that data through a database query. For searchable data, you'd need a real field or table. In 5.3 we are working on custom fields for messages (just like custom profile fields that we have now). Those will offer some more options for searching. Still, whether it performs good enough is something that we'll have to find out later.
If this is for generating top info, then it might be an option to create cached data for this and to trigger the caching code from a scheduled job (cron). In general, this is a good idea for statistical data that is not already aggregated somehow in the database. It's important that such page doesn't bring down the database because of all the queries that have to run.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
If this is for generating top info, then it might be an option to create cached data for this and to trigger the caching code from a scheduled job (cron). In general, this is a good idea for statistical data that is not already aggregated somehow in the database. It's important that such page doesn't bring down the database because of all the queries that have to run.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Module: User Thank/Flame June 19, 2008 03:51PM |
Registered: 22 years ago Posts: 174 |
|
Re: Module: User Thank/Flame June 19, 2008 04:33PM |
Registered: 18 years ago Posts: 49 |
When a user thanks or flames another user, that persons vote is stored in an array in the message meta field. Then when the page is redisplayed, it checks to see if the meta array has a field with the user's id in it. If so, the buttons don't show up. I am working on more substantial security for this, because there are several ways around it.
So basically here is how it works:
Thank/Flame button click
|
\/
$message['meta']['mod_user_thank_flame']['thanks'][$user_id] = 1 (or flames if the user flamed them
|
\/
page loaded
|
\/
script checks $message['meta']['mod_user_thank_flame']['thanks'][$user_id] to see if it exists, if so, then the buttons are not displayed.
Hope this helps :)
That would be really nice for 5.3 maurice. I'm not going to work on a top threads page right now, instead, I am working on making the code run faster.
So basically here is how it works:
Thank/Flame button click
|
\/
$message['meta']['mod_user_thank_flame']['thanks'][$user_id] = 1 (or flames if the user flamed them
|
\/
page loaded
|
\/
script checks $message['meta']['mod_user_thank_flame']['thanks'][$user_id] to see if it exists, if so, then the buttons are not displayed.
Hope this helps :)
That would be really nice for 5.3 maurice. I'm not going to work on a top threads page right now, instead, I am working on making the code run faster.
|
Re: Module: User Thank/Flame June 19, 2008 06:59PM |
Registered: 22 years ago Posts: 174 |
ok i see... nice explanation :)
in my opinion one user SHOULD be able to thank/flame more than once another user.
otherwise there is no big difference between user ratings unless you have many users and vote massively.
if you allow, let's say voting each 48 hours, users could be voted multiple times by different "positive" or "negative" options, encouraging users to respect and contribute the forums.
I don´t even know if this is technically possible, but do you get my point? :)
BTW what do you think about changing the word "rating" for "reputation" or "karma"?
after all it is not a ranking, just a number of votes that reflect the good or bad behaviour of that user...
(I know I can´t change it myself on templates, but just as a side comment)
and another suggestion for the top users page, I would divide it into three segments: best reputation (thanks-flame), most thanked, and most hated. not always the most reputated member is the most thanked (and vice versa!)
of course all of these coments would apply too to the voting thread section
thanks again for the effort on this module! :)
in my opinion one user SHOULD be able to thank/flame more than once another user.
otherwise there is no big difference between user ratings unless you have many users and vote massively.
if you allow, let's say voting each 48 hours, users could be voted multiple times by different "positive" or "negative" options, encouraging users to respect and contribute the forums.
I don´t even know if this is technically possible, but do you get my point? :)
BTW what do you think about changing the word "rating" for "reputation" or "karma"?
after all it is not a ranking, just a number of votes that reflect the good or bad behaviour of that user...
(I know I can´t change it myself on templates, but just as a side comment)
and another suggestion for the top users page, I would divide it into three segments: best reputation (thanks-flame), most thanked, and most hated. not always the most reputated member is the most thanked (and vice versa!)
of course all of these coments would apply too to the voting thread section
thanks again for the effort on this module! :)
|
Re: Module: User Thank/Flame June 25, 2008 09:20AM |
Registered: 18 years ago Posts: 4 |
Ok, so I've upgraded to the new version and most of it is working great. However, when I added the new template calls to the list.tpl, It spits out these errors:
Warning: filemtime() [function.filemtime]: stat failed for ./mods/user_thank_flame/templates/emerald/thread.tpl in /home/.anamokit/divinitry/yerp.singleframemedia.com/include/templates.php on line 130
Fatal error: phorum_get_file_contents: file "./mods/user_thank_flame/templates/emerald/thread.tpl" does not exist in /home/.anamokit/divinitry/yerp.singleframemedia.com/include/templates.php on line 741
Any ideas?
Warning: filemtime() [function.filemtime]: stat failed for ./mods/user_thank_flame/templates/emerald/thread.tpl in /home/.anamokit/divinitry/yerp.singleframemedia.com/include/templates.php on line 130
Fatal error: phorum_get_file_contents: file "./mods/user_thank_flame/templates/emerald/thread.tpl" does not exist in /home/.anamokit/divinitry/yerp.singleframemedia.com/include/templates.php on line 741
Any ideas?
|
Re: Module: User Thank/Flame June 26, 2008 10:06AM |
Admin Registered: 25 years ago Posts: 4,504 |
Permissions on thread.tpl appear to be wrong somehow and PHP can check its modified time. Make sure its permissions are the same as the other template files.
Brian - Personal Blog
|
Re: Module: User Thank/Flame June 26, 2008 10:19AM |
Registered: 18 years ago Posts: 4 |
|
Re: Module: User Thank/Flame June 26, 2008 10:30AM |
Admin Registered: 22 years ago Posts: 8,532 |
Maybe because thread.tpl is not a part of Phorum? Maybe some module or addon code that requires that template to be in the main template tree?
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Module: User Thank/Flame June 26, 2008 11:19AM |
Registered: 18 years ago Posts: 4 |
Yes, the User/Thank Flame module has a folder of templates files it uses for displaying ratings on various pages, and it is calling for a thread.tpl files within it's own /mods/user_thank_flame/templates/emerald folder, but it does not exist. I did not mean to suggest that this file was left out of the phorum build, simply the latest build of this particular add-on.
|
Re: Module: User Thank/Flame June 26, 2008 12:55PM |
Admin Registered: 22 years ago Posts: 8,532 |
Oh, I see. That was me, too busy with my work, trying to answer a question ;-)
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Sorry, only registered users may post in this forum.


