Skip to content
Permalink
Browse files

add usersearch updates #1015

  • Loading branch information...
Slini11 committed Oct 17, 2016
1 parent 32c1f12 commit 955ffacd75f5d9617446e2bab4754c05f5f67d27
@@ -32,7 +32,7 @@ function search_output()
global $opt, $tpl, $login;
global $enable_mapdisplay;
global $called_by_search, $called_by_profile_query, $options, $lat_rad, $lon_rad, $distance_unit;
global $startat, $caches_per_page, $sql, $query_userid, $query_name, $invalid_waypoints;
global $startat, $caches_per_page, $sql, $query_userid, $query_name, $invalid_waypoints, $user;
$tpl->name = 'search.result.caches';
$tpl->menuitem = MNU_CACHES_SEARCH_RESULT;
@@ -197,6 +197,16 @@ function search_output()
$tpl->assign('disable_edit_options', true);
}
if (isset($user) && isset($options['owner'])) {
$tpl->assign('owner', isset($user) ? $user->getUsername() : '');
$tpl->assign('ownerid', isset($user) ? $user->getUserId() : '');
} elseif (isset($user) && isset($options['finder'])) {
$tpl->assign('finder', isset($user) ? $user->getUsername() : '');
$tpl->assign('finderid', isset($user) ? $user->getUserId() : '');
} else {
$tpl->assign('owner_not', isset($options['owner']) ? htmlspecialchars($options['owner'], ENT_COMPAT, 'UTF-8') : '');
$tpl->assign('finder_not', isset($options['finder']) ? htmlspecialchars($options['finder'], ENT_COMPAT, 'UTF-8') : '');
}
$tpl->display();
}
@@ -317,12 +317,36 @@
$options['ownerid'] = isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0;
$options['owner'] = isset($_REQUEST['owner']) ? stripslashes($_REQUEST['owner']) : '';
if (isset($options['owner'])) {
$rs_name = sql("SELECT `user_id` FROM `user` WHERE `username`='&1'", $options['owner']);
if (sql_num_rows($rs_name) == 1) {
$record_id = sql_fetch_array($rs_name);
$options['ownerid'] = $record_id['user_id'];
$user = new user($options['ownerid']);
}
unset($record_id);
sql_free_result($rs_name);
}
} elseif (isset($_REQUEST['searchbyfinder'])) { // Ocprop
$options['searchtype'] = 'byfinder';
$options['finderid'] = isset($_REQUEST['finderid']) ? $_REQUEST['finderid'] : 0;
$options['finder'] = isset($_REQUEST['finder']) ? stripslashes($_REQUEST['finder']) : '';
$options['logtype'] = isset($_REQUEST['logtype']) ? $_REQUEST['logtype'] : '1,7'; // Ocprop
if (isset($options['finder'])) {
$rs_name = sql("SELECT `user_id` FROM `user` WHERE `username`='&1'", $options['finder']);
if (sql_num_rows($rs_name) == 1) {
$record_id = sql_fetch_array($rs_name);
$options['finderid'] = $record_id['user_id'];
$user = new user($options['finderid']);
}
unset($record_id);
sql_free_result($rs_name);
}
} elseif ((isset($_REQUEST['searchbyortplz']) && is_numeric($_REQUEST['ortplz']))
|| isset($_REQUEST['searchbyplz'])) {
$options['searchtype'] = 'byplz';
@@ -112,7 +112,6 @@
</table>
</td>
</tr>
{/if}

<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
<tr>
@@ -188,6 +187,20 @@
</td>
</tr>
<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
{else}
<tr>
<td class="header-small" colspan="2">
&nbsp;&nbsp;<img src="resource2/ocstyle/images/log/16x16-dnf.png"/>&nbsp;
{if $owner}
{t 1=$ownerid 2=$owner}The user <b><a href="viewprofile.php?userid=%1">%2</a></b> does not own any caches that fit to your search options.{/t}
{elseif $finder}
{t 1=$finderid 2=$finder}The user <b><a href="viewprofile.php?userid=%1">%2</a></b> does not own any logs that fit to your search options.{/t}
{elseif $finder_not || $owner_not}
{t 1=$finder_not 2=$owner_not}The user <b>%1%2</b> doesn't exsist.{/t}
{/if}
</td>
</tr>
{/if}
{if $pages_list}
<tr>
<td colspan="2" class="header-small">{include file="res_pager.tpl"}</td>
@@ -2882,6 +2882,9 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2624', 'show al
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2625', 'hide all additional search options', '2016-08-02 15:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2626', 'Select at least one cachetype!', '2016-08-02 15:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2627', 'Select at least one cachesize!', '2016-08-02 15:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2628', 'The user <b><a href=\"viewprofile.php?userid=%1\">%2</a></b> does not own any caches that fit to your search options.', '2016-10-17 03:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2629', 'The user <b><a href=\"viewprofile.php?userid=%1\">%2</a></b> does not own any logs that fit to your search options.', '2016-10-17 03:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2630', 'The user <b>%1%2</b> doesn\'t exsist.', '2016-10-17 03:00:00');

-- Table sys_trans_ref
SET NAMES 'utf8';
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2625', 'DE', 'Verberge alle zusätzlichen Suchoptionen', '2016-08-02 15:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2626', 'DE', 'Wähle mindestens einen Cachetype aus!', '2016-08-02 15:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2627', 'DE', 'Wähle mindestens eine Cachegröße aus!', '2016-08-02 15:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2628', 'DE', 'Der Benutzer <b><a href=\"viewprofile.php?userid=%1\">%2</a></b> besitzt keine Caches, die zu den ausgewählten Suchoptionen passen.', '2016-10-17 03:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2629', 'DE', 'Der Benutzer <b><a href=\"viewprofile.php?userid=%1\">%2</a></b> besitzt keine Logs, die zu den ausgewählten Suchoptionen passen.', '2016-10-17 03:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2630', 'DE', 'Der Benutzer <b>%1%2</b> exestiert nicht.', '2016-10-17 03:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing – please do not login', '2010-08-28 11:48:07');

0 comments on commit 955ffac

Please sign in to comment.
You can’t perform that action at this time.