本文整理汇总了PHP中w_isset_def函数的典型用法代码示例。如果您正苦于以下问题:PHP w_isset_def函数的具体用法?PHP w_isset_def怎么用?PHP w_isset_def使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了w_isset_def函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create the class
*
* @param $params
*/
function __construct($params)
{
$this->params = $params;
// Pass the general options
$options = w_isset_def($params['options'], array());
// Set a few values for faster usage
$options['set_exactonly'] = isset($params['options']['set_exactonly']) ? true : false;
$options['set_intitle'] = isset($params['options']['set_intitle']) ? true : false;
$options['set_incontent'] = isset($params['options']['set_incontent']) ? true : false;
$options['set_incomments'] = isset($params['options']['set_incomments']) ? true : false;
$options['set_inexcerpt'] = isset($params['options']['set_inexcerpt']) ? true : false;
$options['set_inposts'] = isset($params['options']['set_inposts']) ? true : false;
$options['set_inpages'] = isset($params['options']['set_inpages']) ? true : false;
$options['searchinterms'] = $params['data']['searchinterms'] == 1 ? true : false;
$options['set_inbpusers'] = isset($params['options']['set_inbpusers']) ? true : false;
$options['set_inbpgroups'] = isset($params['options']['set_inbpgroups']) ? true : false;
$options['set_inbpforums'] = isset($params['options']['set_inbpforums']) ? true : false;
$options['maxresults'] = $params['data']['maxresults'];
$options['do_group'] = $params['data']['resultstype'] == 'vertical' ? true : false;
$this->options = $options;
$this->searchId = $params['id'];
$this->searchData = $params['data'];
if (isset($this->searchData['image_options'])) {
$this->imageSettings = $this->searchData['image_options'];
}
}
示例2: scripts
function scripts()
{
$prereq = 'wpdreams-asljquery';
$js_source = 'nomin-scoped';
$performance_options = get_option('asl_performance');
$load_in_footer = w_isset_def($performance_options['load_in_footer'], 1) == 1 ? true : false;
wp_register_script('wpdreams-asljquery', ASL_URL . 'js/' . $js_source . '/asljquery.js', array(), ASL_CURR_VER_STRING, $load_in_footer);
wp_enqueue_script('wpdreams-asljquery');
wp_register_script('wpdreams-gestures', ASL_URL . 'js/' . $js_source . '/jquery.gestures.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
wp_enqueue_script('wpdreams-gestures');
wp_register_script('wpdreams-easing', ASL_URL . 'js/' . $js_source . '/jquery.easing.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
wp_enqueue_script('wpdreams-easing');
wp_register_script('wpdreams-mousewheel', ASL_URL . 'js/' . $js_source . '/jquery.mousewheel.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
wp_enqueue_script('wpdreams-mousewheel');
wp_register_script('wpdreams-scroll', ASL_URL . 'js/' . $js_source . '/jquery.mCustomScrollbar.js', array($prereq, 'wpdreams-mousewheel'), ASL_CURR_VER_STRING, $load_in_footer);
wp_enqueue_script('wpdreams-scroll');
wp_register_script('wpdreams-ajaxsearchlite', ASL_URL . 'js/' . $js_source . '/jquery.ajaxsearchlite.js', array($prereq, "wpdreams-scroll"), ASL_CURR_VER_STRING, $load_in_footer);
wp_enqueue_script('wpdreams-ajaxsearchlite');
wp_register_script('wpdreams-asl-wrapper', ASL_URL . 'js/' . $js_source . '/asl_wrapper.js', array($prereq, "wpdreams-ajaxsearchlite"), ASL_CURR_VER_STRING, $load_in_footer);
wp_enqueue_script('wpdreams-asl-wrapper');
$ajax_url = admin_url('admin-ajax.php');
if (w_isset_def($performance_options['use_custom_ajax_handler'], 0) == 1) {
$ajax_url = ASL_URL . 'ajax_search.php';
}
// @deprecated
wp_localize_script('wpdreams-ajaxsearchlite', 'ajaxsearchlite', array('ajaxurl' => $ajax_url, 'backend_ajaxurl' => admin_url('admin-ajax.php'), 'js_scope' => 'asljQuery'));
wp_localize_script('wpdreams-ajaxsearchlite', 'ASL', array('ajaxurl' => $ajax_url, 'backend_ajaxurl' => admin_url('admin-ajax.php'), 'js_scope' => 'asljQuery'));
}
示例3: asl_search_stylesheets
function asl_search_stylesheets()
{
// Don't print if on the back-end
if (!is_admin()) {
$asl_options = get_option('asl_options');
wp_register_style('wpdreams-asl-basic', ASL_URL . 'css/style.basic.css', array(), ASL_CURR_VER_STRING);
wp_enqueue_style('wpdreams-asl-basic');
wp_enqueue_style('wpdreams-ajaxsearchlite', plugins_url('css/style-' . w_isset_def($asl_options['theme'], 'polaroid') . '.css', dirname(__FILE__)), array(), ASL_CURR_VER_STRING);
}
}
示例4: wpdreams_get_stylesheet
function wpdreams_get_stylesheet($dir, $id, $style)
{
ob_start();
include $dir . "style.css.php";
$out = ob_get_contents();
ob_end_clean();
if (isset($style['custom_css_special']) && isset($style['custom_css_selector']) && $style['custom_css_special'] != "") {
$out .= " " . stripcslashes(str_replace('[instance]', str_replace('THEID', $id, $style['custom_css_selector']), $style['custom_css_special']));
}
if (w_isset_def($style['css_compress'], 0) == 1) {
return wpdreams_css_compress($out);
} else {
return $out;
}
}
示例5: wpdreams_asl_shortcode
function wpdreams_asl_shortcode($atts)
{
$style = null;
self::$instanceCount++;
extract(shortcode_atts(array('id' => 'something'), $atts));
$style = get_option('asl_options');
$def_data = get_option('asl_defaults');
$style = array_merge($def_data, $style);
$settingsHidden = w_isset_def($style['show_frontend_search_settings'], 1) == 1 ? false : true;
do_action('asl_layout_before_shortcode', $id);
$out = "";
ob_start();
include ASL_PATH . "includes/views/asl.shortcode.php";
$out = ob_get_clean();
do_action('asl_layout_after_shortcode', $id);
return $out;
}
示例6: asp_indextable_admin_ajax
/**
* This function handles the index table ajax requests
*/
function asp_indextable_admin_ajax()
{
if (isset($_POST['data'])) {
if (is_array($_POST['data'])) {
$options = $_POST['data'];
} else {
parse_str($_POST['data'], $options);
}
} else {
print "No post data detected, function terminated.";
die;
}
$it_obj = new asp_indexTable(array('index_title' => $options['it_index_title'], 'index_content' => $options['it_index_content'], 'index_excerpt' => $options['it_index_excerpt'], 'index_tags' => $options['it_index_tags'], 'index_categories' => $options['it_index_categories'], 'post_types' => $options['it_post_types'], 'post_statuses' => $options['it_post_statuses'], 'index_taxonomies' => $options['it_index_taxonomies'], 'index_custom_fields' => $options['it_index_customfields'], 'index_author_name' => $options['it_index_author_name'], 'index_author_bio' => $options['it_index_author_bio'], 'blog_id' => $_POST['blog_id'], 'extend' => w_isset_def($_POST['asp_index_action'], 'new') == 'extend' ? 1 : 0, 'limit' => $options['it_limit'], 'use_stopwords' => $options['it_use_stopwords'], 'stopwords' => $options['it_stopwords'], 'min_word_length' => $options['it_min_word_length'], 'extract_shortcodes' => $options['it_extract_shortcodes'], 'exclude_shortcodes' => $options['it_exclude_shortcodes']));
if (isset($_POST['asp_index_action'])) {
switch ($_POST['asp_index_action']) {
case 'new':
$ret = $it_obj->newIndex();
print "New index !!!ASP_INDEX_START!!!";
print_r(json_encode($ret));
print "!!!ASP_INDEX_STOP!!!";
die;
break;
case 'extend':
$ret = $it_obj->extendIndex();
print "Extend index !!!ASP_INDEX_START!!!";
print_r(json_encode($ret));
print "!!!ASP_INDEX_STOP!!!";
die;
break;
case 'switching_blog':
$ret = $it_obj->extendIndex(true);
print "Extend index (blog_switch) !!!ASP_INDEX_START!!!";
print_r(json_encode($ret));
print "!!!ASP_INDEX_STOP!!!";
die;
break;
case 'delete':
$it_obj->emptyIndex();
print "Delete index !!!ASP_INDEX_START!!!1!!!ASP_INDEX_STOP!!!";
die;
break;
}
}
// no action set, or other failure
print "No action !!!ASP_INDEX_START!!!0!!!ASP_INDEX_STOP!!!";
die;
}
示例7: str_replace
echo '<div class="wpdreams_clear"></div>';
}
/***************** SUGGESTED PHRASES ******************/
if (w_isset_def($style['frontend_show_suggestions'], 0) == 1) {
$s_phrases = str_replace(array(' ,', ' , ', ', ', ' ,'), '</a>, <a href="#">', $style['frontend_suggestions_keywords']);
?>
<p id="asp-try-<?php
echo $id;
?>
" class="asp-try"><?php
echo $style['frontend_suggestions_text'] . ' <a href="#">' . $s_phrases . '</a>';
?>
</p><?php
}
/******************** DATA INCLUDE ********************/
if (!self::$dataPrinted) {
include 'asp.shortcode.data.php';
self::$dataPrinted = true;
}
/****************** CUSTOM CSS ECHO *******************/
if (w_isset_def($style['custom_css'], "") != "") {
?>
<style type="text/css">
<?php
echo stripcslashes(base64_decode($style['custom_css']));
?>
</style>
<?php
}
/******************** SCRIPT INCLUDE ********************/
include 'asp.shortcode.script.php';
示例8: asp_generate_the_css
/**
* Generates all Ajax Search Pro CSS code
*/
function asp_generate_the_css()
{
global $wpdb;
$css_arr = array();
if (isset($wpdb->base_prefix)) {
$_prefix = $wpdb->base_prefix;
} else {
$_prefix = $wpdb->prefix;
}
$comp_settings = get_option('asp_compatibility');
$async_load = w_isset_def($comp_settings['css_async_load'], false);
$search = $wpdb->get_results("SELECT * FROM " . $_prefix . "ajaxsearchpro", ARRAY_A);
if (is_array($search) && count($search) > 0) {
foreach ($search as $s) {
$s['data'] = json_decode($s['data'], true);
// $style and $id needed in the include
$style = $s['data'];
$id = $s['id'];
ob_start();
include ASP_PATH . "/css/style.css.php";
$out = ob_get_contents();
$css_arr[$id] = $out;
ob_end_clean();
}
// Too big, disabled...
//update_option('asp_styles_base64', base64_encode($css));
$css = implode(" ", $css_arr);
if ($async_load == 1) {
foreach ($css_arr as $sid => $c) {
wpd_put_file(ASP_CSS_PATH . "/async/search" . $sid . ".css", $c);
}
} else {
wpd_put_file(ASP_CSS_PATH . "/style.instances.css", $css);
}
update_option("asp_media_query", asp_gen_rnd_str());
return $css;
}
}
示例9: defined
<?php
/* Prevent direct access */
defined('ABSPATH') or die("You can't access this file directly.");
?>
<form name='options'>
<?php
$fields = w_isset_def($style['field_order'], 'general|custom_post_types|custom_fields|categories_terms');
if (strpos($fields, "general") === false) {
$fields = "general|" . $fields;
}
$field_order = explode('|', $fields);
foreach ($field_order as $field) {
include "asp.shortcode.{$field}.php";
}
?>
</form>
示例10: file_get_contents
'>
<?php
if (w_isset_def($style['loadingimage_custom'], "") == "" && pathinfo($style['loadingimage'], PATHINFO_EXTENSION) == 'svg') {
echo file_get_contents(WP_PLUGIN_DIR . '/' . $style['loadingimage']);
}
?>
<?php
do_action('asp_layout_in_loading', $id);
?>
</div>
<?php
if ($style['show_close_icon']) {
?>
<div class='proclose<?php
echo w_isset_def($style['box_compact_layout'], 0) == 1 ? ' hiddend' : '';
?>
'>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px"
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512"
xml:space="preserve">
<polygon id="x-mark-icon"
points="438.393,374.595 319.757,255.977 438.378,137.348 374.595,73.607 255.995,192.225 137.375,73.622 73.607,137.352 192.246,255.983 73.622,374.625 137.352,438.393 256.002,319.734 374.652,438.378 "/>
</svg>
</div>
<?php
}
?>
<?php
示例11: url
echo $style['settingsimagepos'];
?>
; /* IE9, no flexbox */
<?php
echo $style['settingsbackgroundborder'];
?>
<?php
echo $style['settingsboxshadow'];
?>
cursor: pointer;
background-size: 100% 100%;
align-self: flex-end;
}
<?php
if (w_isset_def($style['settingsimage_custom'], "") != "") {
?>
<?php
echo $asp_div_ids1;
?>
.probox .prosettings .innericon,
<?php
echo $asp_div_ids2;
?>
.probox .prosettings .innericon,
<?php
echo $asp_div_ids;
?>
.probox .prosettings .innericon {
background-image: url("<?php
echo $style['settingsimage_custom'];
示例12: ajaxsearchlite_search
function ajaxsearchlite_search()
{
global $wpdb;
global $search;
/*print "in ajaxsearchlite_search();";
print_r(array()); return; */
$s = $_POST['aslp'];
$s = apply_filters('asl_search_phrase_before_cleaning', $s);
$s = stripcslashes($s);
$s = trim($s);
$s = preg_replace('/\\s+/', ' ', $s);
$s = apply_filters('asl_search_phrase_after_cleaning', $s);
$def_data = get_option('asl_defaults');
$search = array();
$search['data'] = get_option('asl_options');
$search['data'] = array_merge($def_data, $search['data']);
$search['data']['image_options'] = array('show_images' => $search['data']['show_images'], 'image_bg_color' => '#FFFFFF', 'image_transparency' => 1, 'image_crop_location' => w_isset_def($search['data']['image_crop_location'], "c"), 'image_width' => $search['data']['image_width'], 'image_height' => $search['data']['image_height'], 'image_source1' => $search['data']['image_source1'], 'image_source2' => $search['data']['image_source2'], 'image_source3' => $search['data']['image_source3'], 'image_source4' => $search['data']['image_source4'], 'image_source5' => $search['data']['image_source5'], 'image_default' => $search['data']['image_default'], 'image_custom_field' => $search['data']['image_custom_field']);
// ----------------- Recalculate image width/height ---------------
switch ($search['data']['resultstype']) {
case "horizontal":
/* Same width as height */
$search['data']['image_options']['image_width'] = wpdreams_width_from_px($search['data']['image_options']['hreswidth']);
$search['data']['image_options']['image_height'] = wpdreams_width_from_px($search['data']['image_options']['hreswidth']);
break;
case "polaroid":
$search['data']['image_options']['image_width'] = intval($search['data']['preswidth']);
$search['data']['image_options']['image_height'] = intval($search['data']['preswidth']);
break;
case "isotopic":
$search['data']['image_options']['image_width'] = intval($search['data']['i_item_width'] * 1.5);
$search['data']['image_options']['image_height'] = intval($search['data']['i_item_height'] * 1.5);
break;
}
if (isset($search['data']['selected-imagesettings'])) {
$search['data']['settings-imagesettings'] = $search['data']['selected-imagesettings'];
}
/*if (isset($search) && $search['data']['exactonly']!=1) {
$_s = explode(" ", $s);
}*/
if (isset($_POST['options'])) {
parse_str($_POST['options'], $search['options']);
}
$blogresults = array();
$allpageposts = array();
$pageposts = array();
do_action('asl_before_search', $s);
$params = array('data' => $search['data'], 'options' => $search['options']);
$_posts = new wpdreams_searchContent($params);
$pageposts = $_posts->search($s);
$allpageposts = array_merge($allpageposts, $pageposts);
do_action('asl_after_pagepost_results', $s, $pageposts);
$allpageposts = apply_filters('asl_pagepost_results', $allpageposts);
$results = array_merge($allpageposts);
// Keyword suggestions
if (count($results) <= 0 && w_isset_def($search['data']['kw_suggestions'], 1) == 1) {
$keywords = array();
$types = array();
$sd = $search['data'];
if ($sd['searchinposts'] == 1) {
$types[] = "post";
}
if ($sd['searchinpages'] == 1) {
$types[] = "page";
}
if (isset($sd['selected-customtypes']) && count($sd['selected-customtypes']) > 0) {
$types = array_merge($types, $sd['selected-customtypes']);
}
$t = new wpd_keywordSuggest("google", array('maxCount' => w_isset_def($sd['kw_count'], 10), 'maxCharsPerWord' => w_isset_def($sd['kw_length'], 60), 'postTypes' => $types, 'lang' => w_isset_def($sd['kw_google_lang'], "en"), 'overrideUrl' => ''));
$keywords = $t->getKeywords($s);
if ($keywords != false) {
$results['keywords'] = $keywords;
$results['nores'] = 1;
$results = apply_filters('asl_only_keyword_results', $results);
}
} else {
if (count($results > 0)) {
$results = apply_filters('asl_only_non_keyword_results', $results);
}
}
$results = apply_filters('asl_results', $results);
do_action('asl_after_search', $s, $results);
// Generate the results here
$html_results = asl_generate_html_results($results, $search['data']);
/* Clear output buffer, possible warnings */
print "!!ASLSTART!!";
//var_dump($results);die();
print_r($html_results);
print "!!ASLEND!!";
die;
}
示例13: w_isset_def
?>
,
'on_typing': <?php
echo w_isset_def($style['apl_on_typing'], 0);
?>
},
compact: {
enabled: <?php
echo w_isset_def($style['box_compact_layout'], 0);
?>
,
width: "<?php
echo w_isset_def($style['box_compact_width'], "100%");
?>
",
closeOnMagnifier: <?php
echo w_isset_def($style['box_compact_close_on_magn'], 1);
?>
,
closeOnDocument: <?php
echo w_isset_def($style['box_compact_close_on_document'], 0);
?>
,
position: "<?php
echo w_isset_def($style['box_compact_position'], 0);
?>
"
}
});
});
</script>
示例14: ajaxsearchpro_autocomplete
function ajaxsearchpro_autocomplete()
{
global $wpdb;
$s = trim($_POST['sauto']);
$s = preg_replace('/\\s+/', ' ', $s);
do_action('asp_before_autocomplete', $s);
if (!isset($_POST['asid'])) {
return "";
}
// Set the prefix for multisites
if (isset($wpdb->base_prefix)) {
$_prefix = $wpdb->base_prefix;
} else {
$_prefix = $wpdb->prefix;
}
// Forcing numeric value
$_POST['asid'] = $_POST['asid'] + 0;
$search = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $_prefix . "ajaxsearchpro WHERE id=%d", $_POST['asid']), ARRAY_A);
if (!isset($search['data'])) {
return;
}
$sd = json_decode($search['data'], true);
$keyword = '';
$types = array();
if ($sd['searchinposts'] == 1) {
$types[] = "post";
}
if ($sd['searchinpages'] == 1) {
$types[] = "page";
}
if (isset($sd['selected-customtypes']) && count($sd['selected-customtypes']) > 0) {
$types = array_merge($types, $sd['selected-customtypes']);
}
foreach (w_isset_def($sd['selected-autocomplete_source'], array('google')) as $source) {
$taxonomy = "";
// Check if this is a taxonomy
if (strpos($source, 'xtax_') !== false) {
$taxonomy = str_replace('xtax_', '', $source);
$source = "terms";
}
$t = new wpd_keywordSuggest($source, array('maxCount' => 10, 'maxCharsPerWord' => w_isset_def($sd['autocomplete_length'], 60), 'postTypes' => $types, 'lang' => $sd['keywordsuggestionslang'], 'overrideUrl' => '', 'taxonomy' => $taxonomy, 'match_start' => true));
$res = $t->getKeywords($s);
if (isset($res[0]) && ($keyword = $res[0])) {
break;
}
}
do_action('asp_after_autocomplete', $s, $keyword);
print $keyword;
die;
}
示例15: w_isset_def
]" value="<?php
echo $asp_f_uncoded_items[$key];
?>
">
<?php
break;
?>
<?php
case "dropdown":
?>
<div class="asp_select_label<?php
echo w_isset_def($item->asp_f_dropdown_multi, 'asp_unchecked') == 'asp_checked' ? ' asp_select_multiple' : ' asp_select_single';
?>
">
<select <?php
echo w_isset_def($item->asp_f_dropdown_multi, 'asp_unchecked') == 'asp_checked' ? ' multiple name="aspf[' . $item->asp_f_field . '][]"' : 'name="aspf[' . $item->asp_f_field . ']"';
?>
>
<?php
foreach ($item->asp_f_dropdown_value as $dropdown) {
?>
<?php
preg_match('/^(.*?)\\|\\|(.*)/', $dropdown, $matches);
?>
<option value="<?php
echo $matches[1];
?>
"<?php
echo strpos('**', $matches[2]) > 0 ? ' selected' : '';
?>