News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Top 10 Posters today and This Week

Started by burtybob, June 03, 2008, 11:34:31 PM

Previous topic - Next topic

faster123

Hey everyone,

Can someone tell me how I can adjust the stats of the number someone posted? I tried changing it through going to their profile and changing their post count, however, the post count in the top 10 posters this week, does not change.

Please tell me how I can change this asap.

Thank you

petb

Quote from: hcfwesker on July 12, 2011, 10:57:45 PM
I was just fixing to come here and post the same issue for Top 10 Topics starters for the day, week, month, and year.

Glad to see i'm not the only one.  Hope a fix comes soon. :)
Doesn´t seem so.

The Problem still exists.
Only one Member was shown in the Top 10 Topics starters for the day, week, month, and year Sections.

TourFL

No sure if anybody is still using it, but I think I found the solution for the incorrect "Topic Starters" counts. It works on my forum, if somebody wants to give it a try  ;)

In file Sources/Stats.php
Search for that piece of code (Line 495 in my file, SMF 2.0.11)
// Try to cache this when possible, because it's a little unavoidably slow.
  if (($members = cache_get_data('stats_top_starters_mod', 360)) == null)
  {
$request = $smcFunc['db_query']('', '
SELECT t.id_member_started, t.id_first_msg, COUNT(*) AS hits
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}messages AS m ON (t.id_first_msg = m.id_msg)' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
WHERE t.id_board != {int:recycle_board}
AND m.poster_time > {int:start_time}' : '
WHERE m.poster_time > {int:start_time}') . '
GROUP BY id_member_started
ORDER BY hits DESC
LIMIT 20',
array(
'recycle_board' => $modSettings['recycle_board'],
'start_time' => forum_time(false, $start_time[$time]),
)
);
$members = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$members[$row['id_member_started']] = $row['hits'];
$smcFunc['db_free_result']($request);

cache_put_data('stats_top_starters_mod', $members, 360);
  }

Apparently it is the first test with the caching doing mess and blocking further processing, so I commented it. Maybe there is a way to make that test work properly (not sure if it is really needed), but this way it works  ;D

Resulting code
// Try to cache this when possible, because it's a little unavoidably slow.
  //if (($members = cache_get_data('stats_top_starters_mod', 360)) == null)
  // {
$request = $smcFunc['db_query']('', '
SELECT t.id_member_started, t.id_first_msg, COUNT(*) AS hits
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}messages AS m ON (t.id_first_msg = m.id_msg)' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
WHERE t.id_board != {int:recycle_board}
AND m.poster_time > {int:start_time}' : '
WHERE m.poster_time > {int:start_time}') . '
GROUP BY id_member_started
ORDER BY hits DESC
LIMIT 20',
array(
'recycle_board' => $modSettings['recycle_board'],
'start_time' => forum_time(false, $start_time[$time]),
)
);
$members = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$members[$row['id_member_started']] = $row['hits'];
$smcFunc['db_free_result']($request);

cache_put_data('stats_top_starters_mod', $members, 360);
  //}
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

TourFL

And for the French users ;D

Fichier Themes/Default/Language/Modifications.french-utf8.php
Ajouter à la fin, juste avant le '?>'
// Top 10 Posters and Topic Starters Stats.
$txt['top10_posters_today'] = 'Top 10 Posteurs aujourd\'hui';
$txt['top10_posters_week'] = 'Top 10 Posteurs cette semaine';
$txt['top10_posters_month'] = 'Top 10 Posteurs ce mois';
$txt['top10_posters_year'] = 'Top 10 Posteurs cette année';
$txt['top10_topic_starters_today'] = 'Top 10 lanceurs de sujets aujourd\'hui';
$txt['top10_topic_starters_week'] = 'Top 10 lanceurs de sujets cette semaine';
$txt['top10_topic_starters_month'] = 'Top 10 lanceurs de sujets ce mois';
$txt['top10_topic_starters_year'] = 'Top 10 lanceurs de sujets cette année';
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

khigh

Pretty old topic and the mod doesn't technically support current versions, but...

Any code type people see a way to make it display the post counts for ALL posters in a period? Not just the top ten? I installed it hoping there would be some backchannel data I could look at, but there isn't.

I'm trying to piece together a contest where users get a "raffle ticket" for every post in a time period - say a month. But I need to drill all the way down to single posts.

I asked on the SMF 2.0 support board and was told it wasn't a "thing" that I'd either need a mod or be more proficient than I am with MysSQL. I'm kinda hoping someone sees a line in this I could massage to do what I need.

Thanks for looking.

-Rock Lee-

Quote from: khigh on December 06, 2017, 10:03:41 PM
Pretty old topic and the mod doesn't technically support current versions, but...

Any code type people see a way to make it display the post counts for ALL posters in a period? Not just the top ten? I installed it hoping there would be some backchannel data I could look at, but there isn't.

I'm trying to piece together a contest where users get a "raffle ticket" for every post in a time period - say a month. But I need to drill all the way down to single posts.

I asked on the SMF 2.0 support board and was told it wasn't a "thing" that I'd either need a mod or be more proficient than I am with MysSQL. I'm kinda hoping someone sees a line in this I could massage to do what I need.

Thanks for looking.

Neither emulating the version manages to install it? I should try to see how it goes, but I think there is one other model that fulfills the function even if it only marks top 3 users, but of course you just have to change the calculation by which you can!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

khigh

Thanks,

I should clarify. I did install - first in a sandbox, then on the live site. I just modded the package info.

It just doesn't QUITE do do what I need, and I don't have the wherewithal to see if I can make it give me more than 10 people.


-Rock Lee-

Quote from: khigh on December 06, 2017, 10:36:09 PM
Thanks,

I should clarify. I did install - first in a sandbox, then on the live site. I just modded the package info.

It just doesn't QUITE do do what I need, and I don't have the wherewithal to see if I can make it give me more than 10 people.

Now I walk with some sleep in truth (it's the 0:37 GTM +3 here in Argentina) I see if in the morning I take some time to test if there is a failure ... Do you have any other mod installed? or something like knowing at the time of testing emerges incompatibility with another modification.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

khigh

I'm not explaining myself correctly, maybe?

It works perfectly.

I'm asking if it can be made to work differently than intended.

-Rock Lee-

Quote from: khigh on December 06, 2017, 10:53:13 PM
I'm not explaining myself correctly, maybe?

It works perfectly.

I'm asking if it can be made to work differently than intended.

Ah sorry is that my English is not so good, of course could be modified to work in other ways you just have to see what you want to achieve and have some knowledge of php in addition to time to apply it ...


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Advertisement: