diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-10-01 23:22:18 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-10-01 23:22:18 +0000 |
| commit | a711e6d677257b64574fb5c377dfbde7127da3c3 (patch) | |
| tree | 7f0af4764382a88e96fa9fdb35794932de104e46 /phpBB/includes | |
| parent | 09dc77b5813c43d5754d346b6a024d9650ae6a0b (diff) | |
| download | forums-a711e6d677257b64574fb5c377dfbde7127da3c3.tar forums-a711e6d677257b64574fb5c377dfbde7127da3c3.tar.gz forums-a711e6d677257b64574fb5c377dfbde7127da3c3.tar.bz2 forums-a711e6d677257b64574fb5c377dfbde7127da3c3.tar.xz forums-a711e6d677257b64574fb5c377dfbde7127da3c3.zip | |
Changes related to private messaging + some bug fixes
git-svn-id: file:///svn/phpbb/trunk@1111 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/bbcode.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 88 |
2 files changed, 80 insertions, 14 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 5eb8288266..7b2d91da0f 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -156,7 +156,7 @@ function bbencode_second_pass($text, $uid) $text = str_replace("[/color:$uid]", $bbcode_tpl['color_close'], $text); // size - $text = preg_replace("/\[size=([\-\+]?[1-3]):$uid\]/si", $bbcode_tpl['size_open'], $text); + $text = preg_replace("/\[size=([\-\+]?[1-2]?[0-9]):$uid\]/si", $bbcode_tpl['size_open'], $text); $text = str_replace("[/size:$uid]", $bbcode_tpl['size_close'], $text); // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. @@ -248,10 +248,10 @@ function bbencode_first_pass($text, $uid) $text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:o]", false, 'replace_listitems'); // [color] and [/color] for setting text color - $text = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z]+)\](.*?)\[/color\]#si", "[color=\\1:$uid]\\2[/color:$uid]", $text); + $text = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "[color=\\1:$uid]\\2[/color:$uid]", $text); // [size] and [/size] for setting text size - $text = preg_replace("#\[size=([\-\+]?[1-3])\](.*?)\[/size\]#si", "[size=\\1:$uid]\\2[/size:$uid]", $text); + $text = preg_replace("#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#si", "[size=\\1:$uid]\\2[/size:$uid]", $text); // [b] and [/b] for bolding text. $text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 0b8323ea24..7d93624185 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -117,7 +117,7 @@ function get_userdata($username) { } } -function make_jumpbox() +function make_jumpbox($match_forum_id = 0) { global $lang, $db; @@ -131,13 +131,10 @@ function make_jumpbox() message_die(GENERAL_ERROR, "Couldn't obtain category list.", "", __LINE__, __FILE__, $sql); } - $total_categories = $db->sql_numrows(); - if($total_categories) + if( $total_categories = $db->sql_numrows() ) { $category_rows = $db->sql_fetchrowset($q_categories); - $limit_forums = ""; - $sql = "SELECT * FROM " . FORUMS_TABLE . " ORDER BY cat_id, forum_order"; @@ -145,25 +142,25 @@ function make_jumpbox() { message_die(GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql); } + $total_forums = $db->sql_numrows($q_forums); $forum_rows = $db->sql_fetchrowset($q_forums); -// $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata); - $boxstring = '<select name="' . POST_FORUM_URL . '"><option value="-1">' . $lang['Select_forum'] . '</option>'; for($i = 0; $i < $total_categories; $i++) - { + { $boxstring .= '<option value="-1"> </option>'; $boxstring .= '<option value="-1">' . $category_rows[$i]['cat_title'] . '</option>'; $boxstring .= '<option value="-1">----------------</option>'; if($total_forums) { - for($y = 0; $y < $total_forums; $y++) + for($j = 0; $j < $total_forums; $j++) { - if( $forum_rows[$y]['cat_id'] == $category_rows[$i]['cat_id'] ) + if( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && !$forum_rows[$j]['auth_view'] ) { - $boxstring .= '<option value="' . $forum_rows[$y]['forum_id'] . '">' . $forum_rows[$y]['forum_name'] . '</option>'; + $selected = ( $forum_rows[$j]['forum_id'] == $match_forum_id ) ? "selected=\"selected\"" : ""; + $boxstring .= '<option value="' . $forum_rows[$j]['forum_id'] . '"' . $selected . '>' . $forum_rows[$j]['forum_name'] . '</option>'; } } } @@ -892,6 +889,75 @@ function obtain_word_list(&$orig_word, &$replacement_word) } // +// Username search +// +function username_search($calling_script, $search_match, $enable_window = 0, $default_list = "") +{ + global $db, $template, $lang; + + if( $enable_window ) + { + $template->set_filenames(array( + "body" => "mini_search.tpl") + ); + } + + $author_list = ""; + if( !empty($search_match) ) + { + $username_search = preg_replace("/\*/", "%", trim(strip_tags($search_match))); + + $sql = "SELECT username + FROM " . USERS_TABLE . " + WHERE username LIKE '$username_search'"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't obtain search results", "", __LINE__, __FILE__, $sql); + } + + if( $numrows = $db->sql_numrows($result) ) + { + $searchset = $db->sql_fetchrowset($result); + + for($i = 0; $i < $numrows; $i++) + { + $author_list .= "<option value=\"" . $searchset[$i]['username'] . "\">" .$searchset[$i]['username'] . "</option>"; + } + } + else + { + $author_list = "<option>" . $lang['No_match']. "</option>"; + } + + if( $enable_window ) + { + $template->assign_vars(array( + "S_AUTHOR_OPTIONS" => $author_list) + ); + + $template->assign_block_vars("select_name", array()); + } + } + + if( $enable_window ) + { + $template->assign_vars(array( + "L_CLOSE_WINDOW" => $lang['Close_window'], + "L_SEARCH_USERNAME" => $lang['Find_username'], + "L_UPDATE_USERNAME" => $lang['Select_username'], + "L_SELECT" => $lang['Select'], + "L_SEARCH" => $lang['Search'], + + "S_SEARCH_ACTION" => append_sid("$calling_script?mode=searchuser")) + ); + + $template->pparse("body"); + } + + return($author_list); +} + +// // This function gets called to output any message or error // that doesn't require additional output from the calling // page. |
