Changeset 120

Show
Ignore:
Timestamp:
2008-01-07 16:50:34 (1 year ago)
Author:
hannes
Message:

merging changesets [98] to [119] from trunk; creating RC5

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/5.0/admin/classes/pages/Editmember.php

    r93 r120  
    405405                            @closedir($handle); 
    406406                        } 
    407                         $_col1 .= '</select><br /><a href="javascript:void();" onclick="window.open(\'../redirectors/uploadavatar.php?s=' . session_id() . '\', \'uploadwindow\', \'width=350, height=200\');">' . $LANG['Upload_Avatar'] . '</a></td>'; 
     407                        $_col1 .= '</select><br /><a href="javascript:void(0);" onclick="window.open(\'../redirectors/uploadavatar.php?s=' . session_id() . '\', \'uploadwindow\', \'width=350, height=200\');">' . $LANG['Upload_Avatar'] . '</a></td>'; 
    408408                        $_col2 = '<td>'; 
    409409                        /* it shouldn't really occur that the avatar is an empty string, 
  • branches/5.0/classes/misc/Authcode.php

    r93 r120  
    4343        // remove auth code from session since it's no longer needed 
    4444        unset($_SESSION['pw']); 
     45        unset($_SESSION['pw_page']); 
    4546    } /* function destroy */ 
    4647 
     
    5960        // put into session 
    6061        $_SESSION['pw'] = $p->get(); 
     62        // remember number of page this was written 
     63        $_SESSION['pw_page'] = $_SESSION['pages']; 
    6164    } /* function generate */ 
    6265 
  • branches/5.0/classes/misc/Format.php

    r71 r120  
    7979    public function post($str, $simple = FALSE) { 
    8080        // language 
    81         global $LANG
     81        global $LANG, $F
    8282        /* debugging messages; 
    8383         * printed out directly on the screen, so incompatible with general board structure; 
     
    8585        $DEBUG = FALSE; 
    8686        // board code 
    87         $tags_open = Array('[b]', '[i]', '[u]', '[s]', '[color=', '[size=', '[font=', '[align=', '[quote]', '[code]', '[img]', '[url]', '[url=', '[email]', '[email='); 
     87        $tags_open = Array('[b]', '[i]', '[u]', '[s]', '[color=', '[size=', '[font=', '[align=', '[quote]', '[quote=', '[code]', '[img]', '[url]', '[url=', '[email]', '[email='); 
    8888        // closing tags in the SAME order 
    89         $tags_close = Array('[/b]', '[/i]', '[/u]', '[/s]', '[/color]', '[/size]', '[/font]', '[/align]', '[/quote]', '[/code]', '[/img]', '[/url]', '[/url]', '[/email]', '[/email]'); 
     89        $tags_close = Array('[/b]', '[/i]', '[/u]', '[/s]', '[/color]', '[/size]', '[/font]', '[/align]', '[/quote]', '[/quote]', '[/code]', '[/img]', '[/url]', '[/url]', '[/email]', '[/email]'); 
    9090        /* HTML code: 
    9191         * In both the opening and closing tag definition, you can use %% as placeholder. Occurences of this string will be replaced with the attribute given in the board tag (e.g. [url=blah] -> attribute is 'blah'; there are some special cases which are handled individually in the switch statement). 
    9292         * The string contained between opening and closing board tag will automatically appear between opening and closing HTML part anyway. Note that I wrote 'HTML part', not 'tag', since in some cases (e.g. images), the latter doesn't apply. If you're planning to add more code tags, just look at the existing ones and you should understand the different ways to use those definitions to the best effect... */ 
    93         $tags_open_html = Array('<b>', '<i>', '<u>', '<s>', '<span style="color:%%">', '<span style="font-size:%%px">', '<span style="font-family:%%">', '<div align="%%">', '<div class="quote1">' . $LANG['Quote'] . ':</div><div class="quote">', '<div class="code1">' . $LANG['Code'] . ':</div><pre class="code">', '<img src="', '<a target="_blank" href="', '<a target="_blank" href="%%">', '<a href="mailto:', '<a href="mailto:%%">'); 
    94         $tags_close_html = Array('</b>', '</i>', '</u>', '</s>', '</span>', '</span>', '</span>', '</div>', '</div>', '</pre>', '" %% alt="' . $LANG['Image'] . '" />', '">%%</a>', '</a>', '">%%</a>', '</a>'); 
     93        $tags_open_html = Array('<b>', '<i>', '<u>', '<s>', '<span style="color:%%">', '<span style="font-size:%%px">', '<span style="font-family:%%">', '<div align="%%">', '<div class="quote1">' . $LANG['Quote'] . ':</div><div class="quote">', '<div class="quote1">%%:</div><div class="quote">', '<div class="code1">' . $LANG['Code'] . ':</div><pre class="code">', '<img src="', '<a target="_blank" href="', '<a target="_blank" href="%%">', '<a href="mailto:', '<a href="mailto:%%">'); 
     94        $tags_close_html = Array('</b>', '</i>', '</u>', '</s>', '</span>', '</span>', '</span>', '</div>', '</div>', '</div>', '</pre>', '" %% alt="' . $LANG['Image'] . '" />', '">%%</a>', '</a>', '">%%</a>', '</a>'); 
    9595        // initialize string for comparison 
    9696        $str_prev = ''; 
     
    183183                            $_attr_close = $_cont; 
    184184                        break; 
     185                        case '[quote=': 
     186                            // get poster and date of post this quote comes from 
     187                            $p = new Post($_attr); 
     188                            $_attr = str_replace(Array('%poster%', '%date%'), Array($p->getPoster(), $F->datetime($p->getPosttime())), $LANG['quote_from']); 
     189                        break; 
    185190                        default: 
    186191                            // nothing to do for the rest of the tags 
  • branches/5.0/classes/misc/Member.php

    r93 r120  
    6464        // language 
    6565        global $LANG; 
    66         // database connection identifier 
    6766        if ($member === NULL) { 
    6867            // called with member id instead of username 
  • branches/5.0/classes/misc/Post.php

    r93 r120  
    4848    } /* constructor */ 
    4949 
     50    /* get poster */ 
     51    public function getPoster() { 
     52        return $this->post->poster; 
     53    } 
     54 
     55    /* get post time */ 
     56    public function getPosttime() { 
     57        return $this->post->posttime; 
     58    } 
     59 
    5060    /* function setPost - only used if constructor called without id (used in post preview) */ 
    5161    public function setPost($post) { 
     
    7181        $_showip = ''; 
    7282        if ($SETTINGS['ip_logging'] == 1) { 
    73             $_showip = '<a href="javascript:void(0);" ' . "onclick=\"window.open('redirectors/showip.php?id=" . $id . "', 'ipwindow', 'width=200, height=150, scrollbars=yes');\">" . $LANG['IP'] . '</a> | '; 
     83            $_showip = '<a href="javascript:void(0);" ' . "onclick=\"window.open('redirectors/showip.php?id=" . $this->id . "', 'ipwindow', 'width=200, height=150, scrollbars=yes');\">" . $LANG['IP'] . '</a> | '; 
    7484        } 
    7585        // post header (time of post etc.) 
    7686        $table->addRow(Array('<td colspan="2" class="postheader">' . $LANG['Posted'] . ' ' . $F->datetime($this->post->posttime) . ' | <a href="' . $F->link('reply') . 'id=' . $id . '&amp;quote=' . $this->id . '">' . $LANG['Quote'] . '</a> | ' . $_showip . '<a href="' . $F->link('edit') . 'id=' . $this->id . '">' . $LANG['Edit'] . '</a> | <a href="' . $F->link('delete') . 'id=' . $this->id . '">' . $LANG['Delete'] . '</a> ' . $_split . '</td>')); 
    7787        // get member info 
    78         $_member = new Member($this->post->poster, $this->post->postedbymember); 
     88        if ($this->post->postedbymember == 0) { 
     89            $_member = new Member($this->post->poster, $this->post->postedbymember); 
     90        } else { 
     91            $_member = new Member($this->post->postedbymember); 
     92        } 
    7993        // assemble parts of post 
    8094        $_post = '<div>' . $F->post($this->post->post) . '</div>'; 
     
    92106        } 
    93107        // add this post 
    94         $table->addRow(Array('<td valign="top" width="' . ($SETTINGS['maxavatarsize'] + 10) . '">' . $_member->getPostside() . '</td>', '<td valign="top">' . $_post . '</td>'), FALSE, TRUE); 
     108        $table->addRow(Array('<td valign="top" width="' . ($SETTINGS['maxavatarsize'] + 10) . '">' . $_member->getPostside() . '</td>', '<td valign="top">' . str_replace('&', '&amp;', $_post) . '</td>'), FALSE, TRUE); 
    95109        // post footer 
    96110        $table->addRow(Array(''), Array('colspan'=>'2', 'class'=>'postfooter')); 
     
    106120     **/ 
    107121    public function save($show_orig) { 
    108         global $C, $SETTINGS, $LANG; 
     122        global $C, $F, $SETTINGS, $LANG; 
    109123        // post data 
    110124        global $reply, $subject, $forum, $pollchoices, $user, $post, $password, $email, $subscribe; 
     
    257271                                    $email = $row->memberemail; 
    258272                                    // set flag for 'registered member' 
    259                                     $postedbymember = 1
     273                                    $postedbymember = $row->memberid
    260274                                    // always use the membername exactly as it appears in the database 
    261275                                    $user = $row->membername; 
     
    380394                            $q = $C->prepare('INSERT INTO ' . $SETTINGS['dbtableprefix'] . 'posts (topic, post, poster, posteremail, posttime, ip, attachment, postedbymember) VALUES (:reply, :post, :user, :email, :ts, :ip, :attachment, :member)'); 
    381395                            $q->bindParam(':reply', $reply, PDO::PARAM_INT, 12); 
    382                             $q->bindParam(':post', $post, PDO::PARAM_STR); 
    383                             $q->bindParam(':user', $user, PDO::PARAM_STR); 
     396                            $q->bindParam(':post', $F->htmlentities($post, TRUE), PDO::PARAM_STR); 
     397                            $q->bindParam(':user', $F->htmlentities($user, TRUE), PDO::PARAM_STR); 
    384398                            $q->bindParam(':email', $email, PDO::PARAM_STR); 
    385399                            // current time in UTC 
  • branches/5.0/classes/misc/Postform.php

    r71 r120  
    4242    public function __construct($show_orig, $page = FALSE, $id = FALSE, $subject = FALSE, $quote = '', $subscribed = FALSE) { 
    4343        global $SETTINGS, $F, $C, $LANG; 
     44        // define replacements 
     45        $_rep = Array( 
     46            '&amp;'=>'&', 
     47            '&lt;'=>'<', 
     48            '&gt;'=>'>', 
     49            "&apos;"=>"'", 
     50            '&quot;'=>'"' 
     51        ); 
     52        // remove special characters from quote 
     53        $quote = strtr($quote, $_rep); 
    4454        // form object 
    4555        $this->form = new Form($F->link($show_orig).'commit=y', 'postform', 'multipart/form-data'); 
    46         // max. upload size 
    47         if ($show_orig !== 'messenger' && $show_orig !== 'edit' && $show_orig !== 'mail' && $SETTINGS['maxuploadsize'] > 0) { 
    48             $this->form->addInput('hidden', 'MAX_FILE_SIZE', $SETTINGS['maxuploadsize']); 
    49         } 
    5056        // reply to which topic? 
    5157        if ($show_orig === 'reply') { 
  • branches/5.0/classes/pages/Category.php

    r71 r120  
    100100                        if (isset($row5->topicid) && $row5->topicid != '' && $row5->topicid > 0) { 
    101101                        // get poster information 
    102                         $_poster = new Member($row5->poster, $row5->postedbymember); 
     102                        if ($row5->postedbymember == 0) { 
     103                            $_poster = new Member($row5->poster, $row5->postedbymember); 
     104                        } else { 
     105                            $_poster = new Member($row5->postedbymember); 
     106                        } 
    103107                        $_col4 = '<div>' . $LANG['by'] . ' ' . $_poster->getProfileLink() . '</div><div>' . $LANG['in'] . ' <a href="' . $F->link('topic') . 'id=' . $row5->topicid . '">' . $row5->topictitle . '</a></div><div>' . $F->datetime($row5->posttime) . '</div>'; 
    104108                    } 
  • branches/5.0/classes/pages/Forum.php

    r93 r120  
    108108                $q4 = NULL; 
    109109                // get first and last poster information 
    110                 $_poster1 = new Member($row3->poster, $row3->postedbymember); 
    111                 $_poster2 = new Member($row4->poster, $row4->postedbymember); 
     110                if ($row3->postedbymember == 0) { 
     111                    $_poster1 = new Member($row3->poster, $row3->postedbymember); 
     112                } else { 
     113                    $_poster1 = new Member($row3->postedbymember); 
     114                } 
     115                if ($row4->postedbymember == 0) { 
     116                    $_poster2 = new Member($row4->poster, $row4->postedbymember); 
     117                } else { 
     118                    $_poster2 = new Member($row4->postedbymember); 
     119                } 
    112120                // multiple pages for this topic? 
    113121                $topicpages = new Pagination($SETTINGS['postsperpage'], 1, $row2['posts']); 
     
    135143                } 
    136144                // add all the previously compiled topic information to table 
    137                 $table->addRow(Array($_mark, '<td><h3>' . $_prefix . '<a href="' . $F->link('topic') . 'id=' . $row2['topicid'] . '">' . htmlentities($row2['topictitle']) . '</a></h3>' . str_replace('&amp;', '&amp;amp;', $_multipages) . '</td>', '<td align="center">' . $row2['posts'] . '</td>', '<td align="center">' . $row2['views'] . '</td>', '<td><div>' . $LANG['by'] . ' ' . $_poster1->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row3->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row3->posttime, TRUE, FALSE) . '</div></td>', '<td><div>' . $LANG['by'] . ' ' . $_poster2->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row4->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row4->posttime, TRUE, FALSE) . '</div></td>'), FALSE, TRUE); 
     145                $table->addRow(Array($_mark, '<td><h3>' . $_prefix . '<a href="' . $F->link('topic') . 'id=' . $row2['topicid'] . '">' . htmlentities($row2['topictitle'], ENT_QUOTES, 'UTF-8') . '</a></h3>' . str_replace('&', '&amp;', $_multipages) . '</td>', '<td align="center">' . $row2['posts'] . '</td>', '<td align="center">' . $row2['views'] . '</td>', '<td><div>' . $LANG['by'] . ' ' . $_poster1->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row3->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row3->posttime, TRUE, FALSE) . '</div></td>', '<td><div>' . $LANG['by'] . ' ' . $_poster2->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row4->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row4->posttime, TRUE, FALSE) . '</div></td>'), FALSE, TRUE); 
    138146            } 
    139147            // add finished table to parent HTML element 
  • branches/5.0/classes/pages/Page.php

    r71 r120  
    5151        // get current timestamp (microseconds) for execution time 
    5252        $this->exec_time_start = microtime(TRUE); 
     53        // check if auth code in session is set 
     54        if (isset($_SESSION['pw']) && $_SESSION['pw'] != '') { 
     55            // check if it's still valid 
     56            if ($_SESSION['pages'] > $_SESSION['pw_page'] + 1) { 
     57                // has been set longer ago than the previous page -> remove 
     58                $auth = new Authcode(); 
     59                $auth->destroy(); 
     60                unset($auth); 
     61            } 
     62        } 
    5363        /* Have some kind of manual per-page login credentials been posted? 
    5464         * This shouldn't be checked on 'Userpanel' page, because there is a special handling of that there. */ 
     
    281291            $_today->modify($_offset); 
    282292            // get members with this month-day combination 
    283             $q = $C->prepare('SELECT memberid, membername, SUBSTR(birthday,0,4) AS year FROM ' . $SETTINGS['dbtableprefix'] . 'members WHERE SUBSTR(birthday,6,5) = :today'); 
     293            $q = $C->prepare('SELECT memberid, membername, SUBSTR(birthday,1,4) AS year FROM ' . $SETTINGS['dbtableprefix'] . 'members WHERE SUBSTR(birthday,6,5) = :today'); 
    284294            $q->bindParam(':today', $_today->format('m-d'), PDO::PARAM_STR, 5); 
    285295            $s = $q->execute(); 
  • branches/5.0/classes/pages/Reply.php

    r93 r120  
    7373                    $row4 = $q->fetchObject(); 
    7474                    $q = NULL; 
    75                     $_quote_text = '[quote]' . $F->htmlentities($row4->post, TRUE) . '[/quote]'; 
     75                    $_quote_text = '[quote=' . $quote . ']' . $F->htmlentities($row4->post, TRUE) . '[/quote]'; 
    7676                } 
    7777                // default: not previously subscribed 
  • branches/5.0/db/mysql.sql

    r33 r120  
    1 ALTER TABLE %prefix%categories MODIFY category_id INTEGER AUTO_INCREMENT; 
    2 ALTER TABLE %prefix%forums MODIFY forumid INTEGER AUTO_INCREMENT; 
    3 ALTER TABLE %prefix%messages MODIFY messageid INTEGER AUTO_INCREMENT; 
    4 ALTER TABLE %prefix%polls MODIFY pollid INTEGER AUTO_INCREMENT; 
    5 ALTER TABLE %prefix%posts MODIFY postid INTEGER AUTO_INCREMENT; 
    6 ALTER TABLE %prefix%topics MODIFY topicid INTEGER AUTO_INCREMENT; 
    7 ALTER TABLE %prefix%categories MODIFY category_id INTEGER AUTO_INCREMENT; 
    8 ALTER TABLE %prefix%usergroups MODIFY id INTEGER AUTO_INCREMENT; 
    9 ALTER TABLE %prefix%members MODIFY memberid INTEGER AUTO_INCREMENT; 
    10 ALTER TABLE %prefix%mails MODIFY id INTEGER AUTO_INCREMENT; 
     1CREATE TABLE %prefix%categories ( 
     2  category_id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 
     3  category_name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     4  category_order INTEGER NOT NULL 
     5) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     6 
     7CREATE TABLE %prefix%forums ( 
     8  forumid INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 
     9  forumtitle VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     10  forumdescription VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     11  forum_category INTEGER  NOT NULL, 
     12  forum_order INTEGER  NOT NULL 
     13) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     14 
     15CREATE TABLE %prefix%messages ( 
     16  messageid INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 
     17  messagesender INTEGER NOT NULL, 
     18  messagereceipient INTEGER NOT NULL, 
     19  messagetitle VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     20  message TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     21  messagesenderflag INTEGER NOT NULL, 
     22  messagereceipientflag INTEGER NOT NULL, 
     23  messagetime DATETIME NOT NULL 
     24) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     25 
     26CREATE TABLE %prefix%online ( 
     27  onlinememberid INTEGER NOT NULL, 
     28  onlinetime INTEGER NOT NULL, 
     29  onlinesession VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 
     30  onlineposted INTEGER NOT NULL DEFAULT 0 
     31) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     32 
     33CREATE TABLE %prefix%polls ( 
     34  pollid INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 
     35  pollchoices TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     36  pollvotes TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     37  pollvoters TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL 
     38) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     39 
     40CREATE TABLE %prefix%posts ( 
     41  postid INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 
     42  topic INTEGER NOT NULL, 
     43  posteremail VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     44  poster VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     45  post TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     46  ip VARCHAR(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 
     47  attachment VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 
     48  postedbymember INTEGER NOT NULL, 
     49  edited DATETIME DEFAULT NULL, 
     50  editedby VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, 
     51  posttime DATETIME NOT NULL 
     52) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     53 
     54CREATE TABLE %prefix%topics ( 
     55  topicid INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 
     56  forum INTEGER NOT NULL, 
     57  topictitle VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     58  closed INTEGER NOT NULL DEFAULT 0, 
     59  pinned INTEGER NOT NULL DEFAULT 0, 
     60  poll INTEGER NOT NULL DEFAULT 0, 
     61  topic_views INTEGER NOT NULL DEFAULT 0 
     62) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     63 
     64CREATE TABLE %prefix%groupmemberships ( 
     65    member INTEGER NOT NULL, 
     66    usergroup INTEGER NOT NULL 
     67) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     68 
     69CREATE TABLE %prefix%usergroups ( 
     70  id INTEGER PRIMARY KEY AUTO_INCREMENT, 
     71  name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     72  public INTEGER NOT NULL DEFAULT 0 
     73) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     74 
     75CREATE TABLE %prefix%members ( 
     76  memberid INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, 
     77  membername VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     78  memberemail VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     79  memberemailhidden INTEGER NOT NULL DEFAULT 0, 
     80  memberhomepage VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     81  memberavatar VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'images/spacer.gif', 
     82  memberpassword VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 
     83  memberstatus VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 
     84  memberposts INTEGER NOT NULL DEFAULT 0, 
     85  location VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     86  icq VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     87  aim VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     88  yahoo VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     89  msn VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     90  signature VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     91  lastvisit DATETIME NULL, 
     92  boardstyle VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     93  addressbook TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL, 
     94  birthday DATE DEFAULT NULL, 
     95  messagenotification_email INTEGER NOT NULL DEFAULT 0, 
     96  messagenotification_popup INTEGER NOT NULL DEFAULT 1, 
     97  registered DATETIME NOT NULL, 
     98  salt VARCHAR(16) CHARACTER SET utf8 COLLATE utf8_bin NULL, 
     99  lang VARCHAR(16) CHARACTER SET utf8 COLLATE utf8_bin NULL, 
     100  offset INTEGER NULL 
     101) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     102 
     103CREATE TABLE %prefix%mails ( 
     104  id INTEGER NOT NULL PRIMARY KEY, 
     105  receipient VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     106  subject VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 
     107  body TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL 
     108) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     109 
     110CREATE TABLE %prefix%moderators ( 
     111    forum INTEGER NOT NULL, 
     112    member INTEGER NOT NULL 
     113) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     114 
     115CREATE TABLE %prefix%subscriptions ( 
     116    topic INTEGER NOT NULL, 
     117    member INTEGER NOT NULL 
     118) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     119 
     120CREATE TABLE %prefix%rights ( 
     121    page VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 
     122    usergroup INTEGER NOT NULL, 
     123    r INTEGER NOT NULL, 
     124    w INTEGER NOT NULL, 
     125    PRIMARY KEY (page,usergroup) 
     126) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
     127 
     128CREATE TABLE %prefix%rights_default ( 
     129    page VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 
     130    usergroup INTEGER NOT NULL, 
     131    r INTEGER NOT NULL, 
     132    w INTEGER NOT NULL, 
     133    PRIMARY KEY (page,usergroup) 
     134) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 
    11135 
    12136CREATE INDEX idx_forums ON %prefix%forums (forum_category ASC); 
  • branches/5.0/db/sqlite.sql

    r33 r120  
     1CREATE TABLE %prefix%categories ( 
     2  category_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
     3  category_name VARCHAR(255) NOT NULL COLLATE NOCASE, 
     4  category_order INTEGER NOT NULL 
     5); 
     6 
     7CREATE TABLE %prefix%forums ( 
     8  forumid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
     9  forumtitle VARCHAR(255) NOT NULL COLLATE NOCASE, 
     10  forumdescription VARCHAR(255) NOT NULL COLLATE NOCASE, 
     11  forum_category INTEGER  NOT NULL, 
     12  forum_order INTEGER  NOT NULL 
     13); 
     14 
     15CREATE TABLE %prefix%messages ( 
     16  messageid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
     17  messagesender INTEGER NOT NULL, 
     18  messagereceipient INTEGER NOT NULL, 
     19  messagetitle VARCHAR(255) NOT NULL COLLATE NOCASE, 
     20  message TEXT NOT NULL COLLATE NOCASE, 
     21  messagesenderflag INTEGER NOT NULL, 
     22  messagereceipientflag INTEGER NOT NULL, 
     23  messagetime DATETIME NOT NULL 
     24); 
     25 
     26CREATE TABLE %prefix%online ( 
     27  onlinememberid INTEGER NOT NULL, 
     28  onlinetime INTEGER NOT NULL, 
     29  onlinesession VARCHAR(255) NOT NULL COLLATE BINARY, 
     30  onlineposted INTEGER NOT NULL DEFAULT 0 
     31); 
     32 
     33CREATE TABLE %prefix%polls ( 
     34  pollid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
     35  pollchoices TEXT NOT NULL COLLATE NOCASE, 
     36  pollvotes TEXT NOT NULL COLLATE NOCASE, 
     37  pollvoters TEXT NOT NULL COLLATE NOCASE 
     38); 
     39 
     40CREATE TABLE %prefix%posts ( 
     41  postid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
     42  topic INTEGER NOT NULL, 
     43  posteremail VARCHAR(255) NOT NULL COLLATE NOCASE, 
     44  poster VARCHAR(255) NOT NULL COLLATE NOCASE, 
     45  post TEXT NOT NULL COLLATE NOCASE, 
     46  ip VARCHAR(16) NOT NULL COLLATE BINARY, 
     47  attachment VARCHAR(255) NOT NULL COLLATE BINARY, 
     48  postedbymember INTEGER NOT NULL, 
     49  edited DATETIME DEFAULT NULL, 
     50  editedby VARCHAR(255) DEFAULT NULL COLLATE NOCASE, 
     51  posttime DATETIME NOT NULL 
     52); 
     53 
     54CREATE TABLE %prefix%topics ( 
     55  topicid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
     56  forum INTEGER NOT NULL, 
     57  topictitle VARCHAR(255) NOT NULL COLLATE NOCASE, 
     58  closed INTEGER NOT NULL DEFAULT 0, 
     59  pinned INTEGER NOT NULL DEFAULT 0, 
     60  poll INTEGER NOT NULL DEFAULT 0, 
     61  topic_views INTEGER NOT NULL DEFAULT 0 
     62); 
     63 
     64CREATE TABLE %prefix%groupmemberships ( 
     65    member INTEGER NOT NULL, 
     66    usergroup INTEGER NOT NULL 
     67); 
     68 
     69CREATE TABLE %prefix%usergroups ( 
     70  id INTEGER PRIMARY KEY AUTOINCREMENT, 
     71  name VARCHAR(255) NOT NULL COLLATE NOCASE, 
     72  public INTEGER NOT NULL DEFAULT 0 
     73); 
     74 
     75CREATE TABLE %prefix%members ( 
     76  memberid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
     77  membername VARCHAR(255) NOT NULL COLLATE NOCASE, 
     78  memberemail VARCHAR(255) NOT NULL COLLATE NOCASE, 
     79  memberemailhidden INTEGER NOT NULL DEFAULT 0, 
     80  memberhomepage VARCHAR(255) NULL COLLATE NOCASE, 
     81  memberavatar VARCHAR(255) NOT NULL DEFAULT 'images/spacer.gif', 
     82  memberpassword VARCHAR(255) NOT NULL COLLATE BINARY, 
     83  memberstatus VARCHAR(255) NOT NULL COLLATE NOCASE, 
     84  memberposts INTEGER NOT NULL DEFAULT 0, 
     85  location VARCHAR(255) NULL COLLATE NOCASE, 
     86  icq VARCHAR(255) NULL COLLATE NOCASE, 
     87  aim VARCHAR(255) NULL COLLATE NOCASE, 
     88  yahoo VARCHAR(255) NULL COLLATE NOCASE, 
     89  msn VARCHAR(255) NULL COLLATE NOCASE, 
     90  signature VARCHAR(255) NULL COLLATE NOCASE, 
     91  lastvisit DATETIME NULL, 
     92  boardstyle VARCHAR(32) NULL COLLATE BINARY, 
     93  addressbook TEXT NULL COLLATE NOCASE, 
     94  birthday DATE DEFAULT NULL, 
     95  messagenotification_email INTEGER NOT NULL DEFAULT 0, 
     96  messagenotification_popup INTEGER NOT NULL DEFAULT 1, 
     97  registered DATETIME NOT NULL, 
     98  salt VARCHAR(16) NULL COLLATE BINARY, 
     99  lang VARCHAR(16) NULL COLLATE BINARY, 
     100  offset INTEGER NULL 
     101); 
     102 
     103CREATE TABLE %prefix%mails ( 
     104  id INTEGER NOT NULL PRIMARY KEY, 
     105  receipient VARCHAR(255) NOT NULL COLLATE NOCASE, 
     106  subject VARCHAR(255) NOT NULL COLLATE NOCASE, 
     107  body TEXT NOT NULL COLLATE NOCASE 
     108); 
     109 
     110CREATE TABLE %prefix%moderators ( 
     111    forum INTEGER NOT NULL, 
     112    member INTEGER NOT NULL 
     113); 
     114 
     115CREATE TABLE %prefix%subscriptions ( 
     116    topic INTEGER NOT NULL, 
     117    member INTEGER NOT NULL 
     118); 
     119 
     120CREATE TABLE %prefix%rights ( 
     121    page VARCHAR(255) COLLATE BINARY NOT NULL, 
     122    usergroup INTEGER NOT NULL, 
     123    r INTEGER NOT NULL, 
     124    w INTEGER NOT NULL, 
     125    PRIMARY KEY (page,usergroup) 
     126); 
     127 
     128CREATE TABLE %prefix%rights_default ( 
     129    page VARCHAR(255) COLLATE BINARY NOT NULL, 
     130    usergroup INTEGER NOT NULL, 
     131    r INTEGER NOT NULL, 
     132    w INTEGER NOT NULL, 
     133    PRIMARY KEY (page,usergroup) 
     134); 
     135 
    1136CREATE INDEX idx_forums ON %prefix%forums (forum_category ASC); 
    2137CREATE INDEX idx_topics ON %prefix%topics (forum ASC); 
  • branches/5.0/includes/config/bots.php

    r93 r120  
    2727$BOTS[] = 'urllib'; 
    2828$BOTS[] = 'robozilla'; 
     29$BOTS[] = 'yandex'; 
     30$BOTS[] = 'charlotte'; 
    2931 
    3032?> 
  • branches/5.0/includes/config/settings.tmpl

    r71 r120  
    4242$SETTINGS['expire'] = 30; // cookie expiration in days 
    4343$SETTINGS['debug'] = 2; // debug mode (0: off, 1: on, 2: admins only 
    44 $SETTINGS['hash'] = 'ripemd160'; // hash algorithm used for the passwords 
     44$SETTINGS['hash'] = 'sha512'; // hash algorithm used for the passwords 
    4545?> 
  • branches/5.0/includes/config/version.php

    r93 r120  
    2828 * Also good: Spam Board Viking Edition 1.0 (then, you can do your own version numbering from there) */ 
    2929 
    30 $VERSION = '5.0 RC4'; 
     30$VERSION = '5.0 RC5'; 
    3131 
    3232?> 
  • branches/5.0/includes/input.php

    r71 r120  
    2323 **/ 
    2424 
     25/* register_globals atrocity can't just be disabled by using ini_set, 
     26 * because the damage is already done once that takes effect, so... */ 
     27if (ini_get('register_globals') !== 0 && strtolower(ini_get('register_globals')) !== 'off') { 
     28    // don't touch the following: 
     29    $not = Array(); 
     30    $not[] = 'SETTINGS'; 
     31    $not[] = 'VERSION'; 
     32    $not[] = 'BOTS'; 
     33    $not[] = 'MEMBERSTAGES'; 
     34    $not[] = 'CIPHER'; 
     35    $not[] = 'HASH'; 
     36    $not[] = 'LANG'; 
     37    $not[] = 'RULES'; 
     38    $not[] = 'STATUS'; 
     39    // 'de-register' all local names of global variables 
     40    foreach ($_SERVER as $key=>$val) { 
     41        if (in_array($key, $not) === FALSE) { 
     42            unset($$key); 
     43        } 
     44    } 
     45    foreach ($_GET as $key=>$val) { 
     46        if (in_array($key, $not) === FALSE) { 
     47            unset($$key); 
     48        } 
     49    } 
     50    foreach ($_POST as $key=>$val) { 
     51        if (in_array($key, $not) === FALSE) { 
     52            unset($$key); 
     53        } 
     54    } 
     55    foreach ($_COOKIE as $key=>$val) { 
     56        if (in_array($key, $not) === FALSE) { 
     57            unset($$key); 
     58        } 
     59    } 
     60    foreach ($_FILES as $key=>$val) { 
     61        if (in_array($key, $not) === FALSE) { 
     62            unset($$key); 
     63        } 
     64    } 
     65    foreach ($_ENV as $key=>$val) { 
     66        if (in_array($key, $not) === FALSE) { 
     67            unset($$key); 
     68        } 
     69    } 
     70    foreach ($_REQUEST as $key=>$val) { 
     71        if (in_array($key, $not) === FALSE) { 
     72            unset($$key); 
     73        } 
     74    } 
     75    if (isset($_SESSION) && is_array($_SESSION)) { 
     76        foreach ($_SESSION as $key=>$val) { 
     77            if (in_array($key, $not) === FALSE) { 
     78                unset($$key); 
     79            } 
     80        } 
     81    } 
     82} 
     83 
    2584// handle PHP's 'magic quotes' feature (bug) in case disabling it through .htaccess failed 
    2685function stripslashes_array($data) { 
  • branches/5.0/includes/lang/de.php

    r93 r120  
    310310$LANG['View_All'] = 'Alle ansehen'; 
    311311$LANG['per_day'] = 'pro Tag'; 
     312$LANG['quote_from'] = 'Geschrieben von %poster% %date%'; 
    312313 
    313314/* actual sentences */ 
  • branches/5.0/includes/lang/en.php

    r93 r120  
    311311$LANG['View_All'] = 'View All'; 
    312312$LANG['per_day'] = 'per day'; 
     313$LANG['quote_from'] = 'Originally posted by %poster% %date%'; 
    313314 
    314315/* actual sentences */ 
  • branches/5.0/includes/page_out.php

    r8 r120  
    5454header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 
    5555// send document to client 
    56 print(str_replace(Array('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML())); 
     56print(iconv('UTF-8', $SETTINGS['encoding'], str_replace(Array('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML()))); 
    5757 
    5858?> 
  • branches/5.0/includes/styles/default.css

    r93 r120  
    2929body { 
    3030    font-family:sans-serif; 
    31     font-size:0.7em; 
     31    font-size:0.75em; 
    3232    background:#f2f2f2; 
    3333    margin:0px; 
     
    3939 
    4040h1 { 
    41  font-size:1.5em; 
     41  font-size:1.5em; 
    4242    position:relative; 
    4343    top:0.5em; 
     
    6161    color:#000000; 
    6262    font-weight:bold; 
    63     font-size:1.5em; 
     63    font-size:1.25em; 
    6464} 
    6565 
     
    7272    margin:0px; 
    7373    padding:0px; 
    74     font-size:1.2em; 
     74    font-size:1.1em; 
    7575} 
    7676 
     
    360360 
    361361#memberbar div a { 
    362     margin-left:1em; 
     362    margin-left:0.1em; 
    363363} 
    364364 
     
    390390    border:1px solid #000; 
    391391    background:#c0c0c0; 
    392     font-size:1.2em; 
     392    font-size:1.1em; 
    393393} 
    394394 
     
    565565 
    566566.suggestion { 
    567     font-size:8px
     567    font-size:0.8em
    568568    color:#0a0; 
    569569} 
    570570 
    571571.suggestion-highlight { 
    572     font-size:8px
     572    font-size:0.8em
    573573    color:#a00; 
    574574} 
  • branches/5.0/index.php

    r58 r120  
    2424 
    2525// disable output of error messages and warnings 
    26 ini_set('display_errors','Off'); 
     26ini_set('display_errors', 'Off'); 
    2727 
    2828// if install script is present, redirect there 
  • branches/5.0/install.php

    r71 r120  
    5959// define next page number 
    6060$nextpage = $page + 1; 
     61 
     62// since this is important define the order in which the password hashes should be suggested 
     63$hashes_default = Array(); 
     64$hashes_default[0] = 'sha512'; 
     65$hashes_default[1] = 'ripemd320'; 
     66$hashes_default[2] = 'sha384'; 
     67$hashes_default[3] = 'ripemd256'; 
     68$hashes_default[4] = 'sha256'; 
     69$hashes_default[5] = 'ripemd160'; 
     70$hashes_default[6] = 'ripemd128'; 
     71$hashes_default[7] = 'sha1'; 
     72// available 
     73$hashes = hash_algos(); 
     74for ($i = 7; $i <= 0; $i--) { 
     75    if (in_array($hashes_default[$i], $hashes)) { 
     76        // use this hash as default 
     77        $SETTINGS['hash'] = $hashes_default[$i]; 
     78    } 
     79} 
    6180 
    6281// unlike all the other pages, this installer is a little simpler and prints output directly 
     
    221240                    if ($C = new Connection()) { 
    222241                        // get table structure 
    223                         if ($db = @file_get_contents('db/spamboard.sql')) { 
     242                        if ($db = @file_get_contents('db/' . $SETTINGS['sqltype'] . '.sql')) { 
    224243                            // one SQL query at a time 
    225244                            $db = explode(';', $db); 
    226245                            foreach ($db as $query) { 
    227246                                $C->query(str_replace('%prefix%', $SETTINGS['dbtableprefix'], $query)); 
    228                             } 
    229                             // specialities dependent on database type 
    230                             if (is_file('db/' . $SETTINGS['sqltype'] . '.sql')) { 
    231                                 if ($db = @file_get_contents('db/' . $SETTINGS['sqltype'] . '.sql')) { 
    232                                     // one SQL query at a time 
    233                                     $db = explode(';', $db); 
    234                                     foreach ($db as $query) { 
    235                                         $C->query(str_replace('%prefix%', $SETTINGS['dbtableprefix'], $query)); 
    236                                     } 
    237                                 } else { $ok = 0; } 
    238247                            } 
    239248                            // finally, fill in default data 
     
    302311                                } 
    303312                            } 
    304                             if ($file = @fopen('db/.htaccess', 'w')) { 
     313                            @copy('sessions/.htaccess', 'db/.htaccess'); 
     314                            @copy('sessions/.htaccess', 'classes/.htaccess'); 
     315                            @copy('sessions/.htaccess', 'admin/classes/.htaccess'); 
     316                            @copy('sessions/.htaccess', 'includes/.htaccess'); 
     317                            // exception: allow 
     318                            if ($file = @fopen('includes/styles/.htaccess', 'w')) { 
    305319                                // write settings 
    306                                 if (@fwrite($file, 'deny from all')) { 
     320                                if (@fwrite($file, 'allow from all')) { 
    307321                                    @fclose($file); 
    308322                                    // set permissions 
    309                                     @chmod('db/.htaccess', 0660); 
     323                                    @chmod('includes/styles/.htaccess', 0660); 
    310324                                } 
    311325                            } 
     326                            @copy('includes/styles/.htaccess', 'includes/js/.htaccess'); 
    312327                        } else { 
    313328                            // other webservers... 
     
    475490                    <select name="hash"> 
    476491        '); 
    477         $_hashes = hash_algos(); 
    478         foreach ($_hashes as $_hash) { 
     492        foreach ($hashes as $_hash) { 
    479493            print('<option value="' . $_hash . '"'); 
    480494            if ($SETTINGS['hash'] == $_hash) { 
  • branches/5.0/redirectors/preview.php

    r39 r120  
    6868        if ($s && $row = $q->fetchObject()) { 
    6969            // valid member 
    70             $row->postedbymember = 1
     70            $row->postedbymember = $row->memberid
    7171        } else { 
    7272            // guest 
     
    8282    } 
    8383    // decode post 
    84     $row->post = base64_decode(strtr($post, '-_', '+/')); 
     84    $row->post = $F->htmlentities(base64_decode(strtr($post, '-_', '+/')), TRUE);