Advertisement:

Author Topic: Topic Count in Profiles  (Read 30874 times)

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: Topic Count in Profiles
« Reply #40 on: December 05, 2009, 12:44:04 AM »
Arantor i wanna tell you something bro :) really :) i wanna be a expert in PHP and want to make mods and give them to you :) i wanna give you something i dont want anything from you :) you already given me a lot .. Thanks for all
Proud To Be An Indian

Offline kai920

  • Sr. Member
  • ****
  • Posts: 855
  • Gender: Male
  • its != it's
Re: Topic Count in Profiles
« Reply #41 on: December 07, 2009, 02:32:22 AM »
I'm getting this database error, I believe only when a bot visits my forum:

Guest
 66.249.68.46   
 Type of error: Database

http://mysite.com/forums/index.php?action=profile;area=statistics;u=37

Database Error: Unknown column 'b.member_groups' in 'where clause'

File: /home/public_html/forums/Sources/Profile-View.php
Line: 828

If I open up that file, just before line 828 there is this query which I believe is from this mod:

Code: [Select]

   // Grab the topic this member posted in most often.
   $result = $smcFunc['db_query']('', '
      SELECT
         b.id_topic, MAX(m.subject) AS name, MAX(b.num_replies) AS num_replies, COUNT(*) AS message_count
      FROM {db_prefix}messages AS m
         INNER JOIN {db_prefix}topics AS b ON (b.id_topic = m.id_topic)
      WHERE m.id_member = {int:current_member}
         AND {query_see_board}
      GROUP BY b.id_topic
      ORDER BY message_count DESC
      LIMIT 10',
      array(
         'current_member' => $memID,
      )
   );



Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,403
    • StoryBB/StoryBB on GitHub
Re: Topic Count in Profiles
« Reply #42 on: December 07, 2009, 02:37:15 AM »
Interesting query.

* Arantor would STRONGLY suggest not using COUNT(*) in a query. Bad for performance, when COUNT(id_msg) would yield better performance on InnoDB and PostgreSQL.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Topic Count in Profiles
« Reply #43 on: December 07, 2009, 04:48:16 PM »
* Arantor would STRONGLY suggest not using COUNT(*) in a query. Bad for performance, when COUNT(id_msg) would yield better performance on InnoDB and PostgreSQL.

Thanks for the tip.

@kai920: Can guests view profiles? Do you use the 1.1 branch or the 2.0 branch?
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline kai920

  • Sr. Member
  • ****
  • Posts: 855
  • Gender: Male
  • its != it's
Re: Topic Count in Profiles
« Reply #44 on: December 07, 2009, 09:49:05 PM »
@kai920: Can guests view profiles? Do you use the 1.1 branch or the 2.0 branch?


I am using 2.0 RC2, and guests can view the main user profile page.

I just tried viewing a profile as a guest, and there was no db error logged. Could this error affect bots only?

Offline Cal O'Shaw

  • Full Member
  • ***
  • Posts: 444
  • SMF 1.1.14 & 2.0 Sites
Re: Topic Count in Profiles
« Reply #45 on: December 08, 2009, 02:14:46 AM »
Hello,

We use 1.1.11 and we were wondering if there is a way to disable the option to list all the topics a member has participated in.  We have some members who have been busy everywhere.

Also, is it possible to add a screenshot of what the 1.1.x member sees with the additional stats (new page or part of the =statPanel ?)

Grazie

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Topic Count in Profiles
« Reply #46 on: December 08, 2009, 03:14:45 PM »
Updated to 1.5.2: Added options to disable number of topics started and number of topics participated in for all three versions (1.1, 2.0 RC1, 2.0 RC2)
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline Cal O'Shaw

  • Full Member
  • ***
  • Posts: 444
  • SMF 1.1.14 & 2.0 Sites
Re: Topic Count in Profiles
« Reply #47 on: December 08, 2009, 06:54:37 PM »
Wow, that was fast!

Does that disable the ability to list the topics?  We don't have a problem with showing a number, but with having the site process the queries asking for a list of every topic (especially if the list query doesn't know to not include topics normally invisible to members, such as Admin-only topics).

Grazie,

Cal

Offline Cal O'Shaw

  • Full Member
  • ***
  • Posts: 444
  • SMF 1.1.14 & 2.0 Sites
Re: Topic Count in Profiles
« Reply #48 on: December 09, 2009, 02:54:15 AM »
Hi,

Just installed 1.52 and found a bug and had a question.

The bug: I clicked the "show Posts" link and the first page displayed is the initial posts of topics, and the count of pages (the "1, 2, 3... 13") is likely correct, the header says "Show Posts" and if I click on "2", it switches to showing posts (the count of pages increases and the end of the URL changes from "ShowTopics" to "ShowPosts").

The question: where in the AdminCP are the settings for controlling access to the Topic counts?

Grazie

Cal

Offline kai920

  • Sr. Member
  • ****
  • Posts: 855
  • Gender: Male
  • its != it's
Re: Topic Count in Profiles
« Reply #49 on: December 10, 2009, 08:43:12 PM »
I'm still getting the database errors. Any ideas what I can try in order to find the cause of the problem?

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Topic Count in Profiles
« Reply #50 on: December 11, 2009, 08:20:28 PM »
I had another play to try to figure out the interesting query and finished with 1.5.3

Options for this mod:
  • 1.1.x - Features and Options -> Topic Count in Profile
  • 2.0.x - Configuration -> Modifications -> Topic Count in Profile
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline Cal O'Shaw

  • Full Member
  • ***
  • Posts: 444
  • SMF 1.1.14 & 2.0 Sites
Re: Topic Count in Profiles
« Reply #51 on: December 11, 2009, 09:01:46 PM »
Good news with 1.5.3:
- Admin settings control showing topic counts
- 'Show Topics' correctly displays topics after the first page

Things to look at in 1.5.3:
- 'Show Topics' is displayed no matter what boxes are checked.  This is, topics started may not appear, but the 'Show topics' is still visible.
- Although 'Show Topics' works correctly, the title is still 'Show Posts'.
- Would you consider adding a checkbox to control if the "Show Topics" link is displayed?

This is a really nice MOD!

You've been very responsive and quick with updates.

Grazie mille!

Cal
« Last Edit: December 11, 2009, 09:05:02 PM by Cal O'Shaw »

Offline kai920

  • Sr. Member
  • ****
  • Posts: 855
  • Gender: Male
  • its != it's
Re: Topic Count in Profiles
« Reply #52 on: December 11, 2009, 09:22:01 PM »
I had another play to try to figure out the interesting query and finished with 1.5.3

Options for this mod:
    1.1.x - Features and Options -> Topic Count in Profile2.0.x - Configuration -> Modifications -> Topic Count in Profile[/list]


    Thanks very much live627. Will test and report back results!  :)

    Offline live627

    • Development Contributor
    • SMF Hero
    • *
    • Posts: 5,620
    • Gender: Male
      • live627 on Facebook
      • live627 on GitHub
      • live627 on LinkedIn
      • @live627 on Twitter
      • livemods
    Re: Topic Count in Profiles
    « Reply #53 on: December 11, 2009, 11:48:03 PM »
    - 'Show Topics' is displayed no matter what boxes are checked.  This is, topics started may not appear, but the 'Show topics' is still visible.
    - Although 'Show Topics' works correctly, the title is still 'Show Posts'.
    - Would you consider adding a checkbox to control if the "Show Topics" link is displayed?

    This is a really nice MOD!

    You've been very responsive and quick with updates.

    Grazie mille!

    Cal

    • Added an option to show/hide the list of topics
    • title fixed

    Thanks for liking this mod
    Try not to become a man of success, but rather try to become a man of value.
    - Albert Einstein

    Offline Cal O'Shaw

    • Full Member
    • ***
    • Posts: 444
    • SMF 1.1.14 & 2.0 Sites
    Re: Topic Count in Profiles
    « Reply #54 on: December 12, 2009, 12:06:28 AM »
    Hello,

    Just installed the revised 1.5.3.  Saw the additional checkbox.

    Many thanks!

    (the show topics still has "Latest posts of: (memberid)" in the browser tab and the table of the posts is still saying "Show Posts" but the function is there and that's what counts :) ).

    Grazie!

    Cal

    Offline kai920

    • Sr. Member
    • ****
    • Posts: 855
    • Gender: Male
    • its != it's
    Re: Topic Count in Profiles
    « Reply #55 on: December 12, 2009, 04:21:51 AM »
    I'm getting this database error, I believe only when a bot visits my forum:

    Guest
     66.249.68.46   
     Type of error: Database

    http://mysite.com/forums/index.php?action=profile;area=statistics;u=37

    Database Error: Unknown column 'b.member_groups' in 'where clause'

    File: /home/public_html/forums/Sources/Profile-View.php


    Quoting previous error for reference, but have a slightly different error now: (1.5.3)

    Database Error: Unknown column 'b.id_topic' in 'on clause'
    File: /home/public_html/forums/Sources/Profile-View.php
    Line: 833

    Offline beltazar

    • Semi-Newbie
    • *
    • Posts: 55
    Re: Topic Count in Profiles
    « Reply #56 on: December 12, 2009, 12:19:58 PM »
    I'm getting this database error, I believe only when a bot visits my forum:

    Guest
     66.249.68.46   
     Type of error: Database

    http://mysite.com/forums/index.php?action=profile;area=statistics;u=37

    Database Error: Unknown column 'b.member_groups' in 'where clause'

    File: /home/public_html/forums/Sources/Profile-View.php


    Quoting previous error for reference, but have a slightly different error now: (1.5.3)

    Database Error: Unknown column 'b.id_topic' in 'on clause'
    File: /home/public_html/forums/Sources/Profile-View.php
    Line: 833

    I'm using SMF2RC2 & have this error too

    change b.id_topic to b.id_board

    « Last Edit: December 12, 2009, 12:37:38 PM by beltazar »

    Offline kai920

    • Sr. Member
    • ****
    • Posts: 855
    • Gender: Male
    • its != it's
    Re: Topic Count in Profiles
    « Reply #57 on: December 15, 2009, 11:43:33 PM »
    I'm using SMF2RC2 & have this error too

    change b.id_topic to b.id_board


    You mean like this?


    Code: (search) [Select]
             INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
             INNER JOIN {db_prefix}boards AS b ON (b.id_topic = m.id_topic)


    Code: (replace) [Select]
             INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
             INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_topic)

    Offline live627

    • Development Contributor
    • SMF Hero
    • *
    • Posts: 5,620
    • Gender: Male
      • live627 on Facebook
      • live627 on GitHub
      • live627 on LinkedIn
      • @live627 on Twitter
      • livemods
    Re: Topic Count in Profiles
    « Reply #58 on: December 16, 2009, 04:22:38 PM »
    Yes
    Try not to become a man of success, but rather try to become a man of value.
    - Albert Einstein

    Offline kai920

    • Sr. Member
    • ****
    • Posts: 855
    • Gender: Male
    • its != it's
    Re: Topic Count in Profiles
    « Reply #59 on: December 16, 2009, 06:53:41 PM »
    I'm getting this database error, I believe only when a bot visits my forum:

    Guest
     66.249.68.46   
     Type of error: Database

    http://mysite.com/forums/index.php?action=profile;area=statistics;u=37

    Database Error: Unknown column 'b.member_groups' in 'where clause'

    File: /home/public_html/forums/Sources/Profile-View.php
    Line: 871



    Getting this same error, except now it's line 871...