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 : 9.13 (8 years 6 months 3 weeks 6 days 2 hours 15 minutes 23 seconds ago) by djmaze
Changed : +3 -5 lines
Comment: Probably fixed session expire (cookie message) if you try to post a message that takes longer to 24 minutes to write.
This seems to be caused by the PHP garbage collector that deletes sessions older then 24 minutes although PHP says a session cache expires after 3 hours


# Author Rev Line
1 djmaze 1.1 <?php
2 djmaze 1.1 /*********************************************
3 djmaze 9.1 CPG Dragonfly™ CMS
4 djmaze 1.1 ********************************************
5 djmaze 9.1 Copyright © 2004 - 2005 by CPG-Nuke Dev Team
6 djmaze 9.12 http://dragonflycms.org
7 djmaze 1.1  
8 djmaze 8.23 Dragonfly 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.36 $Source: /cvs/html/header.php,v $
12 djmaze 9.13 $Revision: 9.12 $
13 djmaze 9.11 $Author: djmaze $
14 djmaze 9.13 $Date: 2005/08/29 15:10:45 $
15 djmaze 8.23 **********************************************/
16 trevor 8.19 if (!defined('CPG_NUKE')) { exit; }
17 djmaze 1.37 define('HEADER_OPEN', true);
18 djmaze 1.1 function online() {
19 djmaze 9.4 global $userinfo, $prefix, $db, $module_title, $SESS, $mainindex;
20 djmaze 9.4 if ($SESS->dbupdate) {
21 djmaze 9.4 $ip = $userinfo['user_ip'];
22 djmaze 9.4 $url = get_uri();
23 djmaze 9.4 $uname = $SESS->sess_id;
24 djmaze 9.4 $guest = 1;
25 djmaze 9.4 if (is_user()) {
26 djmaze 9.4 $uname = $userinfo['username'];
27 djmaze 9.4 $guest = 0;
28 djmaze 9.4 } elseif (SEARCHBOT) {
29 djmaze 9.4 $uname = SEARCHBOT;
30 djmaze 9.4 $guest = 3;
31 djmaze 9.4 }
32 djmaze 9.4 if (is_admin()) {
33 djmaze 9.4 global $CLASS;
34 djmaze 9.4 if ($guest == 1) { $uname = $CLASS['member']->admin['aid']; }
35 djmaze 9.4 $guest = 2;
36 djmaze 9.4 if (defined('ADMIN_PAGES')) $url = $mainindex;
37 djmaze 9.4 }
38 djmaze 9.7 $uname = Fix_Quotes($uname);
39 djmaze 9.4 $ctime = gmtime();
40 djmaze 9.4 $custom_title = Fix_Quotes(($module_title) ? $module_title : _HOME);
41 djmaze 9.7 $url = Fix_Quotes(ereg_replace('&', '&amp;', $url));
42 djmaze 9.10 if ($db->sql_count($prefix.'_session', "uname='$uname'")) {
43 djmaze 9.10 $db->sql_query('UPDATE '.$prefix."_session SET time='$ctime', module='$custom_title', url='$url', guest='$guest' WHERE uname='$uname'", true);
44 djmaze 9.10 } else {
45 djmaze 9.10 $db->sql_query('INSERT INTO '.$prefix."_session (uname, time, host_addr, guest, module, url) VALUES ('$uname', '$ctime', '$ip', '$guest', '$custom_title', '$url')", true);
46 djmaze 9.4 }
47 djmaze 9.4 }
48 djmaze 1.1 }
49 djmaze 1.1 function head() {
50 djmaze 9.5 global $BASEHREF, $METATAGS, $slogan, $sitename, $userinfo, $showblocks, $index,
51 djmaze 9.4 $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2,
52 djmaze 9.4 $pagetitle, $modheader, $MAIN_CFG, $CPG_SESS, $module_name, $CLASS, $adminindex;
53 djmaze 9.4 include_once("themes/$CPG_SESS[theme]/theme.php");
54 djmaze 9.4 if (!defined('_BROWSER_LANGCODE')) { define('_BROWSER_LANGCODE', _LANGCODE); }
55 djmaze 9.4 if (!defined('_CHARSET')) { define('_CHARSET', 'UTF-8'); }
56 djmaze 1.1  
57 djmaze 9.4 // Work around for "current" Apache 2 + PHP module which seems to not cope with private cache control setting
58 djmaze 9.4 if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) {
59 djmaze 9.4 header('Cache-Control: no-cache, pre-check=0, post-check=0');
60 djmaze 9.4 } else {
61 djmaze 9.13 header('Cache-Control: private, pre-check=0, post-check=0, max-age=10800');
62 djmaze 9.4 }
63 djmaze 9.4 $message = '';
64 djmaze 9.4 $header = '<base href="'.$BASEHREF.'" />
65 trevor 9.9 <title>'.$sitename.(!empty($pagetitle) ? ' '._BC_DELIM.' '.strip_tags($pagetitle) : '').'</title>
66 djmaze 8.14 <meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />
67 djmaze 9.6 <meta http-equiv="imagetoolbar" content="no" />
68 djmaze 1.1 ';
69 djmaze 9.5 foreach ($METATAGS as $name => $content) {
70 djmaze 9.5 $header .= "<meta name=\"$name\" content=\"$content\" />\n";
71 djmaze 9.5 }
72 djmaze 9.4 if (file_exists("themes/$CPG_SESS[theme]/images/favicon.ico")) {
73 djmaze 9.4 $header .= "<link rel=\"shortcut icon\" href=\"themes/$CPG_SESS[theme]/images/favicon.ico\" type=\"image/x-icon\" />\n";
74 djmaze 9.4 } else if (file_exists('favicon.ico')) {
75 djmaze 9.4 $header .= "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\n";
76 djmaze 9.4 }
77 djmaze 9.4 // $header .= "<script type=\"text/javascript\" src=\"includes/javascript/MM_funcs.js\"></script>\n\n";
78 djmaze 9.4 if ($MAIN_CFG['global']['block_frames']) {
79 djmaze 9.4 $header .= "<script type=\"text/javascript\">if (self != top) top.location.replace(self.location)</script>\n";
80 djmaze 9.4 }
81 djmaze 9.4 if ($MAIN_CFG['global']['admin_help']) {
82 djmaze 9.4 $header .= '<script language="JavaScript" type="text/javascript" src="includes/javascript/infobox.js"></script>'."\n";
83 djmaze 9.4 }
84 djmaze 9.4 $header .= '<script type="text/javascript" src="includes/javascript/blockscript.js"></script>
85 trevor 1.32 '.$modheader.'
86 trevor 9.3 <link rel="copyright" href="'.getlink('credits').'" title="Copyrights" />
87 trevor 1.32 <link rel="author" href="'.getlink('Members_List').'" title="'._Members_ListLANG.'" />
88 djmaze 8.22 <link rel="alternate" type="application/rss+xml" title="RSS" href="rss/news2.php" />
89 trevor 1.32 ';
90 djmaze 8.12 /*
91 djmaze 9.4 $languages = lang_selectbox('', '', false, true);
92 djmaze 9.4 for ($i=0; $i < sizeof($languages); $i++) {
93 djmaze 9.4 if ($languages[$i] != '') {
94 djmaze 9.4 $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";
95 djmaze 9.4 }
96 djmaze 9.4 }
97 djmaze 8.12 */
98 djmaze 9.4 if ($module_name != 'Private_Messages' && is_user() && is_active('Private_Messages') && $userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) {
99 djmaze 9.4 $header .= "
100 djmaze 1.19 <script language=\"Javascript\" type=\"text/javascript\">
101 djmaze 1.1 <!--
102 djmaze 9.4 window.open('".getlink("Private_Messages&file=index&mode=newpm", false)."', '', 'height=150,resizable=yes,width=400');
103 djmaze 1.1 //-->
104 djmaze 1.1 </script>";
105 djmaze 9.4 }
106 djmaze 9.4 if ($MAIN_CFG['global']['maintenance']) { $message = '<strong>'._SYS_MESSAGE.'</strong><br />'._SYS_MAINTENANCE; }
107 djmaze 9.4 if (is_admin() && $CLASS['member']->demo) {
108 djmaze 9.4 $message .= ($message == '') ? '<strong>'._SYS_MESSAGES.'</strong>' : '<br />';
109 djmaze 9.4 $message .= '<br />'._SYS_DEMO;
110 djmaze 9.4 }
111 djmaze 9.4 if (!THEME_USES_TPL) {
112 djmaze 9.4 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
113 djmaze 1.39 <html dir="'._TEXT_DIR.'" lang="'._BROWSER_LANGCODE.'">
114 djmaze 1.4 <head>
115 djmaze 1.4 '.$header."
116 djmaze 1.16 <link rel=\"stylesheet\" href=\"themes/$CPG_SESS[theme]/style/style.css\" type=\"text/css\">
117 djmaze 1.4 </head>\n\n";
118 djmaze 9.4 }
119 djmaze 9.4 $index = ($showblocks > 1) ? 1 : 0;
120 djmaze 9.4 themeheader();
121 djmaze 9.4 if (THEME_USES_TPL) {
122 djmaze 9.4 global $cpgtpl, $ownpagetitle, $home;
123 djmaze 9.4 $adminmenuitems = false;
124 djmaze 9.4 $cpgtpl->assign_vars(array(
125 djmaze 9.4 'IMPORTANT_MESSAGE' => $message,
126 djmaze 9.4 'S_TEXTDIR' => _TEXT_DIR,
127 djmaze 9.4 'S_LANGCODE' => _BROWSER_LANGCODE,
128 djmaze 9.4 'S_HEADER_TAGS' => $header,
129 djmaze 9.4 'S_LEFTBLOCKS' => blocks_visible('l'),
130 djmaze 9.4 'S_RIGHTBLOCKS' => blocks_visible('r'),
131 djmaze 9.4 'I18N' => 'enctype="multipart/form-data" accept-charset="utf-8"'
132 djmaze 9.4 )
133 djmaze 9.4 );
134 djmaze 9.4 if (!$home) {
135 djmaze 9.4 if (defined('ADMIN_PAGES') && is_admin() && !(isset($_GET['op']) && $_GET['op'] == 'logout')) {
136 djmaze 9.11 $pagetitle = '<div><span style="float:left;margin-left:5px"><a href="'.$adminindex.'"><input type="button" value="'._MENU.'" onclick="parent.location=\''.$adminindex.'\'" class="liteoption" /></a></span>'
137 djmaze 9.11 .'<span style="float:right;margin-right:5px"><a href="'.adminlink('logout').'"><input type="button" value="'._ADMINLOGOUT.'" onclick="parent.location=\''.adminlink('logout').'\'" class="liteoption" /></a></span></div>'
138 djmaze 9.11 .'<span style="text-align:center">'.$pagetitle.'</span>';
139 djmaze 9.4 require_once('includes/classes/cpg_adminmenu.php');
140 djmaze 9.4 $adminmenuitems = $CLASS['adminmenu']->display('all', 'jsmenu');
141 djmaze 9.4 }
142 djmaze 9.4 }
143 djmaze 9.4 $cpgtpl->assign_vars(array(
144 djmaze 9.4 'PAGE_TITLE' => ($home || isset($ownpagetitle[$module_name]))?'':$pagetitle,
145 djmaze 9.4 'S_ADMIN_MENU' => $adminmenuitems
146 djmaze 9.4 ));
147 djmaze 9.4 } else {
148 djmaze 9.4 echo '<center><span style="font-size: 12px; color: #FF0000">'.$message.'</span></center>';
149 djmaze 9.4 }
150 djmaze 9.4 unset($modheader);
151 djmaze 1.1 }
152 djmaze 1.1  
153 djmaze 1.1 // 4-7 admin.php 1+ when not logged in, 4-7 index.php
154 djmaze 1.1 online(); // 1-2 queries
155 djmaze 1.1 head();
156 djmaze 1.1 global $home, $cpgtpl;
157 djmaze 8.6 if (!defined('ADMIN_PAGES')) {
158 djmaze 9.4 require_once('includes/counter.php'); // 2-3 queries
159 djmaze 9.4 if ($home) {
160 djmaze 9.4 require_once('includes/functions/messagebox.php');
161 djmaze 9.4 message_box();
162 djmaze 9.4 blocks('Center');
163 djmaze 9.4 }
164 djmaze 1.1 }
165 djmaze 1.1 if (THEME_USES_TPL) {
166 djmaze 9.4 $cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
167 djmaze 9.4 $cpgtpl->display('cpgheader');
168 djmaze 1.1 }


Code Credits - Privacy Policy