예제 #1
0
function rules_update($rules_hash = '')
{
    $rules_hash = $rules_hash ? $rules_hash : $_GET['rules_hash'];
    $v_info = get_rules_info($rules_hash);
    $field_arr = array('page_get_type', 'page_link_rules', 'page_url_test', 'theme_url_test', 'theme_get_type', 'theme_rules', 'is_fiter_title', 'title_replace_rules', 'title_filter_rules', 'content_get_type', 'is_fiter_content', 'content_filter_rules', 'is_fiter_reply', 'reply_is_extend', 'reply_get_type', 'reply_rules', 'reply_fiter_replace', 'reply_filter_rules', 'content_page_get_type', 'content_page_rules', 'content_page_get_mode', 'is_get_other', 'from_get_type', 'author_get_type', 'from_get_rules', 'author_get_rules', 'dateline_get_type', 'dateline_get_rules', 'reply_replace_rules', 'content_rules', 'content_replace_rules', 'reply_filter_html');
    foreach ($field_arr as $k => $v) {
        $setarr[$v] = $v_info[$v];
    }
    $query = DB::query("SELECT * FROM " . DB::table('strayer_picker') . "  WHERE rules_hash ='{$rules_hash}'");
    while ($rs = DB::fetch($query)) {
        DB::update('strayer_picker', $setarr, array('rules_hash' => $rs['rules_hash']));
    }
}
예제 #2
0
function create_variable()
{
    global $_G;
    ob_clean();
    ob_end_flush();
    $url = format_url($_GET['url']);
    $rid = $_GET['rid'];
    $arr = explode('(*)', $url);
    $count = count($arr);
    $data = get_rules_info($rid);
    $url_var = unserialize($data['url_var']);
    for ($i = 1; $i < $count; $i++) {
        if ($url_var[$i]['var_type'][$i] == 'select' || $url_var[$i]['var_type'][$i] == 'selects') {
            $show_keyword = "display:none";
        } else {
            $show_ext = "display:none";
        }
        if ($url_var[$i]['var_type'][$i] == 'text') {
            $select_text = 'selected="selected"';
        }
        if ($url_var[$i]['var_type'][$i] == 'textarea') {
            $select_textarea = 'selected="selected"';
        }
        if ($url_var[$i]['var_type'][$i] == 'select') {
            $select_select = 'selected="selected"';
        }
        if ($url_var[$i]['var_type'][$i] == 'selects') {
            $select_selects = 'selected="selected"';
        }
        if ($url_var[$i]['var_ext_keyword'][$i] == 1) {
            $check_box = 'checked="checked" ';
        }
        $html .= '<tr class="hover"><td><input name="url_var[' . $i . '][var_title][' . $i . ']" type="text" value="' . $url_var[$i]['var_title'][$i] . '" class="shorttxt" id="var_title[' . $i . ']" size="15"></td><td><select class="var_ext_select_' . $i . '" onchange="show_var_ext(this.value, ' . $i . ')" name="url_var[' . $i . '][var_type][' . $i . ']" id="var_type[' . $i . ']">
			<option ' . $select_text . ' value="text" selected="">' . milu_lang('text') . '(text)</option>
			<option ' . $select_textarea . ' value="textarea">' . milu_lang('textarea') . '(textarea)</option>
			<option ' . $select_select . ' value="select">' . milu_lang('select') . '(select)</option>
			<option ' . $select_selects . ' value="selects">' . milu_lang('selects') . '(selects)</option>
		</select></td>
<td>
  <label id="var_keyword_' . $i . '" style="' . $show_keyword . '">
  <input ' . $check_box . ' name="url_var[' . $i . '][var_ext_keyword][' . $i . ']" type="checkbox" id="var_ext_keyword[' . $i . ']" value="checkbox" />' . milu_lang('open_keyword') . '</label>
  <div id="var_select_' . $i . '" style="' . $show_ext . '"><textarea style="float:left" rows="6" ondblclick="textareasize(this, 1)" onkeyup="textareasize(this, 0)" name="url_var[' . $i . '][var_ext_select][' . $i . ']" id="var_ext_select[' . $i . ']" cols="50" class="tarea">' . $url_var[$i]['var_ext_select'][$i] . '</textarea>
<span style="float:left"> <em>' . milu_lang('desc_demo') . '</em> </span></div></td>
<td><textarea rows="6" ondblclick="textareasize(this, 1)" onkeyup="textareasize(this, 0)" name="url_var[' . $i . '][var_desc][' . $i . ']" id="var_desc' . $i . '" cols="50" class="tarea">' . $url_var[$i]['var_desc'][$i] . '</textarea></td>
</tr>';
        unset($show_keyword, $show_ext, $select_text, $select_textarea, $select_select, $select_selects);
    }
    echo $html;
    define(FOOTERDISABLED, false);
    exit;
}
예제 #3
0
         cpmsg(milu_lang('empty_pick_confirm'), PICK_GO . 'picker_manage&myaction=pick_empty&pid=' . $pid . '&submit=1', 'form');
     }
     break;
 case 'pick_del':
     if ($pid && $submit) {
         del_picker($pid);
         cpmsg(milu_lang('del_finsh'), PICK_GO . "picker_manage", 'succeed');
     } else {
         cpmsg(milu_lang('pick_del_confirm'), PICK_GO . 'picker_manage&myaction=pick_del&pid=' . $pid . '&submit=1', 'form');
     }
     break;
 case 'export':
     $info['pick'] = get_pick_info();
     if ($info['pick']['rules_hash']) {
         pload('F:rules');
         $info['rules'] = get_rules_info($info['pick']['rules_hash']);
     }
     $is_hava = $info['rules'] ? milu_lang('hava_system_rules') : milu_lang('no_hava_system_rules');
     $args = array('type' => milu_lang('dxc_rules'), 'author' => $_G['setting']['bbname'], 'rules_name' => $info['pick']['name'], 'rule_desc' => $is_hava);
     $info['version'] = PICK_VERSION;
     exportfile($info, $info['pick']['name'], $args);
     break;
 case 'show_article_info':
     $arr['title'] = format_url($_GET['title']);
     $arr['content'] = format_url($_GET['content']);
     $arr['article_get_type'] = $_GET['article_get_type'];
     $arr['url_page_range'] = $_GET['url_page_range'];
     $arr['page_link_rules'] = format_url($_GET['page_link_rules']);
     $url_range_type = $_GET['url_range_type'];
     $page_test_url = $_GET['page_test_url'];
     $arr['url'] = $_GET['url'];
예제 #4
0
 function _ini_config($pid = 0, $is_cron = 0)
 {
     global $_G;
     $this->error = '';
     if ($pid == 0 && $is_cron > 0) {
         $this->error = 1;
         return;
     }
     $this->pid = $pid > 0 ? intval($pid) : intval($_GET['pid']);
     $this->pick_cache_data = load_cache('pick' . $this->pid);
     $this->i = $this->pick_cache_data['i'] ? $this->pick_cache_data['i'] : 1;
     $this->v_i = $this->pick_cache_data['v_i'] ? $this->pick_cache_data['v_i'] : 0;
     $this->a = $this->pick_cache_data['a'] ? $this->pick_cache_data['a'] : 0;
     $this->v_a = $this->pick_cache_data['v_a'] ? $this->pick_cache_data['v_a'] : 0;
     $this->all_get_time = $this->pick_cache_data['all_get_time'] ? $this->pick_cache_data['all_get_time'] : 0;
     $this->temp_arr['have_reply'] = 0;
     $this->plugin_set = get_pick_set();
     if ($is_cron > 0 && $this->plugin_set['is_log_cron'] > 0) {
         $is_log = 1;
     }
     $this->msg_args = array('is_cron' => $is_cron, 'pid' => $this->pid, 'is_log' => $is_log);
     if ($this->i == 1) {
         show_pick_info(milu_lang('pick_start'), '', $this->msg_args);
     }
     $p_arr = get_pick_info($this->pid);
     $p_arr = pstripslashes($p_arr);
     //if(!VIP) unset($p_arr['reply_rules'],$p_arr['reply_is_extend'], $p_arr['content_page_rules']);
     if ($p_arr['rules_type'] == 3) {
         $p_arr['url_range_type'] = '';
     }
     //新增
     $this->pick_set = pick_common_get();
     //插件设置
     $this->pick_config = $_G['cache']['evn_milu_pick'];
     $p_arr['rules_var'] = dstripslashes(unserialize($p_arr['rules_var']));
     $p_arr['many_page_list'] = dstripslashes(unserialize($p_arr['many_page_list']));
     $p_arr['title_filter_rules'] = dstripslashes(unserialize($p_arr['title_filter_rules']));
     $p_arr['content_filter_rules'] = dstripslashes(unserialize($p_arr['content_filter_rules']));
     $p_arr['reply_filter_rules'] = dstripslashes(unserialize($p_arr['reply_filter_rules']));
     $p_arr['content_filter_html'] = dstripslashes(unserialize($p_arr['content_filter_html']));
     $p_arr['reply_filter_html'] = dstripslashes(unserialize($p_arr['reply_filter_html']));
     $p_arr['public_class'] = dstripslashes(unserialize($p_arr['public_class']));
     //发布分类
     //if(!VIP) $p_arr['is_auto_public'] = 0;
     if ($p_arr['is_login'] == 2) {
         $p_arr['login_cookie'] = '';
     }
     if (!$p_arr['reply_max_num']) {
         $p_arr['reply_max_num'] = 200000;
     }
     //如果没有设置回复,这个就是最大数目了
     if ($p_arr['reply_is_extend']) {
         //继承内容规则
         $p_arr['reply_get_type'] = $p_arr['content_get_type'];
         $p_arr['reply_rules'] = $p_arr['content_rules'];
         if ($p_arr['is_fiter_content'] == 1) {
             //内容是过滤的
             if ($p_arr['is_fiter_reply'] == 1) {
                 //回复是过滤的
                 $p_arr['reply_replace_rules'] = array_merge((array) $p_arr['reply_replace_rules'], (array) $p_arr['content_replace_rules']);
                 $p_arr['reply_filter_rules'] = array_merge((array) $p_arr['content_filter_rules'], (array) $p_arr['reply_filter_rules']);
                 $p_arr['reply_filter_html'] = array_merge((array) $p_arr['content_filter_html'], (array) $p_arr['reply_filter_html']);
             } else {
                 //内容过滤,回复不过滤
                 $p_arr['reply_replace_rules'] = $p_arr['content_replace_rules'];
                 $p_arr['reply_filter_rules'] = $p_arr['content_filter_rules'];
                 $p_arr['reply_filter_html'] = $p_arr['content_filter_html'];
                 $p_arr['is_fiter_reply'] = 1;
             }
         }
     }
     $p_arr['stop_time'] = explode(',', $p_arr['stop_time']);
     $p_arr['stop_time'] = array_map('intval', $p_arr['stop_time']);
     $this->p_arr = $p_arr;
     $rules_hash = $this->p_arr['rules_hash'];
     if ($this->p_arr['is_auto_public'] == 1 && !$this->p_arr['public_class'][0]) {
         //既设置了自动发布,又没有设置发布栏目
         $this->error = 1;
         show_pick_info(milu_lang('no_set_public_class'), 'exit', $this->msg_args);
         return;
     }
     if ($this->p_arr['is_auto_public'] == 1 && $this->p_arr['is_word_replace'] == 1) {
         //即自动发布,又设置了同义词替换
         $this->words = get_replace_words();
     }
     pload('F:rules');
     if ($rules_hash) {
         $r_arr = get_rules_info($rules_hash);
     }
     $r_arr = pstripslashes($r_arr);
     $r_arr['url_var'] = dstripslashes(unserialize($r_arr['url_var']));
     $this->r_arr = $r_arr;
     $this->rid = $r_arr['rid'];
     $this->now_level = $this->pick_cache_data['now_level'];
     $this->max_level = $this->pick_cache_data['max_level'];
     if (!$this->pick_cache_data) {
         update_times($this->pid);
     }
     if (!$this->pick_cache_data['start_time']) {
         $this->pick_cache_data['start_time'] = TIMESTAMP;
     }
     $this->cache_time = PICK_ENABLE_CACHE ? 3600 * 24 : -1;
     //缓存
 }