Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Rudolf on June 20, 2007, 01:41:47 PM

Title: Enhanced Forum Statistics
Post by: Rudolf on June 20, 2007, 01:41:47 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=844)

*****************************************************
Enhanced Forum Statistics - Modification for SMF
version 1.0
© 2007, Rudolf Martincsek
*****************************************************
This mod allows you to select periods for which to display the forum statistics.
You can choose between first/last x days/weeks/months/years or custom start and end dates OR their combination.
Experiment.

Some values explained:


Screenshot:
(http://www.simplemods.org/files/screens/simplemods/efs/screen01.png)
Title: Re: Enhanced Forum Statistics
Post by: ArkServer on June 20, 2007, 03:28:43 PM
Nice mod, :D tempted to install but im not sure if it will work with all teh other mods i have.. :(
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on June 20, 2007, 04:55:34 PM
I'm pretty sure it will work. Not many mods relate to the statistics. Probably it will work on all your themes out of the box too.
Title: Re: Enhanced Forum Statistics
Post by: babjusi on June 20, 2007, 08:33:37 PM
Seems a cool mod, do I have to enable it anywhere after installing it? Where will those satistics be shown in my board, do I get to choose the place for them to be displayed? Thank you
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on June 20, 2007, 08:55:52 PM
It is the forum statistics center([More stats] (http://www.simplemachines.org/community/index.php?action=stats)), but enhanced. There's no need to enable anything.
Title: Re: Enhanced Forum Statistics
Post by: babjusi on June 20, 2007, 09:13:03 PM
Thanks for your explanation rudolf
Title: Re: Enhanced Forum Statistics
Post by: casp3r on June 21, 2007, 08:27:42 AM
I have just installed it on two forums:
1 - Many mods and using Cityscape theme - Works
2 - Many Mods and using Classic YaBB SE Theme - Doesn't work - although this forum has a number of other mods that don't work and to be honest I had Tiny Portal installed and I have had problems ever since I uninstalled it.
Title: Re: Enhanced Forum Statistics
Post by: chep on June 21, 2007, 11:29:32 PM
Entered number 2 for "Last 2 weeks"

Database Error
Column 'ID_BOARD' in where clause is ambiguous
File: /home/u1/huntwa/html/smf/Sources/Stats.php
Line: 648
Title: Re: Enhanced Forum Statistics
Post by: topiQ on June 22, 2007, 08:21:54 AM
Thanks Rudolf for this useful mod! As i am a native german speaker i edited the languages.xml and added german language support.
if some one is interested just download my attachment.

Greets,
topiQ

@Rudolf: If u want u can implement the modified language.xml in any new version of your mod.

//EDIT: Attachment removed as Rudolft integrated it in the mod.
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on June 22, 2007, 08:57:19 PM
Quote from: chep on June 21, 2007, 11:29:32 PM
Entered number 2 for "Last 2 weeks"

Database Error
Column 'ID_BOARD' in where clause is ambiguous
File: /home/u1/huntwa/html/smf/Sources/Stats.php
Line: 648


I don't get that error. Any error in the forum error log apart of this?
Can you post the lines from 640 to 655 from Stats.php?
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on June 22, 2007, 09:06:29 PM
Quote from: topiQ on June 22, 2007, 08:21:54 AM
Thanks Rudolf for this useful mod! As i am a native german speaker i edited the languages.xml and added german language support.
if some one is interested just download my attachment.

Greets,
topiQ

@Rudolf: If u want u can implement the modified language.xml in any new version of your mod.

Thank you. I integrated in the mod. You should remove the attachment because it will give errors on the installation if someone doesn't have the german language pack installed.
Title: Re: Enhanced Forum Statistics
Post by: chep on June 22, 2007, 10:44:50 PM
This is the error in the forum error log as well...


Database Error
Column 'ID_BOARD' in where clause is ambiguous
File: /home/u1/huntwa/html/smf/Sources/Stats.php
Line: 648



Lines 636 until 654
//-Enhanced Forum Statistics MOD- Start
if ($restrict_date)
{
$request = db_query("
SELECT ID_MEMBER_STARTED, COUNT(*) AS hits
FROM {$db_prefix}topics
LEFT JOIN  {$db_prefix}messages as msg ON (msg.ID_MSG = ID_FIRST_MSG)
WHERE msg.posterTime >= $start_date AND msg.posterTime <= $end_date
" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "
AND ID_BOARD != $modSettings[recycle_board]" : '') . "
GROUP BY ID_MEMBER_STARTED
ORDER BY hits DESC
LIMIT 20", __FILE__, __LINE__);
$members = array();
while ($row = mysql_fetch_assoc($request))
$members[$row['ID_MEMBER_STARTED']] = $row['hits'];
mysql_free_result($request);
}
//-Enhanced Forum Statistics MOD- End



Lines 647 - 8 - 9


ORDER BY hits DESC
LIMIT 20", __FILE__, __LINE__);
$members = array();


Think it has anything to do with recycle bin boards?
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on June 22, 2007, 10:54:53 PM
Yes, that was it.
I uploaded the package. Download and reinstall should solve the problem.
Title: Re: Enhanced Forum Statistics
Post by: chep on June 22, 2007, 11:03:06 PM
Works now! Great mod.

I have over 30 mods and works well.

1. SMF Links 1.6.3
2. New Topic Button 1.0
3. Increase/Decrease Postbox Size 1.0
4. Coppermine Userpics 1.0
5. TinyPortal 0.983
6. Spam Me Not Mod 1.02
7. Ad Managment 2.3
8. FlashChat Integration 1.0
9. SMF Ajax Registration Feedback 1.0.0
10. Topics Started by a user v 0.1.3 bugfixed - By Yio - bugfixed by Jack van Dijk 0.1.3
11. Enhanced Calendar 1.1
12. Search Topic 1.01
13. Select Admin for Notifications 1.1
14. PhpInfo 1.1
15. Ignore user 1.3
16. vMoveTopic Notify by PM 0.90
17. Googlebot & Spiders Mod 2.0.3
18. EmailFlash 2.0
19. Expand Pages Mod 1.0
20. Enhanced Password Reminder 1.0
21. Who Voted What? 1.1.2
22. Unsend Private Messages 1.1.1
23. Color Bar 2.0
24. Display Number of Attachments 0.4.1
25. Media Center 1.0
26. Unread by category 1.0
27. Reason For Editing Mod 1.14
28. Simple_Mood 1.0
29. SMF Store 1.1.3.1
30. Rename Topic 1.0.2
31. Enhanced Forum Statistics 1.0   
Title: Re: Enhanced Forum Statistics
Post by: kaajee on June 26, 2007, 05:22:54 AM
Nice mod!

I added Dutch language as well, working just fine at my forum.....
Here it can be downloaded (http://www.xs4all.nl/~johonl/kj/dump/Enhanced_Forum_Statistics-1.0-nl.zip)......
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on June 26, 2007, 06:43:47 AM
Thanks. I added to the main package.
Title: Re: Enhanced Forum Statistics
Post by: Skipdawg on June 28, 2007, 12:09:34 AM
This is great! Thanks  8) ;)
Title: Re: Enhanced Forum Statistics
Post by: ShadowStriker on June 30, 2007, 01:48:35 PM
How do you administrate this?
Title: Re: Enhanced Forum Statistics
Post by: babjusi on June 30, 2007, 02:19:57 PM
Rudolf explained that a coupla posts above

QuoteIt is the forum statistics center([More stats]), but enhanced. There's no need to enable anything.
Title: Re: Enhanced Forum Statistics
Post by: dcmouser on July 02, 2007, 07:18:26 PM
really nice idea -- thumbs up!
Title: Re: Enhanced Forum Statistics
Post by: brelay on July 05, 2007, 06:26:46 PM
I just updated from an older version of SMF to 1.1.3 and now we are finally geared up to use this great forum script.
I applied the Enhanced Stats Mod but I must be BLIND because I don't see where the Forum Statistics Center is located.
I will feel pretty dumb after you tell me exactly, I know...

http://www.utswanesthesia.com/forum

Thanks!
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on July 05, 2007, 06:32:39 PM
In that page look at the "Forum Stats" page. There isa link called [More stats] (http://www.utswanesthesia.com/forum/index.php?action=stats)

You should update your style.ccs in the classic theme.
Add this at the end of the file

/* //-Enhanced Forum Statistics MOD- Start */
.statform1
{
width: 85%;
margin: 0 auto;
text-align: center;
}
/* //-Enhanced Forum Statistics MOD- End */
Title: Re: Enhanced Forum Statistics
Post by: brelay on July 05, 2007, 07:04:55 PM
Told you I would feel dumb.
FANTASTIC MOD!!!
Title: Re: Enhanced Forum Statistics
Post by: mildmanneredj on July 11, 2007, 12:14:53 PM
I'm looking for a statistics mod that would show numbers of users/user activity at certain time ranges.  Could this one be modified for that?
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on July 11, 2007, 02:35:01 PM
It does exactly this.
Title: Re: Enhanced Forum Statistics
Post by: raymond8505 on July 18, 2007, 12:47:02 PM
I am getting parse errors on sources, themes and languages when I try to install the package on 1.1.3, the only other mod I have is the visual warning mod.
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on July 18, 2007, 12:50:22 PM
Make sure there is a temp folder (with write access) in the Packages folder before trying to install the mod.
Title: Re: Enhanced Forum Statistics
Post by: raymond8505 on July 18, 2007, 01:01:50 PM
AWESOME!! thanks so much! Is the temp folder required for a lot of mods?

Install ran fine and all tests were successful, but no changes took effect, I checked the files that should have been changed and no changes were effected
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on July 18, 2007, 02:14:21 PM
It is the configuration of your host, that stops the script to create it.
There is a mod that prevents SMF from removing the temp directory: No temp directory removal (http://custom.simplemachines.org/mods/index.php?mod=724) which you might find it crucial for your site.
Install the mod. Create the temp directory and try to install this mod again.
Title: Re: Enhanced Forum Statistics
Post by: raymond8505 on July 18, 2007, 02:44:17 PM
thanks for the advice. I will let you know in a few hours how it went.
Title: Re: Enhanced Forum Statistics
Post by: myoung on July 19, 2007, 12:17:12 AM
anyone using this with Diber MC theme? I'm just seeing the normal stats aftger installation...
Title: Re: Enhanced Forum Statistics
Post by: LadyC on September 04, 2007, 02:35:18 PM
i installed this (and also the enhanced user stats) but nothing changes. no matter what time period i select, it still shows the normal stats as though i hadn't selected any time frame at all.... with both mods.
Title: Re: Enhanced Forum Statistics
Post by: Limun on September 20, 2007, 12:37:13 PM
great mod !! Thanks..  :)
but i have little psoblem  :(

see picture
Title: Re: Enhanced Forum Statistics
Post by: Neorics on September 21, 2007, 01:55:23 PM
can this work or integrate with other stats other than the basic ones?

i mean i have referral and invite mod so i also have the stats for them in the stats center so if i use this thread then will i be able to use it in conjunction with the other 2 mods i just mentioned?

if not is it possible to customize it so that it could? how?
Title: Re: Enhanced Forum Statistics
Post by: hartiberlin on December 13, 2007, 08:17:51 PM
Hi Rudolf,
can your mod display the most  traffic per IP address per
day ?

I really need to catch some abusers, who make too much traffic
on my forum and until now I did not find any
online stats script that shows from which
IP address the most traffic per day came...

Then I could block these IP addresses via the
bot-trap.de
script.

Many thanks.

Regards, Stefan.

P.S: Does it store the information inside the database ?
So how many queries and updates does it do to the database per hour ?
As I am limited to 100.000 accesses to the database per hour,
I don´t want a Mod that adds too many database calls, so this will
shut otherwise down my forum, cause my hoster is limiting this...
Many thanks.
Title: Re: Enhanced Forum Statistics
Post by: Jameel225 on December 20, 2007, 12:57:31 PM
i  have installed but not showing in index page

plz help me
Title: Re: Enhanced Forum Statistics
Post by: anakmacan on February 01, 2008, 10:16:29 PM
Hi, when are you going to make it work for 1.1.4 ?
Title: Re: Enhanced Forum Statistics
Post by: spaZzZilla on February 14, 2008, 11:16:00 AM
I installed this mod on a test forum for 1.1.4 and it seems to work very well.  Really nice.

I have not yet looked at the code, but are you able to change the number of "Top Poster" or other things with a "Top number" kind of category.....


Put another way, how could you change "Top 10 posters" for a period to "Top 27 posters" for a period?  Is that something to change in the mod or in the default SMF installation?

Thanks :)
Title: Re: Enhanced Forum Statistics
Post by: FragaCampos on May 03, 2008, 12:40:44 PM
Hey there.
I installed this mod and received no errors. But when i acess the statistics page i get this error in a blank page:
Parse error: syntax error, unexpected $end in /public_html/Sources/Stats.php on line 628

Help?
Title: Re: Enhanced Forum Statistics
Post by: FragaCampos on May 03, 2008, 12:52:27 PM
For some sad reason, my stats.php file has an unexpected end, since i installed this mod. Now i can't acess my forum's statistics.
Where can i find the original stats.php file?

Btw, i attached the stats.php if someone wants to take a look...


EDIT: I already managed to get the original files...
Title: Re: Enhanced Forum Statistics
Post by: FragaCampos on May 03, 2008, 01:10:33 PM
I think the upload went wrong and truncated the file... reinstalled and everything is ok.  :P


Portuguese and brazilian translations:

<file name="$themedir/languages/Stats.portuguese.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
//-Enhanced Forum Statistics MOD- Start
$txt['enh_stats_title'] = 'Seleccionar per&iacute;odo para ver as estat&iacute;sticas';
$txt['period_title'] = 'Seleccionar o per&iacute;odo onde quer ver as estat&iacute;sticas parciais';
$txt['last'] = '&Uacute;ltimo';
$txt['first'] = 'Primeiro';
$txt['period_0'] = 'Hora(s)';
$txt['period_1'] = 'Dia(s)';
$txt['period_2'] = 'Semana(s)';
$txt['period_3'] = 'M&ecirc;s(es)';
$txt['period_4'] = 'Ano(s)';
$txt['update'] = 'Actualizar';
$txt['number_descr'] = '<em>Usar <strong>0</strong> para ver todos</em>';
$txt['from'] = 'desde';
$txt['to'] = 'at&eacute;';
$txt[564] = 'M&ecirc;s (MM)';
$txt[565] = 'Dia (DD)';
$txt[566] = 'Ano (YYYY)';
//-Enhanced Forum Statistics MOD- End
]]></add>
</operation>
</file>

<file name="$themedir/languages/Stats.brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
//-Enhanced Forum Statistics MOD- Start
$txt['enh_stats_title'] = 'Seleccionar per&iacute;odo para ver as estat&iacute;sticas';
$txt['period_title'] = 'Seleccionar o per&iacute;odo onde quer ver as estat&iacute;sticas parciais';
$txt['last'] = '&Uacute;ltimo';
$txt['first'] = 'Primeiro';
$txt['period_0'] = 'Hora(s)';
$txt['period_1'] = 'Dia(s)';
$txt['period_2'] = 'Semana(s)';
$txt['period_3'] = 'M&ecirc;s(es)';
$txt['period_4'] = 'Ano(s)';
$txt['update'] = 'Actualizar';
$txt['number_descr'] = '<em>Usar <strong>0</strong> para ver todos</em>';
$txt['from'] = 'desde';
$txt['to'] = 'at&eacute;';
$txt[564] = 'M&ecirc;s (MM)';
$txt[565] = 'Dia (DD)';
$txt[566] = 'Ano (YYYY)';
//-Enhanced Forum Statistics MOD- End
]]></add>
</operation>
</file>


Title: Re: Enhanced Forum Statistics
Post by: mjltigger on September 15, 2008, 05:27:11 PM
I just upgraded my test server to 1.1.6 and installed this mod.. it says it all installed properly, i have no errors on either my server or the forum error log and yet nothing has changed on my stats page... am I a muppet?
Title: Re: Enhanced Forum Statistics
Post by: HunterP on December 09, 2010, 04:31:27 PM

I'm getting this error :

Database error: Column 'ID_TOPIC' in field list is ambiguous
File: /www/htdocs/hulpvera/forum/Sources/Stats.php
Line: 492

// Are you on a larger forum?  If so, let's try to limit the number of topics we search through.
if ($modSettings['totalMessages'] > 100000)
{
//-Enhanced Forum Statistics MOD- Start
if ($restrict_date)
$request = db_query("
SELECT ID_TOPIC
FROM {$db_prefix}topics as t
LEFT JOIN {$db_prefix}messages as msg ON (msg.ID_MSG = t.ID_FIRST_MSG)
WHERE numReplies != 0 AND posterTime >= $start_date AND posterTime <= $end_date
ORDER BY numReplies DESC
[b] LIMIT 100", __FILE__, __LINE__);
[/b] else
//-Enhanced Forum Statistics MOD- End
$request = db_query("
SELECT ID_TOPIC
FROM {$db_prefix}topics
WHERE numReplies != 0
ORDER BY numReplies DESC
LIMIT 100", __FILE__, __LINE__);
$topic_ids = array();
while ($row = mysql_fetch_assoc($request))
$topic_ids[] = $row['ID_TOPIC'];
mysql_free_result($request);
}
else
$topic_ids = array();


The bold line is 492.
Title: Re: Enhanced Forum Statistics
Post by: Rudolf on February 18, 2011, 07:46:22 PM
Replace

SELECT ID_TOPIC

with

SELECT t.ID_TOPIC
Title: Re: Enhanced Forum Statistics
Post by: texasman1979 on February 19, 2011, 04:12:55 PM
is there a 2.0 rc 5 version of this downloadable or maybe someone that has it can send it to me or something?
Title: Re: Enhanced Forum Statistics
Post by: HunterP on February 21, 2011, 01:52:30 PM
Quote from: Rudolf on February 18, 2011, 07:46:22 PM
Replace

SELECT ID_TOPIC

with

SELECT t.ID_TOPIC


Thanks! Is fixed now.
Title: Re: Enhanced Forum Statistics
Post by: MommaYoung on June 27, 2012, 09:06:15 AM
Good Morning Rudolf,

I am trying to install the "Enhanced forum Statistics" for a friend, but I am receiving errors and receiving the following message:  Error in Package Installation

"Error in Package Installation - At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF."

She is using 2.0.2

Your suggestions would be much appreciated.

Thank you for your time.
Title: Re: Enhanced Forum Statistics
Post by: TheListener on June 28, 2012, 06:27:17 PM
Letting us know there was an error is not enough to go on.

We need to know what the error actually states.

Have you checked your error log?