Collegamenti a siti internet utili:
//resizeimage
function resizeimage( $forcedwidth, $forcedheight, $sourcefile, $destfile )
{
$fw = $forcedwidth;
$fh = $forcedheight;
$is = getimagesize( $sourcefile );
if( $is[0] >= $is[1] )
{
$orientation = 0;
}
else
{
$orientation = 1;
$fw = $forcedheight;
$fh = $forcedwidth;
}
if ( $is[0] > $fw || $is[1] > $fh )
{
if( ( $is[0] - $fw ) >= ( $is[1] - $fh ) )
{
$iw = $fw;
$ih = ( $fw / $is[0] ) * $is[1];
}
else
{
$ih = $fh;
$iw = ( $ih / $is[1] ) * $is[0];
}
$t = 1;
}
else
{
$iw = $is[0];
$ih = $is[1];
$t = 2;
}
if ( $t == 1 )
{
$img_src = imagecreatefromjpeg( $sourcefile );
$img_dst = imagecreatetruecolor( $iw, $ih );
imagecopyresampled( $img_dst, $img_src, 0, 0, 0, 0, $iw, $ih, $is[0], $is[1] );
if( !imagejpeg( $img_dst, $destfile, 90 ) )
{
exit( );
}
}
else if ( $t == 2 )
{
//copy( $sourcefile, $destfile );
}
}
function br2nl($coffee) {
$coffee = str_replace("\r\n", "\n", $coffee);
$coffee = str_replace("
\n", "\n", $coffee);
return $coffee;
}
function charpost() {
$charset = _CHARSET;
foreach($_POST as $key => $val)
{
$_POST[$key] = nl2br(htmlentities($_POST[$key], ENT_QUOTES,'UTF-8'));
}
}
//RSS 2.0
class MakeRSS{
var $Articles = array();
// Channel info
var $title = '';
var $link = '';
var $description = '';
var $optional = array();
var $image = array('url' => '', 'title' => '', 'link' => '', 'description' => '', 'w' => 0, 'h' => 0);
function MakeRSS($title, $link, $description, $optional = ''){
$this->title = $title;
$this->link = $link;
$this->description = $description;
if( is_array($optional) and count($optional) ){
$this->optional = $optional;
}
}
function AddOptional($key, $value){
$this->optional[$key] = $value;
}
function AddImage($title, $url, $link, $description = ''){
$this->image['title'] = $title;
$this->image['url'] = $url;
$this->image['link'] = $link;
$this->image['description'] = $description;
if( $tmp = @getimagesize($url) ){
$this->image['w'] = ($tmp[0] > 144) ? 144 : $tmp[0];
$this->image['h'] = ($tmp[1] > 400) ? 400 : $tmp[1];
}
}
function AddArticle($title, $link, $description, $author, $optional = ''){
$i = array_push($this->Articles, array('title' => $title, 'link' => $link, 'description' => $description, 'author' => $author));
if( is_array($optional) and count($optional) ){
--$i;
while( list($k, $v) = each($optional) ){
$this->Articles[$i][$k] = $v;
}
}
}
function Output($save = false, $path = ''){
$out = '' . "\n" .
'
Lo studio tecnico associato Ingg. PINO & BERTORA è una associazione professionale costituita nel 1984. I soci dello studio sono iscritti all'Ordine Professionale della Provincia di Imperia.
Collegamenti a siti internet utili: