I did a little mod on the script to display short links from bit.ly here it is.
For this you need to signup at bit.ly.
Go to : http://bit.ly/a/your_api_key/
Copy your username and API key .
go to cgi-bin/Templates/upload_results.html
Paste this script on the top of the page.Insert your USERNAME AND API KEY on the 11 and 12 line.
Code: Select all
<script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
//bit_url function
function bit_url(url)
{
var url=url;
var username="USERNAME"; // bit.ly username
var key="YOUR API KEY";
$.ajax({
url:"http://api.bit.ly/v3/shorten",
data:{longUrl:url,apiKey:key,login:username},
dataType:"jsonp",
success:function(v)
{
var bit_url=v.data.url;
$("#result").html('<a href="'+bit_url+'" target="_blank">'+bit_url+'</a>');
}
});
}
$(".tabbertab").ready(function()
{
var url=$("#url").val();
var urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
var urltest=urlRegex.test(url);
if(urltest)
{
bit_url(url);
}
else
{
alert("Bad URL");
}
});
});
</script>
Code: Select all
<div class="tabbertab">
<h2><TMPL_VAR lang_download_link></h2>
<textarea id="ic0-<TMPL_VAR file_id>" style="width:98%;" rows=3 onFocus="copy(this);"><TMPL_VAR download_link></textarea>
<div id="c0-<TMPL_VAR file_id>" class="btndiv"><TMPL_VAR lang_copy_clipboard></div>
</div>
Code: Select all
<div class="tabbertab">
<h2><TMPL_VAR lang_download_link></h2>
<textarea id="ic0-<TMPL_VAR file_id>" style="width:98%;" rows=3 onFocus="copy(this);"><TMPL_VAR download_link></textarea>
<input type="hidden" id="url" value="<TMPL_VAR download_link>"/>
<div id="c0-<TMPL_VAR file_id>" class="btndiv"><TMPL_VAR lang_copy_clipboard></div>
</div>
Code: Select all
<tr>
<td align=right><b><TMPL_VAR lang_file_size>:</b></td>
<td><TMPL_VAR file_size></td>
</tr>
Code: Select all
<tr>
<td align=right nowrap><b><TMPL_VAR lang_short_link>:</b></td>
<td><div id="result"></div></td>
</tr>
More to come soon.
Hope This Helps.
Demo: http://hivefiles.com