Hash tag support

Did some more testing. Seems like the search has a degree of fuzzyness and will find matches without the hashtag as well. Clicking on #phpBB will pop up lots of phpbb URLs :)

Maybe it's possible to add a parameter to the search to only show exact matches
Wodan
User avatar
ISO Advocate

Unread post22 Nov 2016, 20:53

User avatar
X
Wodan
ISO Advocate
 
Posts: 2604
Joined: 23 Nov 2015, 20:43
Location: ISO-DE
Main keyboard: Random
Main mouse: Logitech G502
Favorite switch: ALL OF THEM
Club member: 0143
 
Ray wrote:actually doing your own tagging system and use the search-function for it isn't that easy in phpbb, because search replaces any non-alphanum with spaces (i.e. word seperator).

If this wasn't the case it would be easy (I guess) to do an autocorrection for anything starting e.g. with # with a link to searchresults for that tag.

Same problem Wodan. You can't search for any special characters.
Rimrul

Unread post22 Nov 2016, 21:04

X
Rimrul
 
Posts: 215
Joined: 17 Feb 2016, 19:07
Location: Germany
Main keyboard: G80-3000LQCDE-2 w/ SKIDATA+
Main mouse: Logitech B100
Favorite switch: M Buckling spring, so far
 
Did some fixes with the German links I found at the last page of the mod for that. Re-creating the search index. This might take a while...
webwit
User avatar
Wild Duck

Unread post22 Nov 2016, 21:04

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
It seems that fix broke the hashtags. Might just be temporary, though.
Rimrul

Unread post22 Nov 2016, 21:06

X
Rimrul
 
Posts: 215
Joined: 17 Feb 2016, 19:07
Location: Germany
Main keyboard: G80-3000LQCDE-2 w/ SKIDATA+
Main mouse: Logitech B100
Favorite switch: M Buckling spring, so far
 
Search index is about 10% filled now...217.3 posts per second.
webwit
User avatar
Wild Duck

Unread post22 Nov 2016, 21:06

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
Okay, here's my proposal. Make the tags by writing a # before the word in your post as it currently works, but hide the # when actually displaying the post. That would fix my major complaint, which is that all those # characters are an eyesore.

Hell, if people actually want to see them, then do what I said above, but give the tag links a class like .hashtag, and add a CSS rule like:
Code: Select all
a.hashtag::before {
    content: "#";
}

Then I could remove them with a custom stylesheet, but everyone who isn't a crotchety young man can leave them in place.
Ratfink
User avatar

Unread post22 Nov 2016, 21:17

User avatar
X
Ratfink
 
Posts: 277
Joined: 03 Jul 2012, 19:32
Location: North Carolina, USA
Main keyboard: IBM Displaywriter
Main mouse: CST L-Trac
Favorite switch: Beam Spring
Club member: 0171
 
It's starting to work again. The bad news is: It's working too good. It recognises # in code blocks. I'm not sure we want threads about firmware tagged with #ifdef and similar hashtags...

EDIT: Ratfinks suggestion could also cause issues with code or urls containing anchors.
Last edited by Rimrul on 22 Nov 2016, 21:33, edited 1 time in total.
Rimrul

Unread post22 Nov 2016, 21:30

X
Rimrul
 
Posts: 215
Joined: 17 Feb 2016, 19:07
Location: Germany
Main keyboard: G80-3000LQCDE-2 w/ SKIDATA+
Main mouse: Logitech B100
Favorite switch: M Buckling spring, so far
 
Yeah I was afraid of that. I'm not sure that can be prevented. It's all or nothing. But feel free to submit patches to that mod to exclude code for example.
webwit
User avatar
Wild Duck

Unread post22 Nov 2016, 21:31

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
It also affects urls with anchors, i.e.
https://www.phpbb.com/community/viewtop ... #p13329580
Rimrul

Unread post22 Nov 2016, 21:34

X
Rimrul
 
Posts: 215
Joined: 17 Feb 2016, 19:07
Location: Germany
Main keyboard: G80-3000LQCDE-2 w/ SKIDATA+
Main mouse: Logitech B100
Favorite switch: M Buckling spring, so far
 
Rimrul wrote:It's starting to work again. The bad news is: It's working too good. It recognises # in code blocks. I'm not sure we want threads about firmware tagged with #ifdef and similar hashtags...

EDIT: Ratfinks suggestion could also cause issues with code or urls containing anchors.

Well, does the current situation change links that have anchors in them?
deskthority-f17/hash-tag-support-t15163-30.html#p340470
EDIT: it seems only long ones get messed with.
Does it mess with text in code tags?
Code: Select all
#ifndef TESTING_H
#define TESTING_H
...blah...
#endif

Oh geez, it does mess with code. That seems like it should be preventable to me.
Ratfink
User avatar

Unread post22 Nov 2016, 21:35

User avatar
X
Ratfink
 
Posts: 277
Joined: 03 Jul 2012, 19:32
Location: North Carolina, USA
Main keyboard: IBM Displaywriter
Main mouse: CST L-Trac
Favorite switch: Beam Spring
Club member: 0171
 
The mod should take anchors and css colors into account.
webwit
User avatar
Wild Duck

Unread post22 Nov 2016, 21:37

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
The fix seems to only damage urls over a cetrain length.
Rimrul

Unread post22 Nov 2016, 21:38

X
Rimrul
 
Posts: 215
Joined: 17 Feb 2016, 19:07
Location: Germany
Main keyboard: G80-3000LQCDE-2 w/ SKIDATA+
Main mouse: Logitech B100
Favorite switch: M Buckling spring, so far
 
I guess the bug in someone in here:

Code: Select all
$text= preg_replace_callback( '/(^|style="[^"#]+|[^\\s]*[\\s]+|>)#([\\p{Lu}\\p{Ll}\\p{N}\\w\\d]+)\\b/um', 'hashtag_callback', $text );


Lovely, lovely. Let's get to it, people! :twisted:

Edit: re-indexing has finished. Test: #phpBB
webwit
User avatar
Wild Duck

Unread post22 Nov 2016, 21:41

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
I think I figured out the part that damages the shortened links and shortened the match, but can't quite figure out how to exclude it from matches.
Rimrul

Unread post22 Nov 2016, 22:05

X
Rimrul
 
Posts: 215
Joined: 17 Feb 2016, 19:07
Location: Germany
Main keyboard: G80-3000LQCDE-2 w/ SKIDATA+
Main mouse: Logitech B100
Favorite switch: M Buckling spring, so far
 
Rimrul wrote:It also affects urls with anchors, i.e.
https://www.phpbb.com/community/viewtop ... ⌗p13329580

Fixed that, but not historically. I cheated by replacing # with ⌗ (viewdata square) in the url shortener code. But that is invoked upon save of a post, not render.
webwit
User avatar
Wild Duck

Unread post22 Nov 2016, 22:09

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
webwit wrote:
Rimrul wrote:It also affects urls with anchors, i.e.
https://www.phpbb.com/community/viewtop ... ⌗p13329580

Fixed that, but not historically. I cheated by replacing # with ⌗ (viewdata square) in the url shortener code. But that is invoked upon save of a post, not render.

Could you maybe just make the URL get shortened to something like this (no spaces around the ellipsis)? https://www.phpbb.com/community/viewtop…#p13329580
Ratfink
User avatar

Unread post22 Nov 2016, 22:15

User avatar
X
Ratfink
 
Posts: 277
Joined: 03 Jul 2012, 19:32
Location: North Carolina, USA
Main keyboard: IBM Displaywriter
Main mouse: CST L-Trac
Favorite switch: Beam Spring
Club member: 0171
 
webwit
User avatar
Wild Duck

Unread post22 Nov 2016, 22:22

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
So that's how feature requests work here? ~12h to fulfill them?

Checked the tags and they work exactly as I hoped they would. How awesome is that...
Wodan
User avatar
ISO Advocate

Unread post23 Nov 2016, 06:07

User avatar
X
Wodan
ISO Advocate
 
Posts: 2604
Joined: 23 Nov 2015, 20:43
Location: ISO-DE
Main keyboard: Random
Main mouse: Logitech G502
Favorite switch: ALL OF THEM
Club member: 0143
 
If only all websites were so efficient...
ohaimark
User avatar
Kingpin

Unread post23 Nov 2016, 06:21

User avatar
X
ohaimark
Kingpin
 
Posts: 2229
Joined: 12 Oct 2015, 19:43
Location: USA
Main keyboard: MagicForce 68 > Gateron Clears > O-rings
Main mouse: Logitech G502
Favorite switch: Blue Alps
Club member: 0130
 
Ratfink wrote:Okay, here's my proposal. Make the tags by writing a # before the word in your post as it currently works, but hide the # when actually displaying the post. That would fix my major complaint, which is that all those # characters are an eyesore.

Hell, if people actually want to see them, then do what I said above, but give the tag links a class like .hashtag, and add a CSS rule like:
[…]
Then I could remove them with a custom stylesheet, but everyone who isn't a crotchety young man can leave them in place.

Image
kbdfr
User avatar
The Tiproman

Unread post23 Nov 2016, 07:47

User avatar
X
kbdfr
The Tiproman
 
Posts: 4308
Joined: 24 Mar 2011, 13:06
Location: Berlin, Germany
Main keyboard: Tipro MID-QM-128A + two Tipro matrix modules
Main mouse: Contour Rollermouse Pro
Favorite switch: Cherry black
Club member: 0010
 
Wodan wrote:~12h to fulfill them?

~12h to 6y.
webwit
User avatar
Wild Duck

Unread post23 Nov 2016, 10:11

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
Ratfink wrote:but hide the # when actually displaying the post.

I see your point, but the # is also an indicator that it leads to a search of the keyword following it. Otherwise it could be any link. It's also now sort of a standard interface element to denote such links, so to change it to a grey link or something would not work either. It's all or nothing basically. If you or some other club member feels strongly about it, start a club vote, "hash tags, yes or no."

#complaintdepartment
webwit
User avatar
Wild Duck

Unread post23 Nov 2016, 23:04

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
Is there any way to resolve numbers with the pound sign, such as #14, being transformed into searchable links?

Perhaps you could limit the feature to strings that have alphanumeric characters, not just numeric characters?
ohaimark
User avatar
Kingpin

Unread post07 Dec 2016, 05:20

User avatar
X
ohaimark
Kingpin
 
Posts: 2229
Joined: 12 Oct 2015, 19:43
Location: USA
Main keyboard: MagicForce 68 > Gateron Clears > O-rings
Main mouse: Logitech G502
Favorite switch: Blue Alps
Club member: 0130
 
It would be possible, but someone would then complain their #1337 hashtag or whatever isn't working.
webwit
User avatar
Wild Duck

Unread post07 Dec 2016, 10:31

User avatar
X
webwit
Wild Duck
 
Posts: 9653
Joined: 27 Jan 2011, 23:27
Location: The Netherlands
Main keyboard: HHKB Pro II
Favorite switch: IBM beam spring
Club member: 0000
 
 
I can't think of many useful hashtags that would have numbers only.

Maybe IBM Model numbers? Ah well.
ohaimark
User avatar
Kingpin

Unread post07 Dec 2016, 10:52

User avatar
X
ohaimark
Kingpin
 
Posts: 2229
Joined: 12 Oct 2015, 19:43
Location: USA
Main keyboard: MagicForce 68 > Gateron Clears > O-rings
Main mouse: Logitech G502
Favorite switch: Blue Alps
Club member: 0130
 
Would it be possible to require a minimum string length for all-number hashtags?
Khers
User avatar

Unread post07 Dec 2016, 10:57

User avatar
X
Khers
 
Posts: 1419
Joined: 11 Sep 2014, 12:23
Location: Sweden
Main keyboard: HHKB Pro 2
Main mouse: Logitech G602
Favorite switch: Capacitive Buckling Spring | Topre | Nixdorf Black
Club member: 0087
 
I would suggest assigning the hashtags a colour.
Or perhaps a pic.
Or music, why not?
:mrgreen:
kbdfr
User avatar
The Tiproman

Unread post07 Dec 2016, 11:01

User avatar
X
kbdfr
The Tiproman
 
Posts: 4308
Joined: 24 Mar 2011, 13:06
Location: Berlin, Germany
Main keyboard: Tipro MID-QM-128A + two Tipro matrix modules
Main mouse: Contour Rollermouse Pro
Favorite switch: Cherry black
Club member: 0010
 
That's a better solution, Khers. I'd say a four digit minimum.
ohaimark
User avatar
Kingpin

Unread post07 Dec 2016, 11:09

User avatar
X
ohaimark
Kingpin
 
Posts: 2229
Joined: 12 Oct 2015, 19:43
Location: USA
Main keyboard: MagicForce 68 > Gateron Clears > O-rings
Main mouse: Logitech G502
Favorite switch: Blue Alps
Club member: 0130
 
Previous

Who is online

Users browsing this forum: No registered users and 3 guests