getRecord($uid); if($_GET["debug"]) var_dump($record); $page =new page(); $persona=unserialize($S['person']); $page->setCssInclude("general.css.min.css"); $page->setCssInclude("recipe.all.css.min.css"); //$page->setCssInclude("lightbox.css"); $page->setJsInclude("prototype.js.min.js"); $page->setJsInclude("tinybox.js.min.js"); $page->setJsInclude("recipe.user.js.min.js"); $page->setAditionalHeader("script"," var uid=$uid; var ruta='thumb/'; ",Array("type"=>"text/javascript")); $content=new content("layout.html"); $page->setContent($content); $page->build(); if(!$persona->isValidated()){ $content=new content("person/rapidConnect.template.html",$matrizConnect); }else{ $content=new content("person/rapidDisconnect.template.html",$matrizConnect); } $page->tag["actions-bar"]->setContent($content); $varcharConf=Array("Type"=>"varchar(100)","Null"=>"NO"); $related = new tableList($TABLES["recipe"]); $related->getList("286,267,263,278"); /*Configuración de recetas*/ $TABLES["recipe"]->loadRelationsArray("ingredient",Array(),$varcharConf,"
  • ###description###
  • ","\n "); $TABLES["recipe"]->loadRelationsArray("tag",Array(),$varcharConf,"###description###",", "); //$relTable[table] ON $this->sqlTable.$relTable[localkey] = $relTable[table].$relTable[foreignkey] $TABLES["recipe"]->imagePath="medium"; $pathPieces=explode("/",$_SERVER["REQUEST_URI"]); //var_dump($pathPieces); if($TABLES["recipe"]->getUrlName()==$pathPieces[1]."/") echo ""; function recipeFormatRepeater($fila,$subpart,$subpartHTML,&$_this) { if($fila["description"]!=NULL) { if($fila["person"]==325) $fila["description"]=strip_tags($fila["description"]); $fila["description"]=explode("\n", $fila["description"]); foreach( $fila["description"] as $filaKEY=>$filaValue) { $step=$filaKEY+1; $fila["description"][$filaKEY]="
  • $filaValue
  • "; } $fila["description"]="
      ".implode("",$fila["description"])."
    "; } if($fila["sourceurl"] != NULL){ $fila["sourceurl"] = "Ver receta original"; } if ($fila["header"] != NULL){ if($fila["person"]==325) $fila["header"]=strip_tags($fila["header"]); $fila["header"] = "

    Descripción

    $fila[header]

    "; } if ($fila["youtubeuid"] != NULL){ global $TABLES; $TABLES["recipe"]->images["medium"]['default']=""; $fila["youtubeobject"] = ' '; $fila["youtubeimg"] = ''.$fila['; } // $fila["sourceurl"]="
    Fuente
    $fila[sourceurl]
    "; $subparte=$_this->formatRepeater($fila,$subpart,$subpartHTML); return $subparte; } $TABLES["recipe"]->rowFormatHandler=recipeFormatRepeater; $dificultyRel=Array("table"=>"dificulty","localkey"=>"dificulty","foreignkey"=>"uid"); $TABLES["recipe"]->relTables[]=$dificultyRel; $regionRel=Array("table"=>"region","localkey"=>"region","foreignkey"=>"uid"); $TABLES["recipe"]->relTables[]=$regionRel; if($persona->isValidated()){ $ratingRel=Array("table"=>"rating","localkey"=>"uid","foreignkey"=>"recipe","sql"=> "AND rating.deleted=0 AND rating.person=".$persona->data["uid"]); $TABLES["recipe"]->relTables[]=$ratingRel; } function ingredientFormatRepeater($fila,$subpart,$subpartHTML,&$_this){ $arr = explode("|",$fila["description"]); if(count($arr)>0){ $fila["description"]=($arr[0]!="")?"$arr[0] ":""; $fila["description"] .=($arr[1]!="")?"$arr[1] ":""; $fila["description"] .=($arr[2]!="")?"$arr[2] ":""; } $subparte=$_this->formatRepeater($fila,$subpart,$subpartHTML); return $subparte; } function formatRepeater($fila,$subpart,$subpartHTML,&$_this) { if($fila["rating_value"]!=NULL) { $rating = $fila["rating_value"]; $fila["rating_value"]='
    '; $i=0; do { $i++; if ($i*2<=$rating) $fila["rating_value"].=''; else if($i*2-1== $rating) $fila["rating_value"].=''; else $fila["rating_value"].=''; }while($i<5); $fila["rating_value"].='

    '; }else $fila["rating_value"]=''; if ($fila["header"]!=NULL){ $fila["header"]="

    Descripción

    $fila[header]

    "; } //var_dump($fila["description"]); $fila["commentdescription"]=str_replace("\n","
    ", $fila["commentdescription"]); if ($fila["sourceurl"]!=NULL) $fila["sourceurl"]="Ver receta original"; $subparte=$_this->formatRepeater($fila,$subpart,$subpartHTML); return $subparte; } $personRel=Array("table"=>"person","localkey"=>"person","foreignkey"=>"uid"); $ratingRel=Array("table"=>"rating","localkey"=>"rating","foreignkey"=>"uid"); $TABLES["comments"]->relTables[]=$personRel; $TABLES["comments"]->relTables[]=$ratingRel; //$userRatingTable = clone $TABLES["rating"]; $TABLES["comments"]->addWhere(" AND NOT ISNULL(commenttitle)"); $TABLES["comments"]->addWhere(" AND comments.recipe='$uid'"); $TABLES["comments"]->ifNoRowsString= "no hay ningun comentario aun"; $TABLES["comments"]->rowFormatHandler=formatRepeater; $TABLES["recipe"]->isTitleOfPage=true; $TABLES["ingredient"]->addWhere(" AND ingredient.recipe='$uid'"); $TABLES["ingredient"]->ifNoRowsString= "no hay ningun ingrediente"; //solo los primeros mil ingredientes $TABLES["ingredient"]->setPager(1000); $TABLES["ingredient"]->rowFormatHandler=ingredientFormatRepeater; $TABLES["person"]->loadRelationsArray("recipe",Array("person"=>$record["person"]),$varcharConf,"###uid###",", "); $TABLES["person"]->addUidWhere($record["person"]); //$content=new content("person/rapidDetail.template.html",Array("PERSON_NAVIGATION"=>$TABLES["person"])); $content=new content("recipe/rapidDetail.template.html",Array( "PERSON_NAVIGATION"=>$TABLES["person"], "SINGLE"=>$TABLES["recipe"], "RELATED"=>$related, "INGREDIENTS"=>$TABLES["ingredient"], "SMS"=>$sms, "HIDDEN"=>"" )); if(isset($page->tag["content"])) $page->tag["content"]->setContent($content); $page->build(); $content=new content("recipe/comments.template.html",Array( "COMMENTS"=>$TABLES["comments"], "URI"=>REDIRECT_URL, "UID"=>$uid, "PERSON"=>$record['person'], "INSERTCOMMENT"=>$persona->isValidated() ? Array("","") :NULL , "NOTLOGGED"=>$persona->isValidated() ? NULL: Array("",""), "###CONNECT###"=>Array("","") ) ); if(isset($page->tag["area"])) $page->tag["area"]->setContent($content); //$content->titleOfPage("title"); //if(isset($page->tag["content"])) // $page->tag["content"]->setContent($content); echo $page->render(); //var_dump($TABLES["ingredient"]->sqlQuery); ?>