My mod wasn't intended for statistics, it was designed for ease of use and simplicity. I believe I have accomplished that and I will not make any further modifications. Sorry to disappoint you.
1 2006-10-30 20:56
Re: Rate Topic 1.0 (32 replies, posted in PunBB 1.2 modifications, plugins and integrations)
2 2006-10-23 10:46
Re: Rate Topic 1.0 (32 replies, posted in PunBB 1.2 modifications, plugins and integrations)
It finally hit me earlier yesterday. The way I have it set up is all the ratings go in a commonpool.
## +----------+------------------+------+-----+---------+-------+
## | Field | Type | Null | Key | Default | Extra |
## +----------+------------------+------+-----+---------+-------+
## | rate | tinyint(2) | | | 0 | |
## | user_id | int(10) unsigned | | | 0 | |
## | topic_id | int(10) unsigned | | | 0 | |
## +----------+------------------+------+-----+---------+-------+
The overall rating for a topic is not stored; only the individual ratings from a person. So if two people vote for the same topic, it is possible that it could show up twice. What you would have to do is select all distinct topic_id and then individually calculate the averages. To find top 5 you would have to store results in an array and do a lot more querying.
3 2006-10-22 20:53
Re: Rate Topic 1.0 (32 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Ok, the update is now available http://www.punres.org/download.php?id=1081
This update allows the user to view the rating in viewtopic.php
4 2006-10-22 15:29
Re: Rate Topic 1.0 (32 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I've decided to just upload the another file and not make a complete new release. I'll tell you when I'm done.
5 2006-10-22 14:37
Re: Rate Topic 1.0 (32 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Sorry that I can't help, like I said, I don't know about merging tables, sorting, and all that stuff. I have recieved a couple emails requesting that the rating be shown in viewtopic.php. I contemplated doing this while I was creating it and decided against it because it would be a lot of code copying and pasting and I was trying to keep it simple and easy for the user to install. I can tell you it is quite simple to modify this, but I haven't decided whether I am going to do so and upload it because then I would probably release it as 1.1 and I haven't really made a way for the user to upgrade and right now the only option is removing it and then uploading a new version, thereby deleting all the rated topics . If I do decide to update, I'll post it here.
6 2006-10-21 23:09
Re: Rate Topic 1.0 (32 replies, posted in PunBB 1.2 modifications, plugins and integrations)
ORDER BY 'id'
I think you're accidentally getting the id in ascending order, that's why it will always show the same subject. this should work (i hope, sql isn't my specialty)
$resultb = $db->query('SELECT rate, topic_id, subject FROM '.$db->prefix.'Ratings ORDER BY rate DESC LIMIT 5 ') or error('Unable to fetch user data', __FILE__, __LINE__, $db->error());
while ($datab = $db->fetch_assoc($resultb))
{
echo "".'<li><a href="http://xxxx/Forum/viewtopic.php?id='.$datab['topic_id'].'">'.pun_htmlspecialchars($datab['subject']).'</a></li> '."";
}
7 2006-10-21 22:52
Re: [Release] PunBB Backup v1.0 (31 replies, posted in PunBB 1.2 modifications, plugins and integrations)
very cool!
8 2006-10-06 21:52
Re: How to Shoot Yourself in the Foot in Any Programming Language (17 replies, posted in Programming)
nice
10 2006-09-10 02:10
Topic: Rate Topic 1.0 (32 replies, posted in PunBB 1.2 modifications, plugins and integrations)
##
##
## Mod title: Rate Topic
##
## Mod version: 1.00
## Works on PunBB: 1.2.* (meaning only small modifications of version 1.2 eg. 1.2.1)
## Release date: 2006-09-09
## Author: Eric Subach A.K.A. Kha0sK1d (kha0s@comcast.net)
##
## Description: This mod allows non-guest users who run MySQL or MySQLi to rate any topic on a scale of 1 - 5 with 5
## being the best. Users may also view who voted for a particular topic and what they rating they gave.
##
## Difference with
## previous version: N/A
##
## Affected files: viewforum.php, viewtopic.php
##
## Affects DB: Yes
## Adds the table 'Ratings':
## +----------+------------------+------+-----+---------+-------+
## | Field | Type | Null | Key | Default | Extra |
## +----------+------------------+------+-----+---------+-------+
## | rate | tinyint(2) | | | 0 | |
## | user_id | int(10) unsigned | | | 0 | |
## | topic_id | int(10) unsigned | | | 0 | |
## +----------+------------------+------+-----+---------+-------+
## Adds the following options to the table 'config':
## - o_rt_enabled
## - o_rt_use_stars
## - o_rt_cur_version
## - o_rt_cur_stars
## - o_rt_default_lang
##
## Notes: - Only MySQL and MySQLi are currently supported.
## - Purging or altering your database will cause Rate
## Topic to work improperly and may cause errors.
## - Ratings by banned members will not count so long as
## their ban is in effect.
## - Administrators have the following options:
## - Enable or disable Rate Topic
## - Use star images or numbers
## - Default language
## - Image packages
## - Having no star image packages will cause Rate Topic
## to default to using numbers.
## - Having corrupt star image packages will not cause
## PunBB to error, may yield images that do not display.
## - Guests may not vote or see who voted for a topic, but
## they may see the rating for a topic.
## - If a Rate Topic language file is not found, some pages
## will display an error, and others will justdefault to
## disabling Rate Topic.
## - If you decide to uninstall Rate Topic, run the
## install_mod.php file and click the restore button. You
## may choose to either remove the code that was added
## into viewforum.php and viewtopic.php, but it is not
## necessary for PunBB to continue working properly.
## - If you want to remove all ratings, uninstall Rate
## Topic and then install it again.
##
## DISCLAIMER: Please note that "mods" are not officially supported by
## PunBB. Installation of this modification is done at your
## own risk. Backup your forum database and any and all
## applicable files before proceeding.
##
##
11 2006-09-04 01:41
Re: CSS/XHTML Resources (26 replies, posted in Programming)
References, tutorials, etc.
12 2006-08-04 22:02
Re: OLD TOPIC TO DELETE (37 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Great job, jo jo, this mod rocks!
13 2006-08-04 21:55
Re: List of User Names who have viewed a topic? (3 replies, posted in Feature requests)
I don't think you could make this as an AMP mod, it would require actually modifying some of the current pages. I presume it wouldn't be difficult.