Exemplo n.º 1
0
function print_header($ctrl)
{
    check_version();
    //Check to make sure the browser is supported
    /* * * MOBILE FORMATTING AND FAVICON * * */
    $additional = "";
    //Additional things we'll be adding to the header
    //If the device is mobile...
    if (is_mobile()) {
        //...use a mobile stylesheet
        $additional .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"/scripts/css/mob/mobile.css\">";
    }
    //Changes favicon URL based on browser
    if (strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "safari")) {
        $additional .= "<link rel=\"SHORTCUT ICON\" href=\"/favicon.ico?v=2\" />";
    } else {
        $additional .= "<link rel=\"SHORTCUT ICON\" href=\"/favicon.ico\" />";
    }
    /* * * MAIN BANNER CONTENTS * * */
    $banner_contents = "";
    //If we aren't on the homepage..
    if (getcwd() !== $_SERVER["DOC_ROOT"]) {
        //Create a 'return home' or 'return to feed' button
        $text = "Return Home";
        //If we're logged in...
        if (isset($_SESSION["userid"])) {
            //...it'll be 'return to feed'
            $text = "Return to Feed";
        }
        //Add this to our banner
        $banner_contents .= "<div onclick=\"window.location='/';\" class=\"backbtn\">{$text}</div>";
    } else {
        //Make it the logo
        $banner_contents .= "<div id=\"logo\"><a href=\"/\"><img src=\"/img/logo.png\"></a></div>";
        //If we aren't logged in...
        if (!isset($_SESSION["userid"])) {
            //Display that text that shows how many members we have
            //Connect to MySQL
            $con = mysqli_connect(host(), username(), password(), mainDb());
            //Get the user count (not possible through API)
            $query = mysqli_query($con, "SELECT COUNT(*) AS count FROM `usr`");
            //Get the number of users
            $user_count = mysqli_fetch_array($query);
            $user_count = $user_count[0];
            $all_items = new Item(array("action" => "get"));
            $items_array = $all_items->run(true);
            $item_count = count($items_array);
            //...add it to the banner
            $banner_contents .= "<div id=\"subtxt\">Now with {$user_count} members worldwide.</div>";
            //Close the connection
            mysqli_close($con);
        }
    }
    $add_box = "";
    //If we are going to show the login/profile panel...
    if ($ctrl) {
        //If the user is logged in
        if (isset($_SESSION["userid"])) {
            //Print their control panel and search box
            $banner_contents .= get_search_box();
            $banner_contents .= get_profile_box($_SESSION["userid"]);
            //$add_box 		 .= get_add_box();
        } else {
            //Print the login box
            $banner_contents .= get_login_box();
        }
    }
    $user_menu = get_user_menu();
    /* * * MAIN HEADER * * */
    $header = <<<HEAD
\t\t\t\t\t<meta http-equiv="X-UA-Compatible" content="IE=edge" />
\t\t\t\t\t<meta name="viewport" content="width=device-width, initial-scale=1.0" />
\t\t\t\t\t<meta name="description" content="eDart is a first-of-its-kind, completely web-based, universal trading application for WPI students." /> 
\t\t\t\t\t<meta name="keywords" content="edart,beta,bartering,tradegrouper,trade,trading,tradby,college,worcester,polytechnic,institute,wpi,2013,free,online,database" /> 
\t\t\t\t\t<meta name="robots" content="index, follow" /> 
\t\t\t\t\t<meta name="Headline" content="Welcome to eDart!">
\t\t\t\t\t<meta name="CPS_SITE_NAME" content="Welcome to eDart!">
\t\t\t\t\t<meta property="og:title" content="eDart is a first-of-its-kind, completely web-based, universal trading application for WPI students."> 
\t\t\t\t\t<meta property="og:type" content="website"> 
\t\t\t\t\t<meta property="og:description" content="eDart is a first-of-its-kind, completely web-based, universal trading application for WPI students.">
\t\t\t\t\t<meta property="og:site_name" content="eDart">
\t\t\t\t\t<meta charset="UTF-8">

\t\t\t\t\t<noscript>
\t\t\t\t\t\t<meta http-equiv="refresh" content="0;URL=/noscript.php">
\t\t\t\t\t</noscript>

\t\t\t\t\t<link rel="stylesheet" type="text/css" media="screen" href="/files/fonts/Vegur/stylesheet.css">
\t\t\t\t\t<link rel="stylesheet" type="text/css" media="screen" href="/files/fonts/Titillium/stylesheet.css">
\t\t\t\t\t<link rel="stylesheet" type="text/css" media="screen" href="/lib/min/?g=css">

\t\t\t\t\t<script>
\t\t\t\t\t\tdocument.cookie='';

\t\t\t\t\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
\t\t\t\t\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
\t\t\t\t\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
\t\t\t\t\t\t})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

\t\t\t\t\t\tga('create', 'UA-44057002-1', 'wewanttotrade.com');
\t\t\t\t\t\tga('send', 'pageview');
\t\t\t\t\t</script>

\t\t\t\t\t{$additional}
\t\t\t\t\t{$add_box}
\t\t\t\t\t{$user_menu}

\t\t\t\t\t<div id="bpho" style="height:60px;width:100%;">
\t\t\t\t\t\t<div id="banner">
\t\t\t\t\t\t\t{$banner_contents}
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
HEAD;
    echo $header;
    //Print the header
}
Exemplo n.º 2
0
            echo get_category_link($category_sub[$e]->term_id);
            echo '">';
            echo $category_sub[$e]->name . '</a>';
            echo '</li>';
        }
        echo '</ul>';
    }
    echo '</li>';
}
?>
            </ul>
    </li>
 </ul>                                      
                                      
                                      <?php 
get_search_box(false, $s);
?>
                                    <ul class="nav navbar-nav navbar-right">	
                                          <?php 
if (!false) {
    ?>
                                                          <li><a href="<?php 
    echo get_variable("login");
    ?>
">Ingresar</a></li>
                                                          <li class="dropdown"> <a href="<?php 
    echo get_variable("register");
    ?>
">Registrarme</a></li>			
                                          <?php 
} else {
Exemplo n.º 3
0
<?php 
    while (have_posts()) {
        the_post();
        get_template_part('entry');
    }
    get_template_part('nav', 'below');
} else {
    ?>
<article id="post-0" class="post no-results not-found">
<header class="header">
<h2 class="entry-title"><?php 
    _e('Ningún resultado', 'blankslate');
    ?>
</h2>
</header>
<section class="entry-content">
<p><?php 
    _e('Lo sentimos, no se encontró nada con esta busqueda. Por favor intente de nuevo.', 'blankslate');
    ?>
</p>
<?php 
    get_search_box(true, $s);
    ?>
</section>
</article>
<?php 
}
?>
</section>
<?php 
get_footer();