summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-11-07 14:47:35 -0500
committermillette <millette@controlyourself.ca>2008-11-07 14:47:35 -0500
commit4eecefb54808019a6181482288dcbdb095f39649 (patch)
tree2bce52261819a489d803cadb7c5ba55fb57a35d3
parent4abd5a6ed955d3c6b8ebd84c5714ed88f40ea043 (diff)
trac31 added 3 more short url services: ur1.ca, 2tu.ru and ptiturl.com
darcs-hash:20081107194735-099f7-fe1ef28b4d36e5dde9e6addc287ad22946b060cd.gz
-rw-r--r--actions/othersettings.php3
-rw-r--r--lib/util.php15
2 files changed, 18 insertions, 0 deletions
diff --git a/actions/othersettings.php b/actions/othersettings.php
index d87f256fa..4e28a94f8 100644
--- a/actions/othersettings.php
+++ b/actions/othersettings.php
@@ -42,6 +42,9 @@ class OthersettingsAction extends SettingsAction {
$services = array(
'' => 'None',
+ 'ur1.ca' => 'ur1.ca (free)',
+ '2tu.ru' => '2tu.ru (free)',
+ 'ptiturl.com' => 'ptiturl.com',
'tinyurl.com' => 'tinyurl.com',
'is.gd' => 'is.gd',
'snipr.com' => 'snipr.com',
diff --git a/lib/util.php b/lib/util.php
index eac18e55e..634140fef 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -763,6 +763,21 @@ function common_shorten_link($long_url) {
curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true);
switch($user->urlshorteningservice) {
+ case 'ur1.ca':
+ $short_url_service = new LilUrl;
+ $short_url = $short_url_service->shorten($long_url);
+ break;
+
+ case '2tu.ru':
+ $short_url_service = new TightUrl;
+ $short_url = $short_url_service->shorten($long_url);
+ break;
+
+ case 'ptiturl.com':
+ $short_url_service = new PtitUrl;
+ $short_url = $short_url_service->shorten($long_url);
+ break;
+
case 'is.gd':
curl_setopt($curlh, CURLOPT_URL, 'http://is.gd/api.php?longurl='.urlencode($long_url));
$short_url = curl_exec($curlh);