コード例 #1
0
function getUserRow($userId)
{
    require_once __DIR__ . '/Database/Db.php';
    $db = new dataBase();
    $db->multiVariableQuery('SELECT username, hidden_count, log_notes_count, founds_count, notfounds_count, email, country, latitude, longitude FROM `user` WHERE `user_id`=:1', $userId);
    return $db->dbResultFetchOneRowOnly();
}
コード例 #2
0
 tpl_set_var('desc_updated', '');
 tpl_set_var('displayGeoPathSection', displayGeoPatchSection('table'));
 if (isset($_POST['description'])) {
     $sql = "UPDATE user SET description = :1 WHERE user_id=:2";
     $db->multiVariableQuery($sql, strip_tags($_POST['description']), (int) $usr['userid']);
     $db->reset();
     tpl_set_var('desc_updated', "<font color='green'>" . tr('desc_updated') . "</font>");
 }
 if (isset($_POST['submit'])) {
     $sql = "UPDATE user SET get_bulletin = :1 WHERE user_id = :2 ";
     $db->multiVariableQuery($sql, intval(sql_escape($_POST['bulletin'])), (int) $usr['userid']);
     $db->reset();
 }
 $sql = "SELECT description, get_bulletin FROM user WHERE user_id = :1 LIMIT 1";
 $db->multiVariableQuery($sql, (int) $usr['userid']);
 $userinfo = $db->dbResultFetchOneRowOnly();
 $description = $userinfo['description'];
 $bulletin = $userinfo['get_bulletin'];
 tpl_set_var('bulletin_label', $bulletin == 1 ? tr('bulletin_label_yes') : tr('bulletin_label_no'));
 tpl_set_var('bulletin_value', $bulletin);
 tpl_set_var('is_checked', $bulletin == 1 ? "checked" : "");
 tpl_set_var('description', $description);
 $tplname = 'myprofile';
 $using_permantent_login_message = tr('no_auto_logout');
 $no_htmledit_message = tr('hide_html_editor');
 $notify_radius_message = tr('notify_new_caches_radius') . ' {radius} km';
 $no_notify_message = tr('no_new_caches_notification');
 // check user can set as Geocaching guide
 // Number of recommendations
 $nrecom = $db->multiVariableQueryValue("SELECT SUM(topratings) as nrecom FROM caches WHERE `caches`.`user_id`= :1", 0, $usr['userid']);
 if ($nrecom >= 20) {