Skip to content

Commit 5058570

Browse files
committed
Small Change
1 parent 3af63af commit 5058570

5 files changed

Lines changed: 33 additions & 4 deletions

File tree

Screenshots/example-page.png

100644100755
File mode changed.

Screenshots/home-page-sample.png

100644100755
File mode changed.

inc/conf.const.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
$sHttp = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']=='on')) ? 'https://' : 'http://';
1313
$sPhp_self = dirname(htmlspecialchars($_SERVER['PHP_SELF']));
1414

15-
define('SELF',(substr($sPhp_self,-1) !== '/') ? $sPhp_self . '/' : $sPhp_self);
15+
#################### URL ####################
16+
17+
define('SELF', (substr($sPhp_self,-1) !== '/') ? $sPhp_self . '/' : $sPhp_self);
1618
define('RELATIVE', SELF);
1719
define('DEF_LANG', 'en');
1820
define('TPL', 'base');
@@ -21,5 +23,12 @@
2123
define('ROOT_PATH', dirname(__DIR__) . '/');
2224
define('DATA_PATH', ROOT_PATH . 'data/');
2325

26+
#################### PATH ####################
27+
2428
define('ROOT_URL', PROT_URL . $_SERVER['HTTP_HOST'] . SELF);
2529
define('STATIC_URL', RELATIVE . 'static/');
30+
31+
#################### INFORMATION ####################
32+
33+
define('SITE_NAME', 'pH');
34+
define('SITE_SLOGAN', 'Documentation');

inc/scripts/fns.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
defined('PH7') or exit('Restricted access');
1111

1212
/**
13-
* @desc Get Browser User Language.
13+
* @desc Gets Browser User Language.
1414
* @return string The first two lowercase letter of the browser language.
1515
*/
1616
function get_browser_lang() {
@@ -44,12 +44,32 @@ function parse_var($sContent) {
4444
$sContent = str_replace('{site_url}', RELATIVE, $sContent);
4545
$sContent = str_replace('{static_url}', STATIC_URL, $sContent);
4646
$sContent = str_replace('{tpl_name}', TPL, $sContent);
47+
$sContent = str_replace('{site_name}', SITE_NAME, $sContent);
48+
$sContent = str_replace('{page_name}', get_page_name(), $sContent);
4749
$sContent = str_replace('{menu_links}', get_links_html(), $sContent);
4850
$sContent = str_replace('{menu_langs}', get_langs_html(), $sContent);
4951

5052
return $sContent;
5153
}
5254

55+
/**
56+
* @desc Gets the page name.
57+
* @return string
58+
*/
59+
function get_page_name() {
60+
if(empty($_GET['p']))
61+
{
62+
$sName = SITE_SLOGAN;
63+
}
64+
else
65+
{
66+
$sPageName = str_replace(array('-','_'), '', $_GET['p']);
67+
$sName = ucfirst($sPageName);
68+
}
69+
70+
return $sName;
71+
}
72+
5373
/**
5474
* @see set_lang()
5575
* @return string The language available.

themes/base/tpl/header.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<title>Documentation</title>
5+
<title>{page_name} - {site_name}</title>
66
<link rel="stylesheet" href="{site_url}themes/{tpl_name}/css/common.css" />
77
<link rel="stylesheet" href="{site_url}themes/{tpl_name}/css/js/ajph.css" />
88
</head>
@@ -11,7 +11,7 @@
1111
<div class="center" id="block">
1212

1313
<header>
14-
<h1><a id="logo" href="{site_url}" data-load="ajax">pH</a></h1>
14+
<h1><a id="logo" href="{site_url}" data-load="ajax">{site_name}</a></h1>
1515
</header>
1616

1717
<div id="ajph">

0 commit comments

Comments
 (0)