本文整理汇总了PHP中w_isset_def函数的典型用法代码示例。如果您正苦于以下问题:PHP w_isset_def函数的具体用法?PHP w_isset_def怎么用?PHP w_isset_def使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了w_isset_def函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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'];
}
}
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:31,代码来源:search.class.php
示例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'));
}
开发者ID:alphacityco,项目名称:kotobanokumo-wp-content,代码行数:28,代码来源:asl_init.class.php
示例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);
}
}
开发者ID:alphacityco,项目名称:kotobanokumo-wp-content,代码行数:10,代码来源:hooks.php
示例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;
}
}
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:15,代码来源:functions.php
示例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;
}
开发者ID:alphacityco,项目名称:kotobanokumo-wp-content,代码行数:17,代码来源:shortcodes.php
示例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;
}
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:50,代码来源:hooks.php
示例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';
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:31,代码来源:asp.shortcode.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;
}
}
开发者ID:booklein,项目名称:wpbookle,代码行数:41,代码来源:general.php
示例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>
开发者ID:hikaram,项目名称:wee,代码行数:17,代码来源:asp.shortcode.settings.php
示例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
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:31,代码来源:asp.shortcode.probox.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'];
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:31,代码来源:style.shared.css.php
示例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;
}
开发者ID:Aqro,项目名称:NewDWM,代码行数:90,代码来源:search.php
示例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>
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:31,代码来源:asp.shortcode.script.php
示例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;
}
开发者ID:booklein,项目名称:wpbookle,代码行数:50,代码来源:search.php
示例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' : '';
?>
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:31,代码来源:asp.shortcode.custom_fields.php
示例16: scripts
/**
* Prints the scripts
*/
function scripts()
{
global $wp_version;
// ------------ Dequeue some scripts causing issues on the back-end --------------
wp_dequeue_script('otw-admin-colorpicker');
wp_dequeue_script('otw-admin-select2');
wp_dequeue_script('otw-admin-otwpreview');
wp_dequeue_script('otw-admin-fonts');
wp_dequeue_script('otw-admin-functions');
wp_dequeue_script('otw-admin-variables');
// Fallback on IE<=8
if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(?i)msie [6-8]/', $_SERVER['HTTP_USER_AGENT'])) {
// Oh, this is IE 8 or below, abort mission
return;
}
$comp_settings = get_option('asp_compatibility');
//var_dump($comp_settings);die();
if ($comp_settings !== false && isset($comp_settings['loadpolaroidjs']) && $comp_settings['loadpolaroidjs'] == 0) {
} else {
wp_register_script('wpdreams-modernizr', ASP_URL . 'js/nomin/modernizr.min.js', array(), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-modernizr');
wp_register_script('wpdreams-classie', ASP_URL . 'js/nomin/classie.js', array(), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-classie');
wp_register_script('wpdreams-photostack', ASP_URL . 'js/nomin/photostack.js', array(), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-photostack');
}
$js_source = w_isset_def($comp_settings['js_source'], 'min-scoped');
$load_noui = w_isset_def($comp_settings['load_noui_js'], 1);
$load_isotope = w_isset_def($comp_settings['load_isotope_js'], 1);
$minify_string = ($load_noui == 1 ? '-noui' : '') . ($load_isotope == 1 ? '-isotope' : '');
if (ASP_DEBUG) {
$js_source = 'nomin';
}
if ($js_source == 'nomin' || $js_source == 'nomin-scoped') {
$prereq = "jquery";
if ($js_source == "nomin-scoped") {
$prereq = "wpdreams-aspjquery";
wp_register_script('wpdreams-aspjquery', ASP_URL . 'js/' . $js_source . '/aspjquery.js', array(), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-aspjquery');
}
wp_register_script('wpdreams-gestures', ASP_URL . 'js/' . $js_source . '/jquery.gestures.js', array($prereq), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-gestures');
wp_register_script('wpdreams-easing', ASP_URL . 'js/' . $js_source . '/jquery.easing.js', array($prereq), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-easing');
/*wp_register_script('wpdreams-mousewheel', ASP_URL . 'js/' . $js_source . '/jquery.mousewheel.js', array($prereq));
wp_enqueue_script('wpdreams-mousewheel');*/
wp_register_script('wpdreams-scroll', ASP_URL . 'js/' . $js_source . '/jquery.mCustomScrollbar.js', array($prereq), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-scroll');
wp_register_script('wpdreams-highlight', ASP_URL . 'js/' . $js_source . '/jquery.highlight.js', array($prereq), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-highlight');
if ($load_noui) {
wp_register_script('wpdreams-nouislider', ASP_URL . 'js/' . $js_source . '/jquery.nouislider.all.js', array($prereq), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-nouislider');
}
if ($load_isotope) {
wp_register_script('wpdreams-rpp-isotope', ASP_URL . 'js/' . $js_source . '/rpp_isotope.js', array($prereq), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-rpp-isotope');
}
wp_register_script('wpdreams-ajaxsearchpro', ASP_URL . 'js/' . $js_source . '/jquery.ajaxsearchpro.js', array($prereq, "wpdreams-scroll"), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-ajaxsearchpro');
} else {
wp_enqueue_script('jquery');
wp_register_script('wpdreams-ajaxsearchpro', ASP_URL . "js/" . $js_source . "/jquery.ajaxsearchpro" . $minify_string . ".min.js", array(), ASP_CURR_VER_STRING);
wp_enqueue_script('wpdreams-ajaxsearchpro');
}
$ajax_url = admin_url('admin-ajax.php');
if (w_isset_def($comp_settings['usecustomajaxhandler'], 0) == 1) {
$ajax_url = ASP_URL . 'ajax_search.php';
}
wp_localize_script('wpdreams-ajaxsearchpro', 'ajaxsearchpro', array('ajaxurl' => $ajax_url, 'backend_ajaxurl' => admin_url('admin-ajax.php')));
}
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:74,代码来源:asp_init.class.php
示例17: do_search
/**
* The search function
*
* @return array|string
*/
protected function do_search()
{
global $wpdb;
global $q_config;
$options = $this->options;
$searchData = $this->searchData;
$parts = array();
$relevance_parts = array();
$types = array();
$post_types = "";
$s = $this->s;
// full keyword
$_s = $this->_s;
// array of keywords
$_si = implode('|', $_s);
// imploded phrase for regexp
$_si = $_si != '' ? $_si : $s;
//$kw_logic = w_isset_def($searchData['keyword_logic'], 'or');
$q_config['language'] = $options['qtranslate_lang'];
if (isset($wpdb->base_prefix)) {
$_prefix = $wpdb->base_prefix;
} else {
$_prefix = $wpdb->prefix;
}
/*------------------------- Statuses ----------------------------*/
$statuses = array('publish');
if ($searchData['searchinpending']) {
$statuses[] = 'pending';
}
if ($searchData['searchindrafts']) {
$statuses[] = 'draft';
}
$words = implode('|', $statuses);
$post_statuses = "(lower({$wpdb->posts}.post_status) REGEXP '{$words}')";
/*---------------------------------------------------------------*/
/*----------------------- Gather Types --------------------------*/
if ($options['set_inposts'] == 1) {
$types[] = "post";
}
if ($options['set_inpages']) {
$types[] = "page";
}
if (isset($options['customset']) && count($options['customset']) > 0) {
$types = array_merge($types, $options['customset']);
}
if (count($types) < 1) {
return '';
} else {
$words = implode('[[:>:]]|[[:<:]]', $types);
$post_types = "({$wpdb->posts}.post_type REGEXP '[[:<:]]" . $words . "[[:>:]]')";
}
/*---------------------------------------------------------------*/
$is_too_short = false;
$not_exact_phrase = '';
$fulltext = wpdreamsFulltext::getInstance();
foreach ($_s as $_pp) {
if (strlen($_pp) < $fulltext->getMinWordLength() || !$options['set_exactonly']) {
$is_too_short = true;
$not_exact_phrase .= " *" . $_pp . "*";
} else {
$not_exact_phrase .= " " . $_pp;
}
}
$not_exact_phrase = trim($not_exact_phrase);
$exact_phrase = '"' . $s . '"';
$ful_options = get_option('asp_fulltexto');
if (w_isset_def($ful_options['dbuseregularwhenshort'], 0) && $is_too_short) {
return parent::do_search();
}
/**
* Construct the INDEX name to search
*/
$match_against = '1';
$relevance = '';
$fixed_phrase = $options['set_exactonly'] ? $exact_phrase : $not_exact_phrase;
$boolean_mode = get_option('asp_fulltext_indexed') == 0 || $is_too_short || !$options['set_exactonly'] ? ' IN BOOLEAN MODE' : '';
$index_name = $options['set_intitle'] ? "{$wpdb->posts}.post_title" : '';
if ($index_name == '') {
$index_name .= $options['set_incontent'] ? "{$wpdb->posts}.post_content" : '';
} else {
$index_name .= $options['set_incontent'] ? ", {$wpdb->posts}.post_content" : '';
}
if ($index_name == '') {
$index_name .= $options['set_inexcerpt'] ? "{$wpdb->posts}.post_excerpt" : '';
} else {
$index_name .= $options['set_inexcerpt'] ? ", {$wpdb->posts}.post_excerpt" : '';
}
if ($index_name != '') {
$match_against = " MATCH(" . $index_name . ") AGAINST ('" . $fixed_phrase . "'" . $boolean_mode . ") ";
}
if ($match_against != '1') {
$relevance = "\r\n (\r\n MATCH(" . $index_name . ") AGAINST ('" . $exact_phrase . "'" . $boolean_mode . ") +\r\n MATCH(" . $index_name . ") AGAINST ('" . $not_exact_phrase . "'" . $boolean_mode . ")\r\n )\r\n ";
}
// ------------------------ Categories/taxonomies ----------------------
if (!isset($options['categoryset']) || $options['categoryset'] == "") {
//.........这里部分代码省略.........
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:101,代码来源:search_content_fulltext.class.php
示例18: w_isset_def
,
"iitemsHeight": <?php
echo w_isset_def($style['i_item_height'], 200);
?>
,
"iishowOverlay": <?php
echo w_isset_def($style['i_overlay'], 1);
?>
,
"iiblurOverlay": <?php
echo w_isset_def($style['i_overlay_blur'], 1);
?>
,
"iihideContent": <?php
echo w_isset_def($style['i_hide_content'], 1);
?>
,
"iianimation": "<?php
echo w_isset_def($style['i_animation'], 1);
?>
",
"analytics": <?php
echo w_isset_def($ana_options['analytics'], 0);
?>
,
"analyticsString": "<?php
echo w_isset_def($ana_options['analytics_string'], "");
?>
"
}
</div>
开发者ID:alphacityco,项目名称:kotobanokumo-wp-content,代码行数:31,代码来源:asl.shortcode.php
示例19: pre_process_results
private function pre_process_results()
{
// No results, save some resources
if (count($this->results) == 0) {
return array();
}
$pageposts = array();
$options = $this->options;
$searchId = $this->searchId;
$searchData = $this->searchData;
$post_ids = array();
//$orderby = w_isset_def($searchData['orderby'], "post_date DESC");
$the_posts = array();
// Get the post IDs
foreach ($this->results as $k => $v) {
$post_ids[$v->blogid][] = $v->id;
}
foreach ($post_ids as $blogid => $the_ids) {
if (isset($options['switch_on_preprocess']) && is_multisite()) {
switch_to_blog($blogid);
}
$args = array('post__in' => $the_ids, 'order_by' => 'post__in', 'posts_per_page' => 1000000, 'post_type' => 'any');
$get_posts = get_posts($args);
foreach ($get_posts as $gk => $gv) {
$get_posts[$gk]->blogid = $blogid;
}
$the_posts = array_merge($the_posts, $get_posts);
}
if (isset($options['switch_on_preprocess']) && is_multisite()) {
restore_current_blog();
}
// Merge the posts with the raw results to a new array
foreach ($the_posts as $k => $r) {
$new_result = new stdClass();
$new_result->id = w_isset_def($r->ID, null);
$new_result->blogid = $r->blogid;
$new_result->title = w_isset_def($r->post_title, null);
$new_result->post_title = $new_result->title;
$new_result->content = w_isset_def($r->post_content, null);
$new_result->excerpt = w_isset_def($r->post_excerpt, null);
$new_result->image = null;
if ($searchData['showauthor'] == 1) {
$post_user = get_user_by("id", $r->post_author);
if ($post_user !== false) {
if (w_isset_def($searchData['author_field'], 'display_name') == "display_name") {
$new_result->author = $post_user->data->display_name;
} else {
$new_result->author = $post_user->data->user_login;
}
} else {
$new_result->author = null;
}
}
$new_result->date = w_isset_def($r->post_date, null);
$new_result->post_date = $new_result->date;
// Get the relevance and priority values
$new_result->relevance = (int) $this->raw_results[$new_result->blogid . "x" . $new_result->id]->relevance;
$new_result->priority = (int) $this->raw_results[$new_result->blogid . "x" . $new_result->id]->priority;
$new_result->post_type = $this->raw_results[$new_result->blogid . "x" . $new_result->id]->post_type;
$new_result->content_type = "pagepost";
$new_result->ttid = $this->raw_results[$new_result->blogid . "x" . $new_result->id]->ttid;
$pageposts[] = $new_result;
}
// Order them once again
if (count($pageposts) > 0) {
usort($pageposts, array($this, 'compare_by_primary'));
/**
* Let us save some time. There is going to be a user selecting the same sorting
* for both primary and secondary. Only do secondary if it is different from the primary.
*/
if ($this->ordering['primary'] != $this->ordering['secondary']) {
$i = 0;
foreach ($pageposts as $pk => $pp) {
$pageposts[$pk]->primary_order = $i;
$i++;
}
usort($pageposts, array($this, 'compare_by_secondary'));
}
}
$this->results = $pageposts;
}
开发者ID:booklein,项目名称:wpbookle,代码行数:81,代码来源:search_indextable.class.php
示例20: adv_desc
/**
* Generates the user result description based on the advanced description field
*
* @param $title string post description
* @param $id int post id
* @return string final post description
*/
protected function adv_desc($desc, $id)
{
$descfield = w_isset_def($this->searchData['user_search_advanced_description_field'], '');
if ($descfield == '') {
return $desc;
}
preg_match_all("/{(.*?)}/", $descfield, $matches);
if (isset($matches[0]) && isset($matches[1]) && is_array($match
|
请发表评论