set_mark(); if ($_SESSION["_screen_alert_"]) { $html_screen_alert = ""; $_SESSION["_screen_alert_"] = ""; } echo "\n"; if ($this->obj_nav->get_field("dologin")=="yes") $this->dologin(); if ($this->obj_nav->get_field("dologout")=="yes") $this->dologout(); echo "\n"; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
"; echo "PT"; echo " | "; echo "ENG"; echo "
"; echo "
"; echo "
"; echo ""; echo "
"; $this->draw_object(''); echo ""; echo "
"; echo "\n"; echo ""; echo ""; echo ""; echo ""; echo "
"; $this->draw_menu(); echo ""; $this->draw_submenu(); echo "
"; echo "
"; echo "
"; $this->draw_object(''); echo ""; echo "
"; $this->draw_object(''); echo ""; $item2 = $this->get_item(3031); echo "
"; echo "".$item2["TITLE"].""; echo "
"; $item2 = $this->get_item(C_ID_FORM_SUGIRA); echo "
"; echo "".$item2["TITLE"].""; echo "
"; echo "
"; echo "
"; if ($this->obj_nav->get_field("search_words")) { $this->draw_object(''); } elseif ($this->obj_nav->get_field("sitemap")) { $this->draw_object(''); } elseif ($this->id==3550) { $this->call_template("newsletter1"); } elseif ($this->id==3551) { $this->call_template("newsletter2"); } elseif ($this->id == $this->start_id) { $this->draw_homepage(); } else { if (!$template = $this->item["TAG"]) { $template = $this->mark["TAG"]; } $this->call_template($template); } echo ""; echo "
"; echo "    "; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; $this->draw_object(''); echo ""; $this->draw_object(''); echo "
"; echo "
"; echo "
"; echo $html_screen_alert; echo "\n\n"; } ######################################################################################################### ######################################################################################################### ######################################################################################################### function draw_homepage() { $banner = $this->get_item(C_VIDEO); $url = $banner["U_LINK"]; if ($banner["ACTIVO"]=="Sim") { echo "
YouTube
"; ?> destaques"; $this->draw_object(''); echo "
"; //echo "
"; $sql = "SELECT * FROM CONTENT A, RELATIONS B WHERE A.ID = B.CHILD_ID AND PARENT_ID IN (3027,3028) AND DESTAQUE='1' AND AVAILABLE=1 ORDER BY P_DATE DESC"; $rs = $this->obj_mydb->query($sql); $i=1; while ($item2 = $this->obj_mydb->fetch($rs)) { $item = $this->get_item($item2["ID"]); if (!$item["TITLE"]== NULL) { echo "
"; echo $item["TITLE"]; echo " "; echo ""; echo "
"; echo "
"; echo date("Y.m",strtotime($item["P_DATE"])); echo "
"; echo "
"; echo ""; } $i++; } //echo "
"; ?> get_list_item(C_ID_MENU,"","AVAILABLE=1"); echo ""; $mouse = "onclick=\"location='?'\""; echo ""; for ($i=0;$iobj_mydb->get_all_child_info($id); $id = $row2[0]["ID"]; #### se for plano de acções ou newsletter ainda vai mais um nivel abaixo if($row[$i]["ID"]==3010 || $row[$i]["ID"]==3012 || $row[$i]["ID"]==7246) { $row3 = $this->obj_mydb->get_all_child_info($id); $id = $row3[0]["ID"]; } } $menu_id = "menu_".$row[$i]["ID"]; $mouse = "onclick=\"location='?id=".$id."'\""; if (!$row[$i]["TITLE"]== NULL) { echo ""; } } echo "
"; echo "
"; echo "HOME"; echo "
"; echo "
"; echo "
"; echo $row[$i]["TITLE"]; echo "
"; echo "
"; } ######################################################################################################### ######################################################################################################### ######################################################################################################### function draw_submenu() { $arr_noexpand = array(); if ($this->mark_id==1000) return; $row = $this->get_list_item($this->mark_id,"","AVAILABLE=1"); ##### SET MENU TREE ############# $arr_tree = array(); if ($this->mark_id != $this->start_id) { $id = $this->id; while ($id != $this->mark_id) { $tree = $this->obj_mydb->get_item($id); $arr_tree[] = $id; $id = $tree["PARENT_ID"]; } } echo ""; for ($i=0;$i"; } echo "
"; $id1 = $row[$i]["ID"]; if ($row[$i]["EXPAND"] && $this->mark_id != 3011 && $this->mark_id != 2141 ) { $row2 = $this->get_list_item($id1,"","AVAILABLE=1"); $id1 = $row2[0]["ID"]; } $mouse = "onclick=\"location='?id=".$id1."'\""; echo "
"; echo $row[$i]["TITLE"]; echo "
"; ##### o plano de acções é diferente if ($this->mark_id == 3010 || $this->mark_id == 3012 || $this->mark_id == 7246 ) { if (in_array($row[$i]["ID"],$arr_tree) && $row[$i]["EXPAND"] ) { echo "
"; for ($i2=0;$i2\n"; echo $title2; echo "
\n"; if (in_array($id2,$arr_tree) && $row2[$i2]["EXPAND"]) { echo "
\n"; $row3 = $this->get_list_item($row2[$i2]["ID"],"","AVAILABLE=1"); for ($i3=0;$i3".$arr_sub[1]:""); $mouse3 = "onclick=\"location='?id=".$id3."'\""; echo "
\n"; echo $title3; if ($row3[$i3]["TITLE_2"]) { echo "
"; $arr_sub = explode("#",$row3[$i3]["TITLE_2"]); echo $arr_sub[0]."
".$arr_sub[1]; } echo "
\n"; if (in_array($id3,$arr_tree)) { echo "\n"; echo "\n"; } echo "
\n"; } } echo "\n"; } } echo "\n"; } } echo "
"; } ######################################################################################################### ######################################################################################################### ######################################################################################################### function draw_object($xml) { $arr_element = $this->parse($xml); echo $this->parse_object($arr_element); } ######################################################################################################### ######################################################################################################### ######################################################################################################### function get_fundo($chave) { $sql = "SELECT * FROM T_BANNER WHERE CHAVE = '".$chave."'"; $rs = $this->obj_mydb->query($sql); $tmp_banner = $this->obj_mydb->fetch($rs); $banner = $this->obj_mydb->get_item($tmp_banner["ID"]); $sql = "SELECT * FROM T_BANNER A,RELATIONS B "; $sql.= " WHERE A.ID = B.CHILD_ID "; $sql.= " AND PARENT_ID = ".$banner["ID"]; $sql.= " AND CHAVE = 'ID".$this->mark_id."'"; $rs = $this->obj_mydb->query($sql); $tmp_banner = $this->obj_mydb->fetch($rs); $banner = $this->obj_mydb->get_item($tmp_banner["ID"]); $rfile = common::get_file($banner["FILE"]); return $rfile; } } $lang = $_GET["lang"]; if (!$lang) $lang = $_POST["lang"]; $app = new site($appname,"site",$id,$action,$lang,"no"); $app->index_file = "index.php"; $app->load_config(); $app->run(); ?>