[3.3][BETA] User Topic Count

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
dingus33
Registered User
Posts: 136
Joined: Fri Sep 29, 2017 11:11 am

Re: [3.2][BETA] User Topic Count

Post by dingus33 »

dear martti,

thank you for your exemplary extensions and hard work. you make cool stuff.

i just tested this extension, and it did not work for me.

my setup:

phpBB 3.2.8
PHP 7.1.32
PostgreSQL 9.6.15

i got this error when trying to enable the extension:

Code: Select all

General Error
SQL ERROR [ postgres ]

ERROR: column "u.user_id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: select count(t.topic_id) as topic_count, u.user_id, u.user_t... ^ []

SQL

select count(t.topic_id) as topic_count, u.user_id, u.user_topic_count from phpbb_topics t, phpbb_users u where t.topic_visibility = 1 and t.topic_poster = u.user_id and u.user_id >= 0 and u.user_id <= 1000 and u.user_id <> 1 group by t.topic_poster having count(t.topic_id) <> u.user_topic_count

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 997
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/postgres.php
LINE: 194
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\postgres->sql_query()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/service/update.php
LINE: 50
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/service/update.php
LINE: 73
CALL: marttiphpbb\usertopiccount\service\update->for_sql_where()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/migrations/mgr_2.php
LINE: 42
CALL: marttiphpbb\usertopiccount\service\update->for_user_range()

FILE: (not given by php)
LINE: (not given by php)
CALL: marttiphpbb\usertopiccount\migrations\mgr_2->update_user_topic_count()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 714
CALL: call_user_func_array()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 661
CALL: phpbb\db\migrator->run_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 436
CALL: phpbb\db\migrator->process_data_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 288
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 241
CALL: phpbb\db\migrator->update_do()

FILE: [ROOT]/phpbb/extension/base.php
LINE: 78
CALL: phpbb\db\migrator->update()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/ext.php
LINE: 51
CALL: phpbb\extension\base->enable_step()

FILE: [ROOT]/phpbb/extension/manager.php
LINE: 190
CALL: marttiphpbb\usertopiccount\ext->enable_step()

FILE: [ROOT]/includes/acp/acp_extensions.php
LINE: 213
CALL: phpbb\extension\manager->enable_step()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: acp_extensions->main()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] User Topic Count

Post by martti »

dingus33 wrote:
Tue Sep 24, 2019 6:15 pm
dear martti,

thank you for your exemplary extensions and hard work. you make cool stuff.

i just tested this extension, and it did not work for me.

my setup:

phpBB 3.2.8
PHP 7.1.32
PostgreSQL 9.6.15

i got this error when trying to enable the extension:

Code: Select all

General Error
SQL ERROR [ postgres ]

ERROR: column "u.user_id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: select count(t.topic_id) as topic_count, u.user_id, u.user_t... ^ []

SQL

select count(t.topic_id) as topic_count, u.user_id, u.user_topic_count from phpbb_topics t, phpbb_users u where t.topic_visibility = 1 and t.topic_poster = u.user_id and u.user_id >= 0 and u.user_id <= 1000 and u.user_id <> 1 group by t.topic_poster having count(t.topic_id) <> u.user_topic_count

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 997
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/postgres.php
LINE: 194
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\postgres->sql_query()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/service/update.php
LINE: 50
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/service/update.php
LINE: 73
CALL: marttiphpbb\usertopiccount\service\update->for_sql_where()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/migrations/mgr_2.php
LINE: 42
CALL: marttiphpbb\usertopiccount\service\update->for_user_range()

FILE: (not given by php)
LINE: (not given by php)
CALL: marttiphpbb\usertopiccount\migrations\mgr_2->update_user_topic_count()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 714
CALL: call_user_func_array()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 661
CALL: phpbb\db\migrator->run_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 436
CALL: phpbb\db\migrator->process_data_step()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 288
CALL: phpbb\db\migrator->try_apply()

FILE: [ROOT]/phpbb/db/migrator.php
LINE: 241
CALL: phpbb\db\migrator->update_do()

FILE: [ROOT]/phpbb/extension/base.php
LINE: 78
CALL: phpbb\db\migrator->update()

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/ext.php
LINE: 51
CALL: phpbb\extension\base->enable_step()

FILE: [ROOT]/phpbb/extension/manager.php
LINE: 190
CALL: marttiphpbb\usertopiccount\ext->enable_step()

FILE: [ROOT]/includes/acp/acp_extensions.php
LINE: 213
CALL: phpbb\extension\manager->enable_step()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: acp_extensions->main()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()
Probably I'll have to try to simplify the query to ensure compatibility across database types.
User avatar
eunaumtenhoid
Registered User
Posts: 996
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.2][BETA] User Topic Count

Post by eunaumtenhoid »

it would be very perfect to show the percentage as well as the posts and be compatible with autogroup
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
strelok-by
Registered User
Posts: 126
Joined: Fri Nov 21, 2014 10:22 am
Location: Mozyr / Belarus
Name: Stanislav
Contact:

Re: [3.2][BETA] User Topic Count

Post by strelok-by »

russian language:
profile.php
(550 Bytes) Downloaded 12 times
Milunice259
Registered User
Posts: 69
Joined: Mon Apr 19, 2010 4:12 pm

Re: [3.2][BETA] User Topic Count

Post by Milunice259 »

Wait for 3.3.0 and Auto group compatible :o :o :o
collantphile
Registered User
Posts: 6
Joined: Sun Mar 03, 2019 2:55 am

Re: [3.2][BETA] User Topic Count

Post by collantphile »

Very nice extension very useful, thank you Martti. :) However I have a problem on my forum, the number of topics ("sujets" in french) appears before the number of messages, I would like it to be the opposite. How to do it please? What changes do I need to make? The style of my forum is Prosilver and I have the version 3.3.0 of phpbb.

FireShot Capture 270 - Boutiques calzedonia - Page 3 - Forum Collants - www.forum-collants.fr.png
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] User Topic Count

Post by martti »

collantphile wrote:
Thu Mar 05, 2020 11:44 am
Very nice extension very useful, thank you Martti. :) However I have a problem on my forum, the number of topics ("sujets" in french) appears before the number of messages, I would like it to be the opposite. How to do it please? What changes do I need to make? The style of my forum is Prosilver and I have the version 3.3.0 of phpbb.


FireShot Capture 270 - Boutiques calzedonia - Page 3 - Forum Collants - www.forum-collants.fr.png
In ext/marttiphpbb/styles/prosilver/template/viewtopic.js,

change

Code: Select all

		$(this).insertBefore($(this).siblings('dd.profile-posts').eq(0));
into

Code: Select all

		$(this).insertAfter($(this).siblings('dd.profile-posts').eq(0));
And similar in the other 3 other javascript files.

I.e In ext/marttiphpbb/styles/prosilver/template/profile.js,

change

Code: Select all

	$('div.panel>div.inner>div.column2>dl.details>dd:eq(2)').after($('div.usertopiccount-hidden').contents());
into

Code: Select all

	$('div.panel>div.inner>div.column2>dl.details>dd:eq(3)').after($('div.usertopiccount-hidden').contents());
collantphile
Registered User
Posts: 6
Joined: Sun Mar 03, 2019 2:55 am

Re: [3.2][BETA] User Topic Count

Post by collantphile »

Thanks a lot Martti, it's perfect, it's solved now. :D ;)
User avatar
eunaumtenhoid
Registered User
Posts: 996
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.2][BETA] User Topic Count

Post by eunaumtenhoid »

many users of my forum show 0 topics, how to solve this?
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] User Topic Count

Post by martti »

eunaumtenhoid wrote:
Mon May 04, 2020 1:24 pm
many users of my forum show 0 topics, how to solve this?

And are these users ttopic starters?
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] User Topic Count

Post by martti »

Hi, there is a new version 0.6.0 now.
  • One bug was found of not updating the topic count after approval topics. (@eunaumtenhoid maybe this solves your problem.)
  • The update query was optimized and probably compatible with more databases.
  • The minmal version is now phpBB 3.3.0
User avatar
eunaumtenhoid
Registered User
Posts: 996
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.2][BETA] User Topic Count

Post by eunaumtenhoid »

martti wrote:
Mon May 04, 2020 2:20 pm
eunaumtenhoid wrote:
Mon May 04, 2020 1:24 pm
many users of my forum show 0 topics, how to solve this?

And are these users ttopic starters?
of course
martti wrote:
Mon May 04, 2020 3:33 pm
Hi, there is a new version 0.6.0 now.
  • One bug was found of not updating the topic count after approval topics. (@eunaumtenhoid maybe this solves your problem.)
  • The update query was optimized and probably compatible with more databases.
  • The minmal version is now phpBB 3.3.0
NO
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] User Topic Count

Post by martti »

eunaumtenhoid wrote:
Tue May 05, 2020 12:17 pm
NO
And you disabled the extension before uploading the files? What is your database?
User avatar
eunaumtenhoid
Registered User
Posts: 996
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.2][BETA] User Topic Count

Post by eunaumtenhoid »

martti wrote:
Tue May 05, 2020 12:27 pm
eunaumtenhoid wrote:
Tue May 05, 2020 12:17 pm
NO
And you disabled the extension before uploading the files? What is your database?
yeah, MySQL(i) 5.6.41-84.1
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.3][BETA] User Topic Count

Post by martti »

A minor update 0.6.1: A wrong type return in a function prevented initializing the extension.

@eunaumtenhoid So far I could not reproduce your issue. Disabling/re-enabling the extension recalculates all topic counts for all users for me.
Post Reply

Return to “Extensions in Development”