Beispiel #1
0
function member_log()
{
    global $head_url, $header_config;
    if (!submitcheck('addsubmit')) {
        $info = pick_common_get();
        $info['header'] = pick_header_output($header_config, $head_url);
        $info['member_field'] = unserialize($info['member_field']);
        if (!$info['url']) {
            $info['url'] = 'http://www.discuz.net/';
        }
        //默认的
        if (!$info['jump_num']) {
            $info['jump_num'] = 45;
        }
        //默认的
        return $info;
    } else {
        $set = $_GET['set'];
        $set['member_field'] = serialize($_GET['member_field']);
        pick_common_set($set);
        cpmsg(milu_lang('op_success'), PICK_GO . "member", 'succeed');
    }
}
Beispiel #2
0
function fastpick_evo_log()
{
    global $head_url, $header_config;
    $page = $_GET['page'] ? intval($_GET['page']) : 1;
    $perpage = 25;
    $start = ($page - 1) * $perpage;
    $mpurl .= '&perpage=' . $perpage;
    $perpages = array($perpage => ' selected');
    $mpurl = '?' . PICK_GO . 'fast_pick&myac=fastpick_evo_log';
    $count = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('strayer_evo_log')), 0);
    $type_arr = array('1' => milu_lang('fast_pick_rules'), '2' => milu_lang('system_rules'), '3' => milu_lang('fastpick_evo'));
    $why_arr = array('1' => milu_lang('no_get_title'), '2' => milu_lang('no_get_content'), '0' => milu_lang('no_get_all'));
    if ($count) {
        $query = DB::query("SELECT * FROM " . DB::table('strayer_evo_log') . " ORDER BY dateline DESC LIMIT {$start},{$perpage} ");
        while ($v = DB::fetch($query)) {
            $v['dateline'] = dgmdate($v['dateline']);
            $v['show_type'] = $type_arr[$v['type']];
            $v['show_why'] = $why_arr[$v['why']];
            $v['show_url'] = cutstr($v['url'], 50);
            if ($v['type'] == 1) {
                $v['go_url'] = '?' . PICK_GO . 'fast_pick&myac=fastpick_edit&id=' . $v['data_id'];
            } else {
                if ($v['type'] == 2) {
                    $v['go_url'] = '?' . PICK_GO . 'system_rules&myac=rules_edit&rid=' . $v['data_id'];
                } else {
                    if ($v['type'] == 3) {
                        $v['go_url'] = '';
                    }
                }
            }
            $info['rs'][] = $v;
        }
    }
    $info['multipage'] = multi($count, $perpage, $page, $mpurl);
    $info['count'] = $count;
    $info['header'] = pick_header_output($header_config, $head_url);
    return $info;
}
Beispiel #3
0
function article_data_count()
{
    global $head_url, $header_config, $_G;
    $info['header'] = pick_header_output($header_config, $head_url);
    return $info;
}
Beispiel #4
0
function pick_import()
{
    global $_G, $head_url, $header_config;
    if (!submitcheck('submit')) {
        num_limit('strayer_picker', 3000, 'p_num_limit');
        $info['header'] = pick_header_output($header_config, $head_url);
        return $info;
    } else {
        $rules_code = $_GET['rules_code'];
        $pick_cid = $_GET['pick_cid'];
        if ($rules_code) {
            $data = $rules_code;
        } else {
            $file_name = str_iconv($_FILES['rules_file']['tmp_name']);
            $fp = fopen($file_name, 'r');
            $data = fread($fp, $_FILES['rules_file']['size']);
        }
        $arr = pimportfile($data);
        if ($arr['rules_hash']) {
            cpmsg_error(milu_lang('import_error', array('url' => PICK_GO)));
        }
        if (!$arr['pick']['pid']) {
            cpmsg_error(milu_lang('rules_error_data', array('url' => PICK_GO)));
        }
        pick_import_data($arr, $pick_cid);
        cpmsg(milu_lang('import_finsh'), PICK_GO . "picker_manage", 'succeed');
    }
}
Beispiel #5
0
function rules_import()
{
    global $_G, $header_config, $head_url;
    $data['header'] = pick_header_output($header_config, $head_url);
    $submit = $_GET['addsubmit'];
    $update_flag = $_GET['update_flag'];
    num_limit('strayer_rules', 3000, 's_num_limit');
    if ($submit) {
        $rules_code = $_GET['rules_code'];
        if ($rules_code) {
            $data = $rules_code;
        } else {
            $file_name = str_iconv($_FILES['rules_file']['tmp_name']);
            $fp = fopen($file_name, 'r');
            $data = fread($fp, $_FILES['rules_file']['size']);
        }
        $arr = pimportfile($data);
        //采集器名称为空,则对将当前的时间戳做为采集器文件名
        if (empty($arr['rules_name'])) {
            $arr['rules_name'] = $_G['timestamp'];
        }
        unset($arr['rid'], $arr['version']);
        //销毁采集器记录的ID与 版本号
        $arr = daddslashes($arr);
        //对值重新addslashes操作
        if ($arr['pick']['pid']) {
            cpmsg_error(milu_lang('import_error2', array('url' => PICK_GO)));
        }
        if (!$arr['rules_hash']) {
            cpmsg_error(milu_lang('rules_error_data'));
        }
        $check = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('strayer_rules') . " WHERE rules_hash='{$arr['rules_hash']}'"), 0);
        if ($check && !$update_flag) {
            if (!$rules_code) {
                $rules_code = $data;
            }
            cpmsg(milu_lang('cover_notice') . '?<input type="hidden" value="' . dstripslashes($data) . '" name="rules_code">', PICK_GO . 'system_rules&myac=rules_import&pid=' . $pid . '&addsubmit=1&update_flag=1', 'form');
        }
        $arr = get_table_field_name('strayer_rules', $arr);
        unset($arr['rid']);
        //去掉主键
        if ($update_flag) {
            $rules_hash = $arr['rules_hash'];
            rules_update($rules_hash);
            unset($arr['rules_hash']);
            DB::update('strayer_rules', $arr, array('rules_hash' => $rules_hash));
        } else {
            DB::insert('strayer_rules', $arr, TRUE);
        }
        del_search_index(2);
        cpmsg(milu_lang('import_finsh'), PICK_GO . "system_rules&myac=rules_list", 'succeed');
    }
    return $data;
}