Example #1
0
    function getjs_action() {
        $lang=include ROOT.'/lang/'.config::get('lang_type').'/system.php';
        $id=front::get('id');
        if(preg_match('/select/i',$id)){
        	exit('非法参数');
        }
        $ballot=new ballot();
        $option=new option();
        $where=array('id'=>$id);
        $arr=$ballot->getrow($where);
        $row=$option->getrows(array('bid'=>$id),null,'num desc');
        $this->view->arr=$arr;
        $this->view->row=$row;
        $this->view->lang=$lang;
        /*$html='document.write(\'<form name="form1" method="post" action="'.url("ballot").'">\');';
        $html .= 'document.write(\'<input type="hidden" name="bid" id="bid" value="'.$arr['id'].'" />\');';
		$html .= 'document.write(\'<h5>\');';
        $html .= 'document.write(\''.$arr['title']."</h5>');";
        foreach ($row as $option) {
            if ($arr['type'] == 'radio') {
                $html .= 'document.write(\'<input type="radio" name="ballot" id="ballot" value="'.$option['id'].'" />\');';
            }
            else {
                $html .= 'document.write(\'<input type="checkbox" name="ballot[]" id="ballot" value="'.$option['id'].'" />\');';
            }
            $html .= 'document.write(\' '.$option['name'].' ('.$option['num'].')<br>\');';
        }
        $html .= 'document.write(\'<input type="submit" name="submit" id="button" value=" '.$lang['vote'].'" /></form>\');';
        echo $html;*/
    }
 /**
  * Help tab for media screen
  * @return help tab with verbose information for plugin
  *
  * @since 1.1.0
  */
 public function help()
 {
     $screen = get_current_screen();
     $large = $this->common->minimum_backstretch_width();
     $height_help = '<h3>' . __('Height', 'display-featured-image-genesis') . '</h3>';
     $height_help .= '<p>' . __('Depending on how your header/nav are set up, or if you just do not want your backstretch image to extend to the bottom of the user screen, you may want to change this number. It will raise the bottom line of the backstretch image, making it shorter.', 'display-featured-image-genesis') . '</p>';
     $height_help .= '<p>' . __('The plugin determines the size of your backstretch image based on the size of the user\'s browser window. Changing the "Height" setting tells the plugin to subtract that number of pixels from the measured height of the user\'s window, regardless of the size of that window.', 'display-featured-image-genesis') . '</p>';
     $height_help .= '<p>' . __('If you need to control the size of the backstretch Featured Image output with more attention to the user\'s screen size, you will want to consider a CSS approach instead. Check the readme for an example.', 'display-featured-image-genesis') . '</p>';
     $default_help = '<h3>' . __('Default Featured Image', 'display-featured-image-genesis') . '</h3>';
     $default_help .= '<p>' . __('You may set a large image to be used sitewide if a featured image is not available. This image will show on posts, pages, and archives.', 'display-featured-image-genesis') . '</p>';
     $default_help .= '<p>' . sprintf(__('Supported file types are: jpg, jpeg, png, and gif. The image must be at least %1$s pixels wide.', 'display-featured-image-genesis'), absint($large + 1)) . '</p>';
     $skipfront_help = '<h3>' . __('Skip Front Page', 'display-featured-image-genesis') . '</h3>';
     $skipfront_help .= '<p>' . __('If you set a Default Featured Image, it will show on every post/page of your site. This may not be desirable on child themes with a front page constructed with widgets, so you can select this option to prevent the Featured Image from showing on the front page. Checking this will prevent the Featured Image from showing on the Front Page, even if you have set an image for that page individually.', 'display-featured-image-genesis') . '</p>';
     $skipfront_help .= '<p>' . sprintf(__('If you want to prevent entire groups of posts from not using the Featured Image, you will want to <a href="%s" target="_blank">add a filter</a> to your theme functions.php file.', 'display-featured-image-genesis'), esc_url('https://github.com/robincornett/display-featured-image-genesis#how-do-i-stop-the-featured-image-action-from-showing-on-my-custom-post-types')) . '</p>';
     $keeptitles_help = '<h3>' . __('Do Not Move Titles', 'display-featured-image-genesis') . '</h3>';
     $keeptitles_help .= '<p>' . __('This setting applies to the backstretch Featured Image only. It allows you to keep the post/page titles in their original location, instead of overlaying the new image.', 'display-featured-image-genesis') . '</p>';
     $excerpts_help = '<h3>' . __('Move Excerpts/Archive Descriptions', 'display-featured-image-genesis') . '</h3>';
     $excerpts_help .= '<p>' . __('By default, archive descriptions (set on the Genesis Archive Settings pages) show below the Default Featured Image, while the archive title displays on top of the image. If you check this box, all headlines, descriptions, and optional excerpts will display in a box overlaying the Featured Image.', 'display-featured-image-genesis') . '</p>';
     $paged_help = '<h3>' . __('Show Featured Image on Subsequent Blog Pages', 'display-featured-image-genesis') . '</h3>';
     $paged_help .= '<p>' . __('Featured Images do not normally show on the second (and following) page of term/blog/post archives. Check this setting to ensure that they do.', 'display-featured-image-genesis') . '</p>';
     $feed_help = '<h3>' . __('Add Featured Image to Feed?', 'display-featured-image-genesis') . '</h3>';
     $feed_help .= '<p>' . __('This plugin does not add the Featured Image to your content, so normally you will not see your Featured Image in the feed. If you select this option, however, the Featured Image (if it is set) will be added to each entry in your RSS feed.', 'display-featured-image-genesis') . '</p>';
     $feed_help .= '<p>' . __('If your RSS feed is set to Full Text, the Featured Image will be added to the entry content. If it is set to Summary, the Featured Image will be added to the excerpt instead.', 'display-featured-image-genesis') . '</p>';
     $cpt_help = '<h3>' . __('Featured Images for Custom Post Types', 'display-featured-image-genesis') . '</h3>';
     $cpt_help .= '<p>' . __('Some plugins and/or developers extend the power of WordPress by using Custom Post Types to create special kinds of content.', 'display-featured-image-genesis') . '</p>';
     $cpt_help .= '<p>' . __('Since your site uses Custom Post Types, you may optionally set a Featured Image for each archive.', 'display-featured-image-genesis') . '</p>';
     $cpt_help .= '<p>' . __('Featured Images for archives can be smaller than the Default Featured Image, but still need to be larger than your site\'s "medium" image size.', 'display-featured-image-genesis') . '</p>';
     $help_tabs = array(array('id' => 'displayfeaturedimage_less_header-help', 'title' => __('Height', 'display-featured-image-genesis'), 'content' => $height_help), array('id' => 'displayfeaturedimage_default-help', 'title' => __('Default Featured Image', 'display-featured-image-genesis'), 'content' => $default_help), array('id' => 'displayfeaturedimage_exclude_front-help', 'title' => __('Skip Front Page', 'display-featured-image-genesis'), 'content' => $skipfront_help), array('id' => 'displayfeaturedimage_keep_titles-help', 'title' => __('Do Not Move Titles', 'display-featured-image-genesis'), 'content' => $keeptitles_help), array('id' => 'displayfeaturedimage_excerpts-help', 'title' => __('Move Excerpts', 'display-featured-image-genesis'), 'content' => $excerpts_help), array('id' => 'displayfeaturedimage_paged-help', 'title' => __('Subsequent Pages', 'display-featured-image-genesis'), 'content' => $paged_help), array('id' => 'displayfeaturedimage_feed-help', 'title' => __('RSS Feed', 'display-featured-image-genesis'), 'content' => $feed_help));
     foreach ($help_tabs as $tab) {
         $screen->add_help_tab($tab);
     }
     if ($this->post_types) {
         $screen->add_help_tab(array('id' => 'displayfeaturedimage_cpt-help', 'title' => __('Custom Post Types', 'display-featured-image-genesis'), 'content' => $cpt_help));
     }
 }
function callback_remove()
{
    option::del('wmzz_mailer_title');
    option::del('wmzz_mailer_text');
    option::del('wmzz_mailer_limit');
    option::del('wmzz_mailer_last');
}
function callback_remove()
{
    global $m;
    option::del('wmzz_anno_set');
    option::del('wmzz_anno_tpl');
    option::del('wmzz_anno_doa');
}
Example #5
0
 /**
  * MySQL 随机取记录
  * 
  * @param $t 表
  * @param $c ID列,默认为id
  * @param $n 取多少个
  * @param $w 条件语句
  * @param $f bool 是否强制以多维数组形式返回,默认false
  * @param $p string 随机数据前缀,如果产生冲突,请修改本项
  * @return array 取1个直接返回结果数组(除非$f为true),取>1个返回多维数组,用foreach取出
  */
 public function rand($t, $c = 'id', $n = '1', $w = '', $f = false, $p = 'tempval_')
 {
     switch (option::get('sign_scan')) {
         case '0':
             $sql = "SELECT * FROM `{$t}` ";
             if (!empty($w)) {
                 $sql .= " WHERE {$w} ";
             }
             $sql .= " LIMIT {$n};";
             break;
         case '2':
             $sql = "SELECT * FROM `{$t}` ";
             if (!empty($w)) {
                 $sql .= " WHERE {$w} ";
             }
             $sql .= " ORDER BY RAND() LIMIT {$n};";
             break;
         default:
             if (!empty($w)) {
                 $w = ' AND ' . $w;
             }
             $sql = "SELECT * FROM `{$t}` AS {$p}t1 JOIN ( SELECT ROUND( RAND() * ((SELECT MAX({$c}) FROM `{$t}`) - (SELECT MIN({$c}) FROM `{$t}`))) AS {$p}id ) AS {$p}t2 WHERE {$p}t1.{$c} >= {$p}t2.{$p}id {$w} ORDER BY {$p}t1.{$c} LIMIT {$n};";
             break;
     }
     $xq = $this->query($sql);
     $r = array();
     while ($x = $this->fetch_array($xq)) {
         $r[] = $x;
     }
     if ($f == false && count($r) == 1) {
         return $r[0];
     } else {
         return $r;
     }
 }
Example #6
0
function mok_follow_check()
{
    $head = array('User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36', 'Cookie:BDUSS=' . $_GET['bduss']);
    $opt = unserialize(option::get('mok_follow'));
    foreach ($opt['mustTieba'] as $tb => $lv) {
        $c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head);
        $t = $c->get();
        $c->close();
        if (textMiddle($t, '&#160;(等级', ')') < $lv) {
            msg($opt['error'][0]);
        }
    }
    if (count($opt['optionTieba']) > 0) {
        $check = false;
        foreach ($opt['optionTieba'] as $tb => $lv) {
            $c = new wcurl('http://tieba.baidu.com/mo/m?kw=' . urlencode($tb), $head);
            $t = $c->get();
            $c->close();
            if (textMiddle($t, '&#160;(等级', ')') >= $lv) {
                $check = true;
                break;
            }
        }
        if ($check == false) {
            msg($opt['error'][0]);
        }
    }
}
function callback_remove()
{
    global $m;
    option::del('plugin_wmzz_post');
    $m->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "wmzz_post`");
    $m->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "wmzz_post_data`");
}
function callback_remove()
{
    global $m;
    option::del('plugin_verifyTiezi');
    $m->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "verifyTiezi`");
    $m->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "verifyTiezi_data`");
}
Example #9
0
function callback_remove()
{
    option::del('mok_zdwk_run');
    option::del('mok_zdwk_log');
    global $m;
    $m->query("DELETE FROM " . DB_PREFIX . "users_options WHERE NAME='mok_zdwk_wk' OR NAME='mok_zdwk_zd'");
}
function callback_remove()
{
    global $m;
    option::del('plugin_weixinArticle');
    $m->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "weixinArticle`");
    $m->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "weixinArticle_data`");
}
 function widget($args, $instance)
 {
     extract($args);
     /* User-selected settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $category = $instance['category'];
     $show_count = $instance['show_count'];
     $show_date = $instance['show_date'] ? true : false;
     $show_thumb = $instance['show_thumb'] ? true : false;
     $show_excerpt = $instance['show_excerpt'] ? true : false;
     $excerpt_length = $instance['excerpt_length'];
     $show_title = $instance['hide_title'] ? false : true;
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Title of widget (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo '<ul class="wpzoom-feature-posts">';
     $query_opts = apply_filters('wpzoom_query', array('posts_per_page' => $show_count, 'post_type' => 'post'));
     if ($category) {
         $query_opts['cat'] = $category;
     }
     query_posts($query_opts);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             echo '<li>';
             if ($show_thumb) {
                 $custom_field = option::get('cf_use') == 'on' ? get_post_meta($post->ID, option::get('cf_photo'), true) : '';
                 $args = array('size' => 'recent-widget', 'width' => $instance['thumb_width'], 'height' => $instance['thumb_height']);
                 if ($custom_field) {
                     $args['meta_key'] = option::get('cf_photo');
                 }
                 get_the_image($args);
             }
             if ($show_title) {
                 echo '<a href="' . get_permalink() . '">' . get_the_title() . '</a>';
             }
             if ($show_date) {
                 echo '<small>' . get_the_date() . '</small>';
             }
             if ($show_excerpt) {
                 $the_excerpt = get_the_excerpt();
                 // cut to character limit
                 $the_excerpt = substr($the_excerpt, 0, $excerpt_length);
                 // cut to last space
                 $the_excerpt = substr($the_excerpt, 0, strrpos($the_excerpt, ' '));
                 echo '<span class="post-excerpt">' . $the_excerpt . '</span>';
             }
             echo '<div class="clear"></div></li>';
         }
     } else {
     }
     //Reset query_posts
     wp_reset_query();
     echo '</ul><div class="clear"></div>';
     /* After widget (defined by themes). */
     echo $after_widget;
 }
Example #12
0
function cron_verifyTiezi()
{
    global $m;
    $set = unserialize(option::get('plugin_verifyTiezi'));
    $today = date("Y-m-d");
    //准备:扫描verifyTiezi表中lastdo不是今天的,然后更新verifyTiezi_data表的remain
    $sy = $m->query("SELECT * FROM `" . DB_PREFIX . "verifyTiezi` WHERE `lastdo` != '{$today}';");
    while ($sx = $m->fetch_array($sy)) {
        $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'verifyTiezi_data` SET `remain` = \'' . $sx['num'] . '\' WHERE `uid` = ' . $sx['uid']);
        $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'verifyTiezi` SET `lastdo` = \'' . $today . '\' WHERE `uid` = ' . $sx['uid']);
    }
    //开始:计划任务
    $count = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_PREFIX . "verifyTiezi_data` WHERE `remain` > '0' LIMIT {$set['rem']};");
    if ($count['c'] == $set['rem']) {
        $y = rand_row(DB_PREFIX . 'verifyTiezi_data', 'id', $set['rem'], "`remain` > '0'");
    } else {
        $y = rand_row(DB_PREFIX . 'verifyTiezi_data', 'id', $count['c'], "`remain` > '0'");
    }
    //如果只有一条记录的兼容方案
    if (isset($y['url'])) {
        $y = array(0 => $y);
    }
    foreach ($y as $x) {
        if (!empty($x['pid']) && !empty($x['uid'])) {
            $u = $m->once_fetch_array("SELECT * FROM `" . DB_PREFIX . "verifyTiezi` WHERE `uid` = '{$x['uid']}'");
            $cont = unserialize($u['cont']);
            $remain = $x['remain'] - 1;
            $res = verifyTiezi_send($x['uid'], $x['url'], $x['pid'], rand_array($cont), $set['device']);
            $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'verifyTiezi_data` SET `remain` = \'' . $remain . '\',`status` = \'' . $res['status'] . '\',`msg` = \'' . $res['msg'] . '\' WHERE `url` = \'' . $x['url'] . '\' AND `uid` = ' . $x['uid']);
            sleep($set['sleep']);
        }
    }
}
function callback_remove()
{
    cron::del('reg_supervise');
    option::xdel('reg_supervise');
    global $m;
    $m->query('DROP TABLE `' . DB_NAME . '`.`' . DB_PREFIX . 'reg`');
    option::del('reg_supervise_run');
}
function callback_init()
{
    global $m;
    $m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_zan` (\n`id`  int(255) NOT NULL AUTO_INCREMENT ,\n`uid`  int(255) NOT NULL ,\n`num`  int(255) NULL DEFAULT 0 ,\n`lastdo`  date NOT NULL DEFAULT '0000-00-00' ,\nPRIMARY KEY (`id`, `uid`),\nUNIQUE INDEX `uid` (`uid`) USING BTREE \n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=3\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0\n;");
    $m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_zan_data` (\n`id`  int(255) NOT NULL AUTO_INCREMENT ,\n`uid`  int(255) NOT NULL DEFAULT 0 ,\n`pid`  int(255) NOT NULL DEFAULT 0 ,\n`tieba`  varchar(10000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`remain`  int(255) NOT NULL DEFAULT 0 ,\nPRIMARY KEY (`id`)\n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=7\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0\n;");
    option::set('plugin_Cloud_Click', 'a:6:{s:3:"num";s:2:"10";s:2:"sp";s:1:"3";s:3:"rem";s:2:"10";s:4:"lmax";s:1:"0";s:4:"cmax";s:1:"0";s:3:"max";s:1:"0";}');
    cron::set('wmzz_zan', 'plugins/Cloud_Click/run.php', 0, 0, 0);
}
function wmzz_recaptcha_check()
{
    $s = option::pget('wmzz_recaptcha');
    $resp = recaptcha_check_answer($s['sk'], $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
    if (!$resp->is_valid) {
        msg('注册失败,您输入的验证码有误');
    }
}
function callback_remove()
{
    /*卸载*/
    option::pdel('fyy_massistant');
    global $m;
    $m->query("DROP TABLE IF EXISTS `" . DB_NAME . "`.`" . DB_PREFIX . "allinfo`");
    $m->query("DROP TABLE IF EXISTS `" . DB_NAME . "`.`" . DB_PREFIX . "fyy_massistant_url`");
}
Example #17
0
function dl_pages_navi5()
{
    echo '<li ';
    if (isset($_GET['plugin']) && $_GET['plugin'] == 'dl_pages' && $_REQUEST['page'] == 'dl_pages_five') {
        echo 'class="active"';
    }
    echo '><a href="index.php?plugin=dl_pages&page=dl_pages_five"><span class="glyphicon glyphicon-file"></span>' . strip_tags(option::get('dl_pages_title5')) . '</a></li>';
}
function callback_remove()
{
    option::pdel('mok_bgimg');
    option::pdel('mok_bgimg_img');
    option::del('mok_bgimg');
    option::del('mok_bgimg_img');
    option::del('mok_bgimg_bing');
}
Example #19
0
 /**
  * Includes rss link if is specified in theme options
  */
 public static function rss()
 {
     $feed = esc_attr(trim(option::get('misc_feedburner')));
     if (!$feed) {
         bloginfo('rss2_url');
     } else {
         echo esc_url_raw(option::get('misc_feedburner'));
     }
 }
Example #20
0
function fyy_assistant_delus()
{
    $key = option::xget('fyy_assistant', 'key');
    foreach ($_POST['user'] as $uid) {
        $usname = $m->once_fetch_array("SELECT `name` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `id` = '{$uid}'");
        $post = new wcurl("{$murl}?pub_plugin=fyy_massistant&delus&key={$key}&stname=" . SYSTEM_NAME . "&usname={$usname}");
        $a = $post->exec();
    }
}
Example #21
0
function wpzoom_options_box()
{
    if (option::get('featured_type') == 'Posts') {
        $FeaturedSource = 'post';
    } else {
        $FeaturedSource = 'page';
    }
    add_meta_box('wpzoom_post_layout', 'Post Layout', 'wpzoom_post_layout_options', 'post', 'normal', 'high');
    add_meta_box('wpzoom_post_options', 'Post Options', 'wpzoom_post_info', $FeaturedSource, 'side', 'high');
}
Example #22
0
 /**
  * WPZOOM custom menu for wp-admin
  */
 public static function register_admin_pages()
 {
     add_object_page('Page Title', 'WPZOOM', 'manage_options', 'wpzoom_options', 'WPZOOM_Admin::admin', WPZOOM::$assetsPath . '/images/shortcode-icon.png');
     add_submenu_page('wpzoom_options', 'WPZOOM', 'Theme Options', 'manage_options', 'wpzoom_options', array(__CLASS__, 'admin'));
     if (option::is_on('framework_update_enable')) {
         add_submenu_page('wpzoom_options', 'Update Framework', 'Update Framework', 'update_themes', 'wpzoom_update', array(__CLASS__, 'update'));
     }
     if (option::is_on('framework_newthemes_enable') && !wpzoom::$tf) {
         add_submenu_page('wpzoom_options', 'New Themes', 'New Themes', 'manage_options', 'wpzoom_themes', array(__CLASS__, 'themes'));
     }
 }
function callback_init()
{
    $day = option::get('dl_backup_day');
    $email = option::get('dl_backup_email');
    if (empty($day)) {
        option::set('dl_backup_day', 1);
    }
    if (empty($email)) {
        option::set('dl_backup_email', EMAIL);
    }
    cron::set('dl_backup', 'plugins/dl_backup/backup.php', 0, 0, 0);
}
/**
 * 云签到内部计划任务
 * [重新尝试签到出错的贴吧]
 */
function cron_system_sign_retry()
{
    global $i;
    $today = date('Y-m-d');
    $sign_again = unserialize(option::get('cron_sign_again'));
    if ($sign_again['lastdo'] != $today) {
        option::set('cron_sign_again', serialize(array('num' => 0, 'lastdo' => $today)));
    }
    foreach ($i['table'] as $value) {
        misc::DoSign_retry($value);
    }
}
Example #25
0
function mok_zdwk_set()
{
    echo '<tr><td>附加签到</td><td><input type="checkbox" name="mok_zdwk_wk" ';
    if (option::uget('mok_zdwk_wk')) {
        echo 'checked';
    }
    echo '> 签到百度文库<br/><input type="checkbox" name="mok_zdwk_zd" ';
    if (option::uget('mok_zdwk_zd')) {
        echo 'checked';
    }
    echo '> 签到百度知道</td></tr>';
}
Example #26
0
function addset($name, $type, $x, $other = '', $text = '')
{
    if ($type == 'checkbox') {
        if (option::get($x) == 1) {
            $other .= ' checked="checked"';
        }
        $value = '1';
    } else {
        $value = option::get($x);
    }
    echo '<tr><td>' . $name . '</td><td><input type="' . $type . '" name="' . $x . '"id="' . $x . '" value="' . htmlspecialchars($value) . '" ' . $other . '><label for="' . $x . '">' . $text . '</label></td>';
}
Example #27
0
function addset($name, $type, $x, $other = '', $text = '')
{
    if ($type == 'checkbox') {
        if (option::uget($x) == 1) {
            $other .= ' checked="checked"';
        }
        $value = '1';
    } else {
        $value = option::uget($x);
    }
    echo '<tr><td>' . $name . '</td><td><input type="' . $type . '" name="' . $x . '" value="' . $value . '" ' . $other . '>' . $text . '</td>';
}
function cron_reg_supervise()
{
    if (option::get('reg_supervise_run') == date('d')) {
        return ok;
    }
    global $m;
    $m->query("DELETE FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `" . DB_PREFIX . "users`.`role` = 'banned'");
    //当天清除昨天未激活用户(建议)
    $m->query("truncate table `" . DB_NAME . "`.`" . DB_PREFIX . "reg`");
    //清除注册ip记录(必须)
    option::set('reg_supervise_run', date('d'));
    return '成功';
}
Example #29
0
function wmzz_anno_show()
{
    global $m;
    $s = option::get('wmzz_anno_set');
    if (!empty($s)) {
        $y = '';
        $x = explode("\n", $s);
        foreach ($x as $value) {
            $y .= $value . '<br/>';
        }
        echo str_replace('{$anno}', $y, option::get('wmzz_anno_tpl'));
    }
}
Example #30
0
function cron_mok_zdwk()
{
    //如果今天签到过了直接返回日志
    if (option::get('mok_zdwk_run') == date('d')) {
        return option::get('mok_zdwk_log');
    }
    global $m;
    $prefix = DB_PREFIX;
    //选出用户的options和bduss
    $res = $m->query("SELECT {$prefix}users_options.`name` , {$prefix}users_options.`value` , {$prefix}baiduid.`bduss` \nFROM {$prefix}baiduid\nINNER JOIN {$prefix}users_options ON {$prefix}users_options.uid = {$prefix}baiduid.uid\nWHERE {$prefix}users_options.`name` =  'mok_zdwk_wk'\nOR {$prefix}users_options.`name` =  'mok_zdwk_zd'");
    $wk = $zd = 0;
    $bduss = array();
    if ($m->num_rows($res) != 0) {
        while ($row = $res->fetch_array()) {
            //判断该选项是否开启
            if ($row['value'] == 'on') {
                //记录bduss(数量),如果bduss数组内没有该bduss,则加入数组
                if (!in_array($row['bduss'], $bduss)) {
                    $bduss[] = $row['bduss'];
                }
                if ($row['name'] === 'mok_zdwk_wk') {
                    $wk++;
                    $head = array('Accept:*/*', 'Accept-Encoding:gzip, deflate, sdch', 'Accept-Language:zh-CN,zh;q=0.8', 'Connection:keep-alive', 'Host:wenku.baidu.com', 'Referer:http://wenku.baidu.com/task/browse/daily', 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', 'X-Requested-With:XMLHttpRequest');
                    $c = new wcurl('http://wenku.baidu.com/task/submit/signin', $head);
                    $c->addCookie('BDUSS=' . $row['bduss']);
                    $c->exec();
                    $c->close();
                } else {
                    if ($row['name'] === 'mok_zdwk_zd') {
                        $zd++;
                        $c = new wcurl('http://zhidao.baidu.com/');
                        $c->addCookie('BDUSS=' . $row["bduss"]);
                        $stoken = $c->get();
                        $c->close();
                        $stoken = textMiddle($stoken, '"stoken":"', '",');
                        if ($stoken != "") {
                            $c = new wcurl('http://zhidao.baidu.com/submit/user');
                            $c->addCookie('BDUSS=' . $row["bduss"]);
                            $c->post(array('cm' => '100509', 'utdata' => '90,90,102,96,107,101,99,97,96,90,98,103,103,99,127,106,99,99,14138554765830', 'stoken' => $stoken));
                            $c->close();
                        }
                    }
                }
            }
        }
    }
    $log = "知道、文库签到完毕<br/>" . date("Y-m-d H:i:s") . "<br/>共计百度账号: " . count($bduss) . " 个<br/>知道签到: {$zd} 个<br/>文库签到: {$wk} 个";
    option::set('mok_zdwk_run', date('d'));
    option::set('mok_zdwk_log', $log);
    return $log;
}