Advertisement:

Author Topic: Top 10 Posters today and This Week  (Read 82991 times)

Offline faster123

  • Semi-Newbie
  • *
  • Posts: 20
Re: Top 10 Posters today and This Week
« Reply #260 on: January 21, 2013, 06:16:37 PM »
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

Offline petb

  • Semi-Newbie
  • *
  • Posts: 60
Re: Top 10 Posters today and This Week
« Reply #261 on: November 05, 2013, 09:23:40 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.

Offline TourFL

  • Semi-Newbie
  • *
  • Posts: 57
Re: Top 10 Posters today and This Week
« Reply #262 on: March 11, 2016, 04:25:27 AM »
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)
Code: [Select]
// 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
Code: [Select]
// 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

Offline TourFL

  • Semi-Newbie
  • *
  • Posts: 57
Re: Top 10 Posters today and This Week
« Reply #263 on: March 11, 2016, 04:33:11 AM »
And for the French users ;D

Fichier Themes/Default/Language/Modifications.french-utf8.php
Ajouter à la fin, juste avant le '?>'
Code: [Select]
// 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

Offline khigh

  • Jr. Member
  • **
  • Posts: 154
Re: Top 10 Posters today and This Week
« Reply #264 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.

Offline Rock Lee

  • Sophist Member
  • *****
  • Posts: 1,194
  • Gender: Male
  • Digitalizando un nuevo mundo :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Top 10 Posters today and This Week
« Reply #265 on: December 06, 2017, 10:09:19 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 © 2017
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline khigh

  • Jr. Member
  • **
  • Posts: 154
Re: Top 10 Posters today and This Week
« Reply #266 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.


Offline Rock Lee

  • Sophist Member
  • *****
  • Posts: 1,194
  • Gender: Male
  • Digitalizando un nuevo mundo :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Top 10 Posters today and This Week
« Reply #267 on: December 06, 2017, 10:39:22 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 © 2017
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline khigh

  • Jr. Member
  • **
  • Posts: 154
Re: Top 10 Posters today and This Week
« Reply #268 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.

Offline Rock Lee

  • Sophist Member
  • *****
  • Posts: 1,194
  • Gender: Male
  • Digitalizando un nuevo mundo :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Top 10 Posters today and This Week
« Reply #269 on: December 07, 2017, 07:11:18 AM »
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 © 2017
Ayudas - Aportes - Tutoriales - Y mucho mas!!!