Changeset 8

Show
Ignore:
Timestamp:
2007-11-21 16:09:54 (5 years ago)
Author:
hannes
Message:
  • generic page_start and page_out routines (ticket #6)
  • fixed broken reply & new poll
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/admin/classes/pages/Settings.php

    r5 r8  
    3232    public function __construct() { 
    3333        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
    3535        // define location and title parameter 
    3636        $this->title = ''; 
     
    7070                    fwrite($file, "\$SETTINGS['guestemail'] = " . $newguestemail . "; // show e-mail address field on post form for guests (1) or not (0)\n"); 
    7171                    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"); 
    7273                    fwrite($file, "\$SETTINGS['floodcontrol'] = " . $newfloodcontrol . "; // number of seconds someone has to wait between two posts\n"); 
    7374                    fwrite($file, "\$SETTINGS['floodcontrol_search'] = " . $newfloodcontrol_search . "; // number of seconds someone has to wait between two searches\n"); 
     
    187188                $_col2 .= ' />' . $LANG['No'] . '</td>'; 
    188189                $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)); 
    189200                $form->addTableRow($LANG['Flood_Control'], 'text', 'newfloodcontrol', $SETTINGS['floodcontrol']); 
    190201                $form->addTableRow($LANG['Flood_Control_search'], 'text', 'newfloodcontrol_search', $SETTINGS['floodcontrol_search']); 
  • trunk/classes/misc/Member.php

    r4 r8  
    596596                // done 
    597597                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') { 
    608599                // check for each of the user's groups 
    609600                foreach ($_groups as $key=>$val) { 
  • trunk/classes/pages/Newtopic.php

    r1 r8  
    3131     **/ 
    3232    public function __construct() { 
    33         global $LANG, $F, $C
     33        global $LANG, $F, $C, $SETTINGS
    3434        global $id, $forum, $commit; 
    3535        // define title and location 
  • trunk/classes/pages/Page.php

    r1 r8  
    6060            } 
    6161        } 
    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; 
    9265        // include code from header file (works only for self-contained, well-formed XML) 
    9366        $_h = file_get_contents($_pref . 'includes/wrappers/header.xml'); 
     
    411384            } 
    412385        } 
    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('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $this->html->asXML())); 
     386        // page output routine 
     387        $html = $this->html; 
     388        require($_pref . 'includes/page_out.php'); 
    447389    } /* function out */ 
    448390 
  • trunk/includes/config/settings.tmpl

    r3 r8  
    2828$SETTINGS['guestemail'] = 0; // show e-mail address field on post form for guests (1) or not (0) 
    2929$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) 
    3031$SETTINGS['floodcontrol'] = 30; // number of seconds someone has to wait between two posts 
    3132$SETTINGS['floodcontrol_search'] = 30; // number of seconds someone has to wait between two searches 
  • trunk/includes/input.php

    r3 r8  
    541541$newfspath = $_POST['newfspath']; 
    542542if (preg_match('/^[A-Za-z0-9_\-\/\\:\.]*$/', $newfspath) != 1) { 
    543     // die($LANG['error_input']); 
     543    die($LANG['error_input']); 
    544544} 
    545545 
    546546$newwebpath = $_POST['newwebpath']; 
    547547if (preg_match('/^[A-Za-z0-9_\-\/\.]*$/', $newwebpath) != 1) { 
    548     // die($LANG['error_input']); 
     548    die($LANG['error_input']); 
     549
     550 
     551$newpolls = $_POST['newpolls']; 
     552if (preg_match('/^[0-1]?$/', $newpolls) != 1) { 
     553    die($LANG['error_input']); 
    549554} 
    550555 
  • trunk/includes/lang/en.php

    r7 r8  
    183183$LANG['Registration'] = 'Registration'; 
    184184$LANG['Suggestion'] = 'Suggestion'; 
     185$LANG['Polls'] = 'Polls'; 
    185186 
    186187/* multi-word statements */ 
  • trunk/redirectors/pollvote.php

    r1 r8  
    4848require('../includes/input.php'); 
    4949 
    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 = '../'; 
     52require('../includes/page_start.php'); 
    7153 
    7254switch ($showresults) { 
     
    186168} 
    187169 
    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('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML())); 
     170// page output 
     171require('../includes/page_out.php'); 
    219172 
    220173?> 
  • trunk/redirectors/postinghelp.php

    r1 r8  
    4848require('../includes/input.php'); 
    4949 
    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 = '../'; 
     52require('../includes/page_start.php'); 
    7153 
    7254// check if user has permission; required: read; independent from id 
     
    140122} 
    141123 
    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('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML())); 
     124// page output 
     125require('../includes/page_out.php'); 
    173126 
    174127?> 
  • trunk/redirectors/preview.php

    r1 r8  
    4848require('../includes/input.php'); 
    4949 
    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 = '../'; 
     52require('../includes/page_start.php'); 
    7153 
    7254// check if user has permission; required: read; independent from id 
     
    118100} 
    119101 
    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('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML())); 
     102// page output 
     103require('../includes/page_out.php'); 
    151104 
    152105?> 
  • trunk/redirectors/showip.php

    r7 r8  
    4848require('../includes/input.php'); 
    4949 
    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 = '../'; 
     52require('../includes/page_start.php'); 
    7153 
    7254// check if user has permission; required: read; dependent on id 
     
    11193    } 
    11294} 
    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('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML())); 
     95 
     96// page output 
     97require('../includes/page_out.php'); 
    12498 
    12599?> 
  • trunk/redirectors/uploadavatar.php

    r7 r8  
    4848require('../includes/input.php'); 
    4949 
    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 = '../'; 
     52require('../includes/page_start.php'); 
    7153 
    7254if (isset($commit) && $commit == 'y') { 
     
    168150$a->addAttribute('href', 'javascript:self.close()'); 
    169151 
    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('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML())); 
     152// page output 
     153require('../includes/page_out.php'); 
    201154 
    202155?>