function do_header($title, $id = 'home') { global $current_user, $dblang, $globals; check_auth_page(); header('Content-type: text/html; charset=utf-8'); header('X-Frame-Options: SAMEORIGIN'); http_cache(); $globals['security_key'] = get_security_key(); setcookie('k', $globals['security_key'], 0, $globals['base_url']); $vars = compact('title', 'id'); return Haanga::Load("mobile/header.html", $vars); }
function do_header($title, $id = 'home', $options = false) { global $current_user, $dblang, $globals, $db; check_auth_page(); header('Content-Type: text/html; charset=utf-8'); header('X-Frame-Options: SAMEORIGIN'); header('X-UA-Compatible: IE=edge,chrome=1'); http_cache(); $globals['security_key'] = get_security_key(); setcookie('k', $globals['security_key'], 0, $globals['base_url']); if (!empty($_REQUEST['q'])) { $globals['q'] = $_REQUEST['q']; } $sites = $db->get_results("select * from subs where visible order by id asc"); $this_site = SitesMgr::get_info(); if ($this_site->nsfw) { $globals['ads'] = false; } /* echo "<pre>"; print_r($this_site); exit; */ if (!is_array($options)) { $left_options = array(); //$left_options[] = new MenuOption(_('portada'), $globals['base_url'], $id, _('página principal')); // $left_options[] = new MenuOption(_('Nuevas'), $globals['base_url'].'queue', $id, _('menear noticias pendientes'), array(), 'nuevas'); $left_options[] = new MenuOption(_('Populares'), $globals['base_url'] . 'popular', $id, _('historias más votadas'), array(), 'populares'); $left_options[] = new MenuOption(_('Más visitadas'), $globals['base_url'] . 'top_visited', $id, _('historias más visitadas/leídas'), array(), 'más visitadas'); //$left_options[] = new MenuOption(_('destacadas'), $globals['base_url'].'top_active', $id, _('historias más activas')); if ($this_site->enabled) { $left_options[] = new MenuOption(_('Enviar noticia'), $globals['base_url'] . 'submit', $id, _('enviar nueva historia'), array('class' => 'link-send-story'), 'enviar historia'); } $right_options = array(); $right_options[] = new MenuOption(_('m/'), $globals['base_url_general'] . 'subs', $id, _('sub menéames'), array(), 'm/'); $right_options[] = new MenuOption(_('Actividad'), $globals['base_url'] . 'sneak', $id, _('visualizador en tiempo real'), array(), 'fisgona'); $right_options[] = new MenuOption(_('Notas y mensajes privados'), post_get_base_url(), $id, _('leer o escribir notas y mensajes privados'), array(), 'nótame'); $right_options[] = new MenuOption(_('Galería'), 'javascript:fancybox_gallery(\'all\');', false, _('las imágenes subidas por los usuarios')); } else { $left_options = $options; $right_options = array(); //$right_options[] = new MenuOption(_('portada'), $globals['base_url'], '', _('página principal')); // $right_options[] = new MenuOption(_('Nuevas'), $globals['base_url'].'queue', '', _('menear noticias pendientes')); $right_options[] = new MenuOption(_('m/'), $globals['base_url_general'] . 'subs', $id, _('sub menéames'), array(), 'm/'); $right_options[] = new MenuOption(_('Actividad'), $globals['base_url'] . 'sneak', $id, _('visualizador en tiempo real'), array(), 'fisgona'); $right_options[] = new MenuOption(_('Notas y mensajes privados'), post_get_base_url(), $id, _('leer o escribir notas y mensajes privados'), array(), 'nótame'); $right_options[] = new MenuOption(_('Galería'), 'javascript:fancybox_gallery(\'all\');', false, _('las imágenes subidas por los usuarios')); } $vars = compact('title', 'greeting', 'id', 'left_options', 'right_options', 'sites', 'this_site', 'themes'); return Haanga::Load('header.html', $vars); }
function do_header($title, $id = 'home') { global $current_user, $dblang, $globals; check_auth_page(); header('Content-type: text/html; charset=utf-8'); http_cache(); //echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n"; echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">' . "\n"; echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $dblang . '">' . "\n"; echo '<head>' . "\n"; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n"; echo '<meta name="ROBOTS" content="NOARCHIVE" />' . "\n"; echo '<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"/>' . "\n"; echo "<title>{$title}</title>\n"; do_css_includes(); echo '<meta name="generator" content="meneame mobile" />' . "\n"; if (!empty($globals['noindex'])) { echo '<meta name="robots" content="noindex,follow"/>' . "\n"; } if (!empty($globals['tags'])) { echo '<meta name="keywords" content="' . $globals['tags'] . '" />' . "\n"; } if (empty($globals['favicon'])) { $globals['favicon'] = 'img/favicons/favicon4.ico'; } echo '<link rel="icon" href="' . $globals['base_static'] . $globals['favicon'] . '" type="image/x-icon"/>' . "\n"; echo '<link rel="apple-touch-icon" href="' . $globals['base_static'] . 'img/favicons/apple-touch-icon.png"/>' . "\n"; echo '<link rel="alternate" type="application/rss+xml" title="' . _('publicadas') . '" href="http://' . get_server_name() . $globals['base_url'] . 'rss2.php" />' . "\n"; if ($globals['extra_head']) { echo $globals['extra_head']; } echo '</head>' . "\n"; echo "<body id=\"{$id}\" " . $globals['body_args'] . ">\n"; echo '<div id="header">' . "\n"; echo '<a href="' . $globals['base_url'] . '" title="' . _('inicio') . '" id="logo">' . _("menéame") . '</a>' . "\n"; echo '<ul id="headtools">'; echo '<li><a href="' . $globals['base_url'] . 'search.php">' . _('buscar') . '</a></li>'; if ($current_user->authenticated) { echo '<li><a href="' . $globals['base_url'] . 'login.php?op=logout&return=' . urlencode($_SERVER['REQUEST_URI']) . '">' . _('logout') . '</a></li>'; echo '<li class="noborder"><a href="' . get_user_uri($current_user->user_login) . '" title="' . $current_user->user_login . '"><img src="' . get_avatar_url($current_user->user_id, $current_user->user_avatar, 20) . '" width="20" height="20" alt="' . $current_user->user_login . '"/></a></li>'; } else { echo '<li class="noborder"><a href="' . $globals['base_url'] . 'login.php?return=' . urlencode($_SERVER['REQUEST_URI']) . '">' . _('login') . '</a></li>'; } echo '</ul>' . "\n"; echo '</div>' . "\n"; do_banner_top_mobile(); echo '<div id="container">' . "\n"; }
function do_header($title, $id = 'home', $options = false) { global $current_user, $dblang, $globals, $db; check_auth_page(); header('Content-Type: text/html; charset=utf-8'); header('X-Frame-Options: SAMEORIGIN'); header('X-UA-Compatible: IE=edge,chrome=1'); http_cache(); if (!empty($globals['link_id'])) { // Pingback autodiscovery // http://www.hixie.ch/specs/pingback/pingback header('X-Pingback: http://' . get_server_name() . $globals['base_url'] . 'xmlrpc.php'); } $globals['security_key'] = get_security_key(); setcookie('k', $globals['security_key'], 0, $globals['base_url']); if (!empty($_REQUEST['q'])) { $globals['q'] = $_REQUEST['q']; } /* if ($globals['greetings']) $greeting = array_rand($globals['greetings'], 1); else $greeting = _('hola'); */ if (!is_array($options)) { $left_options = array(); $left_options[] = new MenuOption(_('enviar historia'), $globals['base_url'] . 'submit.php', $id, _('enviar nueva historia')); $left_options[] = new MenuOption(_('portada'), $globals['base_url'], $id, _('página principal')); $left_options[] = new MenuOption(_('pendientes'), $globals['base_url'] . 'shakeit.php', $id, _('menear noticias pendientes')); $left_options[] = new MenuOption(_('populares'), $globals['base_url'] . 'topstories.php', $id, _('historias más votadas')); $left_options[] = new MenuOption(_('más visitadas'), $globals['base_url'] . 'topclicked.php', $id, _('historias más visitadas/leídas')); $left_options[] = new MenuOption(_('destacadas'), $globals['base_url'] . 'topactive.php', $id, _('historias más activas')); $right_options = array(); $right_options[] = new MenuOption(_('fisgona'), $globals['base_url'] . 'sneak.php', $id, _('visualizador en tiempo real')); $right_options[] = new MenuOption(_('nótame'), post_get_base_url(), $id, _('leer o escribir notas y mensajes privados')); $right_options[] = new MenuOption(_('galería'), 'javascript:fancybox_gallery(\'all\');', false, _('las imágenes subidas por los usuarios')); } else { $left_options = $options; $right_options = array(); //$right_options[] = new MenuOption(_('portada'), $globals['base_url'], '', _('página principal')); $right_options[] = new MenuOption(_('pendientes'), $globals['base_url'] . 'shakeit.php', '', _('menear noticias pendientes')); $right_options[] = new MenuOption(_('fisgona'), $globals['base_url'] . 'sneak.php', $id, _('visualizador en tiempo real')); $right_options[] = new MenuOption(_('nótame'), post_get_base_url(), $id, _('leer o escribir notas y mensajes privados')); $right_options[] = new MenuOption(_('galería'), 'javascript:fancybox_gallery(\'all\');', false, _('las imágenes subidas por los usuarios')); } $sites = $db->get_results("select * from subs where visible order by id asc"); $this_site = SitesMgr::get_info(); $vars = compact('title', 'greeting', 'id', 'left_options', 'right_options', 'sites', 'this_site'); return Haanga::Load('header.html', $vars); }
function do_header($title, $id = 'home') { global $current_user, $dblang, $globals, $greetings; check_auth_page(); header('Content-Type: text/html; charset=utf-8'); http_cache(); if (!empty($globals['link_id'])) { // Pingback autodiscovery // http://www.hixie.ch/specs/pingback/pingback header('X-Pingback: http://' . get_server_name() . $globals['base_url'] . 'xmlrpc.php'); } echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n"; //echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n"; echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $dblang . '" lang="' . $dblang . '">' . "\n"; echo '<head>' . "\n"; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n"; echo '<meta name="ROBOTS" content="NOARCHIVE" />' . "\n"; echo "<title>{$title}</title>\n"; do_css_includes(); echo '<meta name="generator" content="meneame" />' . "\n"; if ($globals['noindex']) { echo '<meta name="robots" content="noindex,follow"/>' . "\n"; } if ($globals['tags']) { echo '<meta name="keywords" content="' . $globals['tags'] . '" />' . "\n"; } if ($globals['description']) { echo '<meta name="description" content="' . $globals['description'] . '" />' . "\n"; } if ($globals['link']) { echo '<link rel="pingback" href="http://' . get_server_name() . $globals['base_url'] . 'xmlrpc.php"/>' . "\n"; } echo '<link rel="microsummary" type="application/x.microsummary+xml" href="' . $globals['base_url'] . 'microsummary.xml" />' . "\n"; echo '<link rel="search" type="application/opensearchdescription+xml" title="' . _("menéame search") . '" href="http://' . get_server_name() . $globals['base_url'] . 'opensearch_plugin.php"/>' . "\n"; echo '<link rel="alternate" type="application/rss+xml" title="' . _('publicadas') . '" href="http://' . get_server_name() . $globals['base_url'] . 'rss2.php" />' . "\n"; echo '<link rel="alternate" type="application/rss+xml" title="' . _('pendientes') . '" href="http://' . get_server_name() . $globals['base_url'] . 'rss2.php?status=queued" />' . "\n"; echo '<link rel="alternate" type="application/rss+xml" title="' . _('comentarios') . '" href="http://' . get_server_name() . $globals['base_url'] . 'comments_rss2.php" />' . "\n"; if (!$globals['favicon']) { $globals['favicon'] = 'img/favicons/favicon4.ico'; } echo '<link rel="shortcut icon" href="' . $globals['base_static'] . $globals['favicon'] . '" type="image/x-icon"/>' . "\n"; do_js_includes(); if ($globals['thumbnail']) { // WARN: It's assumed a thumbanil comes with base_url included $thumb = $globals['thumbnail']; } else { $thumb = 'http://' . get_static_server_name() . $globals['base_url'] . $globals['thumbnail_logo']; } echo '<meta name="thumbnail_url" content="' . $thumb . "\"/>\n"; echo '<link rel="image_src" href="' . $thumb . "\"/>\n"; if ($globals['extra_head']) { echo $globals['extra_head']; } echo '</head>' . "\n"; echo "<body id=\"{$id}\" " . $globals['body_args'] . ">\n"; echo '<div id="wrap">' . "\n"; echo '<div id="header">' . "\n"; echo '<a href="' . $globals['base_url'] . '" title="' . _('inicio') . '" id="logo">' . _("menéame") . '</a>' . "\n"; echo '<ul id="headtools">' . "\n"; // Main search form echo '<li class="searchbox">' . "\n"; echo '<form action="' . $globals['base_url'] . 'search.php" method="get" name="top_search">' . "\n"; echo '<img src="' . $globals['base_static'] . 'img/common/search-left-04.png" width="6" height="22" alt=""/>'; if (!empty($_REQUEST['q'])) { echo '<input type="text" name="q" value="' . htmlspecialchars($_REQUEST['q']) . '" />'; } else { echo '<input name="q" value="' . _('buscar') . '..." type="text" onblur="if(this.value==\'\') this.value=\'' . _('buscar') . '...\';" onfocus="if(this.value==\'' . _('buscar') . '...\') this.value=\'\';"/>'; } echo '<a href="javascript:document.top_search.submit()"><img class="searchIcon" alt="' . _('buscar') . '" src="' . $globals['base_static'] . 'img/common/search-04.png" id="submit_image" width="28" height="22"/></a>' . "\n"; if ($globals['search_options']) { foreach ($globals['search_options'] as $name => $value) { echo '<input type="hidden" name="' . $name . '" value="' . $value . '"/>' . "\n"; } } echo '</form>'; echo '</li>' . "\n"; // form echo '<li><a href="http://meneame.wikispaces.com/Comenzando">' . _('ayuda') . ' <img src="' . $globals['base_static'] . 'img/common/help-bt-02.png" alt="help button" title="' . _('ayuda') . '" width="13" height="16" /></a></li>'; if ($current_user->admin) { echo '<li><a href="' . $globals['base_url'] . 'admin/bans.php">admin <img src="' . $globals['base_static'] . 'img/common/tools-bt-02.png" alt="tools button" title="herramientas" width="16" height="16" /> </a></li>' . "\n"; } if ($current_user->authenticated) { $randhello = array_rand($greetings, 1); echo '<li><a href="' . get_user_uri($current_user->user_login) . '" title="' . _('menéame te saluda en ') . $greetings[$randhello] . '">' . $randhello . ' ' . $current_user->user_login . ' <img src="' . get_avatar_url($current_user->user_id, $current_user->user_avatar, 20) . '" width="20" height="20" alt="' . $current_user->user_login . '"/></a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'login.php?op=logout&return=' . urlencode($_SERVER['REQUEST_URI']) . '">' . _('cerrar sesión') . ' <img src="' . $globals['base_static'] . 'img/common/logout-bt-02.png" alt="" title="logout" width="22" height="16" /></a></li>' . "\n"; } else { echo '<li><a href="' . $globals['base_url'] . 'register.php">' . _('registrarse') . ' <img src="' . $globals['base_static'] . 'img/common/register-bt-02.png" alt="" title="register" width="16" height="18" /></a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'login.php?return=' . urlencode($_SERVER['REQUEST_URI']) . '">' . _('login') . ' <img src="' . $globals['base_static'] . 'img/common/login-bt-02.png" alt="" title="login" width="22" height="16" /></a></li>' . "\n"; } //echo '<li><a href="'.$globals['base_url'].'faq-'.$dblang.'.php">' . _('acerca de menéame').'</a></li>' . "\n"; echo '</ul>' . "\n"; echo '</div>' . "\n"; echo '<div id="naviwrap">' . "\n"; echo '<ul>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'submit.php">' . _('enviar noticia') . '</a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'shakeit.php">' . _('pendientes') . '</a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'sneak.php">' . _('fisgona') . '</a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'notame/">' . _('nótame') . '</a></li>' . "\n"; echo '</ul></div>' . "\n"; do_banner_top(); echo '<div id="container">' . "\n"; }
<?php // The source code packaged with this file is Free Software, Copyright (C) 2005 by // Ricardo Galli <gallir at uib dot es>. // It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise. // You can get copies of the licenses here: // http://www.affero.org/oagpl.html // AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING". include 'config.php'; include mnminclude . 'html1.php'; include mnminclude . 'avatars.php'; $globals['ads'] = false; $globals['secure_page'] = True; check_auth_page(); // We need it because we modify headers ob_start(); $user_levels = array('autodisabled', 'disabled', 'normal', 'special', 'blogger', 'admin', 'god'); $bio_max = 300; // Max bio length // User recovering her password if (!empty($_GET['login']) && !empty($_GET['t']) && !empty($_GET['k'])) { $time = intval($_GET['t']); $key = $_GET['k']; $user = new User(); $user->username = clean_input_string($_GET['login']); if ($user->read()) { $now = time(); $key2 = md5($user->id . $user->pass . $time . $site_key . get_server_name()); //echo "$now, $time; $key == $key2\n"; if ($time > $now - 900 && $time < $now && $key == $key2) { $db->query("update users set user_validated_date = now() where user_id = {$user->id} and user_validated_date is null");
function do_header($title, $id = 'home') { global $current_user, $dblang, $globals, $greetings, $db; // escolhe norma $stdRow = false; // if change by request if ($_REQUEST['standard']) { $stdRow = $globals['standards'][$_REQUEST['standard']]; if ($current_user->authenticated) { // authenticated users store that in their profile $user = new User($current_user->user_id); $user->standard = (int) $_REQUEST['standard']; $user->store(); } else { // if not authenticated, store on cookie setcookie("chuza_current_standard", (int) $_REQUEST['standard'], time() + 3600 * 24 * 365 * 3); // 3 anos de cookie } } elseif ($current_user->authenticated) { // user authenticated but NOT request change $stdRow = $globals['standards'][(int) $current_user->standard]; } else { // set default standard for non authenticated users // search in redis $check_ip = $globals['user_ip_int']; $redis = new Predis_Client(); $r = $redis->zrevrangebyscore($globals['enviroment'] . 'ips', $check_ip, '0', 'WITHSCORES', 'LIMIT', '0', '1'); preg_match('/(^[^-]*)/', $r[0], $matches); if (in_array($matches[0], $globals['lusophonia'])) { $stdRow = 1; } else { if (!$_COOKIE['chuza_current_standard']) { $_COOKIE['chuza_current_standard'] = 1; } $stdRow = $globals['standards'][$_COOKIE['chuza_current_standard']]; } } if ($stdRow) { putenv('LANGUAGE=' . $stdRow['short_name']); setlocale(LC_MESSAGES, $stdRow['short_name']); $current_user->standard = $stdRow['id']; } else { // default standard putenv('LANGUAGE=gl_ES.utf8'); setlocale(LC_MESSAGES, 'gl_ES.utf8'); $current_user->standard = 1; } bindtextdomain('meneame', mnminclude . '/languages'); textdomain('meneame'); // fim de escolher norma check_auth_page(); header('Content-Type: text/html; charset=utf-8'); http_cache(); if (!empty($globals['link_id'])) { // Pingback autodiscovery // http://www.hixie.ch/specs/pingback/pingback header('X-Pingback: http://' . get_server_name() . $globals['base_url'] . 'xmlrpc.php'); } echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n"; //echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n"; echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $dblang . '" lang="' . $dblang . '">' . "\n"; echo '<head>' . "\n"; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n"; echo '<meta name="ROBOTS" content="NOARCHIVE" />' . "\n"; echo "<title>{$title}</title>\n"; do_css_includes(); echo '<meta name="generator" content="meneame" />' . "\n"; if ($globals['noindex']) { echo '<meta name="robots" content="noindex,follow"/>' . "\n"; } if ($globals['tags']) { echo '<meta name="keywords" content="' . $globals['tags'] . '" />' . "\n"; } if ($globals['description']) { echo '<meta name="description" content="' . $globals['description'] . '" />' . "\n"; } if ($globals['link']) { echo '<link rel="pingback" href="http://' . get_server_name() . $globals['base_url'] . 'xmlrpc.php"/>' . "\n"; } echo '<link rel="microsummary" type="application/x.microsummary+xml" href="' . $globals['base_url'] . 'microsummary.xml" />' . "\n"; echo '<link rel="search" type="application/opensearchdescription+xml" title="' . _("menéame search") . '" href="http://' . get_server_name() . $globals['base_url'] . 'opensearch_plugin.php"/>' . "\n"; echo '<link rel="alternate" type="application/rss+xml" title="' . _('publicadas') . '" href="http://' . get_server_name() . $globals['base_url'] . 'rss2.php" />' . "\n"; echo '<link rel="alternate" type="application/rss+xml" title="' . _('pendientes') . '" href="http://' . get_server_name() . $globals['base_url'] . 'rss2.php?status=queued" />' . "\n"; echo '<link rel="alternate" type="application/rss+xml" title="' . _('comentarios') . '" href="http://' . get_server_name() . $globals['base_url'] . 'comments_rss2.php" />' . "\n"; if (!$globals['favicon']) { $globals['favicon'] = 'favicon.ico'; } echo '<link rel="shortcut icon" href="' . $globals['base_static'] . $globals['favicon'] . '" type="image/x-icon"/>' . "\n"; do_js_includes(); if ($globals['thumbnail']) { // WARN: It's assumed a thumbanil comes with base_url included $thumb = $globals['thumbnail']; } else { $thumb = 'http://' . get_static_server_name() . $globals['base_url'] . $globals['thumbnail_logo']; } echo '<meta name="thumbnail_url" content="' . $thumb . "\"/>\n"; echo '<link rel="image_src" href="' . $thumb . "\"/>\n"; if ($globals['extra_head']) { echo $globals['extra_head']; } echo '</head>' . "\n"; echo "<body id=\"{$id}\" " . $globals['body_args'] . ">\n"; if ($globals["news"]) { echo '<div style="background-color:red;padding:8px;font-color:white;font-weigth:bold;" >' . $globals["news"] . '</div>'; } echo '<div id="wrap">' . "\n"; echo '<div id="header">' . "\n"; echo '<a href="' . $globals['base_url'] . '" title="' . _('inicio') . '" id="logo">' . _("menéame") . '</a>' . "\n"; echo '<ul id="headtools">' . "\n"; // Main search form echo '<li class="searchbox">' . "\n"; echo '<form action="' . $globals['base_url'] . 'search.php" method="get" name="top_search">' . "\n"; echo '<img src="' . $globals['base_static'] . 'img/common/search-left-04.png" width="6" height="22" alt=""/>'; if (!empty($_REQUEST['q'])) { echo '<input type="text" name="q" value="' . htmlspecialchars($_REQUEST['q']) . '" />'; } else { echo '<input name="q" value="' . _('buscar') . '..." type="text" onblur="if(this.value==\'\') this.value=\'' . _('buscar') . '...\';" onfocus="if(this.value==\'' . _('buscar') . '...\') this.value=\'\';"/>'; } echo '<a href="javascript:document.top_search.submit()"><img class="searchIcon" alt="' . _('buscar') . '" src="' . $globals['base_static'] . 'img/common/search-04.png" id="submit_image" width="28" height="22"/></a>' . "\n"; if ($globals['search_options']) { foreach ($globals['search_options'] as $name => $value) { echo '<input type="hidden" name="' . $name . '" value="' . $value . '"/>' . "\n"; } } echo '</form>'; echo '</li>' . "\n"; // form echo '<li><a href="' . $globals["base_url"] . 'equipa/index.php?page=axuda">' . _('ayuda') . ' <img src="' . $globals['base_static'] . 'img/common/help-bt-02.png" alt="help button" title="' . _('ayuda') . '" width="13" height="16" /></a></li>'; echo '<li><a href="' . $globals["base_url"] . 'equipa/index.php?page=o-novo-chuza">O novo chuza</a></li>'; if ($globals["show_blog"]) { echo '<li><a href="' . $globals["base_url"] . 'blog">blog</a></li>'; } if ($globals["show_wiki"]) { echo '<li><a href="' . $globals["base_url"] . 'wiki">wiki</a></li>'; } if ($current_user->admin) { echo '<li><a href="' . $globals['base_url'] . 'admin/bans.php">admin <img src="' . $globals['base_static'] . 'img/common/tools-bt-02.png" alt="tools button" title="herramientas" width="16" height="16" /> </a></li>' . "\n"; } // choose standard change link $next_standard = $current_user->standard % count($globals['standards']) + 1; $this_page = basename($_SERVER['REQUEST_URL']); if (strpos($this_page, "?") !== false) { $this_page = reset(explode("?", $this_page)); } //echo '<li><a href="'.$this_page.'?standard='.$next_standard.'" >'.$globals['standards'][$current_user->standard]['name'].'</a></li>'."\n"; echo '<li><a href="' . $this_page . '?standard=' . $next_standard . '" >' . $globals['standards'][$next_standard]['name'] . '</a></li>' . "\n"; if ($current_user->authenticated) { //$randhello = array_rand($greetings, 1); // deprecated in Chuza echo '<li><a href="' . get_user_uri($current_user->user_login) . '" title="' . _('Ver perfil de usuario') . '">' . ' ' . $current_user->user_login . ' <img src="' . get_avatar_url($current_user->user_id, $current_user->user_avatar, 20) . '" width="20" height="20" alt="' . $current_user->user_login . '"/></a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'login.php?op=logout&return=' . urlencode($_SERVER['REQUEST_URI']) . '">' . _('cerrar sesión') . ' <img src="' . $globals['base_static'] . 'img/common/logout-bt-02.png" alt="" title="logout" width="22" height="16" /></a></li>' . "\n"; } else { echo '<li><a href="' . $globals['base_url'] . 'register.php">' . _('registrarse') . ' <img src="' . $globals['base_static'] . 'img/common/register-bt-02.png" alt="" title="register" width="16" height="18" /></a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'login.php?return=' . urlencode($_SERVER['REQUEST_URI']) . '">' . _('login') . ' <img src="' . $globals['base_static'] . 'img/common/login-bt-02.png" alt="" title="login" width="22" height="16" /></a></li>' . "\n"; } //echo '<li><a href="'.$globals['base_url'].'faq-'.$dblang.'.php">' . _('acerca de menéame').'</a></li>' . "\n"; $s = $_SERVER['SCRIPT_NAME']; $matches = array(); preg_match('/\\/([^\\/]*)$/', $s, $matches); switch ($matches[1]) { case "topstories.php": $classTopstories = "enfatized"; break; case "index.php": $classCover = "enfatized"; break; case "shakeit.php": $classPendent = "enfatized"; break; case "sneak.php": $classSneak = "enfatized"; break; } if (strpos($_SERVER['REQUEST_URI'], 'chios') !== FALSE) { $classChios = "enfatized"; $classCover = ""; // previously assigned wrongly } echo '</ul>' . "\n"; echo '</div>' . "\n"; echo '<div id="newnavbar" >' . "\n"; echo '<ul class="first">' . "\n"; //echo '<li style=""><a href="'.$globals['base_url'].'shakeit.php">'._('pendientes').'</a></li>'."\n"; echo '<li class="' . $classCover . '"><a href="' . $globals['base_url'] . '">' . _('portada') . '</a></li>' . "\n"; echo '<li class="' . $classPendent . '"><a href="' . $globals['base_url'] . 'shakeit.php">' . _('pendientes') . '</a></li>' . "\n"; echo '<li class="' . $classTopstories . '"><a href="' . $globals['base_url'] . 'topstories.php">' . _('Populares') . '</a></li>' . "\n"; //Novas populares echo '<li class="' . $classSneak . '"><a href="' . $globals['base_url'] . 'sneak.php">' . _('fisgona') . '</a></li>' . "\n"; echo '<li class="' . $classChios . '" ><a href="' . $globals['base_url'] . 'chios/">' . _('nótame') . '</a></li>' . "\n"; echo '<li id="lastlititle" ><a href="' . $globals['base_url'] . 'equipa/?page=calendario">' . _('calendario') . '</a></li>' . "\n"; echo '</ul>'; echo '<ul class="last">' . "\n"; if ($current_user->user_login) { $u = get_user_uri($current_user->user_login, 'categories'); echo '<li><a href="' . $u . '">' . _('personalizar') . '</a></li>' . "\n"; echo '<li><a href="' . $globals['base_url'] . 'submit.php">' . _('enviar noticia') . '</a></li>' . "\n"; } //echo '<li style=""><a href="'.$globals['base_url'].'shakeit.php">'._('pendientes').'</a></li>'."\n"; //echo '<li><a href="'.$globals['base_url'].'sneak.php">'._('fisgona').'</a></li>'."\n"; //echo '<li><a href="'.$globals['base_url'].'chios/">'._('nótame').'</a></li>'."\n"; echo '</ul>'; echo ' </div>' . "\n"; //do_banner_top(); echo '<div id="container">' . "\n"; }