[ABD] [3.1] [pre]fixed - Topic Prefixes extension

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
Locked
User avatar
imkingdavid
Former Team Member
Posts: 2670
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

To add to that, looking in phpbb/user.php I see there is also a core.user_setup_after event added in 3.1.6:

Code: Select all

		/**
		* Execute code at the end of user setup
		*
		* @event core.user_setup_after
		* @since 3.1.6-RC1
		*/
		$phpbb_dispatcher->dispatch('core.user_setup_after');
Because my event needs to run first, perhaps the fix would actually be for Elias to switch his to use user_setup_after instead of user_setup? I need to use at least user_setup in order to have access to the $user object.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 4067
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by kasimi »

You can add a higher priority to your listener. From the getSubscribedEvents()docs:

Code: Select all

/**
 * Returns an array of event names this subscriber wants to listen to.
 *
 * The array keys are event names and the value can be:
 *
 *  * The method name to call (priority defaults to 0)
 *  * An array composed of the method name to call and the priority
 *  * An array of arrays composed of the method names to call and respective
 *    priorities, or 0 if unset
 *
 * For instance:
 *
 *  * array('eventName' => 'methodName')
 *  * array('eventName' => array('methodName', $priority))
 *  * array('eventName' => array(array('methodName1', $priority), array('methodName2')))
 *
 * @return array The event names to listen to
 */

User avatar
imkingdavid
Former Team Member
Posts: 2670
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

kasimi wrote:You can add a higher priority to your listener. From the getSubscribedEvents()docs:

Code: Select all

/**
 * Returns an array of event names this subscriber wants to listen to.
 *
 * The array keys are event names and the value can be:
 *
 *  * The method name to call (priority defaults to 0)
 *  * An array composed of the method name to call and the priority
 *  * An array of arrays composed of the method names to call and respective
 *    priorities, or 0 if unset
 *
 * For instance:
 *
 *  * array('eventName' => 'methodName')
 *  * array('eventName' => array('methodName', $priority))
 *  * array('eventName' => array(array('methodName1', $priority), array('methodName2')))
 *
 * @return array The event names to listen to
 */
Thanks for the info, I had forgotten about that. I'll look into that.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.

User avatar
imkingdavid
Former Team Member
Posts: 2670
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

SalazarAG wrote:Hi again David!

You can take a look at this error? viewtopic.php?f=456&t=2355811&hilit=wel ... #p14440591

It seems to be a conflict between the two extensions and I can not use the other because of it :(
I've just pushed a change that should fix that. I tested it and it works for me.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.

User avatar
SalazarAG
Registered User
Posts: 673
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

Hi David!

I updated the extension and when I enable Welcome Topic Robot and register new user test, I have this error



SQL ERROR [ mysqli ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 [1064]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

Powered by phpBB® Forum Software © phpBB Limited
The error this time seems to be in the database :(

Is it because I do not deactivated [pre] fixed to update and simply replace it with the new files?
I'm sorry for my English. Google Translator does a bad job. :D

User avatar
imkingdavid
Former Team Member
Posts: 2670
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Can you enable the DEBUG constant in the config.php file? I would need to see more information about the error to know what is causing it. When I enabled the WTR extension and had my fix in place, it submitted the post successfully when I registered a new user.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.

User avatar
SalazarAG
Registered User
Posts: 673
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

imkingdavid wrote:Can you enable the DEBUG constant in the config.php file? I would need to see more information about the error to know what is causing it. When I enabled the WTR extension and had my fix in place, it submitted the post successfully when I registered a new user.
I enabled and seems to be conflicting with another extension, this time hahaha

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/ext/marttiphpbb/usertopiccount/event/hard_update_listener.php on line 129: Undefined index: poster_id
SQL ERROR [ mysqli ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 [1064]

SQL

UPDATE phpbb_users SET user_topic_count = user_topic_count + 1 WHERE user_id =

BACKTRACE

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

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

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

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

FILE: [ROOT]/ext/marttiphpbb/usertopiccount/event/hard_update_listener.php
LINE: 130
CALL: phpbb\db\driver\factory->sql_query()

FILE: (not given by php)
LINE: (not given by php)
CALL: marttiphpbb\usertopiccount\event\hard_update_listener->core_submit_post_end()

FILE: [ROOT]/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
LINE: 158
CALL: call_user_func()

FILE: [ROOT]/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
LINE: 46
CALL: Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()

FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 60
CALL: Symfony\Component\EventDispatcher\EventDispatcher->dispatch()

FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 46
CALL: phpbb\event\dispatcher->dispatch()

FILE: [ROOT]/includes/functions_posting.php
LINE: 2458
CALL: phpbb\event\dispatcher->trigger_event()

FILE: [ROOT]/ext/elias/welcometopicrobot/event/listener.php
LINE: 168
CALL: submit_post()

FILE: [ROOT]/ext/elias/welcometopicrobot/event/listener.php
LINE: 74
CALL: elias\welcometopicrobot\event\listener->create_welcome_topic()

FILE: (not given by php)
LINE: (not given by php)
CALL: elias\welcometopicrobot\event\listener->send_topic()

FILE: [ROOT]/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
LINE: 158
CALL: call_user_func()

FILE: [ROOT]/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
LINE: 46
CALL: Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()

FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 60
CALL: Symfony\Component\EventDispatcher\EventDispatcher->dispatch()

FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 46
CALL: phpbb\event\dispatcher->dispatch()

FILE: [ROOT]/phpbb/user.php
LINE: 184
CALL: phpbb\event\dispatcher->trigger_event()

FILE: [ROOT]/index.php
LINE: 29
CALL: phpbb\user->setup()
I'm sorry for my English. Google Translator does a bad job. :D

User avatar
SalazarAG
Registered User
Posts: 673
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

I will uninstall topic User count until the author again.

Without it everything is fine! Thank you for your help, David! :)
I'm sorry for my English. Google Translator does a bad job. :D

Mr_Richards_
Registered User
Posts: 4
Joined: Mon Jun 13, 2016 2:07 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Mr_Richards_ »

Whenever someone on my forum tries to create a post on any section on my forums (Even ones that aren't directly connected to prefixed) are getting this error? I've even tried this myself on a test account and I got the same error.

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/ext/imkingdavid/prefixed/core/manager.php on line 432: Invalid argument supplied for foreach()
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 2423: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3925)
I don't appear to get this error when I'm on my administrator account and I make a post so I really don't know what's happening?

Any help would be greatly appreciated,

User avatar
imkingdavid
Former Team Member
Posts: 2670
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Thanks Mr_Richards_. Can you please try the latest fix I pushed to the repository and let me know if that works?
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.

Mr_Richards_
Registered User
Posts: 4
Joined: Mon Jun 13, 2016 2:07 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Mr_Richards_ »

imkingdavid wrote:Thanks Mr_Richards_. Can you please try the latest fix I pushed to the repository and let me know if that works?
That appears to have fixed the issue! Thanks a ton!

User avatar
LukeWCS
Registered User
Posts: 173
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by LukeWCS »

@imkingdavid

Thanks for this ext. I want to test it in our tools and support forums, but if i create a new topic or change an existing one, there is nothing to choose (prefix). I added two prefixes with forum: 14 (Tools) and user group 5 (Admin).

Btw, it would be a good idea to explain in readme how to add several forums and groups to a prefix. I found this information here in this topic at page 7. ;)
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor, LF who was here (Fork), ModBreak eXtended (Fork)

User avatar
imkingdavid
Former Team Member
Posts: 2670
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

LukeWCS,

Thanks for the feedback. Right now the extension is a little bit incomplete because it is relying on a template event that hasn't yet been merged. In order to apply a prefix to a topic you'll need to manually edit the posting_editor.html template file to add in that template event. You can find the exact change that needs to be made by viewing the "Files changed" tab in this PR and going to the second changed file: https://github.com/phpbb/phpbb/pull/4371

As for setting the users and groups and forums allowed for individual prefixes, I am planning on making that a bit easier but haven't had a chance to really spend time on that yet. My goal is to have auto-complete for usernames and to use a multi-select box for the forums, and then for groups either auto-complete or another multi-select box. Basically I'd like to move away from having to use the user/group/forum IDs since that's not very intuitive. For now though, you're right, I should probably add a note somewhere about how to set those values correctly in the current version.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.

User avatar
LukeWCS
Registered User
Posts: 173
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by LukeWCS »

Thanks, i will try it.

About your plans, sounds good. :)
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor, LF who was here (Fork), ModBreak eXtended (Fork)

User avatar
imkingdavid
Former Team Member
Posts: 2670
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Great news - https://github.com/phpbb/phpbb/pull/4371 The pull request with the necessary template event has been merged, so it should be included as of versions:
3.1.10-RC1
3.2.0-RC2

I will bump up the minimum version requirements for this extension to reflect that. For any future testing, you should use one of those versions. (or latest dev branch of 3.1 or 3.2 on github).
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.

Locked

Return to “Abandoned Extensions”