Advertisement:

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

Offline Rafferty

  • Jr. Member
  • **
  • Posts: 318
  • Gender: Male
    • 16 Air Defence Regiment Members
Re: Top 10 Posters today and This Week
« Reply #40 on: August 22, 2008, 09:30:40 PM »
Top 10 this month and week on 1.1.4

Installed with no errors, monthly stats working fine, no stats for week
Don't Follow me I got No Idea what I'm Doing

Offline burtybob

  • Jr. Member
  • **
  • Posts: 137
    • SFG
Re: Top 10 Posters today and This Week
« Reply #41 on: August 23, 2008, 07:40:52 AM »

Hey,

can i have a link to the page please?

Thanks,
Burtybob
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

Offline Rafferty

  • Jr. Member
  • **
  • Posts: 318
  • Gender: Male
    • 16 Air Defence Regiment Members
Re: Top 10 Posters today and This Week
« Reply #42 on: August 25, 2008, 11:39:33 PM »
Top 10 this month and week on 1.1.4

Installed with no errors, monthly stats working fine, no stats for week

Any ideas?
Don't Follow me I got No Idea what I'm Doing

Offline burtybob

  • Jr. Member
  • **
  • Posts: 137
    • SFG
Re: Top 10 Posters today and This Week
« Reply #43 on: August 26, 2008, 12:15:33 PM »

Hey,

can i have a link to the page please?

Thanks,
Burtybob

PS. one more message from you that is asking for help that does NOT include the link which i have asked for TWICE now will result in serious burns and no help being issued to you by me.

Thank you.
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

Offline Rafferty

  • Jr. Member
  • **
  • Posts: 318
  • Gender: Male
    • 16 Air Defence Regiment Members
Re: Top 10 Posters today and This Week
« Reply #44 on: August 26, 2008, 09:33:32 PM »
And my quiery?
Don't Follow me I got No Idea what I'm Doing

Offline wgn_white

  • Newbie
  • *
  • Posts: 8
Re: Top 10 Posters today and This Week
« Reply #45 on: November 24, 2008, 07:01:47 AM »
Here's mine...

hxxp:forum.kamoteworks.com/index.php?action=stats [nonactive]

I install it using the admin interface.
No hassle at all...

Q1: What's the different with Top 10 Poster and the Top 10 Poster Today? Why it's repeated?

Q2: My Top 10 poster This month is empty... Is it normal?

Q3: Why the Top 10 weekly doesn't show up?

And the last...

What code should I put and where to paste it so it shows in the homepage...
Maybe somewhere below the News, or I'll make a sidebar and shows the statistic there...

And I have this error in my log...


Quote
Invalid argument supplied for foreach()
File: /home/wpthemes/public_html/forum.kamote/Themes/default/Stats.template.php (main sub template - eval?)
Line: 216

And the error code look like this...

Quote
Line 216 ==>   foreach ($context['top_posters_week'] as $poster)
      echo '
                  <tr>
                     <td width="60%" valign="top">', $poster['link'], '</td>
                     <td width="20%" align="left" valign="top">', $poster['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
                     <td width="20%" align="right" valign="top">', $poster['num_posts'], '</td>
                  </tr>';

Thank you...

« Last Edit: November 25, 2008, 08:46:31 PM by wgn_white »

Offline burtybob

  • Jr. Member
  • **
  • Posts: 137
    • SFG
Re: Top 10 Posters today and This Week
« Reply #46 on: November 29, 2008, 01:55:55 PM »
Here's mine...

http://forum.kamoteworks.com/index.php?action=stats

I install it using the admin interface.
No hassle at all...

Q1: What's the different with Top 10 Poster and the Top 10 Poster Today? Why it's repeated?

Q2: My Top 10 poster This month is empty... Is it normal?

Q3: Why the Top 10 weekly doesn't show up?

And the last...

What code should I put and where to paste it so it shows in the homepage...
Maybe somewhere below the News, or I'll make a sidebar and shows the statistic there...

And I have this error in my log...


Quote
Invalid argument supplied for foreach()
File: /home/wpthemes/public_html/forum.kamote/Themes/default/Stats.template.php (main sub template - eval?)
Line: 216

And the error code look like this...

Quote
Line 216 ==>   foreach ($context['top_posters_week'] as $poster)
      echo '
                  <tr>
                     <td width="60%" valign="top">', $poster['link'], '</td>
                     <td width="20%" align="left" valign="top">', $poster['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
                     <td width="20%" align="right" valign="top">', $poster['num_posts'], '</td>
                  </tr>';

Thank you...

Sorry about taking so long to get back to you, I thank you for the link.

Q1: What's the different with Top 10 Poster and the Top 10 Poster Today? Why it's repeated?
The difference between "Top 10 Posters" and "Top 10 Posters Today" is that the Top 10 Posters is for ALL time where as the Top 10 Posters Today is just that, the 10 top people who have posted today.


Q2: My Top 10 poster This month is empty... Is it normal?
No and yes. I simple say both because there is a case that the month is not perfect and does, on some installs, work perfectly yet on others it does not. This also seems to be irrespective of the other mod's that are installed.



Q3: Why the Top 10 weekly doesn't show up?
This one I honestly can not answer as I have not encountered it before, the Top 10 Month I have but not hte weekly one. Which package is the weekly one with? (With the month or day?)


At a quick glance at
Quote
Line 216 ==>   foreach ($context['top_posters_week'] as $poster)
      echo '
                  <tr>
                     <td width="60%" valign="top">', $poster['link'], '</td>
                     <td width="20%" align="left" valign="top">', $poster['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
                     <td width="20%" align="right" valign="top">', $poster['num_posts'], '</td>
                  </tr>';
I would say the fix is:
Quote
Line 216 ==>   foreach ($context['top_posters_month'] as $poster)
      echo '
                  <tr>
                     <td width="60%" valign="top">', $poster['link'], '</td>
                     <td width="20%" align="left" valign="top">', $poster['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
                     <td width="20%" align="right" valign="top">', $poster['num_posts'], '</td>
                  </tr>';
Simply change the _week to _month should fix it and thank you for pointing that out, I think that is an error on my part.
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

Offline geezmo

  • Full Member
  • ***
  • Posts: 439
Re: Top 10 Posters today and This Week
« Reply #47 on: January 25, 2009, 09:36:22 PM »
Good mod! Installed and it works fine. Question, though. How do I add the Top Posters Today and Top Posters this Month stats to the homepage, as in right above the "Users Online" section?

Thanks!

Offline MF30

  • Jr. Member
  • **
  • Posts: 119
    • Futebol Tuga
Re: Top 10 Posters today and This Week
« Reply #48 on: February 05, 2009, 01:20:25 PM »
I need this mod to 1.1.8. :'(

Offline 4T3IG0

  • Semi-Newbie
  • *
  • Posts: 79
Re: Top 10 Posters today and This Week
« Reply #49 on: February 15, 2009, 10:15:09 PM »
Graet Mod  ;)

Can it -   Adds the top 10 posters today and this week to your Stats page (action=forum)??

If yes, I would like it just before calendar.  Tnks  8)


Offline timned88

  • Jr. Member
  • **
  • Posts: 360
    • The Magic in Pixels
Re: Top 10 Posters today and This Week
« Reply #50 on: February 16, 2009, 09:25:42 PM »
it seems like i have the following problems:
running 2.0RC1....
top 10 posters today and this week have the same amount  -- fixed that by changing (stats.template.php) top_posters_day to top_posters _week

top 10 this month displays an empty box.  changing (stats.template.php) to top_posters_month did not fix the problem.
fixed this problem by hacking two of the mod files together in (sources/stats.php)...   it is working now.

anyone need help?
http://www.themagicinpixels.com/forum
« Last Edit: February 16, 2009, 10:01:53 PM by timned88 »

Offline timned88

  • Jr. Member
  • **
  • Posts: 360
    • The Magic in Pixels
Re: Top 10 Posters today and This Week
« Reply #51 on: February 17, 2009, 12:47:50 AM »
i did notice, however, that the top 10 today did not reset itself at midnight....  it is 0048 right now and this has not reset itself.  anyone?

Offline timned88

  • Jr. Member
  • **
  • Posts: 360
    • The Magic in Pixels
Re: Top 10 Posters today and This Week
« Reply #52 on: February 17, 2009, 09:54:36 AM »
the top 10 today reset itself at 0100 hours and the first couple posts were not credited to the authors.  there are about 7 uncredited posts for today but it is working properly now.  there were 6 posts between 0000-0059 when it reset so there is really only 1 that got "lost" for the top ten today.   
can you help get this to reset at 0000 hours? 

Offline burtybob

  • Jr. Member
  • **
  • Posts: 137
    • SFG
Re: Top 10 Posters today and This Week
« Reply #53 on: February 27, 2009, 09:15:15 AM »
Hmmm... Not quite sure about the time out sync. I believe this could be if your server is an hour behind your local time. If this is not the case I do not know.
If your support topic does not have a link i will NOT assist you.
A link is easy to add AND is a massive help very often.
And a login account would be usefull even if its only pass and user =demo and its a normal account its not hard to add those two pieces of information.

I will do edits for you but not for free :) time costs money.

Offline timned88

  • Jr. Member
  • **
  • Posts: 360
    • The Magic in Pixels
Re: Top 10 Posters today and This Week
« Reply #54 on: February 27, 2009, 09:28:22 PM »
i found that i had a one hour time offset in the admin panel.  problem solved.

Offline heavyccasey

  • Jr. Member
  • **
  • Posts: 212
Re: Top 10 Posters today and This Week
« Reply #55 on: March 26, 2009, 11:00:57 PM »
This is dreadfully, dreadfully slow. 700,000 posts = 12 seconds for query. Please cache it.

Offline spire

  • Newbie
  • *
  • Posts: 1
WEEKLY TOP POSTERS: SOLVED
« Reply #56 on: May 22, 2009, 12:21:57 AM »
I believe I have solved the problem that many are experiencing with the Top Posters of the Week area.

If you search in your Stats.php page, you will find this line:

$starttime = mktime(0, 0, 0, date("n"), date("j"), date("Y")) - (date("N")*3600*24);

You will want to make "N" a lower-case "n", since that is how it is declared to the script.

Everything will be gravy after that.

See example of the proper formatting below:

$starttime = mktime(0, 0, 0, date("n"), date("j"), date("Y")) - (date("n")*3600*24);

or

$starttime = mktime(0, 0, 0, date("n"), date("j"), date("Y"))-(3600*24*date("n"));



To be clear: I had a TOP WEEKLY that just re-displayed the same data as TOP DAILY. All my other stuff was correct, nothing was asking for _daily instead of _weekly, or anything like that. So if you've got a more basic and fundamental I-can't-handle-a-manual-install problem, then this will probably not fix all that ails you, but you should check to make sure you've got it formatted properly all the same. It can't hurt.
« Last Edit: May 22, 2009, 12:28:05 AM by spire »

Offline tyty1234

  • SMF Hero
  • ******
  • Posts: 2,132
  • Gender: Male
  • <?php give_support(); ?>
    • tyty1234's SMF Site
Top 10 Posters Stats (Today, This Week, This Month)
« Reply #57 on: July 08, 2009, 04:51:59 AM »
Hey everyone!

I am considered an additional author for this mod, and I got burtybob's approval to update this mod for all of you. Please refer to the changelog for specifics on what has been changed, and I'm proud to release the Top 10 Posters Stats (Today, This Week, This Month) mod!

There soon will be a v2.0 to accommodate all functions of this mod into one modification! Keep checking back for updates! ;)

Also users who have submitted translations for this mod, I have edited the language files a bit, and I will need you translators to edit those translations and send them to me. Also Joomlamz, I recently saw your translation for this mod, and I didn't have time to incorporate that into this mod, also because of the recent changes I have made, so please send those to me. My email is tyty1993@hotmail.com, and once I receive the translated files, I will incorporate them into the next version of the mod. :)

PLEASE REPORT ANY BUGS OR ERRORS YOU MAY ENCOUNTER. THANKS! :D
(big thanks to spire for pointing out that big error in the code. ;))
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

Offline akbora

  • Sr. Member
  • ****
  • Posts: 960
    • Anında Tepki
Re: Top 10 Posters today and This Week
« Reply #58 on: July 08, 2009, 06:45:57 AM »
I want to run for week and month but I can't fin it?

All of mod are confused. I install for today and month appears today week, or install week month no difference both of them week count.

Help me please I want to install for week, and month...

Thanks
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Offline heinandar

  • Semi-Newbie
  • *
  • Posts: 98
Re: Top 10 Posters today and This Week
« Reply #59 on: July 08, 2009, 08:18:28 AM »

   // Top 10 Posters so far today
   // Change the time depending on server time offset
   list($year, $month, $day) = explode('-', date('Y-m-d'));
    $starttime = mktime(0, 0, 0, $month, $day, $year);
   
   // Offset based on forum time
   $starttime = forum_time(false, $starttime);
   
   // Our query.
   $request = db_query("
      SELECT mem.ID_MEMBER, mem.realName, COUNT(*) as count_posts
      FROM {$db_prefix}messages AS m
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
      WHERE m.posterTime > " . $starttime . "
         AND m.ID_MEMBER != 0
      GROUP BY mem.ID_MEMBER
      ORDER BY count_posts DESC
      LIMIT 10", __FILE__, __LINE__);
   
   // Throw everything into an array!
   $context['top_posters_day'] = array();
   $max_num_posts = 1;
   while ($row_members = mysql_fetch_assoc($request))
   {
      $context['top_posters_day'][] = array(
         'name' => $row_members['realName'],
         'id' => $row_members['ID_MEMBER'],
         'num_posts' => $row_members['count_posts'],
         'href' => $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'],
         'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'] . '">' . $row_members['realName'] . '</a>'
      );

      if ($max_num_posts < $row_members['count_posts'])
         $max_num_posts = $row_members['count_posts'];
   }
   mysql_free_result($request);

   foreach ($context['top_posters_day'] as $i => $j)
      $context['top_posters_day'][$i]['post_percent'] = round(($j['num_posts'] * 100) / $max_num_posts);
   
   // Tidy up
   unset($max_num_posts, $row_members, $j, $i);

   // Top 10 This Month
   $starttime = mktime(0, 0, 0, date("n"), date("j"), date("Y"))-(3600*24*(date("j")-1));
   
   // Offset based on forum time
   $starttime = forum_time(false, $starttime);
   
   // Our query.
   $request = db_query("
      SELECT mem.ID_MEMBER, me,.realName, COUNT(*) as count_posts
      FROM {$db_prefix}messages AS m
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
      WHERE m.posterTime > " . $starttime . "
         AND m.ID_MEMBER != 0
      GROUP BY mem.ID_MEMBER
      ORDER BY count_posts DESC
      LIMIT 10", __FILE__, __LINE__);
   
   // Throw everything into an array!
   $context['top_posters_month'] = array();
   $max_num_posts = 1;
   while ($row_members = mysql_fetch_assoc($request))
   {
      $context['top_posters_month'][] = array(
         'name' => $row_members['realName'],
         'id' => $row_members['ID_MEMBER'],
         'num_posts' => $row_members['count_posts'],
         'href' => $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'],
         'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'] . '">' . $row_members['realName'] . '</a>'
      );

      if ($max_num_posts < $row_members['count_posts'])
         $max_num_posts = $row_members['count_posts'];
   }
   mysql_free_result($request);

   foreach ($context['top_posters_month'] as $i => $j)
      $context['top_posters_month'][$i]['post_percent'] = round(($j['num_posts'] * 100) / $max_num_posts);

   // Tidy up
   unset($max_num_posts, $row_members, $j, $i);

me,.realName should be mem.realName  :)