Dragonfly CMS logo Server sponsored and hosted by
DedicatedNOW
CVS logo  
.:: Home :: Dev. Resources :: Forums ::.
Dragonfly CMS CVS Repository
 Location: / cvs / html / header.php
This is a web interface to the Dragonfly CMS CVS tree. You can browse the file hierarchy by picking directories. If you pick a file, you will see the revision history for that file.
Selecting a revision number will show that revision of the file. There are links at each revision to display diffs, annotate and download.
Note: Info about CVS and our commits can be found at our CVS Info Forum
File name: html/header.php
Revision : 8.17 (9 years 5 months 15 hours 41 minutes 6 seconds ago) by djmaze
Changed : +5 -3 lines
Comment: More bots found :)


# Author Rev Line
1 djmaze 1.1 <?php
2 djmaze 1.1 /*********************************************
3 djmaze 1.1 CPG-NUKE: Advanced Content Management System
4 djmaze 1.1 ********************************************
5 trevor 1.18 Copyright (c) 2004 by CPG-Nuke Dev Team
6 trevor 1.18 http://www.cpgnuke.com
7 djmaze 1.1  
8 trevor 1.26 CPG-Nuke is released under the terms and conditions
9 djmaze 8.11 of the GNU GPL version 2 or any later version
10 djmaze 1.1  
11 djmaze 1.1 Last modification notes:
12 djmaze 1.36 $Source: /cvs/html/header.php,v $
13 djmaze 8.17 $Revision: 8.16 $
14 djmaze 8.12 $Author: djmaze $
15 djmaze 8.17 $Date: 2004/11/17 22:11:43 $
16 djmaze 1.1  
17 djmaze 1.1 ***********************************************************************/
18 trevor 1.32 if (!defined('CPG_NUKE')) { die('You do not have permission to access this file'); }
19 djmaze 1.37 define('HEADER_OPEN', true);
20 djmaze 1.1 function online() {
21 djmaze 8.8 global $userinfo, $prefix, $db, $module_title, $SESS, $mainindex;
22 djmaze 1.7 if ($SESS->dbupdate) {
23 djmaze 1.13 $ip = $userinfo['user_ip'];
24 djmaze 1.47 $url = get_uri(); // added
25 djmaze 8.17 $uname = $SESS->sess_id;
26 djmaze 1.1 $guest = 1;
27 djmaze 1.1 if (is_user()) {
28 djmaze 1.1 $uname = $userinfo['username'];
29 djmaze 1.1 $guest = 0;
30 djmaze 8.17 } elseif (SEARCHBOT) {
31 djmaze 8.17 $ip = $uname = SEARCHBOT;
32 djmaze 1.1 }
33 djmaze 1.1 if (is_admin()) {
34 djmaze 1.31 global $CLASS;
35 djmaze 1.31 if ($guest == 1) { $uname = $CLASS['member']->admin['aid']; }
36 djmaze 1.1 $guest = 2;
37 djmaze 8.8 if (defined('ADMIN_PAGES')) $url = $mainindex;
38 djmaze 1.1 }
39 djmaze 1.5 $ctime = gmtime();
40 djmaze 8.8 $custom_title = Fix_Quotes(($module_title) ? $module_title : _HOME);
41 djmaze 1.1 $url = ereg_replace('&', '&amp;', $url);
42 akamu 1.43 if (!$db->sql_query('UPDATE IGNORE '.$prefix."_session SET time='$ctime', module='$custom_title', url='$url', guest='$guest' WHERE uname='$uname' LIMIT 1", true,__FILE__,__LINE__) || !$db->sql_affectedrows()) {
43 akamu 1.44 $db->sql_query('INSERT IGNORE INTO '.$prefix."_session (uname, time, host_addr, guest, module, url) VALUES ('$uname', '$ctime', '$ip', '$guest', '$custom_title', '$url')",false,__FILE__,__LINE__);
44 djmaze 1.1 }
45 djmaze 1.1 }
46 djmaze 1.1 }
47 djmaze 1.1  
48 djmaze 1.1 function head() {
49 djmaze 1.48 global $BASEHREF, $slogan, $sitename, $userinfo, $showblocks, $index,
50 trevor 1.12 $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2,
51 trevor 8.5 $pagetitle, $modheader, $MAIN_CFG, $CPG_SESS, $module_name, $CLASS, $adminindex;
52 djmaze 1.46 if (isset($CPG_SESS['gfx']) && $module_name != 'Your_Account') {
53 djmaze 1.46 $CPG_SESS['gfx'] = NULL;
54 djmaze 1.46 unset($CPG_SESS['gfx']);
55 djmaze 1.46 }
56 djmaze 1.30 include_once("themes/$CPG_SESS[theme]/theme.php");
57 djmaze 1.4 $year = date('Y');
58 djmaze 1.39 if (!defined('_BROWSER_LANGCODE')) {
59 djmaze 1.39 define('_BROWSER_LANGCODE', _LANGCODE);
60 djmaze 1.1 }
61 djmaze 1.1 if (!defined('_CHARSET')) {
62 djmaze 1.7 define('_CHARSET', 'UTF-8');
63 djmaze 1.1 }
64 djmaze 1.1  
65 djmaze 1.8 // Work around for "current" Apache 2 + PHP module which seems to not cope with private cache control setting
66 djmaze 1.1 if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) {
67 djmaze 1.8 header('Cache-Control: no-cache, pre-check=0, post-check=0');
68 djmaze 1.1 } else {
69 djmaze 1.8 header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
70 djmaze 1.1 }
71 djmaze 1.1 // header("Expires: 0");
72 djmaze 1.19 $message = '';
73 djmaze 1.48 $header = '<base href="'.$BASEHREF.'" />
74 djmaze 8.14 <meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />
75 akamu 1.25 <title>'.$sitename.' '._BC_DELIM.' '.$pagetitle.'</title>
76 djmaze 1.19 <meta http-equiv="expires" content="0" />
77 trevor 1.12 <meta name="resource-type" content="document" />
78 trevor 1.12 <meta name="distribution" content="global" />
79 trevor 1.12 <meta name="author" content="'.$sitename.'" />
80 trevor 1.12 <meta name="copyright" content="Copyright (c) '.$year.' by '.$sitename.'" />
81 trevor 1.12 <meta name="robots" content="index, follow" />
82 trevor 1.12 <meta name="rating" content="general" />
83 trevor 1.12 <meta name="generator" content="CPG-Nuke - Copyright (c) '.$year.' by CPG-Nuke Development Team :: http://www.cpgnuke.com" />
84 djmaze 1.1 ';
85 djmaze 1.1 //<meta name="REVISIT-AFTER" CONTENT="1 DAYS">
86 akamu 1.38 require_once('includes/meta.php');
87 djmaze 1.16 if (file_exists("themes/$CPG_SESS[theme]/images/favicon.ico")) {
88 djmaze 1.16 $header .= "<link rel=\"shortcut icon\" href=\"themes/$CPG_SESS[theme]/images/favicon.ico\" type=\"image/x-icon\" />\n";
89 djmaze 1.4 } else if (file_exists('favicon.ico')) {
90 djmaze 1.6 $header .= "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\n";
91 djmaze 1.1 }
92 djmaze 1.4 // $header .= "<script type=\"text/javascript\" src=\"includes/javascript/MM_funcs.js\"></script>\n\n";
93 djmaze 1.1 if ($MAIN_CFG['global']['block_frames']) {
94 djmaze 1.4 $header .= "<script type=\"text/javascript\">if (self != top) top.location.replace(self.location)</script>\n";
95 djmaze 1.1 }
96 djmaze 1.19 if ($MAIN_CFG['global']['admin_help']) {
97 djmaze 1.19 $header .= '<script language="JavaScript" type="text/javascript" src="includes/javascript/infobox.js"></script>'."\n";
98 djmaze 1.19 }
99 djmaze 1.4 $header .= '<script type="text/javascript" src="includes/javascript/blockscript.js"></script>
100 trevor 1.32 '.$modheader.'
101 trevor 1.32 <link rel="copyright" href="'.getlink('Credits').'" title="Copyrights" />
102 trevor 1.32 <link rel="author" href="'.getlink('Members_List').'" title="'._Members_ListLANG.'" />
103 akamu 8.9 <link rel="alternate" type="application/rss+xml" title="RSS" href="backend.php" />
104 trevor 1.32 ';
105 djmaze 8.12 /*
106 djmaze 8.13 $languages = lang_selectbox('', '', false, true);
107 akamu 8.9 for ($i=0; $i < sizeof($languages); $i++) {
108 akamu 8.9 if ($languages[$i] != '') {
109 djmaze 8.12 $header .= '<link rel="alternate" type="text/html" href="?newlang='.$languages[$i].'" hreflang="'.get_langcode($languages[$i]).'" lang="'.get_langcode($languages[$i]).'" title="Version '.ucfirst($languages[$i]).'" />'."\n";
110 akamu 8.9 }
111 akamu 8.9 }
112 djmaze 8.12 */
113 djmaze 8.7 if ($module_name != 'Private_Messages' && is_user() && is_active('Private_Messages') && $userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) {
114 djmaze 1.19 $header .= "
115 djmaze 1.19 <script language=\"Javascript\" type=\"text/javascript\">
116 djmaze 1.1 <!--
117 djmaze 1.28 window.open('".getlink("Private_Messages&file=index&mode=newpm", false)."', '', 'height=150,resizable=yes,width=400');
118 djmaze 1.1 //-->
119 djmaze 1.1 </script>";
120 djmaze 1.1 }
121 djmaze 1.19 if ($MAIN_CFG['global']['maintenance']) {
122 trevor 1.34 $message = '<strong>'._SYS_MESSAGE.'</strong><br />'._SYS_MAINTENANCE;
123 djmaze 1.19 }
124 djmaze 1.21 if (is_admin() && $CLASS['member']->demo) {
125 trevor 1.34 $message .= ($message == '') ? '<strong>'._SYS_MESSAGES.'</strong>' : '<br />';
126 trevor 1.34 $message .= '<br />'._SYS_DEMO;
127 djmaze 1.19 }
128 djmaze 1.4 if (!THEME_USES_TPL) {
129 djmaze 1.4 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
130 djmaze 1.39 <html dir="'._TEXT_DIR.'" lang="'._BROWSER_LANGCODE.'">
131 djmaze 1.4 <head>
132 djmaze 1.4 '.$header."
133 djmaze 1.16 <link rel=\"stylesheet\" href=\"themes/$CPG_SESS[theme]/style/style.css\" type=\"text/css\">
134 djmaze 1.4 </head>\n\n";
135 djmaze 1.4 }
136 djmaze 1.23 $index = ($showblocks > 1) ? 1 : 0;
137 djmaze 1.1 themeheader();
138 djmaze 1.1 if (THEME_USES_TPL) {
139 djmaze 8.4 global $cpgtpl, $ownpagetitle, $home;
140 djmaze 8.4 $adminmenuitems = false;
141 djmaze 1.4 $cpgtpl->assign_vars(array(
142 djmaze 1.4 'IMPORTANT_MESSAGE' => $message,
143 djmaze 1.33 'S_TEXTDIR' => _TEXT_DIR,
144 djmaze 1.39 'S_LANGCODE' => _BROWSER_LANGCODE,
145 djmaze 1.4 'S_HEADER_TAGS' => $header
146 djmaze 1.4 )
147 djmaze 1.4 );
148 djmaze 1.4 if (!$home) {
149 djmaze 1.22 if (defined('ADMIN_PAGES') && is_admin() && !(isset($_GET['op']) && $_GET['op'] == 'logout')) {
150 trevor 8.5 $pagetitle = '<div style="float: left;"><a href="'.$adminindex.'"><input type="button" value="'._MENU.'" onclick="parent.location=\''.$adminindex.'\'" class="liteoption" /></a></div>'
151 djmaze 1.24 .'<div style="float: left;">&nbsp;'.$pagetitle.'</div>'
152 djmaze 1.24 .'<div style="float: right;"><a href="'.adminlink('logout').'"><input type="button" value="'._ADMINLOGOUT.'" onclick="parent.location=\''.adminlink('logout').'\'" class="liteoption" /></a></div>';
153 djmaze 8.4 require_once('includes/classes/cpg_adminmenu.php');
154 djmaze 8.4 $adminmenuitems = $CLASS['adminmenu']->display('all', 'jsmenu');
155 djmaze 1.4 }
156 djmaze 1.4 }
157 djmaze 1.15 $cpgtpl->assign_vars(array(
158 djmaze 1.15 'PAGE_TITLE' => ($home || isset($ownpagetitle[$module_name]))?'':$pagetitle,
159 djmaze 1.15 'S_ADMIN_MENU' => $adminmenuitems
160 djmaze 1.15 ));
161 djmaze 1.1 } else {
162 trevor 1.18 echo '<center><span style="font-size: 12px; color: #FF0000">'.$message.'</span></center>';
163 djmaze 1.1 }
164 djmaze 1.4 unset($modheader);
165 djmaze 1.1 }
166 djmaze 1.1  
167 djmaze 1.1 // 4-7 admin.php 1+ when not logged in, 4-7 index.php
168 djmaze 1.1 online(); // 1-2 queries
169 djmaze 1.1 head();
170 djmaze 1.1 global $home, $cpgtpl;
171 djmaze 8.6 if (!defined('ADMIN_PAGES')) {
172 djmaze 8.6 require_once('includes/counter.php'); // 2-3 queries
173 djmaze 8.6 if ($home) {
174 djmaze 8.6 require_once('includes/functions/messagebox.php');
175 djmaze 8.6 message_box();
176 djmaze 8.6 blocks('Center');
177 djmaze 8.6 }
178 djmaze 1.1 }
179 djmaze 1.1 if (THEME_USES_TPL) {
180 djmaze 1.1 $cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
181 djmaze 1.1 $cpgtpl->display('cpgheader');
182 djmaze 1.1 }


Code Credits - Privacy Policy