Changeset 8
- Timestamp:
- 2007-11-21 16:09:54 (5 years ago)
- Files:
-
- trunk/admin/classes/pages/Settings.php (modified) (3 diffs)
- trunk/classes/misc/Member.php (modified) (1 diff)
- trunk/classes/pages/Newtopic.php (modified) (1 diff)
- trunk/classes/pages/Page.php (modified) (2 diffs)
- trunk/includes/config/settings.tmpl (modified) (1 diff)
- trunk/includes/input.php (modified) (1 diff)
- trunk/includes/lang/en.php (modified) (1 diff)
- trunk/includes/page_out.php (added)
- trunk/includes/page_start.php (added)
- trunk/redirectors/pollvote.php (modified) (2 diffs)
- trunk/redirectors/postinghelp.php (modified) (2 diffs)
- trunk/redirectors/preview.php (modified) (2 diffs)
- trunk/redirectors/showip.php (modified) (2 diffs)
- trunk/redirectors/uploadavatar.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/admin/classes/pages/Settings.php
r5 r8 32 32 public function __construct() { 33 33 global $LANG, $C, $F, $SETTINGS, $LANG; 34 global $commit, $newsqltype, $newsqlhost, $newsqluser, $newsqlpassword, $newdbname, $newdbtableprefix, $newforumname, $newslogan, $newforumlogo, $newsitename, $newsiteurl, $newforumadmin, $newforumadminemail, $newtopicsperpage, $newpostsperpage, $newmaxavatarsize, $newguestemail, $newfloodcontrol, $newfloodcontrol_search, $newmaxuploadsize, $newuploadextensions, $newlanguage, $newurl_rewriting, $newtimezone, $newencoding, $newdefaultstyle, $newexpire, $newdebug, $newhash, $newseveralaccountspermail, $newmaintainancemode, $newfspath, $newwebpath ;34 global $commit, $newsqltype, $newsqlhost, $newsqluser, $newsqlpassword, $newdbname, $newdbtableprefix, $newforumname, $newslogan, $newforumlogo, $newsitename, $newsiteurl, $newforumadmin, $newforumadminemail, $newtopicsperpage, $newpostsperpage, $newmaxavatarsize, $newguestemail, $newfloodcontrol, $newfloodcontrol_search, $newmaxuploadsize, $newuploadextensions, $newlanguage, $newurl_rewriting, $newtimezone, $newencoding, $newdefaultstyle, $newexpire, $newdebug, $newhash, $newseveralaccountspermail, $newmaintainancemode, $newfspath, $newwebpath, $newpolls; 35 35 // define location and title parameter 36 36 $this->title = ''; … … 70 70 fwrite($file, "\$SETTINGS['guestemail'] = " . $newguestemail . "; // show e-mail address field on post form for guests (1) or not (0)\n"); 71 71 fwrite($file, "\$SETTINGS['severalaccountspermail'] = " . $newseveralaccountspermail . "; // allow registering more than one account per e-mail address (1/0)\n"); 72 fwrite($file, "\$SETTINGS['polls'] = " . $newpolls . "; // polls on (1) or off (0)\n"); 72 73 fwrite($file, "\$SETTINGS['floodcontrol'] = " . $newfloodcontrol . "; // number of seconds someone has to wait between two posts\n"); 73 74 fwrite($file, "\$SETTINGS['floodcontrol_search'] = " . $newfloodcontrol_search . "; // number of seconds someone has to wait between two searches\n"); … … 187 188 $_col2 .= ' />' . $LANG['No'] . '</td>'; 188 189 $form->addRawTableRow(Array($LANG['Several_account_per_mail'], $_col2)); 190 $_col2 = '<td><input type="radio" name="newpolls" value="1"'; 191 if ($SETTINGS['polls'] == 1) { 192 $_col2 .= ' checked="checked"'; 193 } 194 $_col2 .= ' />' . $LANG['Yes'] . '<br /><input type="radio" name="newpolls" value="0"'; 195 if ($SETTINGS['polls'] == 0) { 196 $_col2 .= ' checked="checked"'; 197 } 198 $_col2 .= ' />' . $LANG['No'] . '</td>'; 199 $form->addRawTableRow(Array($LANG['Polls'], $_col2)); 189 200 $form->addTableRow($LANG['Flood_Control'], 'text', 'newfloodcontrol', $SETTINGS['floodcontrol']); 190 201 $form->addTableRow($LANG['Flood_Control_search'], 'text', 'newfloodcontrol_search', $SETTINGS['floodcontrol_search']); trunk/classes/misc/Member.php
r4 r8 596 596 // done 597 597 return $_permit; 598 } elseif ($page == 'Reply' || $page == 'Newtopic' || 599 $page == 'Newpoll') { 600 if ($page == 'Reply') { 601 // $id is given as topic id, but forum id is required 602 $q2 = $C->prepare('SELECT forum FROM ' . $SETTINGS['dbtableprefix'] . 'topics WHERE topicid=:id'); 603 $q2->bindParam(':id', $id, PDO::PARAM_INT, 12); 604 $q2->execute(); 605 $row = $q2->fetchObject(); 606 $id = $row->forum; 607 } 598 } elseif ($page == 'Reply' || $page == 'Newtopic' || $page == 'Newpoll') { 608 599 // check for each of the user's groups 609 600 foreach ($_groups as $key=>$val) { trunk/classes/pages/Newtopic.php
r1 r8 31 31 **/ 32 32 public function __construct() { 33 global $LANG, $F, $C ;33 global $LANG, $F, $C, $SETTINGS; 34 34 global $id, $forum, $commit; 35 35 // define title and location trunk/classes/pages/Page.php
r1 r8 60 60 } 61 61 } 62 // initialize XHTML document and add basic common structure 63 $this->html = new XMLElement('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></html>'); 64 // head 65 $this->html->addChild('head'); 66 $_css = $this->html->head->addChild('link'); 67 $_css->addAttribute('rel', 'stylesheet'); 68 $_css->addAttribute('type', 'text/css'); 69 // user set style or default 70 $_style = $SETTINGS['defaultstyle']; 71 if ($_SESSION['boardstyle'] != '') { 72 $_style = $_SESSION['boardstyle']; 73 } 74 $_css->addAttribute('href', $_pref . 'includes/styles/' . $_style); 75 // JavaScript functions 76 $_js = $this->html->head->addChild('script'); 77 $_js->addAttribute('src', $_pref . 'includes/js/js.js'); 78 $_js->addAttribute('type', 'text/javascript'); 79 if ($this->index === 1) { 80 // page should be indexed 81 $_meta = $this->html->head->addChild('meta'); 82 $_meta->addAttribute('name', 'robots'); 83 $_meta->addAttribute('content', 'index,follow'); 84 } else { 85 // page should not be indexed 86 $_meta = $this->html->head->addChild('meta'); 87 $_meta->addAttribute('name', 'robots'); 88 $_meta->addAttribute('content', 'noindex,nofollow'); 89 } 90 // body 91 $this->html->addChild('body'); 62 // code to handle page start routine 63 require($_pref . 'includes/page_start.php'); 64 $this->html = $html; 92 65 // include code from header file (works only for self-contained, well-formed XML) 93 66 $_h = file_get_contents($_pref . 'includes/wrappers/header.xml'); … … 411 384 } 412 385 } 413 /* figure out which MIME type to send the document with; 414 * depending on browser capabilities */ 415 // set text/html as default (for deprecated legacy browsers) 416 $mime = 'text/html'; 417 if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) { 418 if (preg_match('/application\/xhtml\+xml;q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 419 // priority of XHTML 420 $xhtml_q = $matches[1]; 421 if (preg_match('/text\/html;q=q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 422 // priority of HTML 423 $html_q = $matches[1]; 424 if ((float)$xhtml_q >= (float)$html_q) { 425 /* browser prefers XHTML over HTML, so send the document as such; 426 * this guarantees faster and more reliable rendering */ 427 $mime = 'application/xhtml+xml'; 428 } 429 } 430 } else { 431 /* browser accepts XHTML, but script can't figure out which one it prefers; 432 * send as XHTML */ 433 $mime = 'application/xhtml+xml'; 434 } 435 } 436 // start output with the document headers 437 // header('Content-Type: '.$mime.'; charset=utf-8'); 438 // header('Content-Type: application/xhtml+xml; charset=utf-8'); 439 header('Content-Type: text/html; charset=utf-8'); 440 // send a few headers to prevent client-side caching 441 header('Pragma: no-cache'); 442 header('Cache-Control: no-cache, must-revalidate'); 443 header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 444 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 445 // send document to client 446 print(str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $this->html->asXML())); 386 // page output routine 387 $html = $this->html; 388 require($_pref . 'includes/page_out.php'); 447 389 } /* function out */ 448 390 trunk/includes/config/settings.tmpl
r3 r8 28 28 $SETTINGS['guestemail'] = 0; // show e-mail address field on post form for guests (1) or not (0) 29 29 $SETTINGS['severalaccountspermail'] = 0; // allow registering more than one account per e-mail address (1/0) 30 $SETTINGS['polls'] = 1; // polls on (1) or off (0) 30 31 $SETTINGS['floodcontrol'] = 30; // number of seconds someone has to wait between two posts 31 32 $SETTINGS['floodcontrol_search'] = 30; // number of seconds someone has to wait between two searches trunk/includes/input.php
r3 r8 541 541 $newfspath = $_POST['newfspath']; 542 542 if (preg_match('/^[A-Za-z0-9_\-\/\\:\.]*$/', $newfspath) != 1) { 543 //die($LANG['error_input']);543 die($LANG['error_input']); 544 544 } 545 545 546 546 $newwebpath = $_POST['newwebpath']; 547 547 if (preg_match('/^[A-Za-z0-9_\-\/\.]*$/', $newwebpath) != 1) { 548 // die($LANG['error_input']); 548 die($LANG['error_input']); 549 } 550 551 $newpolls = $_POST['newpolls']; 552 if (preg_match('/^[0-1]?$/', $newpolls) != 1) { 553 die($LANG['error_input']); 549 554 } 550 555 trunk/includes/lang/en.php
r7 r8 183 183 $LANG['Registration'] = 'Registration'; 184 184 $LANG['Suggestion'] = 'Suggestion'; 185 $LANG['Polls'] = 'Polls'; 185 186 186 187 /* multi-word statements */ trunk/redirectors/pollvote.php
r1 r8 48 48 require('../includes/input.php'); 49 49 50 // start constructing the HTML output 51 $html = new XMLElement('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></html>'); 52 $html->addChild('head'); 53 // title 54 $html->head->addChild('title', $SETTINGS['forumname']); 55 // stylesheet 56 $_css = $html->head->addChild('link'); 57 $_css->addAttribute('rel', 'stylesheet'); 58 $_css->addAttribute('type', 'text/css'); 59 // user set style or default 60 $_style = $SETTINGS['defaultstyle']; 61 if ($_SESSION['boardstyle'] != '') { 62 $_style = $_SESSION['boardstyle']; 63 } 64 $_css->addAttribute('href', '../includes/styles/' . $_style); 65 // tell spiders not to index this 66 $_meta = $html->head->addChild('meta'); 67 $_meta->addAttribute('name', 'robots'); 68 $_meta->addAttribute('content', 'noindex,nofollow'); 69 // body 70 $html->addChild('body'); 50 // page start 51 $_pref = '../'; 52 require('../includes/page_start.php'); 71 53 72 54 switch ($showresults) { … … 186 168 } 187 169 188 /* figure out which MIME type to send the document with (depending on browser capabilities) 189 * set text/html as default (for deprecated legacy browsers) */ 190 $mime = 'text/html'; 191 if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) { 192 if (preg_match('/application\/xhtml\+xml;q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 193 // priority of XHTML 194 $xhtml_q = $matches[1]; 195 if (preg_match('/text\/html;q=q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 196 // priority of HTML 197 $html_q = $matches[1]; 198 if ((float)$xhtml_q >= (float)$html_q) { 199 // browser prefers XHTML over HTML, so send the document as such; this guarantees faster and more reliable rendering 200 $mime = 'application/xhtml+xml'; 201 } 202 } 203 } else { 204 // browser accepts XHTML, but script can't figure out which one it prefers; send as XHTML 205 $mime = 'application/xhtml+xml'; 206 } 207 } 208 // start output with the document headers 209 // header('Content-Type: '.$mime.'; charset=utf-8'); 210 // header('Content-Type: application/xhtml+xml; charset=utf-8'); 211 header('Content-Type: text/html; charset=utf-8'); 212 // send a few headers to prevent client-side caching 213 header('Pragma: no-cache'); 214 header('Cache-Control: no-cache, must-revalidate'); 215 header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 216 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 217 // send document to client 218 print(str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $html->asXML())); 170 // page output 171 require('../includes/page_out.php'); 219 172 220 173 ?> trunk/redirectors/postinghelp.php
r1 r8 48 48 require('../includes/input.php'); 49 49 50 // start constructing the HTML output 51 $html = new XMLElement('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></html>'); 52 $html->addChild('head'); 53 // title 54 $html->head->addChild('title', $SETTINGS['forumname']); 55 // stylesheet 56 $_css = $html->head->addChild('link'); 57 $_css->addAttribute('rel', 'stylesheet'); 58 $_css->addAttribute('type', 'text/css'); 59 // user set style or default 60 $_style = $SETTINGS['defaultstyle']; 61 if ($_SESSION['boardstyle'] != '') { 62 $_style = $_SESSION['boardstyle']; 63 } 64 $_css->addAttribute('href', '../includes/styles/' . $_style); 65 // tell spiders not to index this 66 $_meta = $html->head->addChild('meta'); 67 $_meta->addAttribute('name', 'robots'); 68 $_meta->addAttribute('content', 'noindex,nofollow'); 69 // body 70 $html->addChild('body'); 50 // page start 51 $_pref = '../'; 52 require('../includes/page_start.php'); 71 53 72 54 // check if user has permission; required: read; independent from id … … 140 122 } 141 123 142 /* figure out which MIME type to send the document with (depending on browser capabilities) 143 * set text/html as default (for deprecated legacy browsers) */ 144 $mime = 'text/html'; 145 if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) { 146 if (preg_match('/application\/xhtml\+xml;q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 147 // priority of XHTML 148 $xhtml_q = $matches[1]; 149 if (preg_match('/text\/html;q=q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 150 // priority of HTML 151 $html_q = $matches[1]; 152 if ((float)$xhtml_q >= (float)$html_q) { 153 // browser prefers XHTML over HTML, so send the document as such; this guarantees faster and more reliable rendering 154 $mime = 'application/xhtml+xml'; 155 } 156 } 157 } else { 158 // browser accepts XHTML, but script can't figure out which one it prefers; send as XHTML 159 $mime = 'application/xhtml+xml'; 160 } 161 } 162 // start output with the document headers 163 // header('Content-Type: '.$mime.'; charset=utf-8'); 164 // header('Content-Type: application/xhtml+xml; charset=utf-8'); 165 header('Content-Type: text/html; charset=utf-8'); 166 // send a few headers to prevent client-side caching 167 header('Pragma: no-cache'); 168 header('Cache-Control: no-cache, must-revalidate'); 169 header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 170 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 171 // send document to client 172 print(str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $html->asXML())); 124 // page output 125 require('../includes/page_out.php'); 173 126 174 127 ?> trunk/redirectors/preview.php
r1 r8 48 48 require('../includes/input.php'); 49 49 50 // start constructing the HTML output 51 $html = new XMLElement('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></html>'); 52 $html->addChild('head'); 53 // title 54 $html->head->addChild('title', $SETTINGS['forumname']); 55 // stylesheet 56 $_css = $html->head->addChild('link'); 57 $_css->addAttribute('rel', 'stylesheet'); 58 $_css->addAttribute('type', 'text/css'); 59 // user set style or default 60 $_style = $SETTINGS['defaultstyle']; 61 if ($_SESSION['boardstyle'] != '') { 62 $_style = $_SESSION['boardstyle']; 63 } 64 $_css->addAttribute('href', '../includes/styles/'.$_style); 65 // tell spiders not to index this 66 $_meta = $html->head->addChild('meta'); 67 $_meta->addAttribute('name', 'robots'); 68 $_meta->addAttribute('content', 'noindex,nofollow'); 69 // body 70 $html->addChild('body'); 50 // page start 51 $_pref = '../'; 52 require('../includes/page_start.php'); 71 53 72 54 // check if user has permission; required: read; independent from id … … 118 100 } 119 101 120 /* figure out which MIME type to send the document with (depending on browser capabilities) 121 * set text/html as default (for deprecated legacy browsers) */ 122 $mime = 'text/html'; 123 if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) { 124 if (preg_match('/application\/xhtml\+xml;q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 125 // priority of XHTML 126 $xhtml_q = $matches[1]; 127 if (preg_match('/text\/html;q=q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 128 // priority of HTML 129 $html_q = $matches[1]; 130 if((float)$xhtml_q >= (float)$html_q) { 131 // browser prefers XHTML over HTML, so send the document as such; this guarantees faster and more reliable rendering 132 $mime = 'application/xhtml+xml'; 133 } 134 } 135 } else { 136 // browser accepts XHTML, but script can't figure out which one it prefers; send as XHTML 137 $mime = 'application/xhtml+xml'; 138 } 139 } 140 // start output with the document headers 141 // header('Content-Type: '.$mime.'; charset=utf-8'); 142 // header('Content-Type: application/xhtml+xml; charset=utf-8'); 143 header('Content-Type: text/html; charset=utf-8'); 144 // send a few headers to prevent client-side caching 145 header('Pragma: no-cache'); 146 header('Cache-Control: no-cache, must-revalidate'); 147 header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 148 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 149 // send document to client 150 print(str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $html->asXML())); 102 // page output 103 require('../includes/page_out.php'); 151 104 152 105 ?> trunk/redirectors/showip.php
r7 r8 48 48 require('../includes/input.php'); 49 49 50 // start constructing the HTML output 51 $html = new XMLElement('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></html>'); 52 $html->addChild('head'); 53 // title 54 $html->head->addChild('title', $SETTINGS['forumname']); 55 // stylesheet 56 $_css = $html->head->addChild('link'); 57 $_css->addAttribute('rel', 'stylesheet'); 58 $_css->addAttribute('type', 'text/css'); 59 // user set style or default 60 $_style = $SETTINGS['defaultstyle']; 61 if ($_SESSION['boardstyle'] != '') { 62 $_style = $_SESSION['boardstyle']; 63 } 64 $_css->addAttribute('href', '../includes/styles/' . $_style); 65 // tell spiders not to index this 66 $_meta = $html->head->addChild('meta'); 67 $_meta->addAttribute('name', 'robots'); 68 $_meta->addAttribute('content', 'noindex,nofollow'); 69 // body 70 $html->addChild('body'); 50 // page start 51 $_pref = '../'; 52 require('../includes/page_start.php'); 71 53 72 54 // check if user has permission; required: read; dependent on id … … 111 93 } 112 94 } 113 // start output with the document headers 114 // header('Content-Type: '.$mime.'; charset=utf-8'); 115 // header('Content-Type: application/xhtml+xml; charset=utf-8'); 116 header('Content-Type: text/html; charset=utf-8'); 117 // send a few headers to prevent client-side caching 118 header('Pragma: no-cache'); 119 header('Cache-Control: no-cache, must-revalidate'); 120 header('Expires: ' . gmdate('D, d M Y H:i:s').' GMT'); 121 header('Last-Modified: ' . gmdate('D, d M Y H:i:s').' GMT'); 122 // send document to client 123 print(str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $html->asXML())); 95 96 // page output 97 require('../includes/page_out.php'); 124 98 125 99 ?> trunk/redirectors/uploadavatar.php
r7 r8 48 48 require('../includes/input.php'); 49 49 50 // start constructing the HTML output 51 $html = new XMLElement('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></html>'); 52 $html->addChild('head'); 53 // title 54 $html->head->addChild('title', $SETTINGS['forumname']); 55 // stylesheet 56 $_css = $html->head->addChild('link'); 57 $_css->addAttribute('rel', 'stylesheet'); 58 $_css->addAttribute('type', 'text/css'); 59 // user set style or default 60 $_style = $SETTINGS['defaultstyle']; 61 if ($_SESSION['boardstyle'] != '') { 62 $_style = $_SESSION['boardstyle']; 63 } 64 $_css->addAttribute('href', '../includes/styles/'.$_style); 65 // tell spiders not to index this 66 $_meta = $html->head->addChild('meta'); 67 $_meta->addAttribute('name', 'robots'); 68 $_meta->addAttribute('content', 'noindex,nofollow'); 69 // body 70 $html->addChild('body'); 50 // page start 51 $_pref = '../'; 52 require('../includes/page_start.php'); 71 53 72 54 if (isset($commit) && $commit == 'y') { … … 168 150 $a->addAttribute('href', 'javascript:self.close()'); 169 151 170 /* figure out which MIME type to send the document with (depending on browser capabilities) 171 * set text/html as default (for deprecated legacy browsers) */ 172 $mime = 'text/html'; 173 if(stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) { 174 if(preg_match('/application\/xhtml\+xml;q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 175 // priority of XHTML 176 $xhtml_q = $matches[1]; 177 if(preg_match('/text\/html;q=q=([01]|0\.\d{1,3}|1\.0)/i', $_SERVER['HTTP_ACCEPT'], $matches)) { 178 // priority of HTML 179 $html_q = $matches[1]; 180 if((float)$xhtml_q >= (float)$html_q) { 181 // browser prefers XHTML over HTML, so send the document as such; this guarantees faster and more reliable rendering 182 $mime = 'application/xhtml+xml'; 183 } 184 } 185 } else { 186 // browser accepts XHTML, but script can't figure out which one it prefers; send as XHTML 187 $mime = 'application/xhtml+xml'; 188 } 189 } 190 // start output with the document headers 191 // header('Content-Type: '.$mime.'; charset=utf-8'); 192 // header('Content-Type: application/xhtml+xml; charset=utf-8'); 193 header('Content-Type: text/html; charset=utf-8'); 194 // send a few headers to prevent client-side caching 195 header('Pragma: no-cache'); 196 header('Cache-Control: no-cache, must-revalidate'); 197 header('Expires: ' . gmdate('D, d M Y H:i:s').' GMT'); 198 header('Last-Modified: ' . gmdate('D, d M Y H:i:s').' GMT'); 199 // send document to client 200 print(str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $html->asXML())); 152 // page output 153 require('../includes/page_out.php'); 201 154 202 155 ?>
