Changeset 24
- Timestamp:
- 2007-11-23 15:36:28 (4 years ago)
- Files:
-
- trunk/classes/misc/Format.php (modified) (2 diffs)
- trunk/classes/misc/Postbuttons.php (modified) (2 diffs)
- trunk/classes/misc/Postform.php (modified) (1 diff)
- trunk/classes/pages/Category.php (modified) (1 diff)
- trunk/classes/pages/Forum.php (modified) (1 diff)
- trunk/classes/pages/Members.php (modified) (1 diff)
- trunk/classes/pages/Messenger.php (modified) (1 diff)
- trunk/classes/pages/Page.php (modified) (1 diff)
- trunk/includes/input.php (modified) (1 diff)
- trunk/redirectors/forumjump.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/misc/Format.php
r1 r24 295 295 * Description: link to another forum page using either short names via 296 296 * mod_rewrite or longer ones if that module isn't available 297 * Input: $file - page to link to (basically, the class name in 298 * lowercase characters, so no .php or anything) 297 * Input: $file - page to link to (basically, the class name in 298 * lowercase characters, so no .php or anything) 299 * $as_attr - boolean value to signify whether this link is 300 * added to the tree via addAttribute 299 301 * Returns: complete query string 300 302 **/ 301 public function link($file ) {303 public function link($file, $as_attr = FALSE) { 302 304 // get settings 303 305 global $SETTINGS; … … 307 309 } else { 308 310 // regular links 309 return 'index.php?show=' . $file . '&'; 311 if ($as_attr) { 312 // addAttribute automatically converts to & 313 return 'index.php?show=' . $file . '&'; 314 } else { 315 return 'index.php?show=' . $file . '&'; 316 } 310 317 } 311 318 } /* function link */ trunk/classes/misc/Postbuttons.php
r1 r24 47 47 // topic not closed 48 48 $a = $this->html->addChild('a', $LANG['Reply']); 49 $a->addAttribute('href', $F->link('reply' ) . 'id=' . $replyid);49 $a->addAttribute('href', $F->link('reply', TRUE) . 'id=' . $replyid); 50 50 } else { 51 51 // topic closed … … 57 57 // new topic 58 58 $a = $this->html->addChild('a', $LANG['New_Topic']); 59 $a->addAttribute('href', $F->link('newtopic' ) . 'id=' . $newid);59 $a->addAttribute('href', $F->link('newtopic', TRUE) . 'id=' . $newid); 60 60 // new poll 61 61 if ($SETTINGS['polls'] == 1) { 62 62 $a = $this->html->addChild('a', $LANG['New_Poll']); 63 $a->addAttribute('href', $F->link('newpoll' ) . 'id=' . $newid);63 $a->addAttribute('href', $F->link('newpoll', TRUE) . 'id=' . $newid); 64 64 } 65 65 } trunk/classes/misc/Postform.php
r20 r24 118 118 // show shortcuts to common smileys and board code 119 119 $_col1 .= '<div id="posthelp"><a href="javascript:addSmiley(\':)\')"><img src="images/smilies/smile.gif" alt=":)" border="0" /></a><a href="javascript:addSmiley(\':(\')"><img src="images/smilies/sad.gif" alt=":(" border="0" /></a><a href="javascript:addSmiley(\';)\')"><img src="images/smilies/wink.gif" alt=";)" border="0" /></a><a href="javascript:addSmiley(\':angry:\')"><img src="images/smilies/angry.gif" alt=":angry:" border="0" /></a><a href="javascript:addSmiley(\':D\')"><img src="images/smilies/biggrin.gif" alt=":D" border="0" /></a><a href="javascript:addSmiley(\':o\')"><img src="images/smilies/shocked.gif" alt=":o" border="0" /></a><a href="javascript:addSmiley(\':P\')"><img src="images/smilies/tongue.gif" alt=":P" border="0" /></a><a href="javascript:addSmiley(\':embarassed:\')"><img src="images/smilies/embarassed.gif" alt=":embarassed:" border="0" /></a><br />'. 120 '<input type="button" onclick="javascript:addCode(\'img\')" value=" IMG " /><input type="button" onclick="javascript:addCode(\'i\')" value=" I " /><input type="button" onclick="javascript:addCode(\'b\')" value=" B " /><input type="button" onclick="javascript:addCode(\'url\')" value=" URL " /><input type="button" onclick="javascript:addCode(\'quote\')" value=" QUOTE " /><br /><a href="javascript:void(0);" onclick="' . "window.open('redirectors/postinghelp.php ', 'helpwindow', 'width=600, height=450, scrollbars=yes')\">" . $LANG['Formatting_Help'] . '</a></div>';120 '<input type="button" onclick="javascript:addCode(\'img\')" value=" IMG " /><input type="button" onclick="javascript:addCode(\'i\')" value=" I " /><input type="button" onclick="javascript:addCode(\'b\')" value=" B " /><input type="button" onclick="javascript:addCode(\'url\')" value=" URL " /><input type="button" onclick="javascript:addCode(\'quote\')" value=" QUOTE " /><br /><a href="javascript:void(0);" onclick="' . "window.open('redirectors/postinghelp.php?s=" . session_id() . "', 'helpwindow', 'width=600, height=450, scrollbars=yes')\">" . $LANG['Formatting_Help'] . '</a></div>'; 121 121 } 122 122 $_col1 .= '</td>'; trunk/classes/pages/Category.php
r21 r24 129 129 $h2 = $this->html->body->addChild('h2'); 130 130 $a = $h2->addChild('a', $row['category_name']); 131 $a->addAttribute('href', $F->link('category' ) . 'id=' . $row['category_id']);131 $a->addAttribute('href', $F->link('category', TRUE) . 'id=' . $row['category_id']); 132 132 // add newly constructed forums table to parent node 133 133 $_table = $table->get(); trunk/classes/pages/Forum.php
r19 r24 74 74 $h2 = $this->html->body->addChild('h2'); 75 75 $a = $h2->addChild('a', $row->forumtitle); 76 $a->addAttribute('href', $F->link('forum' ) . 'id=' . $row->forumid);76 $a->addAttribute('href', $F->link('forum', TRUE) . 'id=' . $row->forumid); 77 77 // get topic information for the topic list 78 78 $q2 = $C->prepare('SELECT DISTINCT(p.topic) AS topicid, t.topictitle AS topictitle, COUNT(p.postid) AS posts, t.topic_views AS views, MAX(p.posttime) AS posttime, t.poll AS poll, t.pinned AS pinned FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t WHERE t.forum=:forumid AND p.topic=t.topicid GROUP BY p.topic ORDER BY pinned DESC, posttime DESC LIMIT ' . $_start . ',' . $SETTINGS['topicsperpage']); trunk/classes/pages/Members.php
r19 r24 111 111 $_nonpostercount = $membercount - $_postercount; 112 112 // define start and length of database query 113 $_start = $start - $_postercount;113 $_start = max($start - $_postercount, 0); 114 114 $_num = $SETTINGS['topicsperpage'] - count($rows_ordered); 115 115 // get the non-poster ids trunk/classes/pages/Messenger.php
r20 r24 53 53 $div->addAttribute('align', 'center'); 54 54 $a = $div->addChild('a', $LANG['Inbox']); 55 $a->addAttribute('href', $F->link('messenger' ) . 'action=inbox');55 $a->addAttribute('href', $F->link('messenger', TRUE) . 'action=inbox'); 56 56 $div->addChild('span', ' - '); 57 57 $a = $div->addChild('a', $LANG['Outbox']); 58 $a->addAttribute('href', $F->link('messenger' ) . 'action=outbox');58 $a->addAttribute('href', $F->link('messenger', TRUE) . 'action=outbox'); 59 59 $div->addChild('span', ' - '); 60 60 $a = $div->addChild('a', $LANG['Compose']); 61 $a->addAttribute('href', $F->link('messenger' ) . 'action=send');61 $a->addAttribute('href', $F->link('messenger', TRUE) . 'action=send'); 62 62 $div->addChild('span', ' - '); 63 63 $a = $div->addChild('a', $LANG['Address_Book']); 64 $a->addAttribute('href', $F->link('messenger' ) . 'action=addresses');64 $a->addAttribute('href', $F->link('messenger', TRUE) . 'action=addresses'); 65 65 $div->addChild('br'); 66 66 $div->addChild('br'); trunk/classes/pages/Page.php
r20 r24 99 99 $div->addAttribute('id', 'admin_menu'); 100 100 $a = $div->addChild('a', $LANG['Admin_Main']); 101 $a->addAttribute('href', $F->link('index' ));101 $a->addAttribute('href', $F->link('index', TRUE)); 102 102 $div->addChild('br'); 103 103 $div->addChild('hr'); 104 104 $a = $div->addChild('a', $LANG['Settings']); 105 $a->addAttribute('href', $F->link('settings' ));105 $a->addAttribute('href', $F->link('settings', TRUE)); 106 106 $div->addChild('br'); 107 107 $a = $div->addChild('a', $LANG['Header']); 108 $a->addAttribute('href', $F->link('header' ));108 $a->addAttribute('href', $F->link('header', TRUE)); 109 109 $div->addChild('br'); 110 110 $a = $div->addChild('a', $LANG['Footer']); 111 $a->addAttribute('href', $F->link('footer' ));111 $a->addAttribute('href', $F->link('footer', TRUE)); 112 112 $div->addChild('br'); 113 113 $div->addChild('hr'); 114 114 $a = $div->addChild('a', $LANG['Add_Category']); 115 $a->addAttribute('href', $F->link('addcategory' ));115 $a->addAttribute('href', $F->link('addcategory', TRUE)); 116 116 $div->addChild('br'); 117 117 $a = $div->addChild('a', $LANG['Modify_Category']); 118 $a->addAttribute('href', $F->link('modifycategory' ));118 $a->addAttribute('href', $F->link('modifycategory', TRUE)); 119 119 $div->addChild('br'); 120 120 $a = $div->addChild('a', $LANG['Delete_Category']); 121 $a->addAttribute('href', $F->link('deletecategory' ));121 $a->addAttribute('href', $F->link('deletecategory', TRUE)); 122 122 $div->addChild('br'); 123 123 $div->addChild('hr'); 124 124 $a = $div->addChild('a', $LANG['Add_Forum']); 125 $a->addAttribute('href', $F->link('addforum' ));125 $a->addAttribute('href', $F->link('addforum', TRUE)); 126 126 $div->addChild('br'); 127 127 $a = $div->addChild('a', $LANG['Modify_Forum']); 128 $a->addAttribute('href', $F->link('modifyforum' ));128 $a->addAttribute('href', $F->link('modifyforum', TRUE)); 129 129 $div->addChild('br'); 130 130 $a = $div->addChild('a', $LANG['Delete_Forum']); 131 $a->addAttribute('href', $F->link('deleteforum' ));131 $a->addAttribute('href', $F->link('deleteforum', TRUE)); 132 132 $div->addChild('br'); 133 133 $a = $div->addChild('a', $LANG['Moderators']); 134 $a->addAttribute('href', $F->link('moderators' ));134 $a->addAttribute('href', $F->link('moderators', TRUE)); 135 135 $div->addChild('br'); 136 136 $div->addChild('hr'); 137 137 $a = $div->addChild('a', $LANG['Memberstages']); 138 $a->addAttribute('href', $F->link('memberstages' ));138 $a->addAttribute('href', $F->link('memberstages', TRUE)); 139 139 $div->addChild('br'); 140 140 $a = $div->addChild('a', $LANG['User_Groups']); 141 $a->addAttribute('href', $F->link('groups' ));141 $a->addAttribute('href', $F->link('groups', TRUE)); 142 142 $div->addChild('br'); 143 143 $a = $div->addChild('a', $LANG['Edit_Member']); 144 $a->addAttribute('href', $F->link('editmember' ));144 $a->addAttribute('href', $F->link('editmember', TRUE)); 145 145 $div->addChild('br'); 146 146 $a = $div->addChild('a', $LANG['Banning']); 147 $a->addAttribute('href', $F->link('banning' ));147 $a->addAttribute('href', $F->link('banning', TRUE)); 148 148 $div->addChild('br'); 149 149 } trunk/includes/input.php
r20 r24 53 53 // translate input variables to local names and check their integrity 54 54 $show = $_GET['show']; 55 if ($show == '' ) { $show = 'category'; }55 if ($show == '' || $show == 'index') { $show = 'category'; } 56 56 if (preg_match('/^[a-z]+$/', $show) != 1) { die($LANG['error_input']); } 57 57 trunk/redirectors/forumjump.php
r19 r24 59 59 session_start(); 60 60 // forward to forum / category 61 header('Location: ../' . $F->link($_red[0] ) . 'id=' . $_red[1] . '&' . strip_tags(SID));61 header('Location: ../' . $F->link($_red[0], TRUE) . 'id=' . $_red[1] . '&' . strip_tags(SID)); 62 62 // just in case something went wrong with redirecting, print something 63 63 print(str_replace('%link%', '<a href="../' . $F->link(strtolower($_red[0])) . 'id='.$_red[1] . '&' . strip_tags(SID) . '">../' . $F->link(strtolower($_red[0])) . 'id=' . $_red[1] . '&' . strip_tags(SID) . '</a>', $LANG['redirection_problem']));
