Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: live627 on August 18, 2009, 10:40:38 AM

Title: Topic Count in Profiles
Post by: live627 on August 18, 2009, 10:40:38 AM
Link to the mod (https://custom.simplemachines.org/index.php?mod=2084)

Topic Count in Profiles

Original Author: Arantor

Description:
This mod adds a count of the number of topics a user has started, underneath their post count, plus a count of the number of different topics they have posted in overall.

It should work on any theme that uses the same base Profile template as the SMF curve theme, for anything else you may have to do a theme edit, but it is a very small edit in the profile itself.
Title: Re: Topic Count in Profiles
Post by: Rohan_ on August 18, 2009, 03:49:19 PM
Very Nice mod big bro . i installed it in my forum and its working awesome :) .. i really need this option i was just opening a topic for this then i just found this mod in latests .. thanks a lot :)
Title: Re: Topic Count in Profiles
Post by: qtime on August 18, 2009, 04:08:45 PM
Should it be possible to use this value for post counted membergroups?
Title: Re: Topic Count in Profiles
Post by: Costa on August 18, 2009, 04:17:24 PM
Could you update languages?  :D

Modifications.portuguese_pt.php
$txt['profile_topics_started'] = 'Tópicos Iniciados';

Modifications.portuguese_pt-utf8.php
$txt['profile_topics_started'] = 'Tópicos Iniciados';

Modifications.portuguese_brazilian.php
$txt['profile_topics_started'] = 'Tópicos Iniciados';

Modifications.portuguese_brazilian-utf8.php
$txt['profile_topics_started'] = 'Tópicos Iniciados';

Farewell
-Costa
Title: Re: Topic Count in Profiles
Post by: alex30 on August 18, 2009, 04:28:03 PM
Thanks. Very good addition that will eventually make members open new topics.  :P
Title: Re: Topic Count in Profiles
Post by: Costa on August 18, 2009, 04:31:27 PM
alex30, the post count make member post too much :P
Title: Re: Topic Count in Profiles
Post by: Rohan_ on August 18, 2009, 05:46:43 PM
hey after installing this mod i got this in error log .. this error comes when we enter in a topic . and the mod is working fine just giving this error in error log

8: Undefined index: topics
File: /home/vhosts/www.mysite.com/Sources/Load.php
Line: 1214
Title: Re: Topic Count in Profiles
Post by: alex30 on August 18, 2009, 05:56:52 PM
Costa
Which is good when posts are helpful and not "LOL" ones.
Title: Re: Topic Count in Profiles
Post by: Rohan_ on August 19, 2009, 04:37:14 AM
hey Arantor Please Help . i got 5000+ pages in error log ..
Title: Re: Topic Count in Profiles
Post by: Blinker on August 19, 2009, 05:25:37 AM
I also have a lot of errors, but unlike Rohan, only about 45 pages... :)

The error is:

8: Undefined index: topics
File: /home/content/x/x/x/xxxxxxxxx/html/forum/Sources/Load.php
Line: 1247


It's from this code in load.php Arantor:

'topics' => comma_format($profile['topics']),

Oh, also...the topics entry is not showing up in profiles. ;)

It's probably just a small tweak needed, what do you reckon mate?

Title: Re: Topic Count in Profiles
Post by: Rohan_ on August 19, 2009, 05:29:03 AM
yeah the error is in 'topics' => comma_format($profile['topics']),

but everything is working fine just showing error in error log .. plz fix
Title: Re: Topic Count in Profiles
Post by: Arantor on August 19, 2009, 02:59:36 PM
I couldn't fix this last night or earlier on due to not having Internet access last night - and once I saw all your posts here this morning, I fixed the bug and the site was down.

Newly patched version on mod site, sorry for the stupid error folks, is all fixed.

Rohan_ please: I know you want it fixed, bumping it 3 times isn't going to get it fixed any quicker.
Title: Re: Topic Count in Profiles
Post by: JBlaze on August 19, 2009, 03:04:10 PM
Nice job Arantor. Just a little FYI, this is a default feature in 2.0. You can list all posts, attachments and topics made via ?action=profile;u=xx;area=showposts

But again, nice mod indeed ;D
Title: Re: Topic Count in Profiles
Post by: Arantor on August 19, 2009, 03:05:35 PM
Quote from: καrηαgε™ on August 19, 2009, 03:04:10 PM
Nice job Arantor. Just a little FYI, this is a default feature in 2.0. You can list all posts, attachments and topics made via ?action=profile;u=xx;area=showposts

I know, but this gives you a handy count in the profile screen with less clicking :)
Title: Re: Topic Count in Profiles
Post by: alex30 on August 19, 2009, 03:27:10 PM
Thanks for fixing errors.

Arantor any other plans about future mods similar to this?

Just want to know what to expect. :)
Title: Re: Topic Count in Profiles
Post by: Arantor on August 19, 2009, 03:36:01 PM
With me, expect the unexpected :)

I've been asked to expand this to produce a per-category count, but not sure yet about anything else.

I tend to look at things in Mod Requests and if it's a day or so to implement I'll likely do it before long :)
Title: Re: Topic Count in Profiles
Post by: Rohan_ on August 19, 2009, 04:28:50 PM
hey thanx a ton big bro .. and sorry i didn't bumped it 3 times :( i just replied to alex .
Title: Re: Topic Count in Profiles
Post by: cz99 on August 21, 2009, 02:19:18 AM
Hello, congratulations, good mod, as I like to do to include the same data in the profile shown in the post:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg31.imageshack.us%2Fimg31%2F2999%2Fdibujourt.jpg&hash=f1924a698c759268ab3cd82ae101d6a72176dfd6)
Title: Re: Topic Count in Profiles
Post by: Arantor on August 21, 2009, 08:04:16 AM
I really, really wouldn't put it in the thread display's user profile, to be honest. The count of topics is not stored anywhere, meaning that it is recalculated as needed. I wouldn't want to recalculate it on a per-page basis since that could get expensive to do.

I suppose it could be modified to actually store and update the figures, but that would require the mod to calculate it for every user on install... which would be expensive to run too.
Title: Re: Topic Count in Profiles
Post by: Bass_Chaz on August 22, 2009, 07:37:26 PM
Installed and started to get this..

8: Undefined index: topics
File: /home/content/b/a/s/basschaz/html/community/Sources/Load.php
Line: 1103

Uninstalled and everything is back to "normal"
(ok as Normal as a site can be..)
Title: Re: Topic Count in Profiles
Post by: Arantor on August 22, 2009, 07:42:24 PM
When did you install it?
Title: Re: Topic Count in Profiles
Post by: Sabre™ on August 24, 2009, 04:06:20 AM
This is nice, good job mate :)
It compliments this (http://custom.simplemachines.org/mods/index.php?mod=1526) mod well.
A little tweak, and they combined perfectly.

Thanks
Title: Re: Topic Count in Profiles
Post by: Arantor on September 26, 2009, 06:22:04 AM
Also added a new feature to this today to display the number of different topics a user has posted in.
Title: Re: Topic Count in Profiles
Post by: Sabre™ on September 26, 2009, 09:36:44 AM
Nice update.
Cheers :)
Title: Re: Topic Count in Profiles
Post by: aw06 on October 31, 2009, 01:04:24 PM
Quote from: Sabre™ on August 24, 2009, 04:06:20 AM
This is nice, good job mate :)
It compliments this (http://custom.simplemachines.org/mods/index.php?mod=1526) mod well.
A little tweak, and they combined perfectly.

Thanks

I have that mod installed as well .. are you saying that if i install Arantor's mod there will be a conflict that i will have to fix ??
Title: Re: Topic Count in Profiles
Post by: Arantor on October 31, 2009, 01:11:08 PM
I'm not sure what little tweak will be needed; I don't know the other mod, but it sounds like one or the other will need a minor change to work.
Title: Re: Topic Count in Profiles
Post by: aw06 on October 31, 2009, 01:16:33 PM
Quote from: Arantor on October 31, 2009, 01:11:08 PM
I'm not sure what little tweak will be needed; I don't know the other mod, but it sounds like one or the other will need a minor change to work.

Yeah, they both make changes to the same files .. so i figure they may conflict ... will wait to see if Sabre will respond
Title: Re: Topic Count in Profiles
Post by: Arantor on October 31, 2009, 01:17:50 PM
Use the package parser on the mod site. It'll show you what edits they make. Very likely the two try to add something to the Profile page where the conflict is.
Title: Re: Topic Count in Profiles
Post by: aw06 on October 31, 2009, 01:21:41 PM
yeah, they don't seem to change the same lines of code .. still wondering what tweak Sabre is talking about ... :-\
Title: Re: Topic Count in Profiles
Post by: aw06 on October 31, 2009, 01:38:03 PM
Ok mod installed with no error's and no errors in logs .... But i think i see the tweak needed for both mods to compliment each other 8)

Arantor ... your mod ads to profile page
QuoteTopics started:     60
Topics participated in:    168

And the other mod ads to profile page
QuoteShow the last topics of this person.
Which is a clickable url link to http://xxx.com/forum/index.php?action=profile;u=xxx;sa=showPosts;topics

So .. a nice tweak to your mod would be
QuoteTopics started:     60
Topics participated in:    168
Which would also make the Number a clickable url point to http://xxx.com/forum/index.php?action=profile;u=xxx;sa=showPosts;topics

Could you meybe tell me where to edit to turn your number into a clickable url pointing to the link stated ??
Title: Re: Topic Count in Profiles
Post by: Arantor on October 31, 2009, 01:58:06 PM
Should be possible with editing Profile.template.php:

Code (find) Select
<td><b>', $txt['profile_topics_started'], ': </b></td>
<td>', $context['member']['topics'], '</td>


Code (replace) Select
<td><b>', $txt['profile_topics_started'], ': </b></td>
<td><a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=showPosts;topics">', $context['member']['topics'], '</a></td>


NB I don't have the other mod installed so can't test this.
Title: Re: Topic Count in Profiles
Post by: aw06 on October 31, 2009, 02:05:19 PM
Magic ... works 8)
Title: Re: Topic Count in Profiles
Post by: Sabre™ on October 31, 2009, 04:33:57 PM
Yeah, that's all I meant, that you can link it to the topics page :)
Title: Re: Topic Count in Profiles
Post by: aw06 on October 31, 2009, 04:38:59 PM
Quote from: Sabre™ on October 31, 2009, 04:33:57 PM
Yeah, that's all I meant, that you can link it to the topics page :)

Ok kool 8) guess we did the same thing then
Title: Re: Topic Count in Profiles
Post by: live627 on December 03, 2009, 04:05:32 PM
Hello everyone,

I have updated this mod to version 1.5. Don't try to use the upgrade mechanism; it won't work. Instead, uninstall the old one and then install the new one. I have left the old file on the server just in case you want to revert for some reason.

The new changes made are quite a few:
Title: Re: Topic Count in Profiles
Post by: Rohan_ on December 04, 2009, 03:06:20 AM
hey i think arantor made this mod and he started this thread so why i see   live627 in first post ???
Title: Re: Topic Count in Profiles
Post by: Arantor on December 04, 2009, 03:14:58 AM
Because I donated it. When mods are given away, the first post is similarly updated.
Title: Re: Topic Count in Profiles
Post by: Rohan_ on December 04, 2009, 12:19:31 PM
hey arantor donate me something  :P
Title: Re: Topic Count in Profiles
Post by: live627 on December 04, 2009, 02:54:37 PM
Quote from: Rohan_ on December 04, 2009, 12:19:31 PM
hey arantor donate me something  :P
lol

Quote from: Arantor on December 04, 2009, 03:14:58 AM
...I donated it....
it's true as you can see in the mod description. I even left the dates to help prove it ;)
Title: Re: Topic Count in Profiles
Post by: Arantor on December 04, 2009, 08:21:09 PM
Quote from: Rohan_ on December 04, 2009, 12:19:31 PM
hey arantor donate me something  :P

Details for donations: http://www.simplemachines.org/community/index.php?topic=345192.0
Title: Re: Topic Count in Profiles
Post by: Rohan_ 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
Title: Re: Topic Count in Profiles
Post by: kai920 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 (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:



   // 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,
      )
   );



Title: Re: Topic Count in Profiles
Post by: Arantor on December 07, 2009, 02:37:15 AM
Interesting query.

/me would STRONGLY suggest not using COUNT(*) in a query. Bad for performance, when COUNT(id_msg) would yield better performance on InnoDB and PostgreSQL.
Title: Re: Topic Count in Profiles
Post by: live627 on December 07, 2009, 04:48:16 PM
Quote from: Arantor on December 07, 2009, 02:37:15 AM
/me 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?
Title: Re: Topic Count in Profiles
Post by: kai920 on December 07, 2009, 09:49:05 PM
Quote from: live627 on December 07, 2009, 04:48:16 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?
Title: Re: Topic Count in Profiles
Post by: Cal O'Shaw 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
Title: Re: Topic Count in Profiles
Post by: live627 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)
Title: Re: Topic Count in Profiles
Post by: Cal O'Shaw 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
Title: Re: Topic Count in Profiles
Post by: Cal O'Shaw 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
Title: Re: Topic Count in Profiles
Post by: kai920 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?
Title: Re: Topic Count in Profiles
Post by: live627 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:
Title: Re: Topic Count in Profiles
Post by: Cal O'Shaw 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
Title: Re: Topic Count in Profiles
Post by: kai920 on December 11, 2009, 09:22:01 PM
Quote from: live627 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 Profile2.0.x - Configuration -> Modifications -> Topic Count in Profile[/list]


Thanks very much live627. Will test and report back results!  :)
Title: Re: Topic Count in Profiles
Post by: live627 on December 11, 2009, 11:48:03 PM
Quote from: Cal O'Shaw on December 11, 2009, 09:01:46 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


Thanks for liking this mod
Title: Re: Topic Count in Profiles
Post by: Cal O'Shaw 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
Title: Re: Topic Count in Profiles
Post by: kai920 on December 12, 2009, 04:21:51 AM
Quote from: kai920 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 (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
Title: Re: Topic Count in Profiles
Post by: beltazar on December 12, 2009, 12:19:58 PM
Quote from: kai920 on December 12, 2009, 04:21:51 AM
Quote from: kai920 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 (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

Title: Re: Topic Count in Profiles
Post by: kai920 on December 15, 2009, 11:43:33 PM
Quote from: beltazar on December 12, 2009, 12:19:58 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)

Title: Re: Topic Count in Profiles
Post by: live627 on December 16, 2009, 04:22:38 PM
Yes
Title: Re: Topic Count in Profiles
Post by: kai920 on December 16, 2009, 06:53:41 PM
Quote from: kai920 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 (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...
Title: Re: Topic Count in Profiles
Post by: live627 on December 16, 2009, 11:48:31 PM
1.5.4 is out; titles are fixed and those stickler database errors should be gone now
Title: Re: Topic Count in Profiles
Post by: kai920 on December 17, 2009, 01:32:15 AM
Thanks live627 - would like to test but I'm getting an error on install for ./Sources/Profile-View.php, the 2nd step. I tried to see why it was failing, but couldn't figure it out.


Any ideas? This is on a fairly vanilla test RC2 forum with only tagging system and board sort methods installed. It had topic count in profiles 1.5.3 which uninstalled successfully.


edit: the attached xml seems to work
Title: Re: Topic Count in Profiles
Post by: Cal O'Shaw on December 19, 2009, 01:04:27 AM
Got a typo error in 1.5.4!

Using SMF 1.1.11:

In the 3rd edit of themes/default/Profile.template.php you have "showTosts" instead of "showPosts"? or "showTopics"?, which is throwing an error:

8: Undefined index: showTosts
File: /home/xxx/public_html/forum/Themes/default/Profile.template.php
Line: 468

Cal
Title: Re: Topic Count in Profiles
Post by: live627 on December 19, 2009, 11:43:53 AM
lol what a silly typo! I fixed that and reupped. Thanks for pointing that out! :)
Title: Re: Topic Count in Profiles
Post by: Fisch.666 on January 07, 2010, 03:10:29 PM
@kai920

Thanks for this updated install20.xml, works without a problem!
Title: Re: Topic Count in Profiles
Post by: kai920 on January 08, 2010, 12:58:46 AM
Quote from: Fisch.666 on January 07, 2010, 03:10:29 PM
@kai920

Thanks for this updated install20.xml, works without a problem!

You're welcome :)
Title: Re: Topic Count in Profiles
Post by: TheListener on February 21, 2010, 06:57:49 PM
Installed the mod  though I had one minor edit.

I can't see any changes.

:(
Title: Re: Topic Count in Profiles
Post by: live627 on February 22, 2010, 04:07:14 PM
AdminCP => Configuration => Modifications => Topic Count in Profiles
Title: Re: Topic Count in Profiles
Post by: TheListener on February 22, 2010, 04:18:05 PM
Thanks Live.

I managed to find it eventually last night.

:)

Title: Re: Topic Count in Profiles
Post by: aw06 on March 24, 2010, 10:51:35 AM
Update for rc3 ?
Title: Re: Topic Count in Profiles
Post by: live627 on June 08, 2010, 04:14:33 PM
Version 1.6 is an update for SMF  2.0 RC3
Title: Re: Topic Count in Profiles
Post by: recived on June 16, 2010, 05:06:07 AM
Mod only counts or you can display a list?
1. Topics started
2. Topics participated in
Title: Re: Topic Count in Profiles
Post by: live627 on June 19, 2010, 03:36:05 PM
It only displays the count of those two  stats
Title: Re: Topic Count in Profiles
Post by: recived on June 20, 2010, 06:20:46 AM
A very useful feature of "Topics participated in", somebody will do to it output a list of topics?
Title: Re: Topic Count in Profiles
Post by: frozenas on July 25, 2010, 09:59:00 PM
Not working for me, getting this error:

Template Parse Error!
There was a problem loading the /Themes/default/Profile.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/Profile.template.php on line 130

121: echo '
122: <dt>', $txt['profile_posts'], ': </dt>
123: <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
124:
125: echo '
126: <dt>', $txt['profile_topics_started'], ': </dt>
127: <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>
128: <dt>', $txt['profile_topics_participated'], ': </dt>
129:

130: // Only show the email address fully if it's not hidden - and we reveal the email.

131: if ($context['member']['show_email'] == 'yes')
132: echo '
133: <dt>', $txt['email'], ': </dt>
134: <dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
.
This one on the direct link it asks to go:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/frozenas/public_html/test/forum/Themes/default/Profile.template.php on line 130.

Latest versions, default themes...
Title: Re: Topic Count in Profiles
Post by: live627 on July 25, 2010, 10:19:07 PM
Line 129:

Code (Find) Select
<dt>', $txt['profile_topics_participated'], ': </dt>

Code (Replace with) Select
<dt>', $txt['profile_topics_participated'], ': </dt>';
Title: Re: Topic Count in Profiles
Post by: frozenas on July 26, 2010, 08:35:29 AM
Done, still the same~:

119:
120: if (!isset($context['disabled_fields']['posts']))
121: echo '
122: <dt>', $txt['profile_posts'], ': </dt>
123: <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
124:
125: echo '
126: <dt>', $txt['profile_topics_started'], ': </dt>
127: <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>

128: <dt>', $txt['profile_topics_participated'], ': </dt>';[/code

129:
130: // Only show the email address fully if it's not hidden - and we reveal the email.
131: if ($context['member']['show_email'] == 'yes')
132: echo '
.
Title: Re: Topic Count in Profiles
Post by: live627 on July 26, 2010, 07:20:33 PM
119:
120: if (!isset($context['disabled_fields']['posts']))
121: echo '
122: <dt>', $txt['profile_posts'], ': </dt>
123: <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
124:
125: echo '
126: <dt>', $txt['profile_topics_started'], ': </dt>
127: <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>

128: <dt>', $txt['profile_topics_participated'], ': </dt>';

129:
130: // Only show the email address fully if it's not hidden - and we reveal the email.
131: if ($context['member']['show_email'] == 'yes')
132: echo '
Title: Re: Topic Count in Profiles
Post by: TheListener on July 26, 2010, 07:41:58 PM
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /xxxxxxxxxxx/Themes/default/Profile.template.php on line 130


   if (!$context['user']['is_owner'] && $context['can_send_pm'])
      echo '
            <a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '">', $txt['profile_sendpm_short'], '</a><br />';
   echo '
            <a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
            <a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
         </p>';

   echo '
      </div>
      <span class="botslice"><span></span></span>
      </div>
   </div>
   <div id="detailedinfo">
      <div class="windowbg2">
      <span class="topslice"><span></span></span>
      <div class="content">
         <dl>';

   if ($context['user']['is_owner'] || $context['user']['is_admin'])
      echo '
            <dt>', $txt['username'], ': </dt>
            <dd>', $context['member']['username'], '</dd>';

   if (!isset($context['disabled_fields']['posts']))
      echo '
            <dt>', $txt['profile_posts'], ': </dt>
            <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';

   echo '
            <dt>', $txt['profile_topics_started'], ': </dt>
            <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>
            <dt>', $txt['profile_topics_participated'], ': </dt>

      if (!isset($context['disabled_fields']['topics']))
   echo '
            <dt>', $txt['topicp'], ':</dt>
            <dd>', $context['member']['topics'], ' (', $context['member']['topics_per_day'], ' ', $txt['topics_per_day'], ')</dd>';

// Only show the email address fully if it's not hidden - and we reveal the email.


The line in red is the guilty line. Also would having the Ultimate portal mod installed have anyaffect?
Title: Re: Topic Count in Profiles
Post by: Nick Whetstone on July 26, 2010, 07:50:55 PM
Quote from: Brack1 on July 26, 2010, 07:41:58 PM
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /xxxxxxxxxxx/Themes/default/Profile.template.php on line 130


   if (!$context['user']['is_owner'] && $context['can_send_pm'])
      echo '
            <a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '">', $txt['profile_sendpm_short'], '</a><br />';
   echo '
            <a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
            <a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
         </p>';

   echo '
      </div>
      <span class="botslice"><span></span></span>
      </div>
   </div>
   <div id="detailedinfo">
      <div class="windowbg2">
      <span class="topslice"><span></span></span>
      <div class="content">
         <dl>';

   if ($context['user']['is_owner'] || $context['user']['is_admin'])
      echo '
            <dt>', $txt['username'], ': </dt>
            <dd>', $context['member']['username'], '</dd>';

   if (!isset($context['disabled_fields']['posts']))
      echo '
            <dt>', $txt['profile_posts'], ': </dt>
            <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';

   echo '
            <dt>', $txt['profile_topics_started'], ': </dt>
            <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>
            <dt>', $txt['profile_topics_participated'], ': </dt>

      if (!isset($context['disabled_fields']['topics']))
   echo '
            <dt>', $txt['topicp'], ':</dt>
            <dd>', $context['member']['topics'], ' (', $context['member']['topics_per_day'], ' ', $txt['topics_per_day'], ')</dd>';

// Only show the email address fully if it's not hidden - and we reveal the email.


The line in red is the guilty line. Also would having the Ultimate portal mod installed have anyaffect?
Try this:
Code (Find this...) Select
': </dt>

      if (!isset($context['disabled_fields']['topics']))

Code (Replace it with this...) Select
': </dt>';

      if (!isset($context['disabled_fields']['topics']))
Title: Re: Topic Count in Profiles
Post by: TheListener on July 26, 2010, 07:58:25 PM
Woohoo

Well done bud.

(Paints Ha2 green).

Grey makes ya look old.
Title: Re: Topic Count in Profiles
Post by: live627 on July 26, 2010, 08:43:47 PM
Quote from: Brack1 on July 26, 2010, 07:41:58 PM
would having the Ultimate portal mod installed have anyaffect?

No
Title: Re: Topic Count in Profiles
Post by: TheListener on July 26, 2010, 08:47:36 PM
It wasn't until I saw the mod in action that I remembered its job.

;D
Title: Re: Topic Count in Profiles
Post by: Celia N. Foster on July 31, 2010, 01:03:43 PM
When I installed this mod, I got this error:

Template Parse Error!
There was a problem loading the /Themes/default/Profile.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/Profile.template.php on line 130

121:       echo '
122:             <dt>', $txt['profile_posts'], ': </dt>
123:             <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
124:
125:    echo '
126:             <dt>', $txt['profile_topics_started'], ': </dt>
127:             <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>
128:             <dt>', $txt['profile_topics_participated'], ': </dt>
129:

130:    // Only show the email address fully if it's not hidden - and we reveal the email.

131:    if ($context['member']['show_email'] == 'yes')
132:       echo '
133:             <dt>', $txt['email'], ': </dt>
134:             <dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
---------------

How does one fix this error?
Title: Re: Topic Count in Profiles
Post by: Celia N. Foster on July 31, 2010, 02:46:24 PM
Now I've got the following error:

Parse error: syntax error, unexpected '<' in .../Themes/default/Profile.template.php on line 118

109:    <div id="detailedinfo">
110:       <div class="windowbg2">
111:       <span class="topslice"><span></span></span>
112:       <div class="content">
113:          <dl>';
114:
115:    if ($context['user']['is_owner'] || $context['user']['is_admin'])
116:       echo '
117:             <dt>', $txt['username'],': </dt>';

118:             <dd>', $context['member']['username'], '</dd>';

119:
120:    if (!isset($context['disabled_fields']['topics']))
121:       echo '
122:             <dt>', $txt['profile_posts'], ': </dt>

----------
How does one fix this? Help!
Title: Re: Topic Count in Profiles
Post by: live627 on August 06, 2010, 01:22:18 AM
Sorry for the late reply.

Change line 118 to this:

echo '<dd>', $context['member']['username'], '</dd>';
Title: Re: Topic Count in Profiles
Post by: Fisch.666 on August 25, 2010, 03:11:17 AM
Hi!

I have the same problem, thanks for your reply. After changing this line i get a new error:


[25-Aug-2010 09:09:01] PHP Parse error:  syntax error, unexpected '>' in Themes/default/Profile.template.php on line 118


Ah, and you forgot to change the version 1.6 to 2.0 in the new package.  :)
Title: Re: Topic Count in Profiles
Post by: Cal O'Shaw on September 23, 2010, 03:00:01 AM
Hello,

Any chance you could put 1.5.4 back on the MOD page?  It looks like MODs such as "OS & Browser Detection" and "Reason for editing MOD" fail to install (or uninstall) because of Db Query changes that they can't recognise.  I tried to uninstall 1.5.4 but Profile.php and ModSettings.php had problems and without having the 1.5.4 version up to parse and then compare, I can't make the changes needed .

We're still on 1.1.11 and will be for a few months after 2.0 goes Golden, which means we're going to be on 1.1.11 for some time longer.  Any help in being able to resolve this, even just putting 1.5.4 back up, would be greatly appreciated.

Grazie,

Cal
Title: Re: Topic Count in Profiles
Post by: DeroZ on July 04, 2013, 01:18:43 AM
smf 2.0.4

install20.xml Modification parse error
Title: Re: Topic Count in Profiles
Post by: ormuz on July 15, 2013, 11:14:48 AM
Quote from: Snoopix on July 04, 2013, 01:18:43 AM
smf 2.0.4

install20.xml Modification parse error

error...
Title: Re: Topic Count in Profiles
Post by: Deaks on July 15, 2013, 11:18:57 AM
ok sorted, download 2.1a should fix this :)
Title: Re: Topic Count in Profiles
Post by: NanoSector on July 15, 2013, 11:19:48 AM
Is there a download link anywhere? :P
Title: Re: Topic Count in Profiles
Post by: Deaks on July 15, 2013, 11:21:38 AM
yeh modsite :P
Title: Re: Topic Count in Profiles
Post by: ormuz on July 15, 2013, 11:23:27 AM
Quote from: Runic on July 15, 2013, 11:18:57 AM
ok sorted, download 2.1a should fix this :)

that was fast! Thanks
Title: Re: Topic Count in Profiles
Post by: impreza on August 27, 2013, 08:43:35 AM
In my mod does not install properly - defeat the system. Maybe it's other add-ons
Title: Re: Topic Count in Profiles
Post by: Dhayzon on June 01, 2014, 11:42:00 AM
no  works in smf 2.0.7

this code is differente :C

// Otherwise do!
else
{
echo '
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';
Title: Re: Topic Count in Profiles
Post by: Goten22 on August 18, 2018, 01:03:52 PM
Can you count the number of topics for a specific board?
Title: Re: Topic Count in Profiles
Post by: shadav on August 18, 2019, 01:20:11 PM
 ;D any chance on an update for 2.0.15?

getting three errors, one is simple fix
Add After   ./Sources/Profile-View.php   Test failed
it's looking for all of this just to add after
// Posting activity by time.
$result = $smcFunc['db_query']('user_activity_by_time', '
SELECT
HOUR(FROM_UNIXTIME(poster_time + {int:time_offset})) AS hour,
COUNT(*) AS post_count
FROM {db_prefix}messages
WHERE id_member = {int:current_member}' . ($modSettings['totalMessages'] > 100000 ? '
AND id_topic > {int:top_ten_thousand_topics}' : '') . '
GROUP BY hour',
array(
'current_member' => $memID,
'top_ten_thousand_topics' => $modSettings['totalTopics'] - 10000,
'time_offset' => (($user_info['time_offset'] + $modSettings['time_offset']) * 3600),
)
);
$maxPosts = 0;
$context['posts_by_time'] = array();
while ($row = $smcFunc['db_fetch_assoc']($result))
{
// Cast as an integer to remove the leading 0.
$row['hour'] = (int) $row['hour'];

if ($row['post_count'] > $maxPosts)
$maxPosts = $row['post_count'];

$context['posts_by_time'][$row['hour']] = array(
'hour' => $row['hour'],
'posts_percent' => $row['post_count']
);
}
$smcFunc['db_free_result']($result);

if ($maxPosts > 0)
for ($hour = 0; $hour < 24; $hour++)
{
if (!isset($context['posts_by_time'][$hour]))
$context['posts_by_time'][$hour] = array(
'hour' => $hour,
'posts_percent' => 0,
);
else
$context['posts_by_time'][$hour]['posts_percent'] = round(($context['posts_by_time'][$hour]['posts_percent'] * 100) / $maxPosts);
}

// Put it in the right order.
ksort($context['posts_by_time']);

so simply changed for it to just look for
// Put it in the right order.
ksort($context['posts_by_time']);


Add After   ./Themes/default/Profile.template.php   Test failed
this one I fixed what it was looking for but then got template errors, something about unexpected $context
it wants to find
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
but mine looks like this, i'm sure it's probably something I've installed
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>' . (!empty($context['member']['anonymous']) ? '
but when it adds

echo '
', $context['tcip_enabled'] && $context['tcip_show_topic_count'] ? '<dt>'. $txt['profile_topics_started']. ': </dt>
<dd>'. $context['member']['topics']. ' ('. $context['member']['topics_per_day']. ' '. $txt['posts_per_day']. ')</dd>
' : '', $context['tcip_enabled'] && $context['tcip_show_participated_count'] ? '<dt>'. $txt['profile_topics_participated']. ': </dt>
<dd>'. $context['member']['topic_count']. '</dd>' : '', '';

I get template errors

lastly I don't know.....
Replace   ./Themes/default/Profile.template.php   Test failed

instructions are
find
// Otherwise do!
else
{
echo '
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';

replace

// Otherwise do!
else
{
echo '
<p align="center"><b>', $txt['tcip_posts'] ,'</b></p>
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>
<p align="center"><br /><b>', $txt['tcip_topics'] ,'</b></p>
<dl class="stats">';

// The labels.
foreach ($context['topics_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';

I don't have that... I tried to break this apart
find
// Otherwise do!
else
{
echo '

after add
<p align="center"><b>', $txt['tcip_posts'] ,'</b></p>

but i'm not sure about the last part how to edit and add after
my code is
// Otherwise do!
else
{
echo '
<ul class="activity_stats flow_hidden">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
{
echo '
<li', $time_of_day['is_last'] ? ' class="last"' : '', '>
<div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
<div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
<span>', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '</span>
</div>
</div>
<span class="stats_hour">', $time_of_day['hour_format'], '</span>
</li>';
}

echo '

</ul>';
}

echo '
<span class="clear" />
</div>
<span class="botslice"><span></span></span>
</div>
</div>';


thank you for any help
Title: Re: Topic Count in Profiles
Post by: live627 on October 06, 2023, 02:08:32 AM
I have updated this to support SMF 2.1.