示例#1
0
function profilefields_change($uid)
{
    $tpl = new tpl('user/profil_edit');
    $q = db_query("SELECT `id`, `func` FROM `prefix_profilefields` LEFT JOIN `prefix_userfields` ON `prefix_userfields`.`fid` = `prefix_profilefields`.`id` AND `prefix_userfields`.`uid` = " . $uid . " WHERE `func` != 3 AND `func` != 2 ORDER BY `pos`");
    while ($r = db_fetch_assoc($q)) {
        $ar = ProfilefieldRegistry::get($r["func"], $r["id"]);
        $ar["val"] = ProfilefieldRegistry::getUserValue($r["func"], $r["id"], $uid);
        ProfilefieldRegistry::renderProfile($ar);
    }
    ProfilefieldRegistry::clearStack();
}
示例#2
0
            $ar = ProfilefieldRegistry::get($func, $id);
            ProfilefieldRegistry::renderAdmin($ar);
        }
    }
    // damit der rest nicht mehr ausgegeben wird
    die;
}
$design = new design('Ilch Admin-Control-Panel :: Profilfelder', '', 2);
$design->header();
$_POST['show'] = @escape($_POST['show'], 'string');
$_POST['func'] = @escape($_POST['func'], 'integer');
$_POST['sid'] = @escape($_POST['sid'], 'integer');
$show = true;
if (isset($_POST['sub']) and chk_antispam('adminuser_action', true)) {
    if (empty($_POST['sid'])) {
        ProfilefieldRegistry::insert($_POST);
    } else {
        db_query("UPDATE `prefix_profilefields` SET `show` = '" . $_POST['show'] . "', `func` = " . $_POST['func'] . "  WHERE `id` = " . $_POST['sid']);
    }
}
if ($menu->get(1) == 'delete') {
    $id = $menu->get(2);
    // TODO func in diesem query anpassen
    $anz = db_count_query("SELECT COUNT(`id`) FROM `prefix_profilefields` WHERE `id` = " . $id . " AND `func` != 3 AND `func` != 2");
    if ($anz == 1) {
        $pos = db_result(db_query("SELECT `pos` FROM `prefix_profilefields` WHERE `id` = " . $id), 0);
        db_query("DELETE FROM `prefix_profilefields` WHERE `id` = " . $id);
        db_query("UPDATE `prefix_profilefields` SET `pos` = `pos` - 1 WHERE `pos` > " . $pos);
        db_query("DELETE FROM `prefix_userfields` WHERE `fid` = " . $id);
    }
}
示例#3
0
 public function renderProfileEdit($ar)
 {
     ProfilefieldRegistry::pushToStack($ar["func"], array(), 1);
     $this->tpl->out("page start");
 }