Dragonfly CMS logo Server sponsored and hosted by
DedicatedNOW
CVS logo  
.:: Home :: Dev. Resources :: Forums ::.
Dragonfly CMS CVS Repository
 Location: / cvs / themes / reDesign / theme.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: themes/reDesign/theme.php
Revision : 1.18 (6 years 2 months 1 weeks 5 days 2 hours 53 minutes 36 seconds ago) by estlane
Changed : +3 -3 lines
Comment: Version update


# Author Rev Line
1 nanocaio 1.1 <?php
2 nanocaio 1.1 /*********************************************
3 nanocaio 1.1 CPG Dragonfly™ CMS
4 nanocaio 1.1 ********************************************
5 nanocaio 1.1 Copyright © 2004 - 2007 by CPG-Nuke Dev Team
6 nanocaio 1.1 http://dragonflycms.org
7 nanocaio 1.1  
8 nanocaio 1.1 Dragonfly is released under the terms and conditions
9 nanocaio 1.1 of the GNU GPL version 2 or any later version
10 nanocaio 1.1  
11 estlane 1.3 $Source: /cvs/themes/reDesign/theme.php,v $
12 estlane 1.18 $Revision: 1.17 $
13 estlane 1.3 $Author: estlane $
14 estlane 1.18 $Date: 2008/02/05 18:46:10 $
15 nanocaio 1.1 **********************************************/
16 nanocaio 1.1 if (!defined('CPG_NUKE')) { exit; }
17 nanocaio 1.1 //Theme versions' first two digits must be same as DF's version it's built for (i.e 9.1)
18 nanocaio 1.1 //Last two are theme's version(i.e 1.0)
19 estlane 1.18 define('THEME_VERSION', '9.2.1.4');
20 nanocaio 1.1  
21 nanocaio 1.1 /* Text color on security image, THIS_THEME/images/code_bg.png */
22 nanocaio 1.1 $gfxcolor = '#1A712B';
23 nanocaio 1.1  
24 nanocaio 1.1 /* Some background colours used by DF */
25 estlane 1.9 /*$bgcolor1 = '#FFFFFF';
26 estlane 1.9 $bgcolor2 = '#F2F9F2';
27 estlane 1.9 $bgcolor3 = '#F2FFFF';
28 nanocaio 1.1 $bgcolor4 = '#D7FFD7';
29 estlane 1.9 $textcolor1 = '#009900';
30 estlane 1.9 $textcolor2 = '#000000';*/
31 estlane 1.9  
32 nanocaio 1.1  
33 estlane 1.9 /*$bgcolor1 = '#838383';
34 estlane 1.9 $bgcolor2 = '#6F6F6F';
35 estlane 1.9 $bgcolor3 = '#909090';
36 estlane 1.9 $bgcolor4 = '#8B8B8B';
37 estlane 1.9 $textcolor1 = '#E8E8E8';
38 estlane 1.9 $textcolor2 = '#E6E6E6';*/
39 estlane 1.9  
40 estlane 1.9  
41 estlane 1.9 /* Hack for stylesheet specific design */
42 estlane 1.9 $bgcolor1 = '" class="bgcolor1';
43 estlane 1.9 $bgcolor2 = '" class="bgcolor2';
44 estlane 1.9 $bgcolor3 = '" class="bgcolor3';
45 estlane 1.9 $bgcolor4 = '" class="bgcolor4';
46 estlane 1.9 $textcolor1 = '" class="textcolor1';
47 estlane 1.9 $textcolor2 = '" class="textcolor2';
48 nanocaio 1.1  
49 nanocaio 1.1 /* If value is 1 not 0, then in comments hr is shown instead of table bgcolor */
50 nanocaio 1.1 $hr = 1;
51 nanocaio 1.1  
52 nanocaio 1.1 /* Beginning of an usual table of untemplated modules */
53 nanocaio 1.1 function OpenTable() {echo '<div class="table1">';}
54 nanocaio 1.1 /* End of an usual table of untemplated modules */
55 nanocaio 1.1 function CloseTable() {echo '</div>';}
56 nanocaio 1.1  
57 nanocaio 1.1  
58 nanocaio 1.1 /* Beginning of some subtable in untemplated modules */
59 nanocaio 1.1 function OpenTable2() {echo '<div class="table2">';}
60 nanocaio 1.1 /* End of some subtable in untemplated modules */
61 nanocaio 1.1 function CloseTable2() {echo '</div>';}
62 nanocaio 1.1  
63 nanocaio 1.1  
64 nanocaio 1.1 function themeheader() {
65 nanocaio 1.1 global $slogan, $sitename, $banners, $mainindex, $adminindex, $cpgtpl, $site_logo,
66 estlane 1.8 $CPG_SESS, $MAIN_CFG, $pagetitle, $userinfo, $module_name, $home, $Blocks, $my_page_title;
67 nanocaio 1.1  
68 nanocaio 1.1 /* CSS Menu */
69 nanocaio 1.1 if ($MAIN_CFG['global']['admingraphic'] & 4) {
70 nanocaio 1.1 include('themes/'.$CPG_SESS['theme'].'/includes/cssmainmenu.php');
71 nanocaio 1.1 }
72 nanocaio 1.1  
73 nanocaio 1.1 //include file to have proper language selection URL (or prevtheme)
74 nanocaio 1.1 include_once('themes/'.$CPG_SESS['theme'].'/includes/valikurl.php');
75 nanocaio 1.1  
76 nanocaio 1.1 $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
77 nanocaio 1.1 $pngfix = 0;
78 estlane 1.8 $specific = 0;
79 nanocaio 1.1 if (ereg('MSIE 7.0', $user_agent)) {
80 nanocaio 1.1 $specific = 'ie7.css';
81 nanocaio 1.1 } else if (ereg('MSIE ([0-6].[0-9]{1,2})', $user_agent)) {
82 nanocaio 1.1 $specific = 'ie6.css';
83 nanocaio 1.1 $pngfix = 1;
84 estlane 1.7 /* Will be applied only to Opera Mini 3 */
85 estlane 1.7 /*} else if (ereg('Opera Mini', $user_agent) xor ereg('Opera Mini/4.', $user_agent)) {
86 estlane 1.7 $specific = 'operamini.css';*/
87 nanocaio 1.1 } else if (ereg('Opera', $user_agent) xor ereg('Opera/9.[5-9]', $user_agent)) {
88 nanocaio 1.1 $specific = 'opera.css';
89 estlane 1.8 /* For Opera Kestrel Alpha, more like a temporar thing */
90 estlane 1.8 } else if (ereg('Opera/9.[5-9]', $user_agent)) {
91 estlane 1.8 $specific = 'opera_kestrel.css';
92 nanocaio 1.1 } else if (ereg('Safari', $user_agent)) {
93 nanocaio 1.1 $specific = 'safari.css';
94 nanocaio 1.1 }
95 nanocaio 1.1 //We want to use some strings, which exists only in forums.php languagefile, it may cause a small downtime though
96 nanocaio 1.1 get_lang('forums');
97 nanocaio 1.1 global $lang;
98 nanocaio 1.1  
99 estlane 1.6 /*Add left blocks to header.html*/
100 estlane 1.6 $Blocks->display('l');
101 estlane 1.17 /*Add right blocks to header.html*/
102 estlane 1.6 $Blocks->display('r');
103 estlane 1.6  
104 nanocaio 1.1 $cpgtpl->assign_vars(array(
105 nanocaio 1.1 'BROWSER_CSS' => $specific ? "\n".'<link rel="stylesheet" type="text/css" href="themes/'.$CPG_SESS['theme'].'/style/browsers/'.$specific.'" />'."\n" : "\n",
106 estlane 1.7 'PNG_FIX' => $pngfix ? '<script defer type="text/javascript" src="themes/'.$CPG_SESS['theme'].'/javascript/pngfix.js"></script>'."\n" : '',
107 nanocaio 1.1 'PUBLIC_HEADER'=> !defined('ADMIN_PAGES'),
108 estlane 1.17 'B_L_VISIBLE' => $Blocks->hideblock('600') ? ' style=" display: none"' : '',
109 estlane 1.17 'B_R_VISIBLE' => $Blocks->hideblock('601') ? ' style=" display: none"' : '',
110 nanocaio 1.1 'S_MAIN_MENU' => isset($mmcontent) ? $mmcontent : false,
111 estlane 1.6 'S_LIMAGE' => ($Blocks->l && ($Blocks->showblocks & 1)) ? ($Blocks->hideblock('600') ? 'rightplus.gif' : 'rightminus.gif') : '',
112 nanocaio 1.1 'S_RIMAGE' => ($Blocks->r && ($Blocks->showblocks & 2)) ? ($Blocks->hideblock('601') ? 'rightplus.gif' : 'rightminus.gif') : '',
113 nanocaio 1.1 'S_IS_ADMIN' => is_admin(),
114 estlane 1.14 'ALL_OK' => !$MAIN_CFG['global']['maintenance'] || is_admin(),
115 nanocaio 1.1 'S_CAN_ADMIN' => can_admin(),
116 nanocaio 1.1 'S_IS_USER' => is_user(),
117 nanocaio 1.1 //Is user logged in and pm's are active?
118 nanocaio 1.1 'S_PM_OK' => is_user() ? (is_active('Private_Messages') ? true : false) : false,
119 nanocaio 1.1 /*the one should be uncommented if you DONT want to use forums langfile */
120 nanocaio 1.1 //'S_NEW_PM' => ($userinfo['user_new_privmsg'] > 0) ? (($userinfo['user_new_privmsg'] > 1) ? _YOUHAVE.' '.$userinfo['user_new_privmsg'].' '._PRIVATEMSG : _YOUHAVEONEMSG) : sprintf(_ERROR_NONE_TO_DISPLAY, MB::tolower(_NEWPMSG)),
121 nanocaio 1.1 'S_NEW_PM' => ($userinfo['user_new_privmsg'] > 0) ? (($userinfo['user_new_privmsg'] > 1) ? $lang['You_new_pms'] : $lang['You_new_pm']) : $lang['You_no_new_pm'],
122 nanocaio 1.1 'S_NEW_PM_IMG' => ($userinfo['user_new_privmsg'] > 0) ? '_new' : '_no_new',
123 nanocaio 1.1 'S_LOGO' => $site_logo,
124 nanocaio 1.1 'S_SITENAME' => $sitename,
125 nanocaio 1.1 'S_USER_NAME' => $userinfo['username'],
126 nanocaio 1.1 'S_LOGINRDRT' => (isset($CPG_SESS['user']['redirect']) ? $CPG_SESS['user']['redirect'] : getlink()),
127 estlane 1.11 'S_NOT_NEWS' => ($module_name != 'News') || $home,
128 estlane 1.8 'MY_PAGE_TITLE'=> ($module_name != 'Forums')? '<a href="'.$mainindex.'">'._HOME.'</a> '._BC_DELIM.' '.$pagetitle : '',
129 estlane 1.8 'CUR_LANGUAGE' => $currentlang,
130 nanocaio 1.1 'S_HOME' => _HOME,
131 nanocaio 1.1 'S_TOGGLE' => _TOGGLE, /*9.1.2.7 - at last*/
132 nanocaio 1.1 'S_NICKNAME' => _NICKNAME,
133 nanocaio 1.1 'S_WELCOME' => _BWEL,
134 nanocaio 1.1 'S_PASSWORD' => _PASSWORD,
135 nanocaio 1.1 'S_LOGIN' => _LOGIN,
136 nanocaio 1.1 'S_LOGOUT' => _LOGOUT,
137 nanocaio 1.1 'S_FORUMS' => _ForumsLANG,
138 nanocaio 1.1 'S_REGISTER' => _BREG,
139 nanocaio 1.1 'S_PASSLOSS' => _PASSWORD,
140 nanocaio 1.1 'S_DOWNLOADS' => is_active('Downloads') ? _DownloadsLANG : false,
141 nanocaio 1.1 'S_MY_ACCOUNT' => is_user() ? _Your_AccountLANG : _BREG,
142 estlane 1.5 'S_ADMINISTR' => _ADMINISTRATION,
143 nanocaio 1.1 'BC_DELIM' => _BC_DELIM,
144 nanocaio 1.1 'S_BANNER_ACT' => $banners,
145 nanocaio 1.1 'S_BANNER' => ($banners) ? viewbanner() : '',
146 nanocaio 1.1 'S_EDIT' => _EDIT,
147 nanocaio 1.1 'S_SEARCH' => _SEARCH,
148 nanocaio 1.1 'S_SEARCH_ACT' => is_active('Search'),
149 nanocaio 1.1 'U_SEARCH' => getlink('Search'),
150 nanocaio 1.1 'U_MAININDEX' => $mainindex,
151 nanocaio 1.1 'U_LOGOUT' => getlink('Your_Account&amp;op=logout&amp;redirect'),
152 nanocaio 1.1 'U_REGISTER' => getlink('Your_Account&amp;file=register'),
153 nanocaio 1.1 'U_PASSLOSS' => getlink('Your_Account&amp;op=pass_lost'),
154 nanocaio 1.1 'U_DOWNLOADS' => getlink('Downloads'),
155 nanocaio 1.1 'U_FORUMS' => getlink('Forums'),
156 nanocaio 1.1 'U_MY_ACCOUNT' => getlink(is_user() ? 'Your_Account' : 'Your_Account&amp;file=register'),
157 nanocaio 1.1 'U_PM' => getlink('Private_Messages'),
158 nanocaio 1.1 'U_ESTONIAN' => valikvastus('newlang','estonian'),
159 nanocaio 1.1 'U_ENGLISH' => valikvastus('newlang','english'),
160 nanocaio 1.1 'U_ADMININDEX' => $adminindex,
161 nanocaio 1.1 'U_NEWSADMIN' => adminlink('News&amp;edit='),
162 nanocaio 1.1 'S_LASTVISIT' => is_user() ? sprintf($lang['You_last_visit'], formatDateTime($userinfo['user_lastvisit'], _DATESTRING)) : '',
163 estlane 1.8 'S_TIMENOW' => sprintf($lang['Current_time'], formatDateTime(gmtime(), _DATESTRING)),
164 estlane 1.13 'S_NEW_POSTS' => $lang['New_posts'],
165 estlane 1.13 'PM_IMAGE' => 'themes/'.$CPG_SESS['theme'].'/images/forums/lang_'.$currentlang.'/icon_contact_pm.gif',
166 estlane 1.13 'WWW_IMAGE' => 'themes/'.$CPG_SESS['theme'].'/images/forums/lang_'.$currentlang.'/icon_contact_www.gif'
167 nanocaio 1.1 ));
168 estlane 1.6  
169 nanocaio 1.1 }
170 nanocaio 1.1  
171 nanocaio 1.1 function themefooter() {
172 estlane 1.17 global $showblocks, $banners, $cpgtpl, $foot1, $foot2, $foot3, $copyright, $db;
173 estlane 1.6  
174 nanocaio 1.1 $cpgtpl->assign_vars(array(
175 estlane 1.4 'S_BANNER_ACT' => $banners,
176 estlane 1.4 'S_BANNER' => ($banners) ? viewbanner() : '',
177 nanocaio 1.1 'S_FOOTER' => footmsg()
178 nanocaio 1.1 ));
179 nanocaio 1.1 $cpgtpl->set_filenames(array('footer' => 'footer.html'));
180 nanocaio 1.1 $cpgtpl->display('footer');
181 nanocaio 1.1 }
182 nanocaio 1.1  
183 nanocaio 1.1  
184 nanocaio 1.1 /***********************************************************************************
185 nanocaio 1.1  
186 nanocaio 1.1 string theme_open_form
187 nanocaio 1.1  
188 nanocaio 1.1 Creates start tag for form
189 nanocaio 1.1 $get_link : link for action default blank
190 nanocaio 1.1 $form_name : useful for styling and nbbcode
191 nanocaio 1.1 $legend: optional string value is used in form lagend tag
192 nanocaio 1.1 $border: optional use 1 to not show border on fieldset from stylesheet
193 nanocaio 1.1 ************************************************************************************/
194 nanocaio 1.1 function theme_open_form($link, $form_name=false, $legend=false,$tborder=false) {
195 nanocaio 1.1 $leg = $legend ? "<legend>$legend</legend>" : '';
196 nanocaio 1.1 $bord = $tborder ? $tborder : '';
197 nanocaio 1.1 $form_name = $form_name ? ' id="'.$form_name.'"' :'';
198 nanocaio 1.1 return '<form method="post" action="'.$link.'"'.$form_name.' enctype="multipart/form-data" accept-charset="utf-8"><fieldset '.$bord.'>'.$leg;
199 nanocaio 1.1 }
200 nanocaio 1.1 function theme_close_form() {
201 nanocaio 1.1 return '</fieldset></form>';
202 nanocaio 1.1 }
203 nanocaio 1.1 /***********************************************************************************
204 nanocaio 1.1  
205 nanocaio 1.1 string theme_yesno_option
206 nanocaio 1.1  
207 nanocaio 1.1 Creates 2 radio buttons with a Yes and No option
208 nanocaio 1.1 $name : name for the <input>
209 nanocaio 1.1 $value: current value, 1 = yes, 0 = no
210 nanocaio 1.1  
211 nanocaio 1.1 ************************************************************************************/
212 nanocaio 1.1 function theme_yesno_option($name, $value=0) {
213 nanocaio 1.1 $sel[(!$value)] = '';
214 nanocaio 1.1 $sel[$value] = ' selected="selected"';
215 nanocaio 1.1 $select = '<select class="set" name="'.$name.'" id="'.$name."\">\n";
216 nanocaio 1.1 $select .= '<option value="1"'.$sel[1].">"._YES."</option>\n";
217 nanocaio 1.1 $select .= '<option value="0"'.$sel[0].">"._NO."</option>\n";
218 nanocaio 1.1 return $select.'</select>';
219 nanocaio 1.1 }
220 nanocaio 1.1 /***********************************************************************************
221 nanocaio 1.1  
222 nanocaio 1.1 string theme_select_option
223 nanocaio 1.1  
224 nanocaio 1.1 Creates a selection dropdown box of all given variables in the array
225 nanocaio 1.1 $name : name for the <select>
226 nanocaio 1.1 $value: current/default value
227 nanocaio 1.1 $array: array like array("value1","value2")
228 nanocaio 1.1  
229 nanocaio 1.1 ************************************************************************************/
230 nanocaio 1.1 function theme_select_option($name, $value, $array) {
231 nanocaio 1.1 $sel[$value] = ' selected="selected"';
232 nanocaio 1.1 $select = '<select class="set" name="'.$name.'" id="'.$name."\">\n";
233 nanocaio 1.1 foreach($array as $var) {
234 nanocaio 1.1 $select .= '<option'.(isset($sel[$var])?$sel[$var]:'').">$var</option>\n";
235 nanocaio 1.1 }
236 nanocaio 1.1 return $select.'</select>';
237 nanocaio 1.1 }
238 nanocaio 1.1 /***********************************************************************************
239 nanocaio 1.1  
240 nanocaio 1.1 string theme_select_box
241 nanocaio 1.1  
242 nanocaio 1.1 Creates a selection dropdown box of all given variables in the multi array
243 nanocaio 1.1 $name : name for the <select>
244 nanocaio 1.1 $value: current/default value
245 nanocaio 1.1 $array: array like array("value1 => title1","value2 => title2")
246 nanocaio 1.1  
247 nanocaio 1.1 ************************************************************************************/
248 nanocaio 1.1 function theme_select_box($name, $value, $array) {
249 nanocaio 1.1 $select = '<select class="set" name="'.$name.'" id="'.$name."\">\n";
250 nanocaio 1.1 foreach($array as $val => $title) {
251 nanocaio 1.1 $select .= "<option value=\"$val\"".(($val==$value) ? ' selected="selected"' : '').">$title</option>\n";
252 nanocaio 1.1 }
253 nanocaio 1.1 return $select.'</select>';
254 nanocaio 1.1 }


Code Credits - Privacy Policy