require_login(); $page =new page(); $persona=unserialize($S['person']); //$page->setCssInclude("css.all.css.min.css"); $page->setCssInclude("general.css.min.css"); $page->setCssInclude("portada.css.min.css"); // $page->setCssInclude("portada.css"); $page->setJsInclude("prototype.js.min.js"); $page->setJsInclude("tinybox.js.min.js"); // $page->setJsInclude("general.js"); $content=new content("layout.html"); /*seo*/ $page->canonical="http://recetae.com/"; $page->setContent($content); $page->build(); // $page->setAditionalHeader("link","",Array('rel'=>"alternate"), Array('type'=>"application/rss+xml"), Array('href'=>"http://www.recetae.com/feed/"),Array('title'=>"recetas en Recetae.com")); $content=new content("portada2.html"); $TABLES["recipe"]->imagePath="minithumb"; $tableFotos=clone $TABLES["recipe"]; $tableFotos->addWhere(" AND image !=''"); $tableFotos->itemsPerPage=20; $tableVideos=clone $TABLES["recipe"]; $tableVideos->addWhere(" AND youtubeuid !=''"); $tableVideos->itemsPerPage=10; //$content->setTable("popular",$tablePopular); /*$recetasNavidad=clone $TABLES["recipe"]; /$recetasNavidad->relTables[]=Array( "table"=>"tag", "localkey"=>"uid", "foreignkey"=>"recipe" ); $recetasNavidad->addWhere(" AND tag.uid='navidad'"); */ //$TABLES["recipe"]->relationArray["tag"]->max=3; $tableMasNuevas=clone $TABLES["recipe"]; $tableMasNuevas->addOrderBy("uid DESC"); $tableMasNuevas->itemsPerPage=20; $contador=0; function recipeFormatRepeater($fila,$subpart,$subpartHTML,&$_this){ global $contador; if($fila["title"]!=NULL &&strlen($fila["title"])>30){ if (strpos($fila["title"]," ",30)!==false) $fila["title"]=substr($fila["title"],0,strpos($fila["title"]," ",30))."..."; } if ($fila["header"]!=NULL){ $fila["description"]=$fila["header"]; }elseif($fila["description"]!=NULL &&strlen($fila["description"])>100){ if (strpos($fila["description"]," ",100)!==false) $fila["description"]=substr($fila["description"],0,strpos($fila["description"]," ",100))."..."; } if ($fila["resultado"] != NULL) $fila["resultado"] = number_format($fila["resultado"], 2, ',', ''); $fila["pos"] = ++$contador; if ($fila["youtubeuid"] != NULL){ // $fila["youtubeobject"] = ' '; $fila["youtubeimg"] = ''.$fila['; } $fila["description"]=strip_tags($fila["description"]); $subparte=$_this->formatRepeater($fila,$subpart,$subpartHTML); return $subparte; } $tableMasNuevas->rowFormatHandler=recipeFormatRepeater; $tableVideos->rowFormatHandler=recipeFormatRepeater; $recetasNavidad->rowFormatHandler=recipeFormatRepeater; $contador=0; $content->setTable("masnuevas",$tableMasNuevas); $TABLES["type"]->itemsPerPage=20; $TABLES["type"]->addWhere(" AND recipes>0"); $TABLES["type"]->addOrderBy("recipes DESC, uid DESC"); $TABLES["region"]->addWhere(" AND recipes>0"); $TABLES["person"]->itemsPerPage=8; $TABLES["person"]->addOrderBy("recipes DESC, uid DESC"); $TABLES["person"]->addWhere(" AND recipes>0"); $content->setTable("tipos",$TABLES["type"]); $content->setTable("regiones",$TABLES["region"]); $content->setTable("autores",$TABLES["person"]); $content->setTable("photolist",$tableFotos); $content->setTable("videolist",$tableVideos); /*$content->setTable("navidad",$recetasNavidad);*/ $page->tag["content"]->setContent($content); array_push($page->pageTitle,"Recetae.com, receta y cocina"); echo $page->render(); ?>