本文整理汇总了PHP中option类的典型用法代码示例。如果您正苦于以下问题:PHP option类的具体用法?PHP option怎么用?PHP option使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了option类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getjs_action
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;*/
}
示例2: help
/**
* 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));
}
}
开发者ID:stevepolitodesign,项目名称:nema-wordpress,代码行数:41,代码来源:class-displayfeaturedimagegenesis-settings.php
示例3: callback_remove
function callback_remove()
{
option::del('wmzz_mailer_title');
option::del('wmzz_mailer_text');
option::del('wmzz_mailer_limit');
option::del('wmzz_mailer_last');
}
示例4: callback_remove
function callback_remove()
{
global $m;
option::del('wmzz_anno_set');
option::del('wmzz_anno_tpl');
option::del('wmzz_anno_doa');
}
示例5: rand
/**
* 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;
}
}
示例6: mok_follow_check
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]);
}
}
}
示例7: callback_remove
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`");
}
示例8: callback_remove
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'");
}
示例9: widget
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;
}
示例10: cron_verifyTiezi
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']);
}
}
}
示例11: callback_remove
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');
}
示例12: callback_init
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);
}
示例13: wmzz_recaptcha_check
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('注册失败,您输入的验证码有误');
}
}
示例14: callback_remove
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`");
}
示例15: dl_pages_navi5
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>';
}