-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheader.php
More file actions
91 lines (74 loc) · 2.26 KB
/
header.php
File metadata and controls
91 lines (74 loc) · 2.26 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
<?php
/*
+ ----------------------------------------------------------------------------+
| PHPDirector.
| $License: GPL General Public License
| $Website: phpdirector.co.uk
| $Author: Ben Swanson
| $Contributors - Dennis Berko and Monte Ohrt (Monte Ohrt)
+----------------------------------------------------------------------------+
*/
//Installed?
$filename = "installed.php";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
$explode_cont = explode(";", $contents);
if ($explode_cont[1] !== "Yes"){
header("Location: install/index.php");
}
//Installed?
require('libs/Smarty.class.php');
require('libs/SmartyPaginate.class.php');
include("db.php");
include("includes/function.inc.php");
$template = config('template');
$smarty = new Smarty();
$smarty->template_dir = './templates/'.$template;
$smarty->compile_dir = './templates_c';
$smarty->cache_dir = './cache';
$smarty->config_dir = './configs';
$sort1 = $_GET['sort'];
$page = $_GET['page'];
$pagetype = $_GET["pt"];
$smarty->assign('pagetype', $pagetype);
$smarty->assign('cat', $_GET[cat]);
$smarty->assign('next', $_GET["next"]);
$cnf_name = config('name');
$smarty->assign('config_name', $cnf_name);
$cnf_image = config('image');
$smarty->assign('config_image', $cnf_image);
$cnf_slogan = config('slogan');
$smarty->assign('config_slogan', $cnf_slogan);
//NEWS//
$news = config('news');
$smarty->assign('news', $news);
//NEWS//
//Categories
$query_categories = mysql_query("SELECT name, id FROM pp_categories WHERE disable='0'");
$i = 0;
while ($row_cat = mysql_fetch_array($query_categories)) {
$tmp = array(
'id' => $row_cat['id'],
'name' => $row_cat['name']
);
$result[$i++] = $tmp;
}
$smarty->assign('cat', $result);
//Categorires end//
//Tags//
$query_tags = mysql_query("SELECT id, name FROM pp_tags GROUP BY name ORDER BY COUNT(id) DESC LIMIT 0,50");
while ($row_tag = mysql_fetch_array($query_tags)) {
$tags[] = $row_tag;
}
$smarty->assign('tag', $tags);
//tags end
//Firefox?
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
if (!(strpos($HTTP_USER_AGENT,'Mozilla/5') === false)) {
$smarty->assign('firefox', '1');
} else {
$smarty->assign('firefox', '0');
}
//Firefox? END
?>