", "", $contents);
$TitleTxt="";
if ($title!="") {
//$TitleTxt=htmlentities(mb_convert_encoding($title, 'UTF-8', mb_list_encodings()), ENT_QUOTES, 'ISO-8859-1')."
";
$TitleTxt=mb_convert_encoding($title, 'UTF-8', mb_list_encodings())."
";
$TitleImg="";
if (file_exists($PathFilenameThumbs)) {
$JPGfile=RandomFile($PathFilenameThumbs, "jpg");
if (file_exists($JPGfile)) {
list($width, $height, $type, $attr) = getimagesize($JPGfile);
$TitleImg='
';
}
}
if ($TitleImg!="" && $TitleTxt!="") {
echo '
| |
| '; echo ($TitleTxt!="") ? ''.$TitleTxt.'' : ""; echo ($TitleImg!="") ? ''.$TitleImg.'' : ""; echo " |
";
}
}
} else {
$htmfile="";
$htmfile=RandomFile($PathFilename, "html");
if ($htmfile=="") {
$htmfile=RandomFile($PathFilename, "htm");
}
if ($htmfile!="") {
$contents="";
$title="";
$fd=fopen($htmfile, "r");
while($buffer = fread ($fd, 1024)){
$contents.=$buffer;
}
$title=my_strip("", "", $contents);
$TitleTxt="";
if ($title!="") {
//$TitleTxt=htmlentities(mb_convert_encoding($title, 'UTF-8', mb_list_encodings()), ENT_QUOTES, 'ISO-8859-1')."
";
$TitleTxt=mb_convert_encoding($title, 'UTF-8', mb_list_encodings())."
";
$TitleTxt=html_entity_decode($TitleTxt);
$TitleImg="";
$JPGfile=RandomFile($PathFilename, "jpg");
if (file_exists($JPGfile)) {
list($width, $height, $type, $attr) = getimagesize($JPGfile);
$max_width=124;
$max_height=124;
$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;
if( ($width <= $max_width) && ($height <= $max_height) ){
$tn_width = $width;
$tn_height = $height;
} elseif (($x_ratio * $height) < $max_height){
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
} else {
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
$TitleImg='
';
}
}
if ($TitleImg!="" && $TitleTxt!="") {
echo '
| |
| '; echo ($TitleTxt!="") ? ''.$TitleTxt.'' : ""; echo ($TitleImg!="") ? ''.$TitleImg.'' : ""; echo " |
";
}
}
}
}
?>