forked from 20xd6/simple_blog
Merge pull request 'Cleanup header.php' (#22) from issue#10 into master
Reviewed-on: 20xd6/simple_blog#22
This commit is contained in:
commit
efe61157e8
@ -2,20 +2,11 @@
|
||||
<html lang="en-US">
|
||||
<?php
|
||||
//Sets the page title based on the name of the current directory
|
||||
function Title() {//Needs cleanup.
|
||||
//~ $new_title = $_SERVER['REQUEST_URI'];
|
||||
|
||||
//~ $new_title = preg_replace("/^^\//i", "", $new_title);
|
||||
//~ $new_title = preg_replace("/\//i", "", $new_title);
|
||||
//~ $page_title = $_SERVER['REQUEST_URI'];
|
||||
//~ $page_title = preg_replace("/^(.*)\//i", "", $page_title);
|
||||
function Title() {
|
||||
$page_title = basename($_SERVER['SCRIPT_FILENAME'], '.php');
|
||||
//~ echo($page_title);
|
||||
if(strtolower($page_title) == 'index'){
|
||||
parse_str($_SERVER['REQUEST_URI'], $page_uri);
|
||||
$page_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
//~ echo($page_path);
|
||||
//~ $folder_name = sizeof($page_path);
|
||||
$folder_name = explode("/", trim($page_path, "/"));
|
||||
$page_title = $folder_name[(sizeof($folder_name) - 1)];
|
||||
} elseif(strtolower($page_title) == 'homepage'){
|
||||
|
Loading…
x
Reference in New Issue
Block a user