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 : 10.4 (2 years 6 months 1 days 10 hours 23 minutes 8 seconds ago) by nanocaiordo
Changed : +4 -3 lines
Comment: Getting rid of a tpl warning.


# 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 10.4 $Revision: 10.3 $
13 nanocaio 10.2 $Author: nanocaiordo $
14 nanocaio 10.4 $Date: 2011/10/13 13:36:16 $
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 nanocaio 10.1 // temporary patch
20 nanocaio 10.1 if ('HEAD' === $_SERVER['REQUEST_METHOD']) {
21 nanocaio 10.1 HttpHeader::flush();
22 nanocaio 10.1 exit;
23 nanocaio 10.1 }
24 nanocaio 10.1  
25 djmaze 9.22 # 1-2 queries
26 djmaze 1.1 function online() {
27 djmaze 9.4 global $userinfo, $prefix, $db, $module_title, $SESS, $mainindex;
28 djmaze 9.4 if ($SESS->dbupdate) {
29 nanocaio 9.36 $url = URL::uri();
30 djmaze 9.4 $uname = $SESS->sess_id;
31 djmaze 9.4 $guest = 1;
32 djmaze 9.4 if (is_user()) {
33 djmaze 9.4 $uname = $userinfo['username'];
34 djmaze 9.4 $guest = 0;
35 djmaze 9.4 } elseif (SEARCHBOT) {
36 djmaze 9.4 $uname = SEARCHBOT;
37 djmaze 9.4 $guest = 3;
38 djmaze 9.4 }
39 djmaze 9.4 if (is_admin()) {
40 djmaze 9.4 global $CLASS;
41 djmaze 9.4 if ($guest == 1) { $uname = $CLASS['member']->admin['aid']; }
42 djmaze 9.4 $guest = 2;
43 djmaze 9.4 if (defined('ADMIN_PAGES')) $url = $mainindex;
44 djmaze 9.4 }
45 djmaze 9.7 $uname = Fix_Quotes($uname);
46 djmaze 9.14 if (empty($uname)) return; # something screwey
47 nanocaio 9.34 $ctime = time();
48 djmaze 9.4 $custom_title = Fix_Quotes(($module_title) ? $module_title : _HOME);
49 djmaze 9.14 $url = Fix_Quotes(str_replace('&', '&amp;', $url));
50 djmaze 9.10 if ($db->sql_count($prefix.'_session', "uname='$uname'")) {
51 djmaze 9.10 $db->sql_query('UPDATE '.$prefix."_session SET time='$ctime', module='$custom_title', url='$url', guest='$guest' WHERE uname='$uname'", true);
52 djmaze 9.10 } else {
53 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);
54 djmaze 9.4 }
55 djmaze 9.4 }
56 djmaze 1.1 }
57 djmaze 1.1 function head() {
58 nanocaio 10.1 global $BASEHREF, $METATAGS, $sitename, $userinfo,
59 phoenix 9.39 $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2,
60 nanocaio 9.38 $pagetitle, $modheader, $MAIN_CFG, $CPG_SESS, $module_name, $CLASS;
61 nanocaio 9.26 include_once('themes/'.$CPG_SESS['theme'].'/theme.php');
62 djmaze 9.18 if (!defined('THEME_VERSION')) { define('THEME_VERSION', '9.0'); }
63 djmaze 9.4 if (!defined('_BROWSER_LANGCODE')) { define('_BROWSER_LANGCODE', _LANGCODE); }
64 djmaze 9.4 if (!defined('_CHARSET')) { define('_CHARSET', 'UTF-8'); }
65 djmaze 1.1  
66 djmaze 9.22 # Work around for "current" Apache 2 + PHP module which seems to not cope with private cache control setting
67 djmaze 9.4 if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) {
68 djmaze 9.4 header('Cache-Control: no-cache, pre-check=0, post-check=0');
69 djmaze 9.4 } else {
70 djmaze 9.15 header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
71 djmaze 9.4 }
72 djmaze 9.15 header('imagetoolbar: no');
73 nanocaio 9.38 $header = '';
74 djmaze 9.5 foreach ($METATAGS as $name => $content) {
75 nanocaio 9.26 $header .= '<meta name="'.$name.'" content="'.$content.'" />'."\n";
76 djmaze 9.5 }
77 nanocaio 9.26 // $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 nanocaio 9.26 $header .= '<script type="text/javascript">if (self != top) top.location.replace(self.location)</script>'."\n";
80 djmaze 9.4 }
81 nanocaio 9.38 $header .= $modheader.'
82 nanocaio 9.35 <link rel="copyright" href="'.URL::index('credits').'" title="Copyrights" />
83 nanocaio 9.40 <link rel="author" href="'.URL::index('Members_List').'" title="'._Members_ListLANG.'" />
84 nanocaio 9.40 ';
85 djmaze 8.12 /*
86 djmaze 9.4 $languages = lang_selectbox('', '', false, true);
87 djmaze 9.4 for ($i=0; $i < sizeof($languages); $i++) {
88 djmaze 9.4 if ($languages[$i] != '') {
89 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";
90 djmaze 9.4 }
91 djmaze 9.4 }
92 djmaze 8.12 */
93 djmaze 9.4 if ($module_name != 'Private_Messages' && is_user() && is_active('Private_Messages') && $userinfo['user_popup_pm'] && $userinfo['user_new_privmsg']) {
94 nanocaio 9.26 $header .= '
95 nanocaio 9.26 <script type="text/javascript">
96 djmaze 1.1 <!--
97 nanocaio 9.35 window.open(\''.URL::index('Private_Messages&file=index&mode=newpm', false).'\', \'\', \'height=150,resizable=yes,width=400\');
98 djmaze 1.1 //-->
99 nanocaio 9.26 </script>';
100 djmaze 9.4 }
101 nanocaio 9.38 $message = $MAIN_CFG['global']['maintenance'] ? '<strong>'._SYS_MESSAGE.'</strong><br />'._SYS_MAINTENANCE : '';
102 djmaze 9.4 if (is_admin() && $CLASS['member']->demo) {
103 djmaze 9.4 $message .= ($message == '') ? '<strong>'._SYS_MESSAGES.'</strong>' : '<br />';
104 djmaze 9.4 $message .= '<br />'._SYS_DEMO;
105 djmaze 9.4 }
106 djmaze 9.4 themeheader();
107 djmaze 9.14 global $cpgtpl, $ownpagetitle, $home;
108 akamu 9.16 $adminmenuitems = $admincssmenuitems = false;
109 djmaze 9.14 if (!$home) {
110 djmaze 9.14 if (defined('ADMIN_PAGES') && is_admin() && !(isset($_GET['op']) && $_GET['op'] == 'logout')) {
111 djmaze 9.14 require_once('includes/classes/cpg_adminmenu.php');
112 djmaze 9.14 $adminmenuitems = $CLASS['adminmenu']->display('all', 'jsmenu');
113 nanocaio 9.29 $admincssmenuitems = ($MAIN_CFG['global']['admingraphic'] & 4);
114 djmaze 9.4 }
115 djmaze 9.4 }
116 djmaze 9.14 $cpgtpl->assign_vars(array(
117 nanocaio 9.38 'BASEHREF' => $BASEHREF,
118 nanocaio 9.38 'I18N' => 'enctype="multipart/form-data" accept-charset="utf-8"',
119 nanocaio 9.38 'IMPORTANT_MESSAGE' => $message,
120 djmaze 9.14 'PAGE_TITLE' => ($home || isset($ownpagetitle[$module_name]))?'':$pagetitle,
121 nanocaio 9.38 'S_TEXTDIR' => _TEXT_DIR,
122 nanocaio 9.38 'S_LANGCODE' => _BROWSER_LANGCODE,
123 nanocaio 9.38 'S_HEADER_TAGS' => $header,
124 nanocaio 10.1 'S_LEFTBLOCKS' => (Blocks::$showblocks & 1),
125 nanocaio 10.1 'S_RIGHTBLOCKS' => (Blocks::$showblocks & 2),
126 nanocaio 9.38 'S_SITENAME' => $sitename,
127 nanocaio 9.38 'S_PAGETITLE' => !empty($pagetitle) ? strip_tags($pagetitle) : '',
128 nanocaio 9.38 'S_DELIM' => _BC_DELIM,
129 nanocaio 9.38 /* iSCSI, HTTP or FTP allowed */
130 nanocaio 9.38 'S_FILESERVER' => '',
131 djmaze 9.15 'S_ADMIN_MENU' => $adminmenuitems,
132 nanocaio 9.38 'S_ADMIN_CSSMENU' => $admincssmenuitems,
133 nanocaio 9.38 'B_PAGETITLE' => 1 < strlen(strip_tags($pagetitle)),
134 nanocaio 10.4 'B_NEWSRSS' => is_active('News'),
135 nanocaio 10.4 'RSS_DATA' => ''
136 djmaze 9.14 ));
137 djmaze 9.4 unset($modheader);
138 djmaze 1.1 }
139 djmaze 1.1  
140 djmaze 9.22 if (empty($_SESSION['SECURITY']['banned'])) { online(); }
141 nanocaio 10.1 global $home, $cpgtpl, $Blocks, $Module;
142 nanocaio 10.2 if (!is_object($Blocks)) {
143 nanocaio 10.2 $Blocks = new Blocks($Module->mid);
144 nanocaio 10.2 }
145 djmaze 1.1 head();
146 djmaze 8.6 if (!defined('ADMIN_PAGES')) {
147 djmaze 9.22 require_once('includes/counter.php'); # 2-3 queries
148 nanocaio 10.3 require_once('includes/functions/messagebox.php');
149 djmaze 1.1 }
150 nanocaio 9.32 $Blocks->display('c');
151 djmaze 9.14 $cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
152 djmaze 9.14 $cpgtpl->display('cpgheader');


Code Credits - Privacy Policy