Changeset 120
- Timestamp:
- 2008-01-07 16:50:34 (1 year ago)
- Files:
-
- branches/5.0/admin/classes/pages/Editmember.php (modified) (1 diff)
- branches/5.0/classes/misc/Authcode.php (modified) (2 diffs)
- branches/5.0/classes/misc/Format.php (modified) (3 diffs)
- branches/5.0/classes/misc/Member.php (modified) (1 diff)
- branches/5.0/classes/misc/Post.php (modified) (6 diffs)
- branches/5.0/classes/misc/Postform.php (modified) (1 diff)
- branches/5.0/classes/pages/Category.php (modified) (1 diff)
- branches/5.0/classes/pages/Forum.php (modified) (2 diffs)
- branches/5.0/classes/pages/Page.php (modified) (2 diffs)
- branches/5.0/classes/pages/Reply.php (modified) (1 diff)
- branches/5.0/db/mysql.sql (modified) (1 diff)
- branches/5.0/db/spamboard.sql (deleted)
- branches/5.0/db/sqlite.sql (modified) (1 diff)
- branches/5.0/includes/config/bots.php (modified) (1 diff)
- branches/5.0/includes/config/settings.tmpl (modified) (1 diff)
- branches/5.0/includes/config/version.php (modified) (1 diff)
- branches/5.0/includes/input.php (modified) (1 diff)
- branches/5.0/includes/lang/de.php (modified) (1 diff)
- branches/5.0/includes/lang/en.php (modified) (1 diff)
- branches/5.0/includes/page_out.php (modified) (1 diff)
- branches/5.0/includes/styles/default.css (modified) (7 diffs)
- branches/5.0/index.php (modified) (1 diff)
- branches/5.0/install.php (modified) (4 diffs)
- branches/5.0/redirectors/preview.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/5.0/admin/classes/pages/Editmember.php
r93 r120 405 405 @closedir($handle); 406 406 } 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>'; 408 408 $_col2 = '<td>'; 409 409 /* it shouldn't really occur that the avatar is an empty string, branches/5.0/classes/misc/Authcode.php
r93 r120 43 43 // remove auth code from session since it's no longer needed 44 44 unset($_SESSION['pw']); 45 unset($_SESSION['pw_page']); 45 46 } /* function destroy */ 46 47 … … 59 60 // put into session 60 61 $_SESSION['pw'] = $p->get(); 62 // remember number of page this was written 63 $_SESSION['pw_page'] = $_SESSION['pages']; 61 64 } /* function generate */ 62 65 branches/5.0/classes/misc/Format.php
r71 r120 79 79 public function post($str, $simple = FALSE) { 80 80 // language 81 global $LANG ;81 global $LANG, $F; 82 82 /* debugging messages; 83 83 * printed out directly on the screen, so incompatible with general board structure; … … 85 85 $DEBUG = FALSE; 86 86 // 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='); 88 88 // 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]'); 90 90 /* HTML code: 91 91 * 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). 92 92 * 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>'); 95 95 // initialize string for comparison 96 96 $str_prev = ''; … … 183 183 $_attr_close = $_cont; 184 184 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; 185 190 default: 186 191 // nothing to do for the rest of the tags branches/5.0/classes/misc/Member.php
r93 r120 64 64 // language 65 65 global $LANG; 66 // database connection identifier67 66 if ($member === NULL) { 68 67 // called with member id instead of username branches/5.0/classes/misc/Post.php
r93 r120 48 48 } /* constructor */ 49 49 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 50 60 /* function setPost - only used if constructor called without id (used in post preview) */ 51 61 public function setPost($post) { … … 71 81 $_showip = ''; 72 82 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> | '; 74 84 } 75 85 // post header (time of post etc.) 76 86 $table->addRow(Array('<td colspan="2" class="postheader">' . $LANG['Posted'] . ' ' . $F->datetime($this->post->posttime) . ' | <a href="' . $F->link('reply') . 'id=' . $id . '&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>')); 77 87 // 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 } 79 93 // assemble parts of post 80 94 $_post = '<div>' . $F->post($this->post->post) . '</div>'; … … 92 106 } 93 107 // 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('&', '&', $_post) . '</td>'), FALSE, TRUE); 95 109 // post footer 96 110 $table->addRow(Array(''), Array('colspan'=>'2', 'class'=>'postfooter')); … … 106 120 **/ 107 121 public function save($show_orig) { 108 global $C, $ SETTINGS, $LANG;122 global $C, $F, $SETTINGS, $LANG; 109 123 // post data 110 124 global $reply, $subject, $forum, $pollchoices, $user, $post, $password, $email, $subscribe; … … 257 271 $email = $row->memberemail; 258 272 // set flag for 'registered member' 259 $postedbymember = 1;273 $postedbymember = $row->memberid; 260 274 // always use the membername exactly as it appears in the database 261 275 $user = $row->membername; … … 380 394 $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)'); 381 395 $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); 384 398 $q->bindParam(':email', $email, PDO::PARAM_STR); 385 399 // current time in UTC branches/5.0/classes/misc/Postform.php
r71 r120 42 42 public function __construct($show_orig, $page = FALSE, $id = FALSE, $subject = FALSE, $quote = '', $subscribed = FALSE) { 43 43 global $SETTINGS, $F, $C, $LANG; 44 // define replacements 45 $_rep = Array( 46 '&'=>'&', 47 '<'=>'<', 48 '>'=>'>', 49 "'"=>"'", 50 '"'=>'"' 51 ); 52 // remove special characters from quote 53 $quote = strtr($quote, $_rep); 44 54 // form object 45 55 $this->form = new Form($F->link($show_orig).'commit=y', 'postform', 'multipart/form-data'); 46 // max. upload size47 if ($show_orig !== 'messenger' && $show_orig !== 'edit' && $show_orig !== 'mail' && $SETTINGS['maxuploadsize'] > 0) {48 $this->form->addInput('hidden', 'MAX_FILE_SIZE', $SETTINGS['maxuploadsize']);49 }50 56 // reply to which topic? 51 57 if ($show_orig === 'reply') { branches/5.0/classes/pages/Category.php
r71 r120 100 100 if (isset($row5->topicid) && $row5->topicid != '' && $row5->topicid > 0) { 101 101 // 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 } 103 107 $_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>'; 104 108 } branches/5.0/classes/pages/Forum.php
r93 r120 108 108 $q4 = NULL; 109 109 // 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 } 112 120 // multiple pages for this topic? 113 121 $topicpages = new Pagination($SETTINGS['postsperpage'], 1, $row2['posts']); … … 135 143 } 136 144 // 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;', $_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('&', '&', $_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); 138 146 } 139 147 // add finished table to parent HTML element branches/5.0/classes/pages/Page.php
r71 r120 51 51 // get current timestamp (microseconds) for execution time 52 52 $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 } 53 63 /* Have some kind of manual per-page login credentials been posted? 54 64 * This shouldn't be checked on 'Userpanel' page, because there is a special handling of that there. */ … … 281 291 $_today->modify($_offset); 282 292 // 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'); 284 294 $q->bindParam(':today', $_today->format('m-d'), PDO::PARAM_STR, 5); 285 295 $s = $q->execute(); branches/5.0/classes/pages/Reply.php
r93 r120 73 73 $row4 = $q->fetchObject(); 74 74 $q = NULL; 75 $_quote_text = '[quote ]' . $F->htmlentities($row4->post, TRUE) . '[/quote]';75 $_quote_text = '[quote=' . $quote . ']' . $F->htmlentities($row4->post, TRUE) . '[/quote]'; 76 76 } 77 77 // 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; 1 CREATE 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 7 CREATE 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 15 CREATE 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 26 CREATE 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 33 CREATE 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 40 CREATE 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 54 CREATE 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 64 CREATE TABLE %prefix%groupmemberships ( 65 member INTEGER NOT NULL, 66 usergroup INTEGER NOT NULL 67 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 68 69 CREATE 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 75 CREATE 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 103 CREATE 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 110 CREATE TABLE %prefix%moderators ( 111 forum INTEGER NOT NULL, 112 member INTEGER NOT NULL 113 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 114 115 CREATE TABLE %prefix%subscriptions ( 116 topic INTEGER NOT NULL, 117 member INTEGER NOT NULL 118 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; 119 120 CREATE 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 128 CREATE 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; 11 135 12 136 CREATE INDEX idx_forums ON %prefix%forums (forum_category ASC); branches/5.0/db/sqlite.sql
r33 r120 1 CREATE 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 7 CREATE 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 15 CREATE 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 26 CREATE 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 33 CREATE 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 40 CREATE 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 54 CREATE 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 64 CREATE TABLE %prefix%groupmemberships ( 65 member INTEGER NOT NULL, 66 usergroup INTEGER NOT NULL 67 ); 68 69 CREATE 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 75 CREATE 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 103 CREATE 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 110 CREATE TABLE %prefix%moderators ( 111 forum INTEGER NOT NULL, 112 member INTEGER NOT NULL 113 ); 114 115 CREATE TABLE %prefix%subscriptions ( 116 topic INTEGER NOT NULL, 117 member INTEGER NOT NULL 118 ); 119 120 CREATE 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 128 CREATE 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 1 136 CREATE INDEX idx_forums ON %prefix%forums (forum_category ASC); 2 137 CREATE INDEX idx_topics ON %prefix%topics (forum ASC); branches/5.0/includes/config/bots.php
r93 r120 27 27 $BOTS[] = 'urllib'; 28 28 $BOTS[] = 'robozilla'; 29 $BOTS[] = 'yandex'; 30 $BOTS[] = 'charlotte'; 29 31 30 32 ?> branches/5.0/includes/config/settings.tmpl
r71 r120 42 42 $SETTINGS['expire'] = 30; // cookie expiration in days 43 43 $SETTINGS['debug'] = 2; // debug mode (0: off, 1: on, 2: admins only 44 $SETTINGS['hash'] = ' ripemd160'; // hash algorithm used for the passwords44 $SETTINGS['hash'] = 'sha512'; // hash algorithm used for the passwords 45 45 ?> branches/5.0/includes/config/version.php
r93 r120 28 28 * Also good: Spam Board Viking Edition 1.0 (then, you can do your own version numbering from there) */ 29 29 30 $VERSION = '5.0 RC 4';30 $VERSION = '5.0 RC5'; 31 31 32 32 ?> branches/5.0/includes/input.php
r71 r120 23 23 **/ 24 24 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... */ 27 if (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 25 84 // handle PHP's 'magic quotes' feature (bug) in case disabling it through .htaccess failed 26 85 function stripslashes_array($data) { branches/5.0/includes/lang/de.php
r93 r120 310 310 $LANG['View_All'] = 'Alle ansehen'; 311 311 $LANG['per_day'] = 'pro Tag'; 312 $LANG['quote_from'] = 'Geschrieben von %poster% %date%'; 312 313 313 314 /* actual sentences */ branches/5.0/includes/lang/en.php
r93 r120 311 311 $LANG['View_All'] = 'View All'; 312 312 $LANG['per_day'] = 'per day'; 313 $LANG['quote_from'] = 'Originally posted by %poster% %date%'; 313 314 314 315 /* actual sentences */ branches/5.0/includes/page_out.php
r8 r120 54 54 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 55 55 // send document to client 56 print( str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $html->asXML()));56 print(iconv('UTF-8', $SETTINGS['encoding'], str_replace(Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), Array('ο', '»', 'α', '©', ' '), $html->asXML()))); 57 57 58 58 ?> branches/5.0/includes/styles/default.css
r93 r120 29 29 body { 30 30 font-family:sans-serif; 31 font-size:0.7 em;31 font-size:0.75em; 32 32 background:#f2f2f2; 33 33 margin:0px; … … 39 39 40 40 h1 { 41 font-size:1.5em;41 font-size:1.5em; 42 42 position:relative; 43 43 top:0.5em; … … 61 61 color:#000000; 62 62 font-weight:bold; 63 font-size:1. 5em;63 font-size:1.25em; 64 64 } 65 65 … … 72 72 margin:0px; 73 73 padding:0px; 74 font-size:1. 2em;74 font-size:1.1em; 75 75 } 76 76 … … 360 360 361 361 #memberbar div a { 362 margin-left: 1em;362 margin-left:0.1em; 363 363 } 364 364 … … 390 390 border:1px solid #000; 391 391 background:#c0c0c0; 392 font-size:1. 2em;392 font-size:1.1em; 393 393 } 394 394 … … 565 565 566 566 .suggestion { 567 font-size: 8px;567 font-size:0.8em; 568 568 color:#0a0; 569 569 } 570 570 571 571 .suggestion-highlight { 572 font-size: 8px;572 font-size:0.8em; 573 573 color:#a00; 574 574 } branches/5.0/index.php
r58 r120 24 24 25 25 // disable output of error messages and warnings 26 ini_set('display_errors', 'Off');26 ini_set('display_errors', 'Off'); 27 27 28 28 // if install script is present, redirect there branches/5.0/install.php
r71 r120 59 59 // define next page number 60 60 $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(); 74 for ($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 } 61 80 62 81 // unlike all the other pages, this installer is a little simpler and prints output directly … … 221 240 if ($C = new Connection()) { 222 241 // get table structure 223 if ($db = @file_get_contents('db/ spamboard.sql')) {242 if ($db = @file_get_contents('db/' . $SETTINGS['sqltype'] . '.sql')) { 224 243 // one SQL query at a time 225 244 $db = explode(';', $db); 226 245 foreach ($db as $query) { 227 246 $C->query(str_replace('%prefix%', $SETTINGS['dbtableprefix'], $query)); 228 }229 // specialities dependent on database type230 if (is_file('db/' . $SETTINGS['sqltype'] . '.sql')) {231 if ($db = @file_get_contents('db/' . $SETTINGS['sqltype'] . '.sql')) {232 // one SQL query at a time233 $db = explode(';', $db);234 foreach ($db as $query) {235 $C->query(str_replace('%prefix%', $SETTINGS['dbtableprefix'], $query));236 }237 } else { $ok = 0; }238 247 } 239 248 // finally, fill in default data … … 302 311 } 303 312 } 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')) { 305 319 // write settings 306 if (@fwrite($file, ' denyfrom all')) {320 if (@fwrite($file, 'allow from all')) { 307 321 @fclose($file); 308 322 // set permissions 309 @chmod(' db/.htaccess', 0660);323 @chmod('includes/styles/.htaccess', 0660); 310 324 } 311 325 } 326 @copy('includes/styles/.htaccess', 'includes/js/.htaccess'); 312 327 } else { 313 328 // other webservers... … … 475 490 <select name="hash"> 476 491 '); 477 $_hashes = hash_algos(); 478 foreach ($_hashes as $_hash) { 492 foreach ($hashes as $_hash) { 479 493 print('<option value="' . $_hash . '"'); 480 494 if ($SETTINGS['hash'] == $_hash) { branches/5.0/redirectors/preview.php
r39 r120 68 68 if ($s && $row = $q->fetchObject()) { 69 69 // valid member 70 $row->postedbymember = 1;70 $row->postedbymember = $row->memberid; 71 71 } else { 72 72 // guest … … 82 82 } 83 83 // decode post 84 $row->post = base64_decode(strtr($post, '-_', '+/'));84 $row->post = $F->htmlentities(base64_decode(strtr($post, '-_', '+/')), TRUE);
