"; while($langs = mysql_fetch_array($langs_query)){ if($langs[minus] != $lang && $langs[active] == 1){ $aurl=$_SERVER['QUERY_STRING']; $Reemplazar="&lang=(.*)"; $CadenaNueva=""; $aurl =ereg_replace($Reemplazar,$CadenaNueva,$aurl); $Reemplazar="/?lang=(.*)"; $CadenaNueva=""; $aurl =ereg_replace($Reemplazar,$CadenaNueva,$aurl); if($aurl == ""){ $aurl = "lang=$langs[minus]"; }else{ $aurl = "$aurl&lang=$langs[minus]"; } echo "
  • "; echo "$langs[menu]
  • "; } } unset($first_li); echo ""; mysql_free_result($langs_query); } function urls_amigables($url,$id,$absolut) { // Tranformamos todo a minusculas $url = strtolower($url); //Rememplazamos caracteres especiales latinos $find = array('', '', '', '', '', ''); $repl = array('a', 'e', 'i', 'o', 'u', 'n'); $url = str_replace ($find, $repl, $url); // Aaadimos los guiones $find = array(' ', '&', '\r\n', '\n', '+'); $url = str_replace ($find, '-', $url); // Eliminamos y Reemplazamos dems caracteres especiales $find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/'); $repl = array('', '-', ''); $url = preg_replace ($find, $repl, $url); $url = "$absolut/content/$id/Sitges_$url/"; return $url; } function menu_principal($link,$lang,$section,$absolut){ $menu = mysql_query("SELECT * FROM doro_content WHERE menu_principal = 1 order by id_content",$link); echo ""; } function titulo($link,$lang,$section){ $titulo = mysql_query("SELECT * FROM menu WHERE id = $section",$link); $row = mysql_fetch_assoc($titulo); echo "

    ".$row["content_$lang"]."

    "; } function fecha_es($fecha){ $mes["01"] = "Enero"; $mes["02"] = "Febrero"; $mes["03"] = "Marzo"; $mes["04"] = "Abril"; $mes["05"] = "Mayo"; $mes["06"] = "Junio"; $mes["07"] = "Julio"; $mes["08"] = "Agosto"; $mes["09"] = "Septiembre"; $mes["10"] = "Octubre"; $mes["11"] = "Noviembre"; $mes["12"] = "Diciembre"; ereg( "([0-9]{2,4})-([0-9]{1,2})-([0-9]{1,2})", $fecha, $mifecha); $lafecha=$mifecha[3]." de ".$mes["$mifecha[2]"] ." del ".$mifecha[1]; return $lafecha; } function fecha_completa($fecha){ $mes["01"] = "gener"; $mes["02"] = "febrer"; $mes["03"] = "març"; $mes["04"] = "abril"; $mes["05"] = "maig"; $mes["06"] = "juny"; $mes["07"] = "juliol"; $mes["08"] = "agost"; $mes["09"] = "septembre"; $mes["10"] = "octubre"; $mes["11"] = "novembre"; $mes["12"] = "decembre"; ereg( "([0-9]{2,4})-([0-9]{1,2})-([0-9]{1,2})", $fecha, $mifecha); $lafecha=$mifecha[3]." de ".$mes["$mifecha[2]"]." del ".$mifecha[1]; return $lafecha; } function admin_login(){ echo "

    "; } function admin_list($table,$title,$section,$link){ $list_query = mysql_query("SELECT * from $table order by fecha",$link); if($section == 1){ $list_query = mysql_query("SELECT * from $table order by title_es",$link); } echo "

    $title

    "; echo ""; } function img_resize($path,$w=0,$h=0,$quality=100,$save=''){ $image_data=@getimagesize($path); $image_type=$image_data[2]; $gd_ext=array('','jpg','gif'); if($image_type!=1&&$image_type!=2) return false; if($save=='') header('Content-type: '.$image_data['mime']); else $save=eregi_replace('%ext',$gd_ext[$image_type],$save); if($w!=0){ $rapporto=$image_data[0]/$w; if($h!=0){ if($image_data[1]/$rapporto>$h) $rapporto=$image_data[1]/$h; } }elseif($h!=0){ $tmp_h=$image_data[1]/$h; }else{ return false; } $thumb_w=$image_data[0]/$rapporto; $thumb_h=$image_data[1]/$rapporto; if($image_type==1) $img_src=@imagecreatefromgif($path); elseif($image_type==2) $img_src=@imagecreatefromjpeg($path); $img_thumb=@imagecreatetruecolor($thumb_w,$thumb_h); $result=@imagecopyresampled($img_thumb,$img_src, 0,0,0,0,$thumb_w,$thumb_h,$image_data[0],$image_data[1]); if(!$img_src||!$img_thumb||!$result) return false; if($image_type==1) $result=@imagegif($img_thumb,$save); elseif($image_type==2) $result=@imagejpeg($img_thumb,$save,$quality); return $result; } function location($concept){ $lang = $_SESSION["lang"]; //se cargan los textos localizados $location_query = mysql_query("SELECT * from doro_location where concept = '$concept'"); $location = mysql_fetch_assoc($location_query); echo $location["location_$lang"]; mysql_free_result($location_query); } function location_show($concept){ $lang = $_SESSION["lang"]; //se cargan los textos localizados $location_query = mysql_query("SELECT * from doro_location where concept = '$concept'"); $location = mysql_fetch_assoc($location_query); return $location["location_$lang"]; mysql_free_result($location_query); } function mini_text($text,$num){ $mini_text = strip_tags($text); $mini_text = substr($mini_text,0,$num)."..."; echo $mini_text; } function thumb($img,$an,$al,$title){ echo "$title"; } function foot_year($c_year){ $year = date ("Y"); if($c_year != $year){ echo $c_year." - ".$year; }else{ echo $year; } } ?>