예제 #1
0
function seo_set()
{
    global $head_url;
    if (!submitcheck('submit')) {
        $info = pick_common_get();
        $info['open_seo_mod'] = dunserialize($info['open_seo_mod']);
        $info['open_seo_mod_show'][0] = in_array(1, $info['open_seo_mod']) ? 1 : 0;
        //门户
        $info['open_seo_mod_show'][1] = in_array(2, $info['open_seo_mod']) ? 1 : 0;
        //论坛
        $info['open_seo_mod_show'][2] = in_array(3, $info['open_seo_mod']) ? 1 : 0;
        //博客
        $info = dhtmlspecialchars($info);
        return $info;
    } else {
        $set = $_GET['set'];
        $set['open_seo_mod'] = serialize($set['open_seo_mod']);
        pick_common_set($set);
        cpmsg(milu_lang('op_success'), PICK_GO . "seo", 'succeed');
    }
}
예제 #2
0
function virtualdata_set()
{
    global $head_url, $header_config;
    if (!submitcheck('submit')) {
        require_once libfile('function/forumlist');
        $info = pick_common_get();
        $info['vir_cache_time'] = $info['vir_cache_time'] ? $info['vir_cache_time'] : 10;
        $info['vir_data_forum'] = unserialize($info['vir_data_forum']);
        $info['vir_data_usergroup'] = unserialize($info['vir_data_usergroup']);
        $info['forumselect'] = '<select name="set[vir_data_forum][]" size="10" multiple="multiple"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $info['vir_data_forum'], TRUE) . '</select>';
        return $info;
    } else {
        $set = $_GET['set'];
        if (!$set['vir_data_forum'][0] && count($set['vir_data_forum']) == 1) {
            $set['vir_data_forum'] = '';
        }
        pick_common_set($set);
        save_syscache('milu_pick_vir_postdata', '');
        save_syscache('milu_pick_vir_data', '');
        save_syscache('milu_pick_vir_online', '');
        cpmsg(milu_lang('op_success'), PICK_GO . "virtual_data", 'succeed');
    }
}
예제 #3
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');
    }
}
예제 #4
0
function fastpick_set()
{
    global $head_url, $header_config;
    if (!submitcheck('submit')) {
        require_once libfile('function/forumlist');
        $info = pick_common_get();
        $info['fp_open_mod'] = dunserialize($info['fp_open_mod']);
        $info['fp_open_mod'][0] = in_array(1, $info['fp_open_mod']) ? 1 : 0;
        //门户
        $info['fp_open_mod'][1] = in_array(2, $info['fp_open_mod']) ? 1 : 0;
        //论坛
        $info['fp_forum'] = dunserialize($info['fp_forum']);
        $info['fp_usergroup'] = dunserialize($info['fp_usergroup']);
        $info['forumselect'] = '<select name="set[fp_forum][]" size="10" multiple="multiple"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $info['fp_forum'], TRUE) . '</select>';
        $info['header'] = pick_header_output($header_config, $head_url);
        return $info;
    } else {
        $set = $_GET['set'];
        $set['fp_open_mod'] = serialize($set['fp_open_mod']);
        if (!$set['fp_forum'][0] && count($set['fp_forum']) == 1) {
            $set['fp_forum'] = '';
        }
        if (!$set['fp_usergroup'][0] && count($set['fp_usergroup']) == 1) {
            $set['fp_usergroup'] = '';
        }
        pick_common_set($set);
        cpmsg(milu_lang('op_success'), PICK_GO . "fast_pick&myac=fastpick_set", 'succeed');
    }
}
예제 #5
0
function article_batch()
{
    global $_G;
    $aid_arr = $_GET['aid'];
    $is_public_del = $_GET['is_public_del'];
    if (!VIP) {
        $today_arr = dunserialize(pick_common_get('', 'pick_today'));
        if ($today_arr['day'] != date('md', $_G['timestamp'])) {
            $c_set['pick_today'] = array();
            pick_common_set($c_set);
        } else {
            $article_public_num = $today_arr['article_public_num'];
            if ($article_public_num > 10000) {
                cpmsg_error(milu_lang('article_public_limit', array('n' => 10000)));
            }
        }
    }
    extract($_GET);
    extract($set);
    $public_start_time = strtotime($public_start_time);
    $public_end_time = strtotime($public_end_time);
    $args_arr = array('optype', 'pid', 'is_public_del', 'article_public_sort', 'is_public_del', 'public_start_time', 'public_end_time', 'status', 's', 'ordersc', 'orderby', 'time_public', 'portal', 'forums', 'threadtypeid', 'blog', 'perpage', 'oparea', 'article_batch_num', 'move_pid', 'p');
    $args_url = '';
    foreach ($args_arr as $k => $v) {
        $args_url .= '&' . $v . '=' . ${$v};
    }
    //$args_url .= '&myac='
    //echo $args_url;exit();
    $from_url = PICK_GO . "picker_manage&myac=article_manage&finished=1" . $args_url;
    if ($_GET['finished']) {
        cpmsg(milu_lang('run_finsh'), $from_url, 'succeed');
    }
    if (!$_GET['confirmed']) {
        $article_batch_num = $setrr['article_batch_num'] = $article_batch_num ? $article_batch_num : 15;
        pick_common_set($setrr);
        if (!$optype) {
            cpmsg_error(milu_lang('must_select_optype'));
        }
        if ($oparea == 'selected') {
            if (!$aid_arr) {
                cpmsg_error(milu_lang('must_select_data'));
            }
            $aid_str = base64_encode(serialize($aid_arr));
            $total = count($aid_arr);
        } else {
            if ($oparea == 'all') {
                $total = article_count($pid, $status, array('s' => $s));
            }
        }
        pcpmsg_loading(milu_lang('bat_import_article', array('a' => $article_batch_num, 't' => $total)), $from_url, 'loadingform', '', '<div id="percent">0%</div>', FALSE);
        $ajax_url = "admin.php?" . PICK_GO . "picker_manage&myac=ajax_func&inajax=1&af=" . $myac . "&tpl=no&confirmed=1&oparea={$oparea}&aid={$aid_str}" . $args_url;
        $finsh_url = "admin.php?" . PICK_GO . "picker_manage&myac=article_manage&finished=1" . $args_url;
        //echo $ajax_url;exit();
        echo pick_loading($ajax_url, $finsh_url, $total, array('bat_num' => $article_batch_num));
    } else {
        ob_end_clean();
        $total = intval($_GET['total']);
        $pp = intval($_GET['pp']);
        $pid = intval($_GET['pid']);
        $currow = intval($_GET['currow']);
        $oparea = $_GET['oparea'];
        $public_sort = $_GET['public_sort'];
        $public_sort = $public_sort == 1 ? 'asc' : 'desc';
        if ($oparea == 'selected') {
            $aid_arr = unserialize(base64_decode($aid));
            $where = $optype == 'timing_delete' ? " AND t.id IN (" . dimplode($aid_arr) . ") " : " AND aid IN (" . dimplode($aid_arr) . ") ";
        } else {
            if ($oparea == 'all') {
                $where = $optype == 'timing_delete' ? " AND  a.title like '%" . $_GET['s'] . "%' " : " AND title like '%" . $_GET['s'] . "%' ";
            }
        }
        $aid_arr = array();
        if ($is_public_del == 1 && ($optype == 'move_portal' || $optype == 'move_forums' || $optype == 'move_blog') || $optype == 'delete') {
            $currow = 0;
        }
        if ($optype == 'timing_delete') {
            $query = DB::query("SELECT a.aid,t.id, t.data_id FROM " . DB::table('strayer_timing') . " t Inner Join " . DB::table('strayer_article_title') . " a ON a.aid = t.data_id WHERE t.pid='{$pid}' {$where} ORDER by t.data_id LIMIT {$currow},{$pp}");
            while ($rs = DB::fetch($query)) {
                if ($rs['aid']) {
                    DB::update('strayer_article_title', array('status' => 1), array('aid' => $rs['aid']));
                }
                $aid_arr[] = $rs['id'];
            }
        } else {
            $query = DB::query("SELECT aid FROM " . DB::table('strayer_article_title') . " WHERE pid='{$pid}' {$where} ORDER by dateline " . $public_sort . " LIMIT {$currow},{$pp}");
            while ($rs = DB::fetch($query)) {
                $aid_arr[] = $rs['aid'];
            }
        }
        if ($optype == 'move_portal' || $optype == 'move_forums' || $optype == 'move_blog') {
            article_import($_GET['optype'], array('aid' => $aid_arr));
        } else {
            $action = 'article_' . $optype;
            $action($aid_arr, $pid);
        }
        if ($currow + $pp > $total) {
            echo 'TRUE';
            exit;
        }
        echo 'GO';
        exit;
    }
}
예제 #6
0
function tips_no($key = '')
{
    $key = $key ? $key : $_GET['key'];
    $set['pick_tips'][$key] = 1;
    pick_common_set($set);
    return 'ok';
}
예제 #7
0
function article_import($action, $args)
{
    global $_G;
    $pick_common_set = get_pick_set();
    $is_timing = $pick_common_set['is_timing'];
    //if(!VIP) $is_timing = 0;
    pload('F:spider');
    $aid_arr = $args['aid'] ? $args['aid'] : $_GET['aid'];
    $op = 'article_' . $action;
    $type_arr = explode('_', $action);
    $type = $type_arr[1];
    $pid = $args['pid'] ? $args['pid'] : intval($_GET['pid']);
    $p_arr = get_pick_info($pid);
    $view_arr = format_wrap($p_arr['view_num'], ',');
    $public_type = 1;
    if ($type == 'blog') {
        $public_type = 3;
        $type = 'album';
    }
    if ($type == 'forums') {
        $public_type = 2;
        $type = 'forum';
    }
    $today_public_num = 0;
    foreach ($aid_arr as $k => $aid) {
        $arr = $old_arr = article_info($aid);
        if (!$arr) {
            continue;
        }
        $arr['p_arr'] = $p_arr;
        $arr['public_start_time'] = $_GET['public_start_time'] ? $_GET['public_start_time'] : $p_arr['public_start_time'];
        $arr['public_end_time'] = $_GET['public_end_time'] ? $_GET['public_end_time'] : $p_arr['public_end_time'];
        $arr['public_time'] = 0;
        $time_arr = create_public_time($arr, 1);
        $arr['public_time'] = array_pop($time_arr);
        if ($args['cron_run'] && $args['public_time']) {
            $arr['public_time'] = $args['public_time'][$aid];
        }
        $arr['title'] = htmlspecialchars_decode($arr['title'], ENT_QUOTES);
        $arr['content'] = htmlspecialchars_decode($arr['content'], ENT_QUOTES);
        $arr['title'] = format_html($arr['title']);
        $arr['content'] = format_html($arr['content']);
        unset($arr['pic']);
        $arr['view_num'] = rand($view_arr[0], $view_arr[1]);
        $rand_arr = get_rand_uid($p_arr);
        $arr['uid'] = $setarr['uid'] = $rand_arr[0]['uid'] ? $rand_arr[0]['uid'] : $_G['uid'];
        $arr['username'] = $setarr['username'] = $rand_arr[0]['username'];
        $arr['portal_cid'] = $timing_public_arr['portal'] = $args['portal'] ? $args['portal'] : $_GET['portal'];
        $arr['forum_fid'] = $timing_public_arr['forums'] = $args['forums'] ? $args['forums'] : $_GET['forums'];
        $arr['forum_typeid'] = $timing_public_arr['threadtypeid'] = $args['threadtypeid'] ? $args['threadtypeid'] : $_GET['threadtypeid'];
        $arr['blog_big_cid'] = $timing_public_arr['blog'] = $args['blog'] ? $args['blog'] : $_GET['blog'];
        $arr['blog_small_cid'] = $timing_public_arr['classid'] = $args['classid'] ? $args['classid'] : $_GET['classid'];
        $arr['is_download_img'] = $p_arr['is_download_img'];
        $arr['is_water_img'] = $p_arr['is_water_img'];
        $arr['content'] = clear_ad_html($arr['content']);
        $arr['summary'] = addslashes($arr['summary']);
        $arr['public_reply_seq'] = $p_arr['public_reply_seq'];
        $arr['is_public_reply'] = $p_arr['is_public_reply'];
        $arr['public_uid'] = $p_arr['public_uid'];
        $arr['reply_uid'] = $p_arr['reply_uid'];
        $arr['is_page_public'] = $p_arr['is_page_public'];
        $arr['page_url'] = $arr['url'];
        //发布时间大于当前时间,放入定时发布中
        if ($arr['public_time'] > $_G['timestamp'] && $is_timing == 1) {
            $timing_setarr = array('public_type' => $public_type, 'data_id' => $aid, 'content_type' => 1, 'public_dateline' => $arr['public_time'], 'pid' => $pid, 'public_info' => serialize($timing_public_arr));
            article_timing_add($timing_setarr);
            DB::update('strayer_article_title', array('status' => 4), array('aid' => $aid));
            continue;
        }
        $arr['article_tag'] = $pick_common_set['open_tag'] == 1 && ($type == 'album' || $type == 'forum') && empty($arr['article_tag']) ? implode(',', dz_get_tag($arr['title'], $arr['content'], 1)) : $arr['article_tag'];
        $arr['cookie'] = $p_arr['login_cookie'];
        $arr['is_download_file'] = $p_arr['is_download_file'];
        $arr['content_filter_html'] = unserialize(dstripslashes($p_arr['content_filter_html']));
        if ($arr['contents'] > 1 && $arr['is_bbs'] == 0 && $type == 'forum' && $p_arr['is_page_public'] == 2) {
            $arr['is_public_reply'] = 1;
            $arr['public_reply_seq'] = 0;
            $arr['is_content_reply'] = 1;
            $arr['is_bbs'] = 1;
        } else {
            if ($arr['is_bbs'] != 1) {
                $arr['reply'] = array();
            }
        }
        if ($p_arr['is_word_replace'] == 1) {
            //同义词替换
            if ($p_arr['is_bbs'] != 1 && $arr['contents'] > 1) {
                //有几页的文章
                $arr['content_arr'] = article_words_replace($arr['content_arr']);
            }
            $arr['content'] = article_words_replace($arr['content']);
            if ($arr['reply']) {
                $arr['reply'] = article_words_replace($arr['reply']);
            }
            $arr['title'] = article_words_replace($arr['title']);
        }
        $arr['content'] = clear_ad_html($arr['content']);
        unset($arr['url']);
        //跟门户的跳转url重名
        unset($arr['aid']);
        if ($type == 'forum') {
            $arr = $op($arr, $old_arr);
            $insert_aid = $setarr['forum_id'] = $arr['tid'];
        } else {
            $insert_aid = $op($arr, $old_arr);
            if ($type == 'portal') {
                $setarr['portal_id'] = $insert_aid;
            } else {
                $setarr['blog_id'] = $insert_aid;
            }
        }
        if ($insert_aid) {
            $arr['aid'] = $insert_aid;
            $arr['cookie'] = $p_arr['login_cookie'];
            if ($type == 'forum') {
                if ($arr['is_download_img'] == 1 || $arr['is_download_file'] == 1) {
                    forum_downremotefile($arr, $old_arr);
                }
            } else {
                downremotefile($arr, $type, $old_arr);
            }
            if ($type == 'portal') {
                article_thumb($insert_aid);
            }
        }
        $p_arr['is_public_del'] = $p_arr['is_public_del'] ? $p_arr['is_public_del'] : intval($_GET['is_public_del']);
        $setarr['status'] = 2;
        $setarr['article_tag'] = $arr['article_tag'];
        $today_public_num++;
        if ($p_arr['is_public_del'] != 1 && $insert_aid) {
            DB::update('strayer_article_title', $setarr, array('aid' => $aid));
        }
    }
    if (VIP) {
        $today_arr = dunserialize(pick_common_get('', 'pick_today'));
        $c_set['pick_today']['day'] = date('md', $_G['timestamp']);
        $c_set['pick_today']['article_public_num'] = $today_public_num + $today_arr['article_public_num'];
        pick_common_set($c_set);
    }
    if ($p_arr['is_public_del'] == 1) {
        article_delete($aid_arr);
    }
    //导入之后删除
    return $insert_aid;
}