Page 2 of 2

Posted: 22 Nov 2016, 21:53
by Wodan
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

Posted: 22 Nov 2016, 22:04
by Rimrul
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.

Posted: 22 Nov 2016, 22:04
by webwit
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...

Posted: 22 Nov 2016, 22:06
by Rimrul
It seems that fix broke the hashtags. Might just be temporary, though.

Posted: 22 Nov 2016, 22:06
by webwit
Search index is about 10% filled now...217.3 posts per second.

Posted: 22 Nov 2016, 22:17
by Ratfink
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.

Posted: 22 Nov 2016, 22:30
by Rimrul
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.

Posted: 22 Nov 2016, 22:31
by webwit
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.

Posted: 22 Nov 2016, 22:34
by Rimrul
It also affects urls with anchors, i.e.
https://www.phpbb.com/community/viewtop ... #p13329580

Posted: 22 Nov 2016, 22:35
by Ratfink
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.

Posted: 22 Nov 2016, 22:37
by webwit
The mod should take anchors and css colors into account.

Posted: 22 Nov 2016, 22:38
by Rimrul
The fix seems to only damage urls over a cetrain length.

Posted: 22 Nov 2016, 22:41
by webwit
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

Posted: 22 Nov 2016, 23:05
by Rimrul
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.

Posted: 22 Nov 2016, 23:09
by webwit
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.

Posted: 22 Nov 2016, 23:15
by Ratfink
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

Posted: 22 Nov 2016, 23:22
by webwit

Posted: 23 Nov 2016, 07:07
by Wodan
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...

Posted: 23 Nov 2016, 07:21
by ohaimark
If only all websites were so efficient...

Posted: 23 Nov 2016, 08:47
by kbdfr
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

Posted: 23 Nov 2016, 11:11
by webwit
Wodan wrote: ~12h to fulfill them?
~12h to 6y.

Posted: 24 Nov 2016, 00:04
by webwit
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

Posted: 07 Dec 2016, 06:20
by ohaimark
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?

Posted: 07 Dec 2016, 11:31
by webwit
It would be possible, but someone would then complain their #1337 hashtag or whatever isn't working.

Posted: 07 Dec 2016, 11:52
by ohaimark
I can't think of many useful hashtags that would have numbers only.

Maybe IBM Model numbers? Ah well.

Posted: 07 Dec 2016, 11:57
by Khers
Would it be possible to require a minimum string length for all-number hashtags?

Posted: 07 Dec 2016, 12:01
by kbdfr
I would suggest assigning the hashtags a colour.
Or perhaps a pic.
Or music, why not?
:mrgreen:

Posted: 07 Dec 2016, 12:09
by ohaimark
That's a better solution, Khers. I'd say a four digit minimum.