}
else
{
$height = $_GET['height'];
$width = $_GET['width'];
$lifetime=0;
setcookie("Cookieheight","$height","$lifetime");
setcookie("Cookiewidth","$width","$lifetime");
if($sw2=="1")
{
?>
}
}
$homepage=1;
include("include/db.phtml");
include("include/dbconn.phtml");
include("include/header.phtml");
$fecha=date("Y-m-d");
//ARTICULOS DEL LADO IZQUIERDO - MAPEADOS EN HOME
$sql="SELECT SECCION_T.DESCRIPCION AS SECCION,MAPEO_T.SECCION_ID,MAPEO_T.CATEGORIA_ID,MAPEO_T.SUBJECT_ID,PRINCIPAL_T.CONSECUTIVO,PRINCIPAL_T.TITULO,PRINCIPAL_T.RESUMEN,PRINCIPAL_T.DESCRIPCION,SECCION_T.ORDEN AS ORDEN FROM PRINCIPAL_T,REL_PRINCIPAL_MAPEO_T,MAPEO_T,SECCION_T ".
"WHERE PRINCIPAL_T.CONSECUTIVO=REL_PRINCIPAL_MAPEO_T.REL_CONSECUTIVO AND REL_PRINCIPAL_MAPEO_T.REL_MAPEO_ID=MAPEO_T.MAPEO_ID AND ".
" (MAPEO_T.SECCION_ID='238' OR MAPEO_T.SECCION_ID='239' OR MAPEO_T.SECCION_ID='355' OR MAPEO_T.SECCION_ID='242') AND MAPEO_T.CATEGORIA_ID='703' AND".
" MAPEO_T.MAPEO_ID LIKE '$sitio%' AND ".
" PRINCIPAL_T.ACTIVO=1 AND PRINCIPAL_T.SEPUBLICA_EDITOR=1 AND SECCION_T.SECCION_ID=MAPEO_T.SECCION_ID ORDER BY ORDEN LIMIT 4";
$result_home=do_query($sql,$db);
function titulo_destacado_der($id){
switch ($id) {
case 10679:
$img_titulo="tit_quehacemos.gif";
break;
case 2093:
$img_titulo="tit_quienes.gif";
break;
case 14002:
$img_titulo="tit_fundador.gif";
break;
case 14204:
$img_titulo="tit_regnum.gif";
break;
case 14525:
$img_titulo="tit_estamos.gif";
break;
}
return $img_titulo;
}
function sustituye_acentos($cad){
$cadena = str_replace ("á", "Á", $cad);
$cadena = str_replace ("é", "É", $cadena);
$cadena = str_replace ("í", "Í", $cadena);
$cadena = str_replace ("ó", "Ó", $cadena);
$cadena = str_replace ("ú", "Ú", $cadena);
$cadena = str_replace ("ñ", "Ñ", $cadena);
return $cadena;
}
function tam_cadena($cadena){
$tam_cad=strlen($cadena);
return $tam_cad;
}
function elige_caracter($contenido,$inicio){
$caracter=substr($contenido,$inicio,1);
return $caracter;
}
function checa_caracter($contenido,$inicio,$car_sobrantes,$caracter){
if ($caracter==" "){
//echo "
Sobran: ".$car_sobrantes;
echo substr($contenido,0,$car_sobrantes)."...";
} else {
$inicio=$inicio-1;
$car_sobrantes=$car_sobrantes-1;
$caracter=elige_caracter($contenido,$inicio);
//echo "
".$inicio."---".$car_sobrantes."---".$caracter;
checa_caracter($contenido,$inicio,$car_sobrantes,$caracter);
}
}
function calcula_tamano($tam_titulo,$contenido){
if ($tam_titulo>32){
$lineas=$tam_titulo/32;
$car_a_contar=$lineas*32;
} else {
$car_a_contar=32;
}
$tam_contenido=tam_cadena($contenido);
$tam_total=$tam_titulo+$tam_contenido;
if ($tam_total<=200){
echo $contenido;
} else {
if ($car_a_contar<200){
$car_sobrantes=200-$car_a_contar;
//echo $car_sobrantes."
";
//echo substr($contenido,0,$car_sobrantes);
$inicio=$car_sobrantes-1;
$caracter=elige_caracter($contenido,$inicio,$car_sobrantes);
checa_caracter($contenido,$inicio,$car_sobrantes,$caracter);
} else {
echo "";
}
}
}
function calcula_tamanoPP($tam_titulo,$contenido,$caracteres){
if ($tam_titulo>32){
$lineas=$tam_titulo/32;
$car_a_contar=$lineas*32;
} else {
$car_a_contar=32;
}
$tam_contenido=tam_cadena($contenido);
$tam_total=$tam_titulo+$tam_contenido;
if ($tam_total<=$caracteres){
echo $contenido;
} else {
if ($car_a_contar<$caracteres){
$car_sobrantes=$caracteres-$car_a_contar;
$inicio=$car_sobrantes-1;
$caracter=elige_caracter($contenido,$inicio,$car_sobrantes);
checa_caracter($contenido,$inicio,$car_sobrantes,$caracter);
} else {
echo "";
}
}
}
function ajusta_foto($imagen){
list($ancho, $altura, $tipo, $atr) = getimagesize("$imagen");
if($ancho>100){
$ancho_foto=100;
$altura_foto=75;
}else{
$ancho_foto=$ancho;
$altura_foto=$altura;
}
return array($ancho_foto,$altura_foto);
}
?>