Beispiel #1
0
require_once 'inc.php';
$action = empty($_GET["action"]) ? '' : $_GET["action"];
if ($action == "edit") {
    $isbool = false;
    if (file_exists('../configs/web.xml')) {
        $xml = simplexml_load_file('../configs/web.xml');
        foreach ($xml->xpath("/web/info/add") as $val) {
            $val['value'] = $_POST['' . $val['filed'] . ''];
        }
        $xml->saveXML('../configs/web.xml');
        $isbool = true;
    } else {
        info_sysadmin_error('读取站点配置文件失败');
    }
    if ($isbool) {
        success_msg('修改成功', prev_url());
    } else {
        success_msg('修改失败', 'back');
    }
}
if ($action == '') {
    if (file_exists('../configs/web.xml')) {
        $webinfo = array();
        $xml = simplexml_load_file('../configs/web.xml');
        foreach ($xml->xpath('/web/info/add') as $value) {
            $webinfo[] = $value;
        }
        $smarty->assign('webinfo', $webinfo);
    } else {
        info_sysadmin_error('读取站点配置文件失败');
    }
Beispiel #2
0
            } else {
                error_msg('推荐失败', 'back');
            }
        } elseif ($yincang == "3") {
            for ($i = 0; $i < count($id); $i++) {
                $product = $db->fetch($db->query("SELECT * FROM {$table} WHERE id=" . $id[$i]));
                if ($product) {
                    //@unlink('../'.$product['image']);
                    //@unlink('../'.$product['simage']);
                }
                $mod_content = "tuijian='2'";
                $where = 'id=' . $id[$i];
                $isbool = $db->update($table, $mod_content, $where);
            }
            if ($isbool !== false) {
                success_msg('取消推荐成功', prev_url());
            } else {
                error_msg('取消推荐失败', 'back');
            }
        }
    }
}
if ($action == "tj") {
    #分类
    $typeList = array();
    display_type($db, $typeList, 0, 0);
    $smarty->assign('typeList', $typeList);
}
if ($action == "add") {
    //     echo "<pre>";
    //     print_r($_POST);
Beispiel #3
0
if ($action == "delete") {
    if (!empty($_GET['id'])) {
        $id = $_GET['id'];
        #检测是否有子类
        $sub_type = $db->query_count("cn_course_type", "AND parent_id={$id}");
        if ($sub_type > 0) {
            info_sysadmin_error('该分类有子类,不能删除');
        }
        #检测是否有文章
        $product = $db->query_count("cn_course", "AND type_id={$id}");
        if ($product > 0) {
            info_sysadmin_error('该分类有产品,不能删除');
        }
        $isbool = $db->delete($table, "id=" . $id);
        if ($isbool !== false) {
            success_msg('删除成功', prev_url());
        } else {
            error_msg('删除失败', 'back');
        }
    }
}
if ($action == "tj") {
    #分类
    $typeList = array();
    display_type($db, $typeList, 0, 0);
    $smarty->assign('typeList', $typeList);
}
if ($action == "add") {
    $name = $_POST['name'];
    $sort = $_POST['sort'];
    $parent_id = $_POST['parent_id'];
Beispiel #4
0
 $nonvbid = $fbID;
 //ACP-399
 /*
 if ($vbulletin->options['verifyemail']) {
     $sql = "SELECT activationid FROM useractivation WHERE userid = '" .
              $userid . "'";
 
     $data = $vbulletin->db->query_first($sql);
 
     $activationid = $data["activationid"];
 }
 */
 if (!empty($activationid)) {
     $url = "register.php?a=act&u=" . $userid . "&i=" . $activationid;
 } else {
     $url = prev_url();
     // Process vBulletin login
     $vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids,\n                        username, password, salt FROM " . TABLE_PREFIX . "user\n                        WHERE userid = " . $userid);
     require_once DIR . '/includes/functions_login.php';
     vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true);
     vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true);
     process_new_login('', 1, $vbulletin->GPC['cssprefs']);
     cache_permissions($vbulletin->userinfo, true);
     $vbulletin->session->save();
     if ($vbulletin->options['welcomemail']) {
         eval(fetch_email_phrases('welcomemail'));
         vbmail($email, $subject, $message);
     }
     $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
     $userinfo_welcome = fetch_userinfo($userid);
     $userdata->set_existing($userinfo_welcome);