In followup to #628086: Don't use url() to create 'shorturl' URLs, I request the inclusion for a function that returns a full URL, including http://HOSTNAME/ part.
(shorturl_shorturl($original_url), for instance)
You're going to need such a function anyway, when implementing things like #568190: Introduce Automated Mode for Node Types or #546378: New short URL with bookmarklet or http/REST request. I think it should be the business of shorturl.module to provice the complete URL -- because it is a self contained 'service' that other parts of the code can 'query' for a shortened URL. (Just like you query any other shortURL service and get the shortened URL back, not only the part behind the hostname.)
I gave my arguments about why I think you should not use the url() function for this, in http://drupal.org/node/628086#comment-2249864 . Among others: it is good to use the 'shorturl_domain' variable that is configured on the admin/settings/shorturl page, and that domain does not need to be configured in the rest of Drupal. (I am using it this way at the moment, with a different hostname.)
If you don't agree and still want to use url()... then I ask you, why does the 'shorturl_domain' variable exist? It is not used at the moment :-)
Comments
Comment #1
irakli commentedI agree. ShortURL domain is definitely not necessarily the same as the main domain of a website. For instance, the main domain of a website can be: techcrunch.com, while they would want to shorten URLs with the domain: tcrn.ch.
thx
Comment #2
icecreamyou commentedTracking, so I know when to switch to using the planned function in the Shorten URLs module.
Comment #3
roderikFYI: I plan to continue what I started, but don't have time yet. Will look through http://drupal.org/project/url_alter sometime, to see if that's got any usefulness (and 'nice path to D7'), and then report back. In 2 weeks maybe.
Comment #4
irakli commentedThe function to use for Full URLs (dev release):
Comment #5
icecreamyou commentedNice. I'll update Shorten URLs when I get a chance.
Comment #7
summit commentedHi,
I use this function in a custom formatters way, but when I use this function:
1) I got a shorturl [mywebsite]/lql like on comment: http://drupal.org/node/628086
Every node I try the same lql shorturl
2) and url's with variables like /?=code12 are cut off before the variable.
Greetings, Martijn