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.37 (5 years 7 months 4 weeks 11 hours 4 minutes 35 seconds ago) by nanocaiordo
Changed : +3 -2 lines
Comment: Moved Content-Type and Content-language to template file due some possible issue with other kind content type like archives, images ...


# Author Rev Line
1 djmaze 1.1 <?php
2 djmaze 1.1 /*********************************************
3 djmaze 9.1 CPG Dragonfly™ CMS
4 djmaze 1.1 ********************************************
5 nanocaio 9.30 Copyright © 2004 - 2007 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 nanocaio 9.37 $Revision: 9.36 $
13 nanocaio 9.27 $Author: nanocaiordo $
14 nanocaio 9.37 $Date: 2008/07/31 14:38:48 $
15 djmaze 8.23 **********************************************/
16 trevor 8.19 if (!defined('CPG_NUKE')) { exit; }
17 djmaze 1.37 define('HEADER_OPEN', true);
18 djmaze 9.22  
19 djmaze 9.22 # 1-2 queries
20 djmaze 1.1 function online() {
21 djmaze 9.4 global $userinfo, $prefix, $db, $module_title, $SESS, $mainindex;
22 djmaze 9.4 if ($SESS->dbupdate) {
23 nanocaio 9.36 $url = URL::uri();
24 djmaze 9.4 $uname = $SESS->sess_id;
25 djmaze 9.4 $guest = 1;
26 djmaze 9.4 if (is_user()) {
27 djmaze 9.4 $uname = $userinfo['username'];
28 djmaze 9.4 $guest = 0;
29 djmaze 9.4 } elseif (SEARCHBOT) {
30 djmaze 9.4 $uname = SEARCHBOT;
31 djmaze 9.4 $guest = 3;
32 djmaze 9.4 }
33 djmaze 9.4 if (is_admin()) {
34 djmaze 9.4 global $CLASS;
35 djmaze 9.4 if ($guest == 1) { $uname = $CLASS['member']->admin['aid']; }
36 djmaze 9.4 $guest = 2;
37 djmaze 9.4 if (defined('ADMIN_PAGES')) $url = $mainindex;
38 djmaze 9.4 }
39 djmaze 9.7 $uname = Fix_Quotes($uname);
40 djmaze 9.14 if (empty($uname)) return; # something screwey
41 nanocaio 9.34 $ctime = time();
42 djmaze 9.4 $custom_title = Fix_Quotes(($module_title) ? $module_title : _HOME);
43 djmaze 9.14 $url = Fix_Quotes(str_replace('&', '&amp;', $url));
44 djmaze 9.10 if ($db->sql_count($prefix.'_session', "uname='$uname'")) {
45 djmaze 9.10 $db->sql_query('UPDATE '.$prefix."_session SET time='$ctime', module='$custom_title', url='$url', guest='$guest' WHERE uname='$uname'", true);
46 djmaze 9.10 } else {
47 nanocaio 9.33 $db->sql_query('INSERT INTO '.$prefix."_session (uname, time, host_addr, guest, module, url) VALUES ('$uname', '$ctime', {$userinfo['user_ip']}, '$guest', '$custom_title', '$url')", true);
48 djmaze 9.4 }
49 djmaze 9.4 }
50 djmaze 1.1 }
51 djmaze 1.1 function head() {
52 djmaze 9.5 global $BASEHREF, $METATAGS, $slogan, $sitename, $userinfo, $showblocks, $index,
53 nanocaio 9.32 $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $Blocks,
54 djmaze 9.4 $pagetitle, $modheader, $MAIN_CFG, $CPG_SESS, $module_name, $CLASS, $adminindex;
55 nanocaio 9.26 include_once('themes/'.$CPG_SESS['theme'].'/theme.php');
56 djmaze 9.18 if (!defined('THEME_VERSION')) { define('THEME_VERSION', '9.0'); }
57 djmaze 9.4 if (!defined('_BROWSER_LANGCODE')) { define('_BROWSER_LANGCODE', _LANGCODE); }
58 djmaze 9.4 if (!defined('_CHARSET')) { define('_CHARSET', 'UTF-8'); }
59 djmaze 1.1  
60 djmaze 9.22 # Work around for "current" Apache 2 + PHP module which seems to not cope with private cache control setting
61 djmaze 9.4 if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) {
62 djmaze 9.4 header('Cache-Control: no-cache, pre-check=0, post-check=0');
63 djmaze 9.4 } else {
64 djmaze 9.15 header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
65 djmaze 9.4 }
66 djmaze 9.15 header('imagetoolbar: no');
67 djmaze 9.4 $message = '';
68 nanocaio 9.26 $header = '<base href="'.$BASEHREF.'" />'."\n";
69 nanocaio 9.37 $header .= '<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />'."\n";
70 djmaze 9.5 foreach ($METATAGS as $name => $content) {
71 nanocaio 9.26 $header .= '<meta name="'.$name.'" content="'.$content.'" />'."\n";
72 djmaze 9.5 }
73 djmaze 9.17 $header .= '<title>'.$sitename.(!empty($pagetitle) ? ' '._BC_DELIM.' '.strip_tags($pagetitle) : '').'</title>';
74 nanocaio 9.26 if (file_exists('themes/'.$CPG_SESS['theme'].'/images/favicon.ico')) {
75 nanocaio 9.31 $header .= '<link rel="shortcut icon" href="'.$BASEHREF.'themes/'.$CPG_SESS['theme'].'/images/favicon.ico" type="image/x-icon" />'."\n";
76 djmaze 9.4 } else if (file_exists('favicon.ico')) {
77 nanocaio 9.31 $header .= '<link rel="shortcut icon" href="'.$BASEHREF.'favicon.ico" type="image/x-icon" />'."\n";
78 djmaze 9.4 }
79 nanocaio 9.26 // $header .= '<script type="text/javascript" src="includes/javascript/MM_funcs.js"></script>'."\n\n";
80 djmaze 9.4 if ($MAIN_CFG['global']['block_frames']) {
81 nanocaio 9.26 $header .= '<script type="text/javascript">if (self != top) top.location.replace(self.location)</script>'."\n";
82 djmaze 9.4 }
83 djmaze 9.4 if ($MAIN_CFG['global']['admin_help']) {
84 phoenix 9.25 $header .= '<script type="text/javascript" src="includes/javascript/infobox.js"></script>'."\n";
85 djmaze 9.4 }
86 djmaze 9.4 $header .= '<script type="text/javascript" src="includes/javascript/blockscript.js"></script>
87 trevor 1.32 '.$modheader.'
88 nanocaio 9.35 <link rel="copyright" href="'.URL::index('credits').'" title="Copyrights" />
89 nanocaio 9.35 <link rel="author" href="'.URL::index('Members_List').'" title="'._Members_ListLANG.'" />
90 djmaze 8.22 <link rel="alternate" type="application/rss+xml" title="RSS" href="rss/news2.php" />
91 trevor 1.32 ';
92 djmaze 8.12 /*
93 djmaze 9.4 $languages = lang_selectbox('', '', false, true);
94 djmaze 9.4 for ($i=0; $i < sizeof($languages); $i++) {
95 djmaze 9.4 if ($languages[$i] != '') {
96 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";
97 djmaze 9.4 }
98 djmaze 9.4 }
99 djmaze 8.12 */
100 djmaze 9.4 if ($module_name != 'Private_Messages' && is_user() && is_active('Private_Messages') && $userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) {
101 nanocaio 9.26 $header .= '
102 nanocaio 9.26 <script type="text/javascript">
103 djmaze 1.1 <!--
104 nanocaio 9.35 window.open(\''.URL::index('Private_Messages&file=index&mode=newpm', false).'\', \'\', \'height=150,resizable=yes,width=400\');
105 djmaze 1.1 //-->
106 nanocaio 9.26 </script>';
107 djmaze 9.4 }
108 djmaze 9.4 if ($MAIN_CFG['global']['maintenance']) { $message = '<strong>'._SYS_MESSAGE.'</strong><br />'._SYS_MAINTENANCE; }
109 djmaze 9.4 if (is_admin() && $CLASS['member']->demo) {
110 djmaze 9.4 $message .= ($message == '') ? '<strong>'._SYS_MESSAGES.'</strong>' : '<br />';
111 djmaze 9.4 $message .= '<br />'._SYS_DEMO;
112 djmaze 9.4 }
113 djmaze 9.4 $index = ($showblocks > 1) ? 1 : 0;
114 djmaze 9.4 themeheader();
115 djmaze 9.14 global $cpgtpl, $ownpagetitle, $home;
116 akamu 9.16 $adminmenuitems = $admincssmenuitems = false;
117 djmaze 9.14 $cpgtpl->assign_vars(array(
118 djmaze 9.14 'IMPORTANT_MESSAGE' => $message,
119 djmaze 9.14 'S_TEXTDIR' => _TEXT_DIR,
120 djmaze 9.14 'S_LANGCODE' => _BROWSER_LANGCODE,
121 djmaze 9.14 'S_HEADER_TAGS' => $header,
122 nanocaio 9.32 'S_LEFTBLOCKS' => ($Blocks->showblocks & 1),
123 nanocaio 9.32 'S_RIGHTBLOCKS' => ($Blocks->showblocks & 2),
124 djmaze 9.14 'I18N' => 'enctype="multipart/form-data" accept-charset="utf-8"'
125 djmaze 9.14 ));
126 djmaze 9.14 if (!$home) {
127 djmaze 9.14 if (defined('ADMIN_PAGES') && is_admin() && !(isset($_GET['op']) && $_GET['op'] == 'logout')) {
128 djmaze 9.14 require_once('includes/classes/cpg_adminmenu.php');
129 djmaze 9.14 $adminmenuitems = $CLASS['adminmenu']->display('all', 'jsmenu');
130 nanocaio 9.29 $admincssmenuitems = ($MAIN_CFG['global']['admingraphic'] & 4);
131 djmaze 9.4 }
132 djmaze 9.4 }
133 djmaze 9.14 $cpgtpl->assign_vars(array(
134 djmaze 9.14 'PAGE_TITLE' => ($home || isset($ownpagetitle[$module_name]))?'':$pagetitle,
135 djmaze 9.15 'S_ADMIN_MENU' => $adminmenuitems,
136 djmaze 9.15 'S_ADMIN_CSSMENU' => $admincssmenuitems
137 djmaze 9.14 ));
138 djmaze 9.4 unset($modheader);
139 djmaze 1.1 }
140 djmaze 1.1  
141 djmaze 9.22 if (empty($_SESSION['SECURITY']['banned'])) { online(); }
142 nanocaio 9.32 global $home, $cpgtpl, $Blocks;
143 nanocaio 9.32 $Blocks->init();
144 djmaze 1.1 head();
145 djmaze 8.6 if (!defined('ADMIN_PAGES')) {
146 djmaze 9.22 require_once('includes/counter.php'); # 2-3 queries
147 djmaze 9.4 if ($home) {
148 djmaze 9.4 require_once('includes/functions/messagebox.php');
149 djmaze 9.4 message_box();
150 djmaze 9.4 }
151 djmaze 1.1 }
152 nanocaio 9.32 $Blocks->display('c');
153 djmaze 9.14 $cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
154 djmaze 9.14 $cpgtpl->display('cpgheader');


Code Credits - Privacy Policy