| ||
![]() | ||
|
| You are logged in as a guest. ( logon | register ) |
| Random quote: Phase two. The flower blossoms through what seems to be a concrete surface, i.e. greed, racism, insanity, physical and social handicaps. These are the things that moor the flower. Red rose or black rose, no in-between. - (Added by: Equinox) |
MOD: Advanced User StatisticsModerators: Support Team Jump to page : 1 2 3 Now viewing page 1 [25 messages per page] | View previous thread :: View next thread |
| MegaBBS -> MegaBBS 2.x MODs | Message format |
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | This mod will show you a number of statistics for any given user, like the most active forums by posts, breakdown of posts by time, weekday and month, average posts per day, week and month and more. For an example see here: http://www.havocaos.com/forum/user-stats.asp?uid=3 Thanks to Muis for his help with the SQL queries. Update The MOD has been updated on June 11th, 2004. If you have an older copy, download the files again and go through the installation procedure again. Changes: - Implemented security checks as requested by Zoefff. - Added last 5 IPs the user has posted and logged in from, as requested by ssnaiper. This is only visible to moderators and higher users. Installation 1. Download the attached files, then rename and upload them as follows: 1.1. user-stats.asp.root - rename to user-stats.asp and upload to your MegaBBS root directory. 1.2. user-stats.asp.template - rename to user-stats.asp and upload to the /templates/original/BBS directory. 1.3. bar.gif - simply upload to the /templates/original/images/common directory. The image is basically the existing poll-center.gif rotated 90 degrees clockwise. If you use your own image, either name it bar.gif as well, or change the file name in step 2.2. 2. Configure your template: 2.1. Open your /templates/original/template-config.asp file. 2.2. After line 63 (or any other place you want) add the following line: dictImages.add "BAR", sBBSTemplateImagesRoot & "/bar.gif" 3. Configure your languages file: 3.1. Open your /languages/language-config.asp file. 3.2. Find the following line: (should be 812) dictLanguage.add "VIEWPROFILE-TITLE", "Viewing user profile" 3.3. (Optional) Right below it add this code: dictLanguage.add "VIEW-PROFILE-STATS", "See this user's statistics" This is only needed if you plan on doing step 4. 3.3. Below it, add this code: elseif sBBSLangPage = "view-stats" then Note: if you're also using my multi-language support mod, then in step 3.1 open your /languages/language-xx.asp files, where xx is the two-letter language identifier, and repeat steps 3.2 and 3.3 with every language file. dictLanguage.add "VIEW-STATS-TITLE", "Viewing user stats" dictLanguage.add "VIEW-STATS-1", "User statistics for" dictLanguage.add "VIEW-STATS-2", "Total time spent online:" dictLanguage.add "VIEW-STATS-3", "Total posts:" dictLanguage.add "VIEW-STATS-4", "Total threads:" dictLanguage.add "VIEW-STATS-5", "Total polls created:" dictLanguage.add "VIEW-STATS-6", "Total votes cast:" dictLanguage.add "VIEW-STATS-7", "Posts this year:" dictLanguage.add "VIEW-STATS-8", "Posts this month:" dictLanguage.add "VIEW-STATS-9", "Posts today:" dictLanguage.add "VIEW-STATS-10", "Posting activity by time" dictLanguage.add "VIEW-STATS-11", "Time of day" dictLanguage.add "VIEW-STATS-12", "Posting activity by day" dictLanguage.add "VIEW-STATS-13", "Weekday" dictLanguage.add "VIEW-STATS-14", "Posting activity by month" dictLanguage.add "VIEW-STATS-15", "Month" dictLanguage.add "VIEW-STATS-16", "Most popular forums by posts" dictLanguage.add "VIEW-STATS-17", "Last active topics" dictLanguage.add "VIEW-STATS-18", "Average posts per day:" dictLanguage.add "VIEW-STATS-19", "Average posts per week:" dictLanguage.add "VIEW-STATS-20", "Average posts per month:" dictLanguage.add "VIEW-STATS-21", "Last 5 IPs the user posted from:" dictLanguage.add "VIEW-STATS-22", "Last 5 IPs the user logged in from:" dictLanguage.add "VIEW-STATS-DISABLED", "Disabled" dictLanguage.add "VIEW-STATS-NOPOSTS", "This user has yet to post." 4. Add link to the profile page: 4.1. Open your /templates/original/BBS/view-profile.asp file. 4.2. Change the following code: if dictConfiguration("bINTERNALMESSAGINGENABLED") = 1 then to this: (new code is highlighted) response.write "<img align='middle' src='" & dictImages("NAV-MESSAGES") & "'> <a href='" & sBBSForumRoot & "/send-private-message.asp?uid=" & BBS.ValidateNumeric(dictEnvironment("V-USERINFO")(UI_MemberID)) & "'>" & dictLanguage("VIEWPROFILE-14") & "</a>" response.write "</td></tr></table>" end if if dictConfiguration("bINTERNALMESSAGINGENABLED") = 1 then response.write "<img align='middle' src='" & dictImages("NAV-MESSAGES") & "'> <a href='" & sBBSForumRoot & "/send-private-message.asp?uid=" & BBS.ValidateNumeric(dictEnvironment("V-USERINFO")(UI_MemberID)) & "'>" & dictLanguage("VIEWPROFILE-14") & "</a><br>" end if response.write "<a href='" & sBBSForumRoot & "/user-stats.asp?uid=" & BBS.ValidateNumeric(dictEnvironment.item("V-USERINFO")(UI_MemberID)) & "'>See this user's statistics</a><br>" response.write "</td></tr></table>" Note: if you use other templates besides / instead of the original, repeat steps 1, 2 and 4 for every template, each time replacing original with the template's root folder name. Enjoy :) Next up: Jarrek's Advanced BBS Statistics mod for MegaBBS v2.x (bar.gif) Attachments ---------------- user-stats.asp.root (10KB - 762 downloads) user-stats.asp.template (12KB - 758 downloads) bar.gif (0KB - 795 downloads) | ||
| |||
| Zoefff |
| ||
![]() Member Posts: 49 ![]() Location: The Netherlands | I LOVE the Mod!! Thanks to your exellent guide, it works perfect! | ||
| |||
| Zoefff |
| ||
![]() Member Posts: 49 ![]() Location: The Netherlands | Hm, there's only one thing... is it possible to build in a permission-check? Users with no permission to view certain forums and theads, are now able to see them at the stats page. | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | Yeah, I'll take a look at it right away. Shouldn't be too hard. *crosses fingers* I've regretted saying that before...lol | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | OK, security checks implemented. Thanks for pointing that out. Grab the files from the top post again and redo step 3 of the installation procedure, there's two new language tokens to be added. | ||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | Karmic, The mod works great for about half of my members, but I get these errors when trying to view the rest of them. Any thoughts? Microsoft VBScript runtime error '800a0009' Subscript out of range: '-1' /forum/user-stats.asp, line 90 ################################## Microsoft VBScript runtime error '800a0009' Subscript out of range: '-2' /forum/user-stats.asp, line 90 | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | Hmm... something with the time offset probably. Going below zero or something like that. Try this attached file, see if it works. Attachments ---------------- user-stats.asp (9KB - 772 downloads) | ||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | karmic - 2004-06-11 1:56 PM Hmm... something with the time offset probably. Going below zero or something like that. Try this attached file, see if it works. That did it...thanks! Got a second problem. When a member has never posted, my custom footer which uses a table with three columns is not spread across the entire width of the page. (error.png) Attachments ---------------- error.png (8KB - 688 downloads) | ||
| |||
| Styx |
| ||
Posts: 588 ![]() ![]() ![]() ![]() Location: Knoxville, TN | i get the same error also when a user has not posted on the forum at all i get the following message. Error encountered in: \forum\templates\original\bbs\user-stats.asp Microsoft VBScript runtime error - Subscript out of range and when i went to the file directly i get the following error. Microsoft VBScript runtime error '800a000d' Type mismatch: 'dictImages' /forum/templates/original/bbs/user-stats.asp, line 3 hope this helps and you can find out what is causing it | ||
| |||
| Muis |
| ||
![]() ![]() ![]() Location: Netherlands | Try this file and place it in your root-forum directory (NOT in the templates dir) It should work EDIT forget it....didn't work properly.....follow up soon (I hope) Edited by Muis 2004-06-11 4:30 PM | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | The error about dictImages is what you get if you try to run a template file directly. OK, I got it pinned down to the permission checks, threw in an extra variable and now it seems to work. See Lofty's profile for example Grab the attached files again, and in language-config.asp add another line: dictLanguage.add "VIEW-STATS-NOPOSTS", "This user has yet to post." Put it with the other view-stats language tokens. I'll update the top post ASAP. Cheers for the bug reports guys Attachments ---------------- user-stats.asp.template (12KB - 653 downloads) user-stats.asp.root (10KB - 648 downloads) | ||
| |||
| Muis |
| ||
![]() ![]() ![]() Location: Netherlands | Is it correct that it now only shows the last 3 most active threads? | ||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | Works on some, but not all. (error2.png) Attachments ---------------- error2.png (10KB - 647 downloads) | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | Such is the life of a mod-maker... The ubound() call on one of the arrays was using the wrong dimension. Working file attached here, and updated in top post. I really hope this is the last error... Attachments ---------------- user-stats.asp.template (12KB - 735 downloads) | ||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | karmic - 2004-06-11 5:08 PM Such is the life of a mod-maker... The ubound() call on one of the arrays was using the wrong dimension. Working file attached here, and updated in top post. I really hope this is the last error... So far so good, don't see anymore problems. Might be nice to tie it to a members "Hide your post count?" option. Maybe disable the link in the event someone chooses to hide their count...just a thought. Thanks guys, nice addition! Nick | ||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | Whoops...one last fix. I have one member that spells her name like this LisaRenee' and apparently it creating this error. I'll just change her name if it's a big deal to fix it. Just thought you'd like to know. Microsoft JET Database Engine error '80040e14' Syntax error in string in query expression 'username='LisaRenee'''. /forum/user-stats.asp, line 30 | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | Anything that directly displays the user's post count in the stats page is already tied to the option. Ah that... no biggie at all, I'll just run the username through ValidateSQL() Moment... Edit: OK, here you go. Attachments ---------------- user-stats.asp.root (10KB - 654 downloads) | ||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | Nope...sorry, same error. Microsoft JET Database Engine error '80040e14' Syntax error in string in query expression 'username='LisaRenee'''. /forum/user-stats.asp, line 30 | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | Duh... two instances of username in two different queries... fixed the other one. Try the file from the above post again. | ||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | karmic - 2004-06-11 6:26 PM Duh... two instances of username in two different queries... fixed the other one. Try the file from the above post again. That's it! Tried all my members and it looks to be bug free here, good work...thanks | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | Wheew! *swipes forehead* I'll be gone for the next two or so days, so if no bugs arise during that, it hopefully means the mod is finally bugfree... | ||
| |||
| reubs |
| ||
| i don't think the 'posts today' thing works. i just posted one and it didn't come up as one???? cheers | |||
| |||
| Nick |
| ||
Veteran Posts: 150 ![]() ![]() ![]() Location: Victorville, CA | reubs - 2004-06-13 10:07 AM i don't think the 'posts today' thing works. i just posted one and it didn't come up as one???? cheers Yep, I agree. "Posts today" are not working here either. | ||
| |||
| SkyWolf~*BA*~ |
| ||
Veteran Posts: 164 ![]() ![]() ![]() Location: Miami, FL USA | Was this tested with an SQL database? I can't seem to get it to work at all. I get this error: Microsoft OLE DB Provider for SQL Server error '80040e14' Incorrect syntax near the keyword 'ORDER'. /forum/user-stats.asp, line 149 I haven't had time to sit down and go through that SQL statement but at first glance it looks ok to me. | ||
| |||
| karmic |
| ||
Posts: 1678 ![]() ![]() ![]() ![]() ![]() ![]() Location: Omnipresent | Nope, that has only been tested with Access. I currently have no place to run MSSQL databases on, so I can't test it. If someone could modify the queries so that they work on MSSQL too, and post the changes here, that'd be great. | ||
| |||
| Jump to page : 1 2 3 Now viewing page 1 [25 messages per page] |
| Search this forum Printer friendly version E-mail a link to this thread |
| (Delete all cookies set by this site) | |
| Running MegaBBS ASP Forum Software © 2002-2010 PD9 Software | |

MOD: Advanced User Statistics