Coder Social home page Coder Social logo

mention's Introduction

phpBB mentions

Installation

Copy the extension to phpBB/ext/paul999/mention

Go to "ACP" > "Customise" > "Extensions" and enable the "phpBB mentions" extension.

Please note that this extension requires phpBB 3.3 and at least php 7.1! The extension has only been tested with PHP7.1, 7.2, 7.3 7,4 and 8.0. If you use phpBB 3.2, you should use 1.0.x instead.

Tests and Continuous Integration

We use Travis-CI as a continuous integration server and phpunit for our unit testing. See more information on the phpBB development wiki. To run the tests locally, you need to install phpBB from its Git repository. Afterwards run the following command from the phpBB Git repository's root:

Windows:

phpBB\vendor\bin\phpunit.bat -c phpBB\ext\paul999\mention\phpunit.xml.dist

others:

phpBB/vendor/bin/phpunit -c phpBB/ext/paul999/mention/phpunit.xml.dist

License

GPLv2

mention's People

Contributors

alhitary avatar galixte avatar imattpro avatar jackennils avatar jbreu avatar kumencz avatar madu696 avatar paul999 avatar phpbb-es avatar rxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mention's Issues

Notification incorrectly shows when my

For example:

  1. Paul mentions onlyproevo
  2. onlyproevo quotes that same post
  3. onlyproevo then (incorrectly) receives a notification telling them that he has just mentioned himself

Special letters in usernames

Special letters in usernames destroying search when they are typed.

Example:
@Stono - generate drop down menu with usernames: "@Stonožka" and "@stonohavic" usernames
When another letter was entered:
@Stonož - drop down menu is gone

When @user is quoted, the user receives notification

For example: when you quote a message including @C1n, I will get a notification.

This is annoying as you sometimes get multiple notifications because multiple users quoted the entire post. Notifications should only be given when @function is used in a message and not a quote.

Extension Outright Fails [phpBB 3.3.0]

It appears that, even without other extensions, the mention plugin does not work with phoBB 3.3.0, using our server config. Either this is a php issue , or some fault with 3.3.0 compatibility.

Server details:

Database server: MySQL(i) 5.7.29-0ubuntu0.18.04.1
GZip compression: Off
PHP version: 7.2.24-0ubuntu0.18.04.3
Orphan attachments: 2
Board version: 3.3.0 [ Re-Check version ]

Running on Ubuntu Server 18.04LTS, with NGINX.

Forum URL: https:/openzc.org/forums

Report cc'd on the phpBB.org support forum plugin topic. I'm not yet familiar-enough with version differences between 3.3.0 and 3.2.x to know anything more specific.

Make sure to select all required fields for auth initialisation

[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/auth/auth.php on line 424: Undefined index: user_type
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1835: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257)

Username URL / Group Coloring

  1. Usernames should be linked to the persons profile, that your mentioning.
  2. Username should be the same color they are according to the group they are in, or a default CSS color.

This is just my thoughts is all, thanks for the mod.

Notification email

Dear Paul!
Thanks for the great job! I really love this simple extension.

I'd like to add a little enhancement to it.
In notification/type/mention.php, function get_email_template_variables() instead of overwriting the USERNAME variable, which contains the recepient's name, would you consider to change to an another var name, like AUTHOR_NAME?

        public function get_email_template_variables()
        {
                return [
                        'AUTHOR_NAME'          => $this->notification_data['username'],
                        'TOPIC_TITLE'           => $this->notification_data['topic_title'],
                        'U_LINK_TO_TOPIC'   => generate_board_url() . '/viewtopic.' . $this->php_ext . '?p=' . $this->notification_data['post_id'] . '#p' .$this->no
                ];
        }

With that change we can use the USERNAME variable in the template email, for example like this:

Hello {USERNAME}!

You were just mentioned by {AUTHOR_NAME} in {TOPIC_TITLE} at {SITENAME}.

To view the post you were mentioned in use this link:
{U_LINK_TO_TOPIC}

{EMAIL_SIG}

Thanks.
Cheers,
Tamas

Display name should match the extension name ;)

The ext is titled "Simple mentions" but in composer.json the display name is "phpBB mentions" (I also noticed phpBB mentions is the name in the code docblocks).

This is a little inconsistent. In an board with tons of extensions, it's hard to find since you go looking for Simple mentions but don't find it since it's actually displayed as phpBB mentions.

Error in the url sent by email

Hi Paul,

just installed your extension which is great ! And thank you for this

Just one thing you might want to know, when I asked for a notification by email, the link that was in there was wrong, a “/” was missing just before viewtopic and after the name of my forum

So I received this

“Hello,
You just have been mentioned by "XXX" at "forumxxx".
To view the post you have been mentioned in use this link:
http://www.forumxxx.frviewtopic.php?p=135611#p135611 »

The link above is wrong, it should read instead:
http://www.forumxxx.fr/viewtopic.php?p=135611#p135611

A small "/" make all the difference !

If you could fix it that would be so terrific.

Anyways, thanks again for his incredbly useful feature,
B

no notification/email being sent when post is edited

When an existing post that has no mention is edited and a mention is added, no notification or email is being sent.

I would expect the opposite, but maybe this is the intended behavior. Asking for feedback on this. Thanks.

Notification should contain the topic/post title

Can the notification message also mention the post? e.g.,

"You have been mentioned by username in "Title of the post"

I think it'd be super helpful to know where you've been mentioned... You know, in case it's a topic you want to respond to or one you might want to totally ignore. :)

Fatal error: Cannot use object of type phpbb\user as array

I am seeing an error when I make a post, which I think is caused by the fix for #3 . The error is:

PHP Fatal error: Cannot use object of type phpbb\user as array in <path_to_my_board>\ext\paul999\mention\event\main_listener.php on line 181

I was able to fix this by changing 181 to:

$on_page = $this->viewonline_helper->get_user_page($this->user->data['session_page']);

And 183 to:

if (0 === strpos($on_page,'posting'))

phpBB version is 3.2.20
PHP Version: 5.6.6

EDIT: The above is not logically correct on a second look, so I'm not sure my solution is correct

Disable self-mentioning

Currently it is possible to mention yourself. I don't see any useful benefit for this and recommend it be removed.

wrong link in notification email

When an email about a mention is sent, a slash is missing in the link:

{U_LINK_TO_TOPIC} generates:
https://mydivision.net/forumviewtopic.php?p=53340#p53340
instead of
https://mydivision.net/forum/viewtopic.php?p=53340#p53340

Link to user profile

Hi! Could the feature linking to the user profile be added after it has been mentioned?

This feature has been quite requested there on the support page, I believe it will be very usefull.

INCLUDECSS and so on should contain T_ASSETS_VERSION

because of caching,

<!-- INCLUDECSS @paul999_mention/tribute.css -->

should IMHO be extended by:

<!-- INCLUDECSS @paul999_mention/tribute.css?assets_version={T_ASSETS_VERSION} -->

and so other similar files as well

Error while quoting posts

[phpBB Debug] PHP Notice: in file [ROOT]/ext/paul999/mention/event/main_listener.php on line 287: Undefined index: message [phpBB Debug] PHP Notice: in file [ROOT]/ext/paul999/mention/event/main_listener.php on line 290: Indirect modification of overloaded element of phpbb/event/data has no effect [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4511: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257) [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4511: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257) [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4511: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257)

Simple mention v. RC2

Notifications for not approved posts

Paul, thank you for a great job!

User case:
User posts message with mention, but submitted post still need to be approved (post_visibility = 0) by Moderator.
Mentioned user recieves notification anyway.

Thanks.

Option to use the group color of person being mentioned

It would be awesome if you could add an option to use the group color of the person being mentioned when posting the mention.

Right now the default color for a mention is bright red. If I mention "Paul" who is in a group with a blue group color, then I would like the mention in the forum post to be in that specific blue color.

Thanks for your consideration.

Simple mentions issues

Notifications tends to be duplicated

  1. When I enter username with numbers it gives whole listing, does not target said name: http://image.prntscr.com/image/e23e5a812bd94a9abfd63bb6695a460d.png

  2. On a 3gb+ board enabling extension tends to hang and mysql usage is at top resulting in a crash.

  3. Upon enalbing ext and applying permissions following error appears: http://prnt.sc/f202a0 and recent one: http://prntscr.com/f204dj

3.Upon uploading ext: it gives 2 versions, older one @mentions and phpbb mentions using new one

  • Greying out parts because images are on a public place. Thanks

strange behaviour with soft links in filesystem

Hi, I noticed that I am unable to ln -s the extension from other part of filesystem to the phpbb installation, as mention in some magic way connects itself to the real place in filesystem and gives errors it cannot find files in expected locations.

Is it possible to make it agnostic to that issue?

Capital letters

It don't work with capital letters, all usernames must start with lowercase.

Nickname = not working
nickname = working

Feature: Provide a way to change the color of the mention

Mentioned names are hardcoded to #ff0000.

It would be good to be able to change that maybe, via ACP or something. As some styles might not look good with that color, or some user's may just want a more subtle appearance (like not changing the font color from the rest of the text, and just keeping it bold).

When using '@' and a real username but not using [mention] we have a permanent dropdown with the username in following quotes of that post

While testing the extension in my board I noticed that if I try to tag someone but end up not really tagging them, ending up with only the text "@username" (and not [mention]username[/mention] ) whenever someone quotes that post then a dropdown with the username will always be visible and will follow the cursor position as if to finish tagging the user on the quoted post.

Sample:

I'm quoting a post with the text: "test @admin." (not a mention). A dropdown trying to complete the mention is displayed:

simple_mentions_1

The dropdown follows the cursor:

simple_mentions_2

if I press enter, then the tag [mention]admin[/mention] will be added, which is annoying.

Also, this happens in any quote of that message, even if there are multiple quotes in the middle:

simple_mentions_3

Redirects to this after using Mentions, on either QuickReply or Full Editor.

[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/auth/auth.php on line 424: Undefined index: user_type
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1835: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3257)

It posts fine, just gives that error message in a blank page each time a Mention is used.

Fatal error

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "". in /home/xxxxxx/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php:824 Stack trace: #0 /home/xxxxxx/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php(464): Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('') #1 /home/xxxxxx/public_html/phpbb/notification/manager.php(881): Symfony\Component\DependencyInjection\ContainerBuilder->get('') #2 /home/xxxxxx/public_html/phpbb/notification/manager.php(870): phpbb\notification\manager->load_object('') #3 /home/xxxxxx/public_html/phpbb/notification/manager.php(370): phpbb\notification\manager->get_method_class('') #4 /home/xxxxxx/public_html/phpbb/notification/manager.php(295): phpbb\notification\manager->add_notifications_for_users('notification.ty...', Array, Array) #5 /home/xxxxxx/public_html/phpbb/notification/manager.php(266): phpbb\notification\manager->add_notifications('notific in /home/xxxxxx/public_html/vendor/symfony/dependency-injection/ContainerBuilder.php on line 824


I get the above error randomly (so called because I'm sure there is a rhyme and reason that I just haven't noticed yet.) when saving a message. Not 100% sure, but seems to be related to the mention extension. Has been happening with 1.01 and 1.02. PHPbb is 3.2.0 previously and 3.2.1 now. PHP is 7.0. Ironically even though it errors out, the post gets saved (and everyone reposts making a duplicate).

dropdown list does not show up

After the extension is activated I checked the permissions. admins and registered members are yes for mentions. checked my personal account and it was yes as well.

Went to post a message and attempted to mention my test account. Typed @ran and the dropdown did not appear. Tried @ ran also with no success. Could my issue be that there are only two members on my board?

Running 3.2.0 php 5.5.12 on apache 2.4.9 wampserver

Useless adm style file

You have an unused adm/style/mention_body.html that is not used (and contains only old acme demo code)

Reparsing of BBCodes kills mention display

I had to reparse all my BBCodes because of an update for "Advanced BBCode Box 3". After reparsing all previously parsed [mention] BBCodes which showed "@username" are now plain BBCodes like "[mention]username[/mention]".

Is there any fix for this?

ABBC3 comments still in mentions code

The ABBC3 page docblock is in your bbcodes_installer class.

You might consider updating that unless it was intentionally left to credit the original author (which was me :octocat: )

Popup not showing when single @ already exists in the text

if there's an @ in the text followed by a space, subsequent @mentions will not work:

Example:

1- Lorem ipsum some text @user--> dropdown shows for all nicknames that start with ('user')
2- Lorem ipsum '@' some text @user --> dropdown shows correctly
3- Lorem ipsum @ some text @user --> no dropdown shows at all

What's happening is that in the last case the extension will keep trying to find users for the first @ as you can see in the image below:

capture

Probably the extension should ignore @ when there's nothing directly after it (ie, is followed by a blank space).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.