Jump to content

Extension talk:ShortUrl

About this board

Proeksad (talkcontribs)
Pppery (talkcontribs)

This is the wrong place for this post (it should be at Extension talk:UrlShortener), and the aforementioned restriction is about creating short URLs, not using them anyway. And like any place in which text can be input there need to be some abuse protections.

Proeksad (talkcontribs)

Why? I'm interested only in the button in the sidebar.<br>And like any place in which text can be input there need to be some abuse protections. But we don’t restrict input in the search field. This feature is offered to all readers.

Pppery (talkcontribs)

The "Get Shortened URL" post on the sidebar on this site is provided by the URLShortener extension, not the ShortURL extension. And the reason your search analogy doesn't apply is that searching doesn't create a publicly visible entry in a database that lasts forever, whereas creating a short URL does.

Proeksad (talkcontribs)
Reply to "“Suspicious” IP"

How to use with different domain

1
8.41.6.131 (talkcontribs)

Is there an option to select a redirect from a different domain?

Reply to "How to use with different domain"

permalink as limited alternative to ShortUrl

3
Hoziron (talkcontribs)

In case others find the suggestion useful, I'll mention that I have found it sufficient to use permalinks in email for page revisions on my wiki that have long titles, rather than arrange to get this extension installed.

For example, it's nice that the Hindi-language page about the Hindi Wikipedia is at <http://hi.wikipedia.org/s/164>. However, if that were not the case, it would still be nearly as useful that its present revision can be accessed via <http://hi.wikipedia.org/w/?oldid=1902067>. (I don't know any Hindi at all. I only knew that this extension is installed on that language version of Wikipedia.)

I am not placing this suggestion on the extension's page. When I mentioned it a short while ago in IRC #mediawiki, I found that it might not meet with consensus.

Nemo bis (talkcontribs)
Hoziron (talkcontribs)

Thanks! Here's what I learned from that bugzilla item.

In some cases, a "curid" link will be confusing.

  • By the time the link is used, the page with that "curid" value may have been renamed.
  • By the time the link is used, the page with that "curid" value may have new text.

The page's new text might pertain to a different concept, as compared with the old text.

  • It could be a disambiguation page, when it used to be an article.
  • It could be an article, but now pertaining to a different meaning of the same title. It could be as different as a river "bank" is from a savings "bank".
  • With both renamings and revisions, it could even be an article about a different meaning of a different title.

To create a "curid" link, first get the "curid" value.

  1. Use any of the usual software products for web browsing, such as Google Chrome.
  2. Open the page that will be the target of the link.
  3. Use the command called View Source, or View Page Source.
  4. Find the text "wgArticleId".
  5. That will be followed by a colon, then a number. That number is the "curid" value.

Then use the "curid" value in a link.

  • For the English-language Wikipedia, you can paste the "curid" number onto the end of this: https://en.wikipedia.org?curid=
  • Equivalently, you can do this:
  1. Go to the site's "Special pages" list. The site provides a link to Special Pages in the Tools section of the sidebar.
  2. On the page "Special Pages", use the link "Redirect by file, user, page, revision, or log ID".
  3. In the Lookup pop-down list, select "Page ID".
  4. In the Value text box, paste the "curid" value.
  5. Press "Go".
Reply to "permalink as limited alternative to ShortUrl"

the path for generating short URLs

3
Domitori (talkcontribs)

Statement Set $wgShortUrlTemplate to the template of the path for generating short URLs. $1 is replaced with the actual short url id. should be explained. I have installed this the ShortUrl extension at http://mizugadro.mydns.jp/q/index.php/Special:Version but it does not work. I added line $wgShortUrlTemplate= "http://mizugadro.mydns.hp/k" at the end of the LocalSetting.php

expecting, that instead of http://mizugadro.mydns.hp/q/index.php/test

I can type simply http://mizugadro.mydns.hp/k/test

but I see, this does not work. When, where and how should I specify the desired short URL for this wiki to make it work? Should I create directory http://mizugadro.mydns.hp/k ? Should I put there some files? How to quess, which files should be placed there?

Some sentences or paragraphs seem to be missed between statements "Set $wgShortUrlTemplate to the template of the path for generating short URLs." and "$1 is replaced with the actual short url id."

Could you recover, please the missed explanation?

TerraCodes (talkcontribs)

Pinging @Yuvipanda: as they are the user listed as the author.

80.84.117.82 (talkcontribs)

I know this one is old as heck, but here is the answer:

If, for instance, you have your MediaWiki on "wiki.com" domain, and you have $wgArticlePath = "/wiki/$1" (you can check that in LocalSettings.php file), and you want you short links to look like "wiki.com/wiki/short/_shortname_", your $wgShortUrlTemplate would look like this:

$wgShortUrlTemplate='/wiki/short/$1';

For some reason I am unable to post this into the article directly, maybe somebody else could do it?

Reply to "the path for generating short URLs"

Install for more wikis

2
Trần Nguyễn Minh Huy (talkcontribs)

I think this extension should be install for some of others wiki also use length url which diffcult for share and read as Russian or Vietnamese.

See example for: "Korean War" in 4 languages:

CKoerner (WMF) (talkcontribs)

Minh Huy,

There's some work happening to get ShortURL deployed on Wikimedia wikis. (T108557) Follow that task to keep up-to-date on development.

I don't know if you knew or not, but MediaWiki saw an update recently that makes URLs a little cleaner (copy/pasting might depend on browser if I recall correctly), it even works with section IDs! Not perfect, but better.

https://vi.wikipedia.org/wiki/Chiến_tranh_Triều_Tiên

https://vi.wikipedia.org/wiki/Chiến_tranh_Triều_Tiên#Tái_chiếm_Nam_Triều_Tiên

https://ru.wikipedia.org/wiki/Корейская_война

https://ja.wikipedia.org/wiki/朝鮮戦争

Reply to "Install for more wikis"

URLs of a minimum length?

1
RFlan (talkcontribs)

Is there a way to edit the code so that it generates short URLs of a minimum length? Say 5 or so instead of 2.

Reply to "URLs of a minimum length?"

ShortUrl and Semantic Mediawiki

2
StasR (talkcontribs)

Extension:SemanticMediaWiki and Extension:SemanticForms don't work correctly after installing ShortUrl:

  • page Special:Properties (SMW) contains “NO_VALID_VALUE” instead of the names of predefined properties;
  • page Special:CreateProperty (SF) displays a message “This appears to be a cross-site request forgery; canceling save” when you try to save or preview property

I was able to fix it by editing the function setupUrlRouting (ShortUrl.hooks.php): replaced

$router->add( $wgShortUrlTemplate,
              array( 'title' => SpecialPage::getTitleFor( 'ShortUrl', '$1' )->getPrefixedText() )
            );

with

$router->add( $wgShortUrlTemplate,
              array( 'title' => 'Special:ShortUrl/$1' ) 
            );

After that everything is working correctly.

Rotsee (talkcontribs)

How about this?

$router->add( $wgShortUrlTemplate,
              array( 'title' => SpecialPage::getTitleFor( 'ShortUrl', false, '$1' )->getPrefixedText() )
            );
Reply to "ShortUrl and Semantic Mediawiki"
Siddhartha Ghai (talkcontribs)

The current UI of the extension is really bad. It is:

  • Obtrusive (lying just below the heading)
  • Confusing: Since the url is not accompanied by any indication that this is the url for the current page, half the people (those who don't bother clicking it) probably have no idea what it is for.
  • Clickable: I'm not sure if having a clickable link is needed, since the objective of having a short url is to be able to copy-paste it somewhere.

I'd suggest that the url be moved somewhere more unobtrusive, and be presented with a heading/info (similar to what other sites use, such as "Link to this page"). One way could be such a tag (like "Link to this page") displayed somewhere prominently, clicking on which brings up a dialog box (jquery.ui.dialog maybe?) with the url selected for copying (along with a copy button, maybe?). I don't think there is a need for the url to be permanently displayed on the page.

PS:I don't see why we need the short url displayed at two places (in the sidebar as well as below the heading).

Nemo bis (talkcontribs)

I agree, this is among the ugliest extensions ever. :) See bugzilla:38863.

YuviPanda (talkcontribs)

I agree, though I'll note that it was mainly written as a direct replacement of the userscripts on a few indian wikis (or and ta, I think) that were being used a few years ago when I started on it.

Reply to "UI"

Database table need to be set up manually?

4
Rotsee (talkcontribs)

It seems to me like the maintainence script does not create the needed database table? If that is the case, it would be nice with a line or two about how the table should be set up. rotsee (talk) 20:00, 19 February 2012 (UTC)

Rotsee (talkcontribs)

in case someone else is looking, it's all in the folder ”schemas”. I somehow didn't notice that.

Jdlrobson (talkcontribs)
Reply to "Database table need to be set up manually?"

Not yet ready for deployment

2
Sumanah (talkcontribs)
158.144.44.212 (talkcontribs)

Just a follow up - those things that were blocking deployment have now been fixed.

Reply to "Not yet ready for deployment"