New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linked and formatted user names #527
Conversation
Implements an event which can modify the link below usernames, and the displayed user name. When no name supplied, the name of currently logged-in user is used.
* | ||
* @triggers COMMON_USER_LINK | ||
*/ | ||
function userinfo($username = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think null
or maybe an empty string would make slightly more sense as a default.
One way to deal with the rewriting problem could be handling the Hmm thinking about it, we could always do that when the link does not contain a slash (eg. is not an URL or path). When this is the case we put the resolved link through wl(). This should give us enough flexibility. |
* allowed urlparams * added `wiki:users:` as default user profile link
uses the user interwiki link as profile link
summary sofar:
todo's:
|
@@ -24,12 +24,13 @@ amazon.de http://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/ | |||
amazon.uk http://www.amazon.co.uk/exec/obidos/ASIN/ | |||
paypal https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business= | |||
phpfn http://www.php.net/{NAME} | |||
coral http://{HOST}.{PORT}.nyud.net:8090/{PATH}?{QUERY} | |||
coral http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY} | |||
freecache http://freecache.org/{NAME} | |||
sb http://www.splitbrain.org/go/ | |||
skype skype:{NAME} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn. I forgot about this usecase. this will break with your change. You no longer can create a shortcut to have special protocol links like skype:, mailto: or javascript:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could use a (pseudo) full link syntax instead?
user [[wiki:user:{NAME}]]
But users would expect these to work too then:
user [[wiki:user:{NAME}|Profile for {name}]]
user [[wiki:user:{NAME}|{{some:img.png|Profile}}]]
user [[wiki:user:{NAME}|{{http://example.com|some:img.png|Profile}}]]
which doesn't really make sense. Maybe we can do something like in mime.conf and prefix things that should be resolved as page name with a !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FS#2713 suggests using _shortcut
or .shortcut
for internal links, you added !shortcut
as well.
Which variant do we like?
@selfthinker can you have a look at my usage of the |
$url = $url.rawurlencode($reference); | ||
$url = $url . rawurlencode($reference); | ||
} | ||
//url without slashes is handled as a pageid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the current behavior anymore.
freecache http://freecache.org/{NAME} | ||
sb http://www.splitbrain.org/go/ | ||
skype skype:{NAME} | ||
google.de http://www.google.de/search?q= | ||
go http://www.google.com/search?q={URL}&btnI=lucky | ||
user :wiki:users:{NAME} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use singular here, so :wiki:user:{NAME}
.
Also not sure if the wiki
namespace is a good and/or essential place for it. :user:{NAME}
would be easiest and is more universal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. :user:{NAME}
seems to be a good default.
The "Logged in as" username link needs to be blue to match the design. I will add that in a bit. |
…l (to fit design)
The use of |
I'm wondering if there should be an option to remove the link from the user at "Logged in as"? Always adding it will otherwise essentially force every wiki to have user pages...! |
huh? there is only a link when you select the appropriate displayas option or is there? |
Ah, yes, true. Sorry, my bad. |
Conflicts: inc/parser/renderer.php inc/template.php
What's the state here? I think it's good to merge? |
It is ready so far i know. The user icon is a colored image An idea is to reuse the profile image of the 'edit profile' link via css, only for user interwikilinks in the header.
What do you think? |
I updated the CSS to override the icon in the header. good to merge in my opinion 👍 |
if($evt->advise_before(true)) { | ||
if(empty($data['name'])) { | ||
if($conf['showuseras'] == 'loginname') { | ||
$data['name'] = $textonly ? $data['username'] : hsc($data['username']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does one have hsc()
and not the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
textonly shouldn't require html escaping.
I don't like the name of the function userinfo() -- too similar to $USERINFO. How about userlink() ? |
The naming is improved as indicated. |
Linked and formatted user names
Implements an event which can modify the link below usernames, and the
displayed user name.
When no name supplied, the name of currently logged-in user is used.
Fixes:
2 question left:
Implemented as:
<bdi>
tags