i dont know hw the forum does it, but here is one way....
<?php
$URL = "http://www.mydomain.com/someforums/somefolder/someotherfolder/somefile.php?somevar=somevalue";
$shorten_to = "20";
$split_var = $shorten_to / "2";
$url_array = explode(":|:",chunk_split($URL, $split_var, ':|:'));
$num = count($url_array) - "2";
$new_url = $url_array[0]."...".$url_array[$num];
echo'<a href="'.$URL.'">'.$new_url.'</a>';
?>