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.23 (9 years 8 months 4 days 13 hours 28 minutes 2 seconds ago) by djmaze
Changed : +3 -2 lines
Comment: Added "module" based custom sideblocks viewing for none, left, right, both to setup which side to show at a module.
This new system overwrites the old limited $index
ALTER TABLE `cms_modules` ADD `blocks` TINYINT UNSIGNED NOT NULL DEFAULT 1


# 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 djmaze 1.1 GNU General Public License version 2
9 djmaze 1.1  
10 djmaze 1.1 Last modification notes:
11 djmaze 1.1  
12 djmaze 1.23 $Id: header.php,v 1.22 2004/08/20 22:08:47 djmaze Exp $
13 djmaze 1.1  
14 djmaze 1.1 ***********************************************************************/
15 trevor 1.18 if (!defined('CPG_NUKE')) { header('Location: /'); exit; }
16 djmaze 1.1  
17 djmaze 1.1 ##################################################
18 djmaze 1.1 # Include some common header for HTML generation #
19 djmaze 1.1 ##################################################
20 djmaze 1.1  
21 djmaze 1.1 function online() {
22 djmaze 1.1 global $userinfo, $prefix, $db, $name, $module_title, $SESS;
23 djmaze 1.7 if ($SESS->dbupdate) {
24 djmaze 1.13 $ip = $userinfo['user_ip'];
25 djmaze 1.1 $url = $_SERVER['REQUEST_URI']; // added
26 djmaze 1.1 $uname = $ip;
27 djmaze 1.1 $guest = 1;
28 djmaze 1.1 if (is_user()) {
29 djmaze 1.1 $uname = $userinfo['username'];
30 djmaze 1.1 $guest = 0;
31 djmaze 1.1 }
32 djmaze 1.1 if (is_admin()) {
33 djmaze 1.1 if ($guest == 1) { $uname = is_admin(); }
34 djmaze 1.1 $guest = 2;
35 djmaze 1.1 }
36 djmaze 1.5 $ctime = gmtime();
37 djmaze 1.1 $custom_title = addslashes((strlen($module_title) < 2) ? $name : $module_title);
38 djmaze 1.1 $remove = stristr( $url, '&CMSSESSID');
39 djmaze 1.1 $url = substr( $url, 0, strlen($url)-strlen($remove) );
40 djmaze 1.1 $url = ereg_replace('&', '&amp;', $url);
41 djmaze 1.7 if ($userinfo['session_start'] == $userinfo['session_time']) {
42 djmaze 1.7 $db->sql_query('INSERT INTO '.$prefix."_session (uname, time, host_addr, guest, module, url) VALUES ('$uname', '$ctime', '$ip', '$guest', '$custom_title', '$url')");
43 djmaze 1.9 } else if (!$db->sql_query('UPDATE '.$prefix."_session SET time='$ctime', module='$custom_title', url='$url', guest='$guest' WHERE uname='$uname' LIMIT 1", true) || !$db->sql_affectedrows()) {
44 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')");
45 djmaze 1.1 }
46 djmaze 1.1 }
47 djmaze 1.1 }
48 djmaze 1.1  
49 djmaze 1.1 function head() {
50 djmaze 1.23 global $slogan, $sitename, $userinfo, $showblocks, $index,
51 trevor 1.12 $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2,
52 djmaze 1.21 $pagetitle, $locale, $modheader, $MAIN_CFG, $CPG_SESS, $module_name, $CLASS;
53 djmaze 1.16 include("themes/$CPG_SESS[theme]/theme.php");
54 djmaze 1.4 $year = date('Y');
55 djmaze 1.1 if (!defined('_LANGCODE')) {
56 djmaze 1.1 define('_LANGCODE', $locale);
57 djmaze 1.1 }
58 djmaze 1.1 if (!defined('_CHARSET')) {
59 djmaze 1.7 define('_CHARSET', 'UTF-8');
60 djmaze 1.1 }
61 djmaze 1.1  
62 djmaze 1.8 // Work around for "current" Apache 2 + PHP module which seems to not cope with private cache control setting
63 djmaze 1.1 if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) {
64 djmaze 1.8 header('Cache-Control: no-cache, pre-check=0, post-check=0');
65 djmaze 1.1 } else {
66 djmaze 1.8 header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
67 djmaze 1.1 }
68 djmaze 1.1 // header("Expires: 0");
69 djmaze 1.19 $message = '';
70 djmaze 1.6 $header = '<base href="http://'.getenv('HTTP_HOST').$MAIN_CFG['server']['path'].'" />
71 djmaze 1.6 <meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />
72 djmaze 1.19 <title>'.$sitename.': '.$pagetitle.'</title>
73 djmaze 1.19 <meta http-equiv="expires" content="0" />
74 trevor 1.12 <meta name="resource-type" content="document" />
75 trevor 1.12 <meta name="distribution" content="global" />
76 trevor 1.12 <meta name="author" content="'.$sitename.'" />
77 trevor 1.12 <meta name="copyright" content="Copyright (c) '.$year.' by '.$sitename.'" />
78 trevor 1.12 <meta name="robots" content="index, follow" />
79 trevor 1.12 <meta name="rating" content="general" />
80 trevor 1.12 <meta name="generator" content="CPG-Nuke - Copyright (c) '.$year.' by CPG-Nuke Development Team :: http://www.cpgnuke.com" />
81 djmaze 1.1 ';
82 djmaze 1.1 //<meta name="REVISIT-AFTER" CONTENT="1 DAYS">
83 djmaze 1.19 include('includes/meta.php');
84 djmaze 1.16 if (file_exists("themes/$CPG_SESS[theme]/images/favicon.ico")) {
85 djmaze 1.16 $header .= "<link rel=\"shortcut icon\" href=\"themes/$CPG_SESS[theme]/images/favicon.ico\" type=\"image/x-icon\" />\n";
86 djmaze 1.4 } else if (file_exists('favicon.ico')) {
87 djmaze 1.6 $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.19 if ($MAIN_CFG['global']['admin_help']) {
94 djmaze 1.19 $header .= '<script language="JavaScript" type="text/javascript" src="includes/javascript/infobox.js"></script>'."\n";
95 djmaze 1.19 }
96 djmaze 1.4 $header .= '<script type="text/javascript" src="includes/javascript/blockscript.js"></script>
97 djmaze 1.4 '.$modheader.'
98 djmaze 1.4 <link rel="copyright" href="'.getlink('Credits').'" title="Copyrights" />
99 djmaze 1.4 <link rel="author" href="'.getlink('Members_List').'" title="'._Members_ListLANG.'" />';
100 djmaze 1.1 if ($module_name != 'Private_Messages' && is_user() && $userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) {
101 djmaze 1.19 $header .= "
102 djmaze 1.19 <script language=\"Javascript\" type=\"text/javascript\">
103 djmaze 1.1 <!--
104 trevor 1.17 window.open('".getlink("Private_Messages&file=index&mode=newpm&popup=1", false)."', '', 'height=225,resizable=yes,width=400');
105 djmaze 1.1 //-->
106 djmaze 1.1 </script>";
107 djmaze 1.1 }
108 djmaze 1.19 if ($MAIN_CFG['global']['maintenance']) {
109 djmaze 1.19 $message = '<strong>System Message</strong><br />You are running under maintenance mode';
110 djmaze 1.19 }
111 djmaze 1.21 if (is_admin() && $CLASS['member']->demo) {
112 djmaze 1.19 $message .= ($message == '') ? '<strong>System Messages</strong>' : '<br />';
113 djmaze 1.19 $message .= '<br />You are running under administration demo mode<br />You cannot make any changes to the database<br /><a href="'.adminlink('logout').'">Log me out!</a>';
114 djmaze 1.19 }
115 djmaze 1.4 if (!THEME_USES_TPL) {
116 djmaze 1.4 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
117 djmaze 1.4 <html lang="'._LANGCODE.'">
118 djmaze 1.4 <head>
119 djmaze 1.4 '.$header."
120 djmaze 1.16 <link rel=\"stylesheet\" href=\"themes/$CPG_SESS[theme]/style/style.css\" type=\"text/css\">
121 djmaze 1.4 </head>\n\n";
122 djmaze 1.4 }
123 djmaze 1.23 $index = ($showblocks > 1) ? 1 : 0;
124 djmaze 1.1 themeheader();
125 djmaze 1.1 if (THEME_USES_TPL) {
126 djmaze 1.15 global $cpgtpl, $adminmenuitems, $ownpagetitle, $home;
127 djmaze 1.4 $cpgtpl->assign_vars(array(
128 djmaze 1.4 'IMPORTANT_MESSAGE' => $message,
129 djmaze 1.4 'S_LANGCODE' => _LANGCODE,
130 djmaze 1.4 'S_HEADER_TAGS' => $header
131 djmaze 1.4 )
132 djmaze 1.4 );
133 djmaze 1.4 if (!$home) {
134 djmaze 1.22 if (defined('ADMIN_PAGES') && is_admin() && !(isset($_GET['op']) && $_GET['op'] == 'logout')) {
135 djmaze 1.4 $pagetitle = '<table border="0" cellspacing="0" cellpadding="2" width="100%"><tr>'
136 trevor 1.18 .'<td align="center" width="100">&nbsp;<a href="'.adminlink().'"><input type="button" value="Main Menu" onclick="parent.location=\''.adminlink().'\'" class="liteoption" /></a></td>'
137 djmaze 1.4 .'<th align="center" width="100%" class="thHead">'.$pagetitle.'</th>'
138 trevor 1.18 .'<td align="center" width="100"><a href="'.adminlink('logout').'"><input type="button" value="'._ADMINLOGOUT.'" onclick="parent.location=\''.adminlink('logout').'\'" class="liteoption" /></a>&nbsp;</td>'
139 djmaze 1.4 .'</tr></table>';
140 djmaze 1.4 }
141 djmaze 1.4 }
142 djmaze 1.15 $cpgtpl->assign_vars(array(
143 djmaze 1.15 'PAGE_TITLE' => ($home || isset($ownpagetitle[$module_name]))?'':$pagetitle,
144 djmaze 1.15 'S_ADMIN_MENU' => $adminmenuitems
145 djmaze 1.15 ));
146 djmaze 1.1 } else {
147 trevor 1.18 echo '<center><span style="font-size: 12px; color: #FF0000">'.$message.'</span></center>';
148 djmaze 1.1 }
149 djmaze 1.4 unset($modheader);
150 djmaze 1.1 }
151 djmaze 1.1  
152 djmaze 1.1 // 4-7 admin.php 1+ when not logged in, 4-7 index.php
153 djmaze 1.1 online(); // 1-2 queries
154 djmaze 1.1 head();
155 djmaze 1.1 if (!defined('ADMIN_PAGES')) { require('includes/counter.php'); } // 2-3 queries
156 djmaze 1.1 global $home, $cpgtpl;
157 djmaze 1.1 if ($home) {
158 djmaze 1.2 include("includes/functions/messagebox.php");
159 djmaze 1.1 message_box();
160 djmaze 1.1 blocks('Center');
161 djmaze 1.1 }
162 djmaze 1.1 if (THEME_USES_TPL) {
163 djmaze 1.1 $cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
164 djmaze 1.1 $cpgtpl->display('cpgheader');
165 djmaze 1.1 // $cpgtpl->destroy();
166 djmaze 1.1 }
167 djmaze 1.21 ?>


Code Credits - Privacy Policy