-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
212 lines (196 loc) · 8.44 KB
/
header.php
File metadata and controls
212 lines (196 loc) · 8.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?php
/************************************************************************/
/* FlatNuke - Flat Text Based Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2003-2006 by Simone Vellei */
/* http://www.flatnuke.org/ */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
// deny direct access to this file
if (preg_match("/header.php/i",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
// dynamically build page's title and meta tags
$mod = _FN_MOD;
$action = getparam("action", PAR_GET, SAN_FLAT);
$news = getparam("news", PAR_GET, SAN_FLAT);
$title = $sitename;
if (get_mod()!="") {
$news_dir = get_fn_dir("sections")."/".get_mod()."/none_newsdata/";
} else $news_dir = get_fn_dir("sections")."/none_News/none_newsdata/";
if(trim($mod)!="" AND $action!="viewnews" AND $action!="addcommentinterface") {
// include specifics keywords for this section
if (file_exists(get_fn_dir('sections')."/$mod/none_newmetatags.php")) {
include_once (get_fn_dir('sections')."/$mod/none_newmetatags.php");
}
// build title for a section
$page_title = str_replace("/", " - ", _FN_MOD);
$page_title = str_replace("none_", "", $page_title);
$page_title = preg_replace("/^[0-9]*_/", "", $page_title);
$page_title = preg_replace("/ - [0-9]*_/", " - ", $page_title);
$page_title = str_replace("_", " ", $page_title);
$title = "$sitename » $page_title";
}
if(($action=="viewnews" OR $action=="addcommentinterface") AND file_exists("$news_dir/$news.fn.php")) {
// build title for a news
$newsfile = get_file("$news_dir/$news.fn.php");
$page_title = get_xml_element("title",$newsfile);
$keywords = preg_replace('/[\.]*[[:alpha:]]+$/i','',get_xml_element("category",$newsfile)).", $keywords";
$sitedescription = substr(strip_tags(get_xml_element("header",$newsfile)), 0, 200);
$sitedescription = _FLEGGI." : $sitedescription";
$title = "$sitename » $page_title";
}
// start HTML 5 headers
echo "<!DOCTYPE html>";
echo "<!--[if lt IE 7]> <html class=\"no-js lt-ie9 lt-ie8 lt-ie7\"> <![endif]-->";
echo "<!--[if IE 7]> <html class=\"no-js lt-ie9 lt-ie8\"> <![endif]-->";
echo "<!--[if IE 8]> <html class=\"no-js lt-ie9\"> <![endif]-->";
echo "<!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"$lang\"> <!--<![endif]-->";
//echo "<html >\n";
echo "<head>\n";
echo "<meta charset=\"utf-8\">";
//echo "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">";
echo "<title>".stripslashes($title)."</title>\n";
define("_FN_TITLE",$title);
//echo "<meta http-equiv=\"content-type\" content=\"text/html; charset="._CHARSET."\">\n";
//echo "<meta http-equiv=\"expires\" content=\"0\">\n";
//echo "<meta name=\"resource-type\" content=\"document\">\n";
//echo "<meta name=\"distribution\" content=\"global\">\n";
echo "<meta name=\"author\" content=\"$admin\">\n";
//echo "<meta name=\"copyright\" content=\"Copyright (c) ".date("Y",time())." by $sitename\">\n";
echo "<meta name=\"keywords\" content=\"$keywords\">\n";
echo "<meta name=\"description\" content=\"$sitedescription\">\n";
if (file_exists(_FN_SECTIONS_DIR."/"._FN_MOD."/noindex"))
echo "<meta name=\"robots\" content=\"noindex, nofollow\">\n";
else echo "<meta name=\"robots\" content=\"index, follow\">\n";
echo "<meta name=\"revisit-after\" content=\"1 days\">\n";
echo "<meta name=\"rating\" content=\"general\">\n";
echo "<meta name=\"viewport\" content=\"width=device-width\">";
?>
<!--[if lt IE 7]>
<script>
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
}
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->
<script type="text/javascript">
<!--
// Request confirmation before continue action
function check(url){
if(confirm ("<?php echo _SICURO?>"))
window.location=url;
}
// Let overload window.onload function
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
// -->
</script>
<?php
// declaration of all default StyleSheets provided by the system
$path_css_sys = "include/css";
if(file_exists($path_css_sys)) {
$dir_css_sys = opendir($path_css_sys);
$file_css_sys = 0;
while ($filename_css_sys = readdir($dir_css_sys)) {
if(preg_match('/[\.]css$/', $filename_css_sys) AND $filename_css_sys!="." AND $filename_css_sys!=".." AND !preg_match("/^none_/", $filename_css_sys)) {
$array_css_sys[$file_css_sys] = $filename_css_sys;
$file_css_sys++;
}
}
closedir($dir_css_sys);
for($i=0; $i<$file_css_sys; $i++) {
echo "\n<link rel='StyleSheet' type='text/css' href='$path_css_sys/$array_css_sys[$i]'>";
}
if($mod=="none_Admin" AND _FN_IS_ADMIN AND file_exists("$path_css_sys/none_dashboard.css")) {
echo "\n<link rel='StyleSheet' type='text/css' href='$path_css_sys/none_dashboard.css'>";
}
}
// declaration of all StyleSheets provided by the theme in use (if not using Administration section)
global $theme;
$path_css_thm = "themes/$theme";
if($mod!="none_Admin" AND file_exists($path_css_thm)) {
$dir_css_thm = opendir($path_css_thm);
$file_css_thm = 0;
while ($filename_css_thm = readdir($dir_css_thm)) {
if(preg_match('/[\.]css$/', $filename_css_thm) AND $filename_css_thm!="." AND $filename_css_thm!=".." AND !preg_match("/^none_/", $filename_css_thm)) {
$array_css_thm[$file_css_thm] = $filename_css_thm;
$file_css_thm++;
}
}
closedir($dir_css_thm);
for($i=0; $i<$file_css_thm; $i++) {
echo "\n<link rel='StyleSheet' type='text/css' href='$path_css_thm/$array_css_thm[$i]'>";
}
}
// declaration of the XML file with rss-feeds
if(file_exists(get_fn_dir("var")."/backend.xml"))
echo "\n<link rel=\"alternate\" type=\"application/rss+xml\" href=\"".get_fn_dir("var")."/backend.xml\" title=\"$sitename\">";
// favicon
if(file_exists("favicon.ico"))
echo "\n<link rel=\"shortcut icon\" href=\"favicon.ico\">\n";
// loading all JavaScripts that are present in '/include/javascripts' directory
$path_js = "include/javascripts";
if(file_exists($path_js)) {
$dir_js = opendir($path_js);
$file_js = 0;
while ($filename_js = readdir($dir_js)) {
if(preg_match('/[\.]js$/', $filename_js) AND $filename_js!="." AND $filename_js!=".." AND !preg_match("/^none_/", $filename_js) AND !preg_match("/^\./", $filename_js)) {
$array_js[$file_js] = $filename_js;
$file_js++;
}
}
closedir($dir_js);
if($file_js>0) sort($array_js);
for($i=0; $i<$file_js; $i++) {
echo "\n<script type='text/javascript' src='$path_js/$array_js[$i]'></script>";
}
}
//Link to fontAwesomeCDN
echo "\n<link href=\"//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css\" rel=\"stylesheet\">";
// end of HTML headers
echo "\n\n</head>\n";
?>