thank you - Simple mentions
thank you
i tested on phpbb3.3, it works good thanks,
two questions for you:
1. it only works on new post, not working on edit post. is there any modification to do this?
2. there is no link for @username to user's profile. what file should i edit to achieve this?
thanks,
Theme: default
Regards
-
- I've Been Banned!
- Posts: 352
- Joined: Tue Jun 23, 2020 5:18 am
- Contact:
Re: thank you
2. This is not supported right now.
Race condition
Who's there?
Keep your 3D printing filament inventory easy • My Photos • my phpBB Extensions • custom phpBB work & Development
-
- Infrastructure Team Leader
- Posts: 27105
- Joined: Sat Dec 04, 2004 3:44 pm
- Location: The netherlands.
- Name: Paul Sohier
- Contact:
Re: thank you
1. would you please guide me to edit your extension and do that? we can check the post's content if it has [mention] or not right? or its harder than this?Paul wrote:1. Editing is not supported because the extension can't detect if the mention was there already previously
2. This is not supported right now.
2. the same thing for @username, if its not hard to do this please guide me to edit your extension for this functionality!
by the way, thank you very much for this great extension,
Theme: default
Regards
-
- I've Been Banned!
- Posts: 352
- Joined: Tue Jun 23, 2020 5:18 am
- Contact:
Re: thank you
Race condition
Who's there?
Keep your 3D printing filament inventory easy • My Photos • my phpBB Extensions • custom phpBB work & Development
-
- Infrastructure Team Leader
- Posts: 27105
- Joined: Sat Dec 04, 2004 3:44 pm
- Location: The netherlands.
- Name: Paul Sohier
- Contact:
Re: thank you
i didn't ask you to add those features, i just asked you to guide me to add them on my copy!Paul wrote:No, I won't be adding those features
but anyway thanks,
Theme: default
Regards
-
- I've Been Banned!
- Posts: 352
- Joined: Tue Jun 23, 2020 5:18 am
- Contact:
Re: thank you
Hi, I've figured out a way to obtain this with just a minor edit to this ext source code:php_BB_Lover wrote: 2. there is no link for @username to user's profile. what file should i edit to achieve this?
1) add a custom bbcode [user] as described here
2) edit /ext/paul999/mention/styles/all/template/js/mention.js by changing
Code: Select all
return '[mention]' + item.original.value + '[/mention]';
Code: Select all
return '[mention][user]' + item.original.value + '[/user][/mention]';
Please note that I'm by no means an expert, and although this works on my board, I don't know if something unexpected could happen following these changes. Bye

-
- Registered User
- Posts: 12
- Joined: Wed Jul 01, 2020 8:45 am
- Contact:
Re: thank you


Race condition
Who's there?
Keep your 3D printing filament inventory easy • My Photos • my phpBB Extensions • custom phpBB work & Development
-
- Infrastructure Team Leader
- Posts: 27105
- Joined: Sat Dec 04, 2004 3:44 pm
- Location: The netherlands.
- Name: Paul Sohier
- Contact:
Re: thank you
thank you very much! it worked!klingklang wrote:Hi, I've figured out a way to obtain this with just a minor edit to this ext source code:php_BB_Lover wrote: 2. there is no link for @username to user's profile. what file should i edit to achieve this?
1) add a custom bbcode [user] as described here
2) edit /ext/paul999/mention/styles/all/template/js/mention.js by changingtoCode: Select all
return '[mention]' + item.original.value + '[/mention]';
you may have to play a little bit with mention.css as well, to tweak the colors at your convenience.Code: Select all
return '[mention][user]' + item.original.value + '[/user][/mention]';
Please note that I'm by no means an expert, and although this works on my board, I don't know if something unexpected could happen following these changes. Bye
i only got this error while adding user tag in bbcode.
Code: Select all
Warning
The BBCode you are trying to add seems unsafe. If the BBCode uses a {TEXT} token in a sensitive context, try using a more restrictive type instead. Only proceed if you understand the risks involved.
i dont know if adding user tag is unsafe or not because of this error!
Theme: default
Regards
-
- I've Been Banned!
- Posts: 352
- Joined: Tue Jun 23, 2020 5:18 am
- Contact:
Re: thank you
then give us the solution!Paul wrote:And if a username gets changed it will be directly broken![]()
at least he helped us by giving that solution!
Theme: default
Regards
-
- I've Been Banned!
- Posts: 352
- Joined: Tue Jun 23, 2020 5:18 am
- Contact:
Re: thank you
You should be happy to I provide the extension, and instead respect the volunteers here. It has a reason that I don't provide certain features, simply because it is not that easy to add. You are free to use that solution, however it simply has issues and thats what I pointed out.
Race condition
Who's there?
Keep your 3D printing filament inventory easy • My Photos • my phpBB Extensions • custom phpBB work & Development
-
- Infrastructure Team Leader
- Posts: 27105
- Joined: Sat Dec 04, 2004 3:44 pm
- Location: The netherlands.
- Name: Paul Sohier
- Contact:
Re: thank you
i said [then]. i didn't say [should]Paul wrote: Sorry? I am not required here to provide you with a solution.
thanks for the extension by the way.
Theme: default
Regards
-
- I've Been Banned!
- Posts: 352
- Joined: Tue Jun 23, 2020 5:18 am
- Contact:
Re: thank you
Unfortunately, further research has taught me that by using {TEXT} inside a html tag, you open your board to malicious attacks, which could be easily done by injecting code inside your [mention] tag. Which by the way could be tweaked to bring to the user's profile without the need for an extra [user] tag, nor any editing of the source code.php_BB_Lover wrote: i dont know if adding user tag is unsafe or not because of this error!
If you are sure that none of your users have an apostrophe (for example) in their nickname, you could replace {TEXT} with {INTTEXT} and be safer, but I have those, and can't go that way. So, never mind the minor issue of a user changing his nickname and see his mention links broken: this is a major security problem, big enough to convince me to give up on this idea, at least for now

-
- Registered User
- Posts: 12
- Joined: Wed Jul 01, 2020 8:45 am
- Contact:
Re: thank you
thank you. your right. i will wait too.klingklang wrote: Unfortunately, further research ...
please reply my post here and give me the solution for [user changes username fix] if you find it!
thanks
Theme: default
Regards
-
- I've Been Banned!
- Posts: 352
- Joined: Tue Jun 23, 2020 5:18 am
- Contact:
Re: thank you
1) in /ext/paul999/mention/controller/main.php, you have:
Code: Select all
$return[] = [
'key' =>$row['username'],
'value' => $row['username'],
];
Code: Select all
$return[] = [
'id' =>$row['user_id'],
'key' =>$row['username'],
'value' => $row['username'],
];
Code: Select all
return '[mention]' + item.original.value + '[/mention]';
Code: Select all
return '[mention=' + item.original.id + ']' + item.original.value + '[/mention]';
Code: Select all
[mention={NUMBER}]{TEXT}[/mention]
Code: Select all
<span class="mention"><a style="color: #4a9a6a;" href="https://your.url/memberlist.php?mode=viewprofile&u={NUMBER}">{TEXT}</a></span>
You should be good

-
- Registered User
- Posts: 12
- Joined: Wed Jul 01, 2020 8:45 am
- Contact:
Re: thank you
With my latest solution, the link points to the user id, so it won't get broken (albeit still showing the old nickname). Do you think it's a sensible approach or i will run into more problems down the road? Thank you, also for this brilliant extension which brings a feature I very much envied to XenforoPaul wrote:And if a username gets changed it will be directly broken![]()

-
- Registered User
- Posts: 12
- Joined: Wed Jul 01, 2020 8:45 am
- Contact: