Browse Source

Fixed get_page()

pull/24/head
Teknikode 8 years ago
parent
commit
ad5531582b
  1. 16
      includes/common.php
  2. 2
      templates/default/header.php

16
includes/common.php

@ -57,13 +57,11 @@ function get_subdomain() @@ -57,13 +57,11 @@ function get_subdomain()
function get_page()
{
$full_page = $_SERVER['REQUEST_URI'];
$parts = explode("/", $full_page);
if (count($parts) > 1)
{
return $parts[1];
}
return "";
$url_array = explode("/",$_SERVER["REQUEST_URI"]);
$firstPage = strtolower($url_array[1]);
return $firstPage;
}
function get_http($CONF)
@ -81,6 +79,10 @@ function get_http($CONF) @@ -81,6 +79,10 @@ function get_http($CONF)
function get_active($page)
{
if ($page == $CONF['default_page'])
{
$page = 'www';
}
$cur_page = '';
switch ($CONF['url_type'])
{

2
templates/default/header.php

@ -228,7 +228,7 @@ @@ -228,7 +228,7 @@
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="<?php echo get_active("home"); echo get_active(""); ?>"><a href="<?php echo get_page_url("home", $CONF); ?>">Home</a></li>
<li class="<?php echo get_active("home"); ?>"><a href="<?php echo get_page_url("home", $CONF); ?>">Home</a></li>
<li class="<?php echo get_active("about"); ?>"><a href="<?php echo get_page_url("about", $CONF); ?>">About</a></li>
<li class="<?php echo get_active("blog"); ?>"><a href="<?php echo get_page_url("blog", $CONF); ?>">Blog</a></li>
<li class="<?php echo get_active("podcast"); echo get_active("pod"); ?>"><a href="<?php echo get_page_url("podcast", $CONF); ?>">Podcast</a></li>

Loading…
Cancel
Save