News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Top 10 Posters today and This Week

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

Previous topic - Next topic

Rafferty

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

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.

Rafferty

Quote from: Rafferty 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

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

burtybob

Quote from: burtybob on August 23, 2008, 07:40:52 AM
Quote from: burtybob on August 20, 2008, 12:31:24 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.

Rafferty

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

wgn_white

#45
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...


QuoteInvalid 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...

QuoteLine 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...


burtybob

Quote from: wgn_white on November 24, 2008, 07:01:47 AM
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...


QuoteInvalid 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...

QuoteLine 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
QuoteLine 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:
QuoteLine 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.

geezmo

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!

MF30


4T3IG0

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)


timned88

#50
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

timned88

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?

timned88

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? 

burtybob

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.

timned88

i found that i had a one hour time offset in the admin panel.  problem solved.

heavyccasey

This is dreadfully, dreadfully slow. 700,000 posts = 12 seconds for query. Please cache it.

spire

#56
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.

tyty1234

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 [email protected], 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.

akbora

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
---------------

heinandar


   // 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  :)

Advertisement: