diff options
-rw-r--r-- | phpBB/profile.php | 11 | ||||
-rw-r--r-- | phpBB/search.php | 38 | ||||
-rwxr-xr-x | phpBB/templates/Default/profile_view_body.tpl | 2 | ||||
-rw-r--r-- | phpBB/templates/PSO/profile_view_body.tpl | 4 |
4 files changed, 34 insertions, 21 deletions
diff --git a/phpBB/profile.php b/phpBB/profile.php index a15ad94aa9..e39277aeed 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -320,10 +320,11 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) "MSN" => stripslashes($profiledata['user_msnm']), "L_YAHOO" => stripslashes($l_yahoo), "YIM" => stripslashes($profiledata['user_yim']), - "WEBSITE" => "<a href=\"".stripslashes($profiledata['user_website'])."\" target=\"_blank\">".stripslashes($profiledata['user_website'])."</a>", + "WEBSITE" => stripslashes($profiledata['user_website']), "LOCATION" => stripslashes($profiledata['user_from']), "OCCUPATION" => stripslashes($profiledata['user_occ']), - "INTERESTS" => stripslashes($profiledata['user_interests']), + "INTERESTS" => stripslashes($profiledata['user_interests']), + "AVATAR_IMG" => $board_config['avatar_path'] . "/" . stripslashes($profiledata['user_avatar']), "L_VIEWING_PROFILE" => $l_viewing_profile, "L_USERNAME" => $l_username, @@ -338,7 +339,11 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) "L_MESSENGER" => $l_messenger, "L_LOCATION" => $l_from, "L_OCCUPATION" => $l_occupation, - "L_INTERESTS" => $l_interests, + "L_INTERESTS" => $l_interests, + "L_AVATAR" => $l_avatar, + + "U_SEARCH_USER" => append_sid("search.$phpEx?a=".urlencode($profiledata['username'])."&f=all&b=0&d=DESC&c=100&dosearch=1"), + "U_USER_WEBSITE" => stripslashes($profiledata['user_website']), "S_PROFILE_ACTION" => append_sid("profile.$phpEx")) ); diff --git a/phpBB/search.php b/phpBB/search.php index ff1071cba1..42c00a63e9 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -30,7 +30,6 @@ include('extension.inc'); include('common.'.$phpEx); -include('includes/bbcode.'.$phpEx); $pagetype = "search"; $page_title = "Search Forums"; @@ -260,7 +259,7 @@ function gensearch_sql($searchstring, $override_all = 0) } } - $searchstring = "WHERE ($searchstring) AND (pt.post_id = p.post_id) "; + $searchstring = "($searchstring)"; $searchdata[0] = $searchstring; for($i = 0; $i < count($searchforwords); $i++) @@ -290,11 +289,11 @@ init_userprefs($userdata); $start = (isset($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : 0; -$querystring = (isset($HTTP_POST_VARS['querystring'])) ? $HTTP_POST_VARS['querystring'] : ( (isset($HTTP_GET_VARS['q'])) ? stripslashes($HTTP_GET_VARS['q']) : "" ); -$authorstring = (isset($HTTP_POST_VARS['authorstring'])) ? $HTTP_POST_VARS['authorstring'] : ( (isset($HTTP_GET_VARS['a'])) ? stripslashes($HTTP_GET_VARS['a']) : "" ); +$querystring = (isset($HTTP_POST_VARS['querystring'])) ? $HTTP_POST_VARS['querystring'] : ( (!empty($HTTP_GET_VARS['q'])) ? stripslashes($HTTP_GET_VARS['q']) : "" ); +$authorstring = (isset($HTTP_POST_VARS['authorstring'])) ? $HTTP_POST_VARS['authorstring'] : ( (!empty($HTTP_GET_VARS['a'])) ? stripslashes($HTTP_GET_VARS['a']) : "" ); $return_chars = ($HTTP_POST_VARS['charsreqd'] != "all") ? $HTTP_POST_VARS['charsreqd'] : -1; -$return_chars = (isset($HTTP_GET_VARS['c'])) ? ( ($HTTP_GET_VARS['c']!= "all") ? $HTTP_GET_VARS['c'] : -1 ) : $return_chars; +$return_chars = (isset($HTTP_GET_VARS['c'])) ? ( ($HTTP_GET_VARS['c'] != "all") ? $HTTP_GET_VARS['c'] : -1 ) : $return_chars; $searchall = ($HTTP_POST_VARS['addterms'] == "all") ? 1 : ( ($HTTP_GET_VARS['m'] == "all") ? 1 : 0 ); $searchforum = (isset($HTTP_POST_VARS['searchforum'])) ? $HTTP_POST_VARS['searchforum'] : $HTTP_GET_VARS['f'] ; $sortby = (isset($HTTP_POST_VARS['sortby'])) ? $HTTP_POST_VARS['sortby'] : $HTTP_GET_VARS['b']; @@ -325,27 +324,33 @@ if((isset($HTTP_POST_VARS['dosearch']) || isset($HTTP_GET_VARS['dosearch'])) && // searching of private forums // - if($querystring != "") + if($querystring != "" || $authorstring != "") { $search_sql = ""; - $searchdata = gensearch_sql(stripslashes($querystring), $searchall); - $search_sql = $searchdata[0]; + if($querystring != "") + { + $searchdata = gensearch_sql(stripslashes($querystring), $searchall); + $search_sql = $searchdata[0]; + } + if($authorstring != "") + { + $search_sql = preg_replace("/\(\)/", "", $search_sql); + $authorstring = stripslashes($authorstring); + $search_sql .= ($searchstring == "") ? "u.username LIKE '%$authorstring%'" : " AND (u.username LIKE '%$authorstring%')"; + } if(!ereg("\([ ]*\)",$search_sql)) { - if($authorstring != "") - { - $authorstring = stripslashes($authorstring); - $search_sql .= ($querystring == "") ? "WHERE u.username LIKE '%$authorstring%'" : " AND (u.username LIKE '%$authorstring%')"; - } - $sql .= $search_sql." + $sql .= "WHERE $search_sql AND (pt.post_id = p.post_id) AND (f.forum_id = p.forum_id) AND (p.topic_id = t.topic_id) AND (p.poster_id = u.user_id)"; if($searchforum != "all") + { $sql .= " AND (f.forum_id = '$searchforum')"; + } $sql .= " ORDER BY ".$sortby_sql[$sortby]." $sortby_dir"; @@ -411,7 +416,10 @@ if((isset($HTTP_POST_VARS['dosearch']) || isset($HTTP_GET_VARS['dosearch'])) && $message = preg_replace("/\[.*\]/", "", $message); $message = str_replace("\n", "<br />", $message); - $message = preg_replace($search_string, $replace_string, $message); + if(count($searchdata) > 1) + { + $message = preg_replace($search_string, $replace_string, $message); + } } else diff --git a/phpBB/templates/Default/profile_view_body.tpl b/phpBB/templates/Default/profile_view_body.tpl index 517709abe2..72fcc63d79 100755 --- a/phpBB/templates/Default/profile_view_body.tpl +++ b/phpBB/templates/Default/profile_view_body.tpl @@ -42,7 +42,7 @@ </tr> <tr class="tablebody"> <td bgcolor="#DDDDDD"><b>{L_WEBSITE}:</b></td> - <td bgcolor="#CCCCCC">{WEBSITE}</td> + <td bgcolor="#CCCCCC"><a href="{U_USER_WEBSITE}" target="_wwwuser">{WEBSITE}</a></td> </tr> <tr class="tablebody"> <td bgcolor="#DDDDDD"><b>{L_LOCATION}:</b></td> diff --git a/phpBB/templates/PSO/profile_view_body.tpl b/phpBB/templates/PSO/profile_view_body.tpl index 24edc6ac5b..537bca9dcf 100644 --- a/phpBB/templates/PSO/profile_view_body.tpl +++ b/phpBB/templates/PSO/profile_view_body.tpl @@ -12,7 +12,7 @@ </tr> <tr> <td bgcolor="{T_TD_COLOR1}" width="20%"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}">{L_USERNAME}:</font></td> - <td bgcolor="{T_TD_COLOR2}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{USERNAME}</b> [<a href="search.{PHPEX}?term=&addterms=any&forum=all&search_username={USERNAME}&sortby=p.post_time&searchboth=both&submit=Search">{L_VIEW_USERS_POSTS}</a>]</font></td> + <td bgcolor="{T_TD_COLOR2}" valign="middle"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{USERNAME}</b> [<a href="{U_SEARCH_USER}">{L_VIEW_USERS_POSTS}</a>]</font></td> </tr> <tr> <td bgcolor="{T_TD_COLOR1}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}">{L_JOINED}:</font></td> @@ -44,7 +44,7 @@ </tr> <tr> <td bgcolor="{T_TD_COLOR1}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}">{L_WEBSITE}:</font></td> - <td bgcolor="{T_TD_COLOR2}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}">{WEBSITE}</b></font></td> + <td bgcolor="{T_TD_COLOR2}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><a href="{U_USER_WEBSITE}" target="_userwww">{WEBSITE}</a></b></font></td> </tr> <tr> <td bgcolor="{T_TD_COLOR1}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}">{L_LOCATION}:</font></td> |