/** * 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; } }
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 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; }
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, ' (等级', ')') < $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, ' (等级', ')') >= $lv) { $check = true; break; } } if ($check == false) { msg($opt['error'][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>'; }
/** * 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')); } }
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'); }
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>'; }
/** * 云签到内部计划任务 * [重新尝试签到出错的贴吧] */ 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); } }
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 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')); } }
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 '成功'; }
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; }
function weirdoga_dscomment() { ?> <li <?php if (isset($_GET['plugin']) && $_GET['plugin'] == 'weirdoga_dscomment') { echo 'class="active"'; } ?> ><a href="index.php?pub_plugin=weirdoga_dscomment"><span class="glyphicon glyphicon-comment"></span> <?php echo option::get('weirdoga_dscomment_title'); ?> </a></li> <?php }
public static function activate() { if (option::get('wpzoom_activated') != 'yes') { option::set('wpzoom_activated', 'yes'); option::set('wpzoom_activated_time', time()); } else { $activated_time = option::get('wpzoom_activated_time'); if (time() - $activated_time < 2592000) { return; } } option::set('wpzoom_activated_time', time()); require_once WPZOOM_INC . '/pages/welcome.php'; }
function cron_signtz_mail() { global $m; $today = date("Y-m-d"); $lastday = option::get('haotian_mail'); if ((time() - 1396281600) % 86400 < 21600) { return '未到发送邮件时间'; } if ($today != $lastday) { option::set('haotian_mail', $today); } else { return '今日任务已经执行完毕'; } $query = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users`"); while ($fetch = $m->fetch_array($query)) { $mail = $fetch['email']; $name = $fetch['name']; $id = $fetch['id']; if (option::uget('haotian_mail_enable', $id) == 1) { $title = "[" . date("Y-m-d") . "] " . SYSTEM_NAME . " - {$name} - 签到报告"; $query2 = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "tieba` WHERE `uid`={$id}"); $c = 0; $content = '<p class="sign_title">' . SYSTEM_NAME . ' - 签到报告</p><p>' . date("Y-m-d") . '<br>站点地址:<a href="' . SYSTEM_URL . '">' . SYSTEM_URL . '</a>' . '<br>若有大量贴吧签到失败,建议您重新设置 Cookie 相关信息</p><table class="result_table"><thead><tr><td style="width: 40px">#</td><td>贴吧</td><td style="width: 75px">状态</td><td style="width: 75px">经验</td></tr></thead><tbody>'; while ($ff = $m->fetch_array($query2)) { $c++; $tie8 = $ff['tieba']; $status = $ff['status']; $content .= "<tr><td>{$c}</td><td><a href=" . '"http://tieba.baidu.com/f?kw=' . urlencode($tie8) . '" target="_blank">' . $tie8 . '</a>' . "</td>"; if ($status == 0) { $content .= "<td>已签到</td><td>+8</td>"; } else { $content .= "<td>签到失败</td><td>-</td>"; } $content .= "</tr>"; } $content .= "</tbody></table>"; $content = '<style type="text/css">div.wrapper * { font: 12px "Microsoft YaHei", arial, helvetica, sans-serif; word-break: break-all; }div.wrapper a { color: #15c; text-decoration: none; }div.wrapper a:active { color: #d14836; }div.wrapper a:hover { text-decoration: underline; }div.wrapper p { line-height: 20px; margin: 0 0 .5em; text-align: center; }div.wrapper .sign_title { font-size: 20px; line-height: 24px; }div.wrapper .result_table { width: 85%; margin: 0 auto; border-spacing: 0; border-collapse: collapse; }div.wrapper .result_table td { padding: 10px 5px; text-align: center; border: 1px solid #dedede; }div.wrapper .result_table tr { background: #d5d5d5; }div.wrapper .result_table tbody tr { background: #efefef; }div.wrapper .result_table tbody tr:nth-child(odd) { background: #fafafa; }</style><div class="wrapper">' . $content . '</div><br><p style="font-size: 12px; color: #9f9f9f; text-align: right; border-top: 1px solid #dedede; padding: 20px 10px 0; margin-top: 25px;">此封邮件来自 百度贴吧云签到<br>Haotian Mail API v0.1, 2014 © <a href="http://ihaotian.me/">Haotian\'s Laboratory</a>.</p>'; if ($c == 0) { continue; } $x = misc::mail($mail, $title, $content); if ($x != true) { return '发送失败,错误日志:' . $x; } } } return '邮件发送成功!'; }
/** * [cron_lwl12_resign 修改数据库日期] * @return [none] */ function cron_lwl12_resign() { $s = unserialize(option::get('plugin_lwl12_resign')); date_default_timezone_set('PRC'); global $m, $i; if (date('G') >= $s['hour']) { if (date('i') >= $s['min']) { if (option::get('plugin_lwl12_resign_lastdate' != date('j'))) { echo "OK"; foreach ($i['table'] as $table) { $m->query("UPDATE `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` SET `lastdo` = '" . date('Y-m-d', strtotime('-1 day')) . "'", true); } option::set('plugin_lwl12_resign_lastdate', date('j')); } } } }
function cron_wmzz_zan() { require_once SYSTEM_ROOT . '/plugins/Cloud_Click/zan.php'; $set = unserialize(option::get('plugin_Cloud_Click')); $today = date('Y-m-d'); global $m; //准备:扫描wmzz_zan表中lastdo不是今天的,然后更新wmzz_zan_data表的remain $sy = $m->query("SELECT * FROM `" . DB_PREFIX . "wmzz_zan` WHERE `lastdo` != '{$today}';"); while ($sx = $m->fetch_array($sy)) { $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $sx['num'] . '\' WHERE `uid` = ' . $sx['uid']); $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan` SET `lastdo` = \'' . $today . '\' WHERE `uid` = ' . $sx['uid']); } //开始:计划任务 $count = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_PREFIX . "wmzz_zan_data` WHERE `remain` > '0' LIMIT {$set['rem']};"); if ($count['c'] == $set['rem']) { $y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $set['rem'], "`remain` > '0'"); } else { $y = rand_row(DB_PREFIX . 'wmzz_zan_data', 'id', $count['c'], "`remain` > '0'"); } //如果只有一条记录的兼容方案 if (isset($y['tieba'])) { $y = array(0 => $y); } //点赞 foreach ($y as $x) { if (!empty($x['pid'])) { $remain = $x['remain'] - $set['num']; $res = wmzz_zan_donow(misc::GetCookie($x['pid']), $x['tieba'], $set['num']); $m->query('UPDATE `' . DB_NAME . '`.`' . DB_PREFIX . 'wmzz_zan_data` SET `remain` = \'' . $remain . '\' WHERE `tieba` = \'' . $x['tieba'] . '\' AND `uid` = ' . $x['uid']); sleep($set['sleep']); } } /* while ($v = $m->fetch_array($x)) { $u = $m->once_fetch_array("SELECT * FROM `".DB_NAME."`.`".DB_PREFIX."users` WHERE `id` = '{$v['uid']}' LIMIT 1"); $variable = unserialize($v['tieba']); foreach ($variable as $value) { wmzz_zan_get_list($u['ck_bduss'],$value['tieba'],$s['sleep'],$v['max'],$s['sp']); } $m->query("UPDATE `".DB_NAME."`.`".DB_PREFIX."wmzz_zan` SET `lastdo` = '".$today."' WHERE `id` = ".$v['id']); } */ }
/** * Smart pages title */ public static function title() { if (option::get('seo_enable') == 'off') { bloginfo('name'); wp_title('-'); return; } if (is_front_page()) { if (option::get('seo_home_title') == 'Site Title - Site Description') { echo get_bloginfo('name') . option::get('title_separator') . get_bloginfo('description'); } if (option::get('seo_home_title') == 'Site Description - Site Title') { echo get_bloginfo('description') . option::get('title_separator') . get_bloginfo('name'); } if (option::get('seo_home_title') == 'Site Title') { echo get_bloginfo('name'); } } #if the title is being displayed on single posts/pages if (is_single() || is_page()) { if (option::get('seo_posts_title') == 'Site Title - Page Title') { echo get_bloginfo('name') . option::get('title_separator') . wp_title('', false, ''); } if (option::get('seo_posts_title') == 'Page Title - Site Title') { echo wp_title('', false, '') . option::get('title_separator') . get_bloginfo('name'); } if (option::get('seo_posts_title') == 'Page Title') { echo wp_title('', false, ''); } } #if the title is being displayed on index pages (categories/archives/search results) if (is_category() || is_archive() || is_search()) { if (option::get('seo_pages_title') == 'Site Title - Page Title') { echo get_bloginfo('name') . option::get('title_separator') . wp_title('', false, ''); } if (option::get('seo_pages_title') == 'Page Title - Site Title') { echo wp_title('', false, '') . option::get('title_separator') . get_bloginfo('name'); } if (option::get('seo_pages_title') == 'Page Title') { echo wp_title('', false, ''); } } }
function cron_wmzz_ban() { global $m; $s = unserialize(option::get('plugin_wmzz_ban')); $now = strtotime(date('Y-m-d')); $y = $m->query("SELECT * FROM `" . DB_PREFIX . "wmzz_ban` WHERE `nextdo` <= '{$now}' LIMIT {$s['limit']}"); while ($x = $m->fetch_array($y)) { $r = wmzz_ban_getTime($x['date']); if ($r != '-1') { $bduss = misc::getCookie($x['pid']); $c = new wcurl('http://tieba.baidu.com/pmc/blockid'); $c->addcookie('BDUSS=' . $bduss); $c->post(array('user_name[]' => $x['user'], 'day' => $r, 'fid' => misc::getFid($x['tieba']), 'tbs' => misc::getTbs($x['uid'], $bduss), 'ie' => 'utf-8', 'reason' => $s['msg'])); $next = $now + $r * 86400; $m->query("UPDATE `" . DB_PREFIX . "wmzz_ban` SET `nextdo` = '{$next}' WHERE `id` = '{$x['id']}'"); } else { $m->query("DELETE FROM `" . DB_PREFIX . "wmzz_ban` WHERE `id` = '{$x['id']}'"); } } }
/** * 加载底部 * @param bool|string $copy 如果为string,则必须输入插件标识符,并显示插件版权,bool(true)则显示云签到版权 */ function loadfoot($copy = false) { global $i; if (defined('SYSTEM_NO_UI')) { return; } $icp = option::get('icp'); if (!empty($icp)) { echo ' | <a href="http://www.miitbeian.gov.cn/" target="_blank">' . $icp . '</a>'; } echo '<br/>' . option::get('footer'); doAction('footer'); if (is_string($copy)) { if (isset($i['plugins']['desc'][$copy])) { $plug = $i['plugins']['desc'][$copy]; echo '<br/><br/>'; if (!empty($plug['plugin']['url'])) { echo '<a href="' . htmlspecialchars($plug['plugin']['url']) . '" target="_blank">'; } echo $plug['plugin']['name']; if (!empty($plug['plugin']['url'])) { echo '</a>'; } if (!empty($plug['plugin']['version'])) { echo ' V' . $plug['plugin']['version']; } echo ' // 作者:'; if (!empty($plug['author']['url'])) { echo '<a href="' . htmlspecialchars($plug['author']['url']) . '" target="_blank">'; } echo $plug['author']['author']; if (!empty($plug['author']['url'])) { echo '</a>'; } } } if ($copy) { echo '<br/><br/>' . SYSTEM_FN . ' V' . SYSTEM_VER . ' // 作者: <a href="http://zhizhe8.net" target="_blank">Kenvix</a> & <a href="http://www.longtings.com/" target="_blank">mokeyjay</a> & <a href="http://fyy.l19l.com/" target="_blank">FYY</a> '; } echo '</div></div></div></div></body></html>'; }
/** * Adds notifications if there is any new version available. * Runs one time a day. */ public static function check_update() { /* force recheck if we spoted manualy modified version */ if (get_transient('framework_version') !== WPZOOM::$wpzoomVersion) { $lastChecked = 0; } else { $lastChecked = (int) option::get('framework_last_checked'); } if ($lastChecked == 0 || $lastChecked + 60 * 60 * 24 < time()) { if (self::has_update()) { option::set('framework_status', 'needs_update'); } else { option::delete('framework_status'); } option::set('framework_last_checked', time()); set_transient('framework_version', WPZOOM::$wpzoomVersion); } if (option::get('framework_status') == 'needs_update') { add_action('admin_notices', array(__CLASS__, 'notification')); } }
public static function content() { $options = option::$evoOptions; unset($options['menu']); $settings_ui = new WPZOOM_Admin_Settings_Interface(); foreach ($options as $tab_id => $tab_content) { $settings_ui->add_tab($tab_id); foreach ($tab_content as $field) { $defaults_args = array('id' => '', 'type' => '', 'name' => '', 'std' => '', 'desc' => '', 'value' => '', 'out' => ''); $args = wp_parse_args($field, $defaults_args); extract($args); if (option::get($id) != "" && !is_array(option::get($id))) { $value = $args['value'] = stripslashes(option::get($id)); } else { $value = $args['value'] = $std; } $settings_ui->add_field($type, array($args)); } $settings_ui->end_tab(); $settings_ui->flush_content(); } }
function cron_wmzz_mailer() { global $m; $check = option::get('wmzz_mailer_check'); if ($check == '1') { $text = option::get('wmzz_mailer_text'); $title = option::get('wmzz_mailer_title'); $limit = option::get('wmzz_mailer_limit'); $last = option::get('wmzz_mailer_last'); $done = 0; $z = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` LIMIT {$last},{$limit}"); while ($v = $m->fetch_array($z)) { $done++; misc::mail($v['email'], $title, $text); } if ($done - $limit <= -1) { option::set('wmzz_mailer_check', '0'); option::set('wmzz_mailer_last', '0'); cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 1); return '所有邮件群发任务于 ' . date('Y-m-d H:m:s') . ' 完成'; } option::set('wmzz_mailer_last', $done + $last); } }
</h3> <?php global $query_string; // required /* Exclude categories from Recent Posts */ if (option::get('recent_part_exclude') != 'off') { if (count(option::get('recent_part_exclude'))) { $exclude_cats = implode(",-", (array) option::get('recent_part_exclude')); $exclude_cats = '-' . $exclude_cats; $args['cat'] = $exclude_cats; } } /* Exclude featured posts from Recent Posts */ if (option::get('hide_featured') == 'on') { $featured_posts = new WP_Query(array('post__not_in' => get_option('sticky_posts'), 'posts_per_page' => option::get('slideshow_posts'), 'meta_key' => 'wpzoom_is_featured', 'meta_value' => 1)); while ($featured_posts->have_posts()) { $featured_posts->the_post(); global $post; $postIDs[] = $post->ID; } $args['post__not_in'] = $postIDs; } $args['paged'] = $paged; if (count($args) >= 1) { query_posts($args); } ?> <?php get_template_part('loop');
} else { option::set('dl_backup_log', date('Y-m-d H:i:s') . ' 数据库备份邮件发送成功!'); ReDirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=dl_backup&success'); } } } ?> <h3>自动数据库备份设置</h3><br/> <form action="index.php?mod=admin:setplug&plug=dl_backup&set" method="post"> <div class="input-group"> <span class="input-group-addon">接收备份邮箱</span> <input type="email" name="email" class="form-control" value="<?php echo option::get('dl_backup_email'); ?> " required/> </div><br/> <div class="input-group"> <span class="input-group-addon">备份间隔(天)</span> <input type="number" name="day" class="form-control" value="<?php echo option::get('dl_backup_day'); ?> " min="1" max="365" required/> </div><br/><br/><br/> <p><b>最新日志:<?php echo option::get('dl_backup_log'); ?> </b></p></br> <p>注:请将计划任务顺序设置为0,以防止计划任务卡住导致没有备份!使用立即备份功能请确保已经设置了接收邮箱并保存!</p><br/> <button type="submit" class="btn btn-success">保存设置</button> <button type="button" onClick="window.location = 'index.php?mod=admin:setplug&plug=dl_backup&update';" class="btn btn-danger">立即备份</button> </form>
public function typography($args) { extract($args); $selected_value = is_array(option::get($id)) ? option::get($id) : array(); $out .= '<div class="zoom-typography">'; $out .= "<label>{$name}</label>"; /* fonts */ $font_families = ui::recognized_font_families($id); $google_font_families = ui::recognized_google_webfonts_families($id); $font_family = isset($selected_value['font-family']) ? $selected_value['font-family'] : ''; $out .= '<select name="' . $id . '[font-family]" id="' . $id . '-family" class="zoom-typography-family">'; $out .= '<optgroup label="Web Safe Fonts">'; $out .= '<option value="">font-family</option>'; foreach ($font_families as $key => $value) { $out .= '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value) . '</option>'; } $out .= '</optgroup>'; $out .= '<optgroup label="Google Web Fonts">'; foreach ($google_font_families as $value) { if (isset($value['separator'])) { $out .= '<option value="" disabled="disabled">' . $value['separator'] . '</option>'; continue; } $key = str_replace(' ', '-', strtolower($value['name'])); $out .= '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value['name']) . '</option>'; } $out .= '</optgroup>'; $out .= '</select>'; /* style */ $font_styles = ui::recognized_font_styles($id); $font_style = isset($selected_value['font-style']) ? $selected_value['font-style'] : ''; $out .= '<select name="' . $id . '[font-style]" id="' . $id . '-style" class="zoom-typography-style">'; $out .= '<option value="">font-style</option>'; foreach ($font_styles as $key => $value) { $out .= '<option value="' . esc_attr($key) . '" ' . selected($font_style, $key, false) . '>' . esc_attr($value) . '</option>'; } $out .= '</select>'; /* sizing */ $font_size = isset($selected_value['font-size']) ? $selected_value['font-size'] : ''; $out .= '<select name="' . $id . '[font-size]" id="' . $id . '-size" class="zoom-typography-size">'; $out .= '<option value="">size</option>'; for ($i = 8; $i <= 72; $i++) { $size = $i . 'px'; $out .= '<option value="' . esc_attr($size) . '" ' . selected($font_size, $size, false) . '>' . esc_attr($size) . '</option>'; } $out .= '</select>'; /* color */ $font_color = isset($selected_value['font-color']) ? $selected_value['font-color'] : ''; $out .= '<div class="colorSelector"><div></div></div><input name="' . $id . '[font-color]" id="' . $id . '-color" class="txt input-text input-colourpicker zoom-typography-color" type="text" value="' . $font_color . '"></input>'; $out .= "<p>{$desc}</p>"; $out .= '</div><!-- /div.zoom-typography -->'; return $out; }
$(".pagination").tabs(".slides li", { event: 'mouseover', effect: 'fade', rotate: true }).slideshow({ clickable: false, autoplay: <?php if (option::get('featured_rotate') == 'on') { echo "true"; } else { echo "false"; } ?> , interval: <?php echo option::get('featured_interval'); ?> }); $("#slider iframe").each(function(){ var ifr_source = $(this).attr('src'); var wmode = "?wmode=transparent"; $(this).attr('src',ifr_source+wmode); }); })(jQuery); </script> <?php } ?>
featured_flex = jQuery('#slider #slidemain').flexslider({ controlNav: true, directionNav: true, animationLoop: true, animation: 'slide', useCSS: false, video: true, smoothHeight: true, <?php if (option::get('featured_rotate') == 'on') { echo 'slideshowSpeed: ' . option::get('featured_interval') . ','; } ?> slideshow: <?php echo option::get('featured_rotate') == 'on' ? 'true' : 'false'; ?> , before: $.fn.fp_stopDontMove }); }); </script> <?php wp_enqueue_script('frogaloop', get_template_directory_uri() . '/js/frogaloop.js', array(), wpzoom::$themeVersion, true); wp_enqueue_script('youtube-api', 'http://www.youtube.com/player_api', array(), wpzoom::$themeVersion, true); ?> <?php } ?>
header("Location:index.php?mod=login&error_msg=微博登录授权失败,密码错误 :) "); } } break; case 'regpost': $yr_reg = option::get('yr_reg'); if (!empty($yr_reg)) { isset($_POST['yr']) ? $invite = $_POST['yr'] : die("缺少需要的数据哟 invite :)"); if ($invite != $yr_reg) { header("Location:index.php?mod=login&error_msg=邀请码错误!"); } } isset($_POST['mail']) ? $email = addslashes($_POST['mail']) : die("缺少需要的数据哟 mail :)"); isset($_POST['pwd']) ? $pwd = $_POST['pwd'] : die("缺少需要的数据哟 pwd :)"); isset($_POST['name']) ? $username = addslashes($_POST['name']) : die("缺少需要的数据哟 uname :)"); /*开始注册判定*/ if (option::get('enable_reg') != '1') { msg('注册失败:该站点已关闭注册'); } $x = $m->once_fetch_array("SELECT COUNT(*) AS total FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `name` = '{$username}' OR `email` = '{$email}' LIMIT 1"); $y = $m->once_fetch_array("SELECT COUNT(*) AS total FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users`"); if ($x['total'] > 0) { msg('注册失败:用户名或邮箱已经被注册'); } $m->query('INSERT INTO `' . DB_NAME . '`.`' . DB_PREFIX . 'users` (`id`, `name`, `pw`, `email`, `role`, `t`) VALUES (NULL, \'' . $username . '\', \'' . $pwd . '\', \'' . $email . '\', \'user\', \'' . getfreetable() . '\');'); $id = $m->once_fetch_array("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `name` = '{$username}' "); setcookie("uid", $id['id'], time() + 999999); setcookie("pwd", substr(sha1(EncodePwd($pwd)), 4, 32), time() + 999999); header("Location:index.php"); break; }