Skip to content

Instantly share code, notes, and snippets.

@danilo04
Last active December 20, 2015 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danilo04/6189555 to your computer and use it in GitHub Desktop.
Save danilo04/6189555 to your computer and use it in GitHub Desktop.
<?php
$pageIndexToSection = array(
0 => 'inicio',
1 => 'registro',
2 => 'busqueda',
3 => 'perfil',
4 => 'perfil_publico',
5 => 'agregar_evento',
6 => 'agregar_empresa',
7 => 'buscar_certificado',
8 => 'carrito',
9 => 'recuper_password',
10 => 'perfil_empresa',
11 => 'agregar_email',
12 => 'eliminar_email',
13 => 'validar_certificado',
14 => 'ver_certificado',
15 => 'consolidar_certificado',
16 => 'validar_certificado',
17 => 'ver_consolidados',
18 => 'ver_certificado',
19 => 'registro',
20 => 'como_funciona',
21 => 'eliminar_evento',
90 => 'editar_evento',
404 => '404',
98 => 'terminas_sitemap'
);
/*$seccion = 'inicio';
if (isset($_GET['page']))
$seccion = htmlentities(addslashes($_GET['page']));
else
$seccion = 'inicio';*/
$page = htmlentities(addslashes($_REQUEST["load"]));
$seccion = 'inicio';
if (array_key_exists($page, $pageIndexToSection)) {
$seccion = $pageIndexToSection[$page];
}
$rs = DBQRY(QRY_PAGE_GETXNAME, $seccion);
if ($rs) {
if ($row = mysql_fetch_array($rs)) {
$v_meta_title = $row['meta_title'];
$v_meta_descripcion = $row['meta_descripcion'];
$v_meta_keywords = $row['meta_keywords'];
$v_meta_robots = $row['meta_robots'];
$v_head_script = $row['head_script'];
$v_head_script_include = $row['head_script_include'];
$v_page_content = $row['content'];
}
} else {
$seccion = 'inicio';
$rs = DBQRY(QRY_PAGE_GETXNAME, $seccion);
if ($rs) {
if ($row = mysql_fetch_array($rs)) {
$v_meta_title = $row['meta_title'];
$v_meta_descripcion = $row['meta_descripcion'];
$v_meta_keywords = $row['meta_keywords'];
$v_meta_robots = $row['meta_robots'];
$v_head_script = $row['head_script'];
$v_head_script_include = $row['head_script_include'];
$v_page_content = $row['content'];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment