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.47 (9 years 6 months 3 weeks 3 days 10 hours 36 minutes 32 seconds ago) by djmaze
Changed : +3 -3 lines
Comment: Added new function get_uri() because supid IIS 5 doesn't support it


# 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 1.35 of the CPG Open Source License Agreement version 1
10 djmaze 1.1  
11 djmaze 1.1 Last modification notes:
12 djmaze 1.36 $Source: /cvs/html/header.php,v $
13 djmaze 1.47 $Revision: 1.46 $
14 djmaze 1.46 $Author: djmaze $
15 djmaze 1.47 $Date: 2004/09/27 16:19:29 $
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  
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.47 $url = get_uri(); // added
26 djmaze 1.42 $uname = $SESS->sess_id;
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.31 global $CLASS;
34 djmaze 1.31 if ($guest == 1) { $uname = $CLASS['member']->admin['aid']; }
35 djmaze 1.1 $guest = 2;
36 djmaze 1.1 }
37 djmaze 1.5 $ctime = gmtime();
38 djmaze 1.45 $custom_title = Fix_Quotes((strlen($module_title) < 2) ? $name : $module_title);
39 djmaze 1.1 $remove = stristr( $url, '&CMSSESSID');
40 djmaze 1.1 $url = substr( $url, 0, strlen($url)-strlen($remove) );
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.23 global $slogan, $sitename, $userinfo, $showblocks, $index,
50 trevor 1.12 $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2,
51 djmaze 1.39 $pagetitle, $modheader, $MAIN_CFG, $CPG_SESS, $module_name, $CLASS;
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 akamu 1.43 $host = (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $MAIN_CFG['server']['domain']).$MAIN_CFG['server']['path'];
74 akamu 1.43 $header = '<base href="'.($_SERVER['SERVER_PORT'] != 443 ? 'http' : 'https') . '://'.$host.'" />
75 akamu 1.38 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
76 akamu 1.25 <title>'.$sitename.' '._BC_DELIM.' '.$pagetitle.'</title>
77 djmaze 1.19 <meta http-equiv="expires" content="0" />
78 trevor 1.12 <meta name="resource-type" content="document" />
79 trevor 1.12 <meta name="distribution" content="global" />
80 trevor 1.12 <meta name="author" content="'.$sitename.'" />
81 trevor 1.12 <meta name="copyright" content="Copyright (c) '.$year.' by '.$sitename.'" />
82 trevor 1.12 <meta name="robots" content="index, follow" />
83 trevor 1.12 <meta name="rating" content="general" />
84 trevor 1.12 <meta name="generator" content="CPG-Nuke - Copyright (c) '.$year.' by CPG-Nuke Development Team :: http://www.cpgnuke.com" />
85 djmaze 1.1 ';
86 djmaze 1.1 //<meta name="REVISIT-AFTER" CONTENT="1 DAYS">
87 akamu 1.38 require_once('includes/meta.php');
88 djmaze 1.16 if (file_exists("themes/$CPG_SESS[theme]/images/favicon.ico")) {
89 djmaze 1.16 $header .= "<link rel=\"shortcut icon\" href=\"themes/$CPG_SESS[theme]/images/favicon.ico\" type=\"image/x-icon\" />\n";
90 djmaze 1.4 } else if (file_exists('favicon.ico')) {
91 djmaze 1.6 $header .= "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\n";
92 djmaze 1.1 }
93 djmaze 1.4 // $header .= "<script type=\"text/javascript\" src=\"includes/javascript/MM_funcs.js\"></script>\n\n";
94 djmaze 1.1 if ($MAIN_CFG['global']['block_frames']) {
95 djmaze 1.4 $header .= "<script type=\"text/javascript\">if (self != top) top.location.replace(self.location)</script>\n";
96 djmaze 1.1 }
97 djmaze 1.19 if ($MAIN_CFG['global']['admin_help']) {
98 djmaze 1.19 $header .= '<script language="JavaScript" type="text/javascript" src="includes/javascript/infobox.js"></script>'."\n";
99 djmaze 1.19 }
100 djmaze 1.4 $header .= '<script type="text/javascript" src="includes/javascript/blockscript.js"></script>
101 trevor 1.32 '.$modheader.'
102 trevor 1.32 <link rel="copyright" href="'.getlink('Credits').'" title="Copyrights" />
103 trevor 1.32 <link rel="author" href="'.getlink('Members_List').'" title="'._Members_ListLANG.'" />
104 trevor 1.32 ';
105 djmaze 1.1 if ($module_name != 'Private_Messages' && is_user() && $userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) {
106 djmaze 1.19 $header .= "
107 djmaze 1.19 <script language=\"Javascript\" type=\"text/javascript\">
108 djmaze 1.1 <!--
109 djmaze 1.28 window.open('".getlink("Private_Messages&file=index&mode=newpm", false)."', '', 'height=150,resizable=yes,width=400');
110 djmaze 1.1 //-->
111 djmaze 1.1 </script>";
112 djmaze 1.1 }
113 djmaze 1.19 if ($MAIN_CFG['global']['maintenance']) {
114 trevor 1.34 $message = '<strong>'._SYS_MESSAGE.'</strong><br />'._SYS_MAINTENANCE;
115 djmaze 1.19 }
116 djmaze 1.21 if (is_admin() && $CLASS['member']->demo) {
117 trevor 1.34 $message .= ($message == '') ? '<strong>'._SYS_MESSAGES.'</strong>' : '<br />';
118 trevor 1.34 $message .= '<br />'._SYS_DEMO;
119 djmaze 1.19 }
120 djmaze 1.4 if (!THEME_USES_TPL) {
121 djmaze 1.4 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
122 djmaze 1.39 <html dir="'._TEXT_DIR.'" lang="'._BROWSER_LANGCODE.'">
123 djmaze 1.4 <head>
124 djmaze 1.4 '.$header."
125 djmaze 1.16 <link rel=\"stylesheet\" href=\"themes/$CPG_SESS[theme]/style/style.css\" type=\"text/css\">
126 djmaze 1.4 </head>\n\n";
127 djmaze 1.4 }
128 djmaze 1.23 $index = ($showblocks > 1) ? 1 : 0;
129 djmaze 1.1 themeheader();
130 djmaze 1.1 if (THEME_USES_TPL) {
131 djmaze 1.15 global $cpgtpl, $adminmenuitems, $ownpagetitle, $home;
132 djmaze 1.4 $cpgtpl->assign_vars(array(
133 djmaze 1.4 'IMPORTANT_MESSAGE' => $message,
134 djmaze 1.33 'S_TEXTDIR' => _TEXT_DIR,
135 djmaze 1.39 'S_LANGCODE' => _BROWSER_LANGCODE,
136 djmaze 1.4 'S_HEADER_TAGS' => $header
137 djmaze 1.4 )
138 djmaze 1.4 );
139 djmaze 1.4 if (!$home) {
140 djmaze 1.22 if (defined('ADMIN_PAGES') && is_admin() && !(isset($_GET['op']) && $_GET['op'] == 'logout')) {
141 trevor 1.34 $pagetitle = '<div style="float: left;"><a href="'.adminlink().'"><input type="button" value="'._MENU.'" onclick="parent.location=\''.adminlink().'\'" class="liteoption" /></a></div>'
142 djmaze 1.24 .'<div style="float: left;">&nbsp;'.$pagetitle.'</div>'
143 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>';
144 djmaze 1.4 }
145 djmaze 1.4 }
146 djmaze 1.15 $cpgtpl->assign_vars(array(
147 djmaze 1.15 'PAGE_TITLE' => ($home || isset($ownpagetitle[$module_name]))?'':$pagetitle,
148 djmaze 1.15 'S_ADMIN_MENU' => $adminmenuitems
149 djmaze 1.15 ));
150 djmaze 1.1 } else {
151 trevor 1.18 echo '<center><span style="font-size: 12px; color: #FF0000">'.$message.'</span></center>';
152 djmaze 1.1 }
153 djmaze 1.4 unset($modheader);
154 djmaze 1.1 }
155 djmaze 1.1  
156 djmaze 1.1 // 4-7 admin.php 1+ when not logged in, 4-7 index.php
157 djmaze 1.1 online(); // 1-2 queries
158 djmaze 1.1 head();
159 akamu 1.38 if (!defined('ADMIN_PAGES')) { require_once('includes/counter.php'); } // 2-3 queries
160 djmaze 1.1 global $home, $cpgtpl;
161 djmaze 1.1 if ($home) {
162 akamu 1.38 require_once('includes/functions/messagebox.php');
163 djmaze 1.1 message_box();
164 djmaze 1.1 blocks('Center');
165 djmaze 1.1 }
166 djmaze 1.1 if (THEME_USES_TPL) {
167 djmaze 1.1 $cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
168 djmaze 1.1 $cpgtpl->display('cpgheader');
169 djmaze 1.1 // $cpgtpl->destroy();
170 djmaze 1.1 }
171 djmaze 1.37  
172 djmaze 1.35 ?>


Code Credits - Privacy Policy