/Sources/Subs.php
Pesquisar
// Parse bulletin board code in a string, as well as smileys optionally.
Adicionar
// ed2k links functions
function human_size($size)
{
if ( $size / 1073741824 > 1 )
return round( $size / 1073741824, 2 ) . ' GiB';
if ( $size / 1048576 > 1 )
return round( $size / 1048576, 2 ) . ' MiB';
if ( $size / 1024 > 1 )
return round( $size / 1024, 2 ) . ' KiB';
return round( $size, 2 ) . ' Bytes';
}
function link_from_a_ed2k ($m)
{
$ed2k_img = '<img src="./ed2kfile/donkey.gif" alt="ed2k:" title="Edonkey Link" /> ';
return $ed2k_img . "<a href=" . $m[1] . ">" . $m[5] . "</a> (" . human_size($m[3]) . ")";
}
function link_from_ed2k ($m)
{
$ed2k_img = '<img src="./ed2kfile/donkey.gif" alt="ed2k:" title="Edonkey Link" /> ';
return $m[1] . $ed2k_img . "<a href=" . $m[2] . ">" . $m[3] . "</a> (" . human_size($m[4]) . ")" . $m[5];
}
// end of ed2k links functions
Pesquisar
$message = strtr($message, array("\n" => '<br />'));
Adicionar
// ed2k links support
$message = preg_replace_callback('~<a\s+href=(?:")?(ed2k://\|file\|(.+?)\|(.+?)\|(.+?))(?:")?>(.+?)</a>~i', 'link_from_a_ed2k' , $message );
$message = preg_replace_callback('~(\s|<br.+?/>|^)(ed2k://\|file\|(.+?)\|(.+?)\|.+?)(\s|<br.+?/>|$)~i', 'link_from_ed2k' , $message );
$message = preg_replace_callback('~(\s|<br.+?/>|^)(ed2k://\|file\|(.+?)\|(.+?)\|.+?)(\s|<br.+?/>|$)~i', 'link_from_ed2k' , $message );
// end of ed2k links support
a imagem esta No anexo