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 : 1.5 (9 years 8 months 4 weeks 20 hours 30 minutes 17 seconds ago) by djmaze
Changed : +2 -2 lines
Comment: Added new function gmtime() which returns the proper GMT time to prevent conflicts
Changed all time() calls to gmtime()


# 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 djmaze 1.1 Copyright of CPG Dev Team http://cpgnuke.com
6 djmaze 1.1  
7 djmaze 1.1 GNU General Public License version 2
8 djmaze 1.1  
9 djmaze 1.1 Last modification notes:
10 djmaze 1.1  
11 djmaze 1.5 $Id: header.php,v 1.4 2004/07/23 14:39:13 djmaze Exp $
12 djmaze 1.1  
13 djmaze 1.1 ***********************************************************************/
14 djmaze 1.1 if (!defined('CPG_NUKE')) { header('Location: index.php'); exit; }
15 djmaze 1.1  
16 djmaze 1.1 ##################################################
17 djmaze 1.1 # Include some common header for HTML generation #
18 djmaze 1.1 ##################################################
19 djmaze 1.1  
20 djmaze 1.1 function online() {
21 djmaze 1.1 global $userinfo, $prefix, $db, $name, $module_title, $SESS;
22 djmaze 1.1 if ($SESS->start == $userinfo['session_time']) {
23 djmaze 1.1 $ip = encode_ip($_SERVER['REMOTE_ADDR']);
24 djmaze 1.1 $url = $_SERVER['REQUEST_URI']; // added
25 djmaze 1.1 $uname = $ip;
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 1.1 }
31 djmaze 1.1 if (is_admin()) {
32 djmaze 1.1 if ($guest == 1) { $uname = is_admin(); }
33 djmaze 1.1 $guest = 2;
34 djmaze 1.1 }
35 djmaze 1.5 $ctime = gmtime();
36 djmaze 1.1 $custom_title = addslashes((strlen($module_title) < 2) ? $name : $module_title);
37 djmaze 1.1 $remove = stristr( $url, '&CMSSESSID');
38 djmaze 1.1 $url = substr( $url, 0, strlen($url)-strlen($remove) );
39 djmaze 1.1 $url = ereg_replace('&', '&amp;', $url);
40 djmaze 1.1 if (!$db->sql_query('UPDATE '.$prefix."_session SET time='$ctime', module='$custom_title', url='$url', guest='$guest' WHERE uname='$uname'", true) || !$db->sql_affectedrows()) {
41 djmaze 1.1 $db->sql_query('INSERT INTO '.$prefix."_session (uname, time, host_addr, guest, module, url) VALUES ('$uname', '$ctime', '$ip', '$guest', '$custom_title', '$url')");
42 djmaze 1.1 }
43 djmaze 1.1 }
44 djmaze 1.1 }
45 djmaze 1.1  
46 djmaze 1.1 function head() {
47 djmaze 1.1 global $slogan, $sitename, $banners, $nukeurl, $artpage, $topic, $hlpfile, $userinfo, $hr,
48 djmaze 1.1 $theme, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $pagetitle,
49 djmaze 1.1 $locale, $modheader, $MAIN_CFG, $cpgtpl, $module_name, $home;
50 djmaze 1.1 $ThemeSel = get_theme();
51 djmaze 1.1 include("themes/$ThemeSel/theme.php");
52 djmaze 1.4 $year = date('Y');
53 djmaze 1.1 if (!defined('_LANGCODE')) {
54 djmaze 1.1 define('_LANGCODE', $locale);
55 djmaze 1.1 }
56 djmaze 1.1 if (!defined('_CHARSET')) {
57 djmaze 1.1 define('_CHARSET', 'ISO-8859-1');
58 djmaze 1.1 }
59 djmaze 1.1  
60 djmaze 1.1 // Work around for "current" Apache 2 + PHP module
61 djmaze 1.1 // which seems to not cope with private cache control setting
62 djmaze 1.1 if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) {
63 djmaze 1.1 header ('Cache-Control: no-cache, pre-check=0, post-check=0');
64 djmaze 1.1 } else {
65 djmaze 1.1 header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
66 djmaze 1.1 }
67 djmaze 1.1 // header("Expires: 0");
68 djmaze 1.1 // header ("pragma: private");
69 djmaze 1.1 // header("P3P: CP=\"ALL DSP COR NID CURa OUR STP PUR\"");
70 djmaze 1.4 $header = '<base href="http://'.getenv('HTTP_HOST').$MAIN_CFG['server']['path'].'">
71 djmaze 1.1 <meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'">
72 djmaze 1.4 <title>'.$sitename.': '.$pagetitle."</title>\n";
73 djmaze 1.4 include('includes/meta.php');
74 djmaze 1.4 $header .= '<meta http-equiv="EXPIRES" CONTENT="0">
75 djmaze 1.1 <meta name="RESOURCE-TYPE" content="DOCUMENT">
76 djmaze 1.1 <meta name="DISTRIBUTION" content="GLOBAL">
77 djmaze 1.1 <meta name="AUTHOR" content="'.$sitename.'">
78 djmaze 1.1 <meta name="COPYRIGHT" content="Copyright (c) '.$year.' by '.$sitename.'">
79 djmaze 1.1 <meta name="ROBOTS" content="index, follow">
80 djmaze 1.1 <meta name="RATING" content="GENERAL">
81 djmaze 1.1 <meta name="GENERATOR" content="CPG-Nuke - Copyright(c) '.$year.' by http://cpgnuke.com">
82 djmaze 1.1 ';
83 djmaze 1.1 //<meta name="REVISIT-AFTER" CONTENT="1 DAYS">
84 djmaze 1.1 if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
85 djmaze 1.4 $header .= "<link rel=\"shortcut icon\" href=\"themes/$ThemeSel/images/favicon.ico\" type=\"image/x-icon\">\n";
86 djmaze 1.4 } else if (file_exists('favicon.ico')) {
87 djmaze 1.4 $header .= "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n";
88 djmaze 1.1 }
89 djmaze 1.4 // $header .= "<script type=\"text/javascript\" src=\"includes/javascript/MM_funcs.js\"></script>\n\n";
90 djmaze 1.1 if ($MAIN_CFG['global']['block_frames']) {
91 djmaze 1.4 $header .= "<script type=\"text/javascript\">if (self != top) top.location.replace(self.location)</script>\n";
92 djmaze 1.1 }
93 djmaze 1.4 $header .= '<script type="text/javascript" src="includes/javascript/blockscript.js"></script>
94 djmaze 1.4 '.$modheader.'
95 djmaze 1.4 <link rel="copyright" href="'.getlink('Credits').'" title="Copyrights" />
96 djmaze 1.4 <link rel="author" href="'.getlink('Members_List').'" title="'._Members_ListLANG.'" />';
97 djmaze 1.1 if ($module_name != 'Private_Messages' && is_user() && $userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) {
98 djmaze 1.4 $header .= "<script language=\"Javascript\" type=\"text/javascript\">
99 djmaze 1.1 <!--
100 djmaze 1.1 window.open('".getlink("Private_Messages&file=index&mode=newpm&popup=1", false)."', '', 'HEIGHT=225,resizable=yes,WIDTH=400');
101 djmaze 1.1 //-->
102 djmaze 1.1 </script>";
103 djmaze 1.1 }
104 djmaze 1.4 if (!THEME_USES_TPL) {
105 djmaze 1.4 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
106 djmaze 1.4 <html lang="'._LANGCODE.'">
107 djmaze 1.4 <head>
108 djmaze 1.4 '.$header."
109 djmaze 1.4 <link rel=\"stylesheet\" href=\"themes/$ThemeSel/style/style.css\" type=\"text/css\">
110 djmaze 1.4 </head>\n\n";
111 djmaze 1.4 }
112 djmaze 1.1 themeheader();
113 djmaze 1.1 $message = '';
114 djmaze 1.3 if (CPGN_DEMO && is_admin() && eregi(is_admin(), 'demo')) {
115 djmaze 1.1 $message .= 'Warning you are in admin demo mode! You can\'t do anything then view all pages <a href="'.adminlink('logout').'">Click here to logout</a><br />';
116 djmaze 1.1 }
117 djmaze 1.1 if (intval($MAIN_CFG['global']['maintenance']) != 0) {
118 djmaze 1.1 $message .= 'Warning you are in Maintenance mode<br />';
119 djmaze 1.1 }
120 djmaze 1.1 if (THEME_USES_TPL) {
121 djmaze 1.4 $cpgtpl->assign_vars(array(
122 djmaze 1.4 'IMPORTANT_MESSAGE' => $message,
123 djmaze 1.4 'S_LANGCODE' => _LANGCODE,
124 djmaze 1.4 'S_HEADER_TAGS' => $header
125 djmaze 1.4 )
126 djmaze 1.4 );
127 djmaze 1.4 if (!$home) {
128 djmaze 1.4 if (defined('ADMIN_PAGES')) {
129 djmaze 1.4 $pagetitle = '<table border="0" cellspacing="0" cellpadding="2" width="100%"><tr>'
130 djmaze 1.4 .'<td align="center" width="100"><a href="'.adminlink().'"><input type="button" value="Main Menu" onclick="parent.location=\''.adminlink().'\'" class="liteoption" /></a></td>'
131 djmaze 1.4 .'<th align="center" width="100%" class="thHead">'.$pagetitle.'</th>'
132 djmaze 1.4 .'<td align="center" width="100"><a href="'.adminlink('logout').'"><input type="button" value="'._ADMINLOGOUT.'" onclick="parent.location=\''.adminlink('logout').'\'" class="liteoption" /></a></td>'
133 djmaze 1.4 .'</tr></table>';
134 djmaze 1.4 }
135 djmaze 1.4 $cpgtpl->assign_var('PAGE_TITLE', $pagetitle);
136 djmaze 1.4 }
137 djmaze 1.1 } else {
138 djmaze 1.1 echo '<center><span style="font-size: 16px; color: #FF0000"><b>'.$message.'</b></span></center>';
139 djmaze 1.1 }
140 djmaze 1.4 unset($modheader);
141 djmaze 1.1 }
142 djmaze 1.1  
143 djmaze 1.1 // 4-7 admin.php 1+ when not logged in, 4-7 index.php
144 djmaze 1.1 online(); // 1-2 queries
145 djmaze 1.1 head();
146 djmaze 1.1 if (!defined('ADMIN_PAGES')) { require('includes/counter.php'); } // 2-3 queries
147 djmaze 1.1 global $home, $cpgtpl;
148 djmaze 1.1 if ($home) {
149 djmaze 1.2 include("includes/functions/messagebox.php");
150 djmaze 1.1 message_box();
151 djmaze 1.1 blocks('Center');
152 djmaze 1.1 }
153 djmaze 1.1 if (THEME_USES_TPL) {
154 djmaze 1.1 $cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
155 djmaze 1.1 $cpgtpl->display('cpgheader');
156 djmaze 1.1 // $cpgtpl->destroy();
157 djmaze 1.1 }
158 djmaze 1.1 ?>


Code Credits - Privacy Policy