当前位置: 首页>>代码示例>>PHP>>正文


PHP _wpl_import函数代码示例

本文整理汇总了PHP中_wpl_import函数的典型用法代码示例。如果您正苦于以下问题:PHP _wpl_import函数的具体用法?PHP _wpl_import怎么用?PHP _wpl_import使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_wpl_import函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: start

 public function start($layout, $params)
 {
     $room_types = wpl_global::return_in_id_array(wpl_room_types::get_room_types());
     /** include layout **/
     $layout_path = _wpl_import($layout, true, true);
     include $layout_path;
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:7,代码来源:main.php

示例2: upload

 public function upload()
 {
     /** import upload library **/
     _wpl_import('assets.packages.ajax_uploader.UploadHandler');
     $kind = wpl_request::getVar('kind', 0);
     $params = array();
     $params['accept_ext'] = wpl_flex::get_field_options(301);
     $extentions = explode(',', $params['accept_ext']['ext_file']);
     $ext_str = '';
     foreach ($extentions as $extention) {
         $ext_str .= $extention . '|';
     }
     // remove last |
     $ext_str = substr($ext_str, 0, -1);
     $ext_str = rtrim($ext_str, ';');
     $custom_op = array('upload_dir' => wpl_global::get_upload_base_path(), 'upload_url' => wpl_global::get_upload_base_url(), 'accept_file_types' => '/\\.(' . $ext_str . ')$/i', 'max_file_size' => $params['accept_ext']['file_size'] * 1000, 'min_file_size' => 1, 'max_number_of_files' => null);
     $upload_handler = new UploadHandler($custom_op);
     $response = json_decode($upload_handler->json_response);
     if (isset($response->files[0]->error)) {
         return;
     }
     $attachment_categories = wpl_items::get_item_categories('attachment', $kind);
     // get item category with first index
     $item_cat = reset($attachment_categories)->category_name;
     $index = floatval(wpl_items::get_maximum_index(wpl_request::getVar('pid'), wpl_request::getVar('type'), $kind, $item_cat)) + 1.0;
     $item = array('parent_id' => wpl_request::getVar('pid'), 'parent_kind' => $kind, 'item_type' => wpl_request::getVar('type'), 'item_cat' => $item_cat, 'item_name' => $response->files[0]->name, 'creation_date' => date("Y-m-d H:i:s"), 'index' => $index);
     wpl_items::save($item);
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:28,代码来源:wpl_attachments.php

示例3: apply

 /**
  * Use this function for applying any filter
  * @author Howard <howard@realtyna.com>
  * @param string $trigger
  * @param array $params
  * @return mixed
  */
 public static function apply($trigger, $params = array())
 {
     /** fetch filters **/
     $filters = self::get_filters($trigger, 1);
     if (count($filters) == 0) {
         return $params;
     }
     foreach ($filters as $filter) {
         /** generate all params **/
         $all_params = array();
         $all_params[0] = $params;
         $all_params[1] = json_decode($filter->params, true);
         $all_params[2] = $filter;
         /** import class **/
         $path = _wpl_import($filter->class_location, true, true);
         if (!wpl_file::exists($path)) {
             continue;
         }
         include_once $path;
         /** call function **/
         $filter_obj = new $filter->class_name();
         $params = call_user_func(array($filter_obj, $filter->function_name), $all_params);
     }
     return $params;
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:32,代码来源:filters.php

示例4: run

 /**
  * Service runner
  * @author Howard <howard@realtyna.com>
  * @return void
  */
 public function run()
 {
     $wpl_format = wpl_request::getVar('wpl_format');
     if (trim($wpl_format) == '') {
         return;
     }
     /** add listing menu **/
     if ($wpl_format == 'b:listing:ajax') {
         $wpl_function = wpl_request::getVar('wpl_function');
         if ($wpl_function == 'save') {
             $table_name = wpl_request::getVar('table_name');
             $table_column = wpl_request::getVar('table_column');
             $value = wpl_request::getVar('value');
             /** for checking limitation on feature and hot tag **/
             if (($table_column == 'sp_featured' or $table_column == 'sp_hot') and $value == 1) {
                 _wpl_import('libraries.property');
                 $current_user_id = wpl_users::get_cur_user_id();
                 $user_data = wpl_users::get_wpl_user($current_user_id);
                 $user_limit = $table_column == 'sp_featured' ? $user_data->maccess_num_feat : $user_data->maccess_num_hot;
                 $model = new wpl_property();
                 $used = $model->get_properties_count(" AND `user_id`='{$current_user_id}' AND `{$table_column}`='1'");
                 if ($used >= $user_limit and $user_limit != '-1') {
                     self::response(array('success' => '0', 'message' => '', 'data' => '', 'js' => "wplj(form_element_id).prop('checked', false); wpl_alert(\"" . __('Your membership limit reached. contact to administrator if you want to upgrade!', WPL_TEXTDOMAIN) . "\");"));
                 }
             }
         }
     }
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:33,代码来源:process.php

示例5: shortcode_wizard

 private function shortcode_wizard()
 {
     _wpl_import('libraries.sort_options');
     /** global settings **/
     $this->settings = wpl_global::get_settings();
     parent::render($this->tpl_path, 'shortcode_wizard');
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:7,代码来源:wpl_ajax.php

示例6: __construct

 /**
  * Constructor method
  * @author Howard <howard@realtyna.com>
  * @param string $format
  */
 public function __construct($format)
 {
     $this->_wpl_request_format = $format;
     $ex = explode(':', $this->_wpl_request_format);
     $this->_wpl_client = array_search($this->_wpl_clients[$ex[0]], $this->_wpl_clients) ? $this->_wpl_clients[$ex[0]] : 'frontend';
     $this->_wpl_folder = $ex[1];
     $this->_wpl_file = $this->get_file_name($ex[2]);
     $this->_wpl_plugin = isset($ex[3]) ? $ex[3] : '';
     $this->_wpl_class = $this->get_class_name($ex);
     /** import file **/
     _wpl_import($this->get_class_path());
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:17,代码来源:request_controller.php

示例7: show_tips

 public function show_tips()
 {
     $page = wpl_request::getVar('page', '');
     /** First Validation **/
     if (!trim($page)) {
         return false;
     }
     $tips = array();
     $path = _wpl_import('assets.tips.' . $page, true, true);
     if (wpl_file::exists($path)) {
         $tips = (include_once $path);
     }
     /** Generate script **/
     $this->generate_scripts($tips);
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:15,代码来源:helps.php

示例8: profile

 public function profile($instance = array())
 {
     /** check access **/
     if (!wpl_users::check_access('profilewizard')) {
         /** import message tpl **/
         $this->message = __("You don't have access to this part!", WPL_TEXTDOMAIN);
         return parent::render($this->tpl_path, 'message');
     }
     _wpl_import('libraries.flex');
     $this->tpl = 'profile';
     $this->kind = wpl_flex::get_kind_id('user');
     $this->user_id = wpl_users::get_cur_user_id();
     if (wpl_users::is_administrator($this->user_id) and wpl_request::getVar('id', 0)) {
         $this->user_id = wpl_request::getVar('id');
     }
     $this->user_fields = wpl_flex::get_fields('', 1, $this->kind, 'pwizard', 1);
     $this->user_data = (array) wpl_users::get_wpl_data($this->user_id);
     /** import tpl **/
     parent::render($this->tpl_path, $this->tpl);
 }
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:20,代码来源:wpl_main.php

示例9: defined

<?php

/** no direct access **/
defined('_WPLEXEC') or die('Restricted access');
include _wpl_import('widgets.carousel.scripts.js', true, true);
$image_width = isset($this->instance['data']['image_width']) ? $this->instance['data']['image_width'] : 1920;
$image_height = isset($this->instance['data']['image_height']) ? $this->instance['data']['image_height'] : 558;
$tablet_image_height = isset($this->instance['data']['tablet_image_height']) ? $this->instance['data']['tablet_image_height'] : 400;
$phone_image_height = isset($this->instance['data']['phone_image_height']) ? $this->instance['data']['phone_image_height'] : 310;
$thumbnail_width = isset($this->instance['data']['thumbnail_width']) ? $this->instance['data']['thumbnail_width'] : 150;
$thumbnail_height = isset($this->instance['data']['thumbnail_height']) ? $this->instance['data']['thumbnail_height'] : 60;
$auto_play = isset($this->instance['data']['auto_play']) ? $this->instance['data']['auto_play'] : true;
$smart_resize = isset($this->instance['data']['smart_resize']) ? $this->instance['data']['smart_resize'] : false;
$slide_interval = isset($this->instance['data']['slide_interval']) ? $this->instance['data']['slide_interval'] : 3000;
/** add Layout js **/
$js[] = (object) array('param1' => 'modern.slider', 'param2' => 'js/libraries/wpl.modern.slider.min.js');
foreach ($js as $javascript) {
    wpl_extensions::import_javascript($javascript);
}
$larg_images = $thumbnail = NULL;
foreach ($wpl_properties as $key => $gallery) {
    if (isset($gallery["items"]["gallery"][0])) {
        $params = array();
        $params['image_name'] = $gallery["items"]["gallery"][0]->item_name;
        $params['image_parentid'] = $gallery["items"]["gallery"][0]->parent_id;
        $params['image_parentkind'] = $gallery["items"]["gallery"][0]->parent_kind;
        $params['image_source'] = wpl_global::get_upload_base_path() . $params['image_parentid'] . DS . $params['image_name'];
        $image_title = wpl_property::update_property_title($gallery['raw']);
        if (isset($gallery['items']['gallery'][0]->item_extra2) and trim($gallery['items']['gallery'][0]->item_extra2) != '') {
            $image_alt = $gallery['items']['gallery'][0]->item_extra2;
        } else {
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:31,代码来源:modern.php

示例10: foreach

?>
 <?php 
echo $this->css_class;
?>
">
    <!-- Do not change the ID -->
    <div id="wpl_searchwidget_<?php 
echo $widget_id;
?>
" class="clearfix">
	    <div class="wpl_search_from">
	    	<?php 
foreach ($this->rendered as $data) {
    echo '<div class="wpl_search_feilds ' . $data['field_data']['type'] . '">' . $data['html'] . '</div>';
}
?>
	    	<div class="search_submit_box">
		    	<input id="wpl_search_widget_submit<?php 
echo $widget_id;
?>
" class="wpl_search_widget_submit" type="submit" value="<?php 
echo __('Search', WPL_TEXTDOMAIN);
?>
" />
		    </div>
	    </div>
	</div>
</form>
<?php 
include _wpl_import('widgets.search.scripts.js', true, true);
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:30,代码来源:simple.php

示例11: update_locationtextsearch_data

 /**
  * Updates locationtextsearch data. It runes by WPL cronjob!
  * @author Howard <howard@realtyna.com>
  * @static
  */
 public static function update_locationtextsearch_data()
 {
     /** detele wpl_locationtextsearch completely **/
     wpl_db::q("DELETE FROM `#__wpl_locationtextsearch`");
     /** Don't run in case of many listings **/
     if (wpl_db::num('', 'wpl_properties') > 2500) {
         wpl_db::q("UPDATE `#__wpl_cronjobs` SET `enabled`='0' WHERE `id`='1'");
         return false;
     }
     _wpl_import('libraries.property');
     $properties = wpl_property::select_active_properties('', '`id`,`location1_name`,`location2_name`,`location3_name`,`location4_name`,`location5_name`,`location6_name`,`location7_name`,`zip_name`');
     $locations = array();
     foreach ($properties as $property) {
         $pid = $property['id'];
         $locations[$pid] = array();
         $locations[$pid]['full_location'] = '';
         $locations[$pid]['zip'] = '';
         for ($j = 1; $j <= 7; $j++) {
             $locations[$pid][$j] = '';
         }
         for ($i = 7; $i >= 1; $i--) {
             $locations[$pid]['full_location'] .= ', ' . $property['location' . $i . '_name'];
             if ($i <= 7 and trim($property['location7_name'])) {
                 $locations[$pid]['7'] .= ', ' . $property['location' . $i . '_name'];
             }
             if ($i <= 6 and trim($property['location6_name'])) {
                 $locations[$pid]['6'] .= ', ' . $property['location' . $i . '_name'];
             }
             if ($i <= 5 and trim($property['location5_name'])) {
                 $locations[$pid]['5'] .= ', ' . $property['location' . $i . '_name'];
             }
             if ($i <= 4 and trim($property['location4_name'])) {
                 $locations[$pid]['4'] .= ', ' . $property['location' . $i . '_name'];
             }
             if ($i <= 3 and trim($property['location3_name'])) {
                 $locations[$pid]['3'] .= ', ' . $property['location' . $i . '_name'];
             }
             if ($i <= 2 and trim($property['location2_name'])) {
                 $locations[$pid]['2'] .= ', ' . $property['location' . $i . '_name'];
             }
             if ($i <= 1 and trim($property['location1_name'])) {
                 $locations[$pid]['1'] .= ', ' . $property['location' . $i . '_name'];
             }
         }
         /** remove extra , and spaces if any **/
         foreach ($locations[$pid] as $key => $location) {
             $locations[$pid][$key] = trim($location, ', ');
         }
         /** add zip code **/
         $locations[$pid]['zip'] = $property['zip_name'] . ', ' . $locations[$pid]['full_location'];
     }
     /** make a new location array **/
     $unique_locations = array();
     foreach ($locations as $pid => $location) {
         foreach ($location as $location_level => $location_string) {
             $unique_locations[] = $location_string;
         }
     }
     $unique_locations = array_unique($unique_locations);
     foreach ($unique_locations as $location_text) {
         $query = "SELECT `kind`, COUNT(id) AS count FROM `#__wpl_properties` WHERE `deleted`='0' AND `finalized`='1' AND `confirmed`='1' AND `expired`='0' AND `location_text` LIKE '%" . wpl_db::escape($location_text) . "%' GROUP BY `kind`";
         $counts = wpl_db::select($query, 'loadAssocList');
         $total_count = 0;
         foreach ($counts as $count) {
             $total_count += $count['count'];
         }
         /** add to wpl_locationtextsearch **/
         $query = "INSERT INTO `#__wpl_locationtextsearch` (`location_text`,`count`,`counts`) VALUES ('" . wpl_db::escape($location_text) . "','{$total_count}','" . json_encode($counts) . "')";
         wpl_db::q($query);
     }
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:76,代码来源:locations.php

示例12: defined

<?php

/** no direct access **/
defined('_WPLEXEC') or die('Restricted access');
_wpl_import('libraries.pagination');
_wpl_import('libraries.sort_options');
class wpl_data_structure_controller extends wpl_controller
{
    public $tpl_path = 'views.backend.data_structure.tmpl';
    public $tpl;
    public function display()
    {
        /** check permission **/
        wpl_global::min_access('administrator');
        $function = wpl_request::getVar('wpl_function');
        if ($function == 'sort_options') {
            $sort_ids = wpl_request::getVar('sort_ids');
            self::sort_options($sort_ids);
        } elseif ($function == 'sort_options_enabled_state_change') {
            $id = wpl_request::getVar('id');
            $enabled_status = wpl_request::getVar('enabled_status');
            self::update('wpl_sort_options', $id, 'enabled', $enabled_status);
        } elseif ($function == 'save_sort_option') {
            $id = wpl_request::getVar('id');
            $sort_name = wpl_request::getVar('sort_name', '');
            self::update('wpl_sort_options', $id, 'name', $sort_name);
        }
    }
    /**
     *{tablename,id,key,value of key}
     * this function call update function in units library and change value of a field
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:31,代码来源:wpl_ajax_sort_options.php

示例13: display

 public function display($instance = array())
 {
     /** check access **/
     if (!wpl_users::check_access('propertylisting')) {
         /** import message tpl **/
         $this->message = __("You don't have access to this part!", WPL_TEXTDOMAIN);
         return parent::render($this->tpl_path, 'message', false, true);
     }
     $this->tpl = wpl_request::getVar('tpl', 'default');
     $this->method = wpl_request::getVar('wplmethod', NULL);
     /** global settings **/
     $this->settings = wpl_settings::get_settings();
     /** listing settings **/
     $this->page_number = wpl_request::getVar('wplpage', 1, '', true);
     $this->limit = wpl_request::getVar('limit', $this->settings['default_page_size']);
     $this->start = wpl_request::getVar('start', ($this->page_number - 1) * $this->limit, '', true);
     $this->orderby = wpl_request::getVar('wplorderby', $this->settings['default_orderby'], '', true);
     $this->order = wpl_request::getVar('wplorder', $this->settings['default_order'], '', true);
     /** Set Property CSS class **/
     $this->property_css_class = !$this->wplraw ? wpl_request::getVar('wplpcc', NULL) : NULL;
     if (!$this->property_css_class) {
         $this->property_css_class = wpl_request::getVar('wplpcc', 'grid_box', 'COOKIE');
     }
     $this->property_css_class_switcher = wpl_request::getVar('wplpcc_switcher', '1');
     $this->property_listview = wpl_request::getVar('wplplv', '1');
     #Show listview or not
     /** RSS Feed Setting **/
     $this->listings_rss_enabled = isset($this->settings['listings_rss_enabled']) ? $this->settings['listings_rss_enabled'] : 0;
     /** detect kind **/
     $this->kind = wpl_request::getVar('kind', 0);
     if (!$this->kind) {
         $this->kind = wpl_request::getVar('sf_select_kind', 0);
     }
     if (!in_array($this->kind, wpl_flex::get_valid_kinds())) {
         /** import message tpl **/
         $this->message = __('Invalid Request!', WPL_TEXTDOMAIN);
         return parent::render($this->tpl_path, 'message', false, true);
     }
     /** pagination types **/
     $this->wplpagination = wpl_request::getVar('wplpagination', 'normal', '', true);
     wpl_request::setVar('wplpagination', $this->wplpagination);
     /** property listing model **/
     $this->model = new wpl_property();
     /** set page if start var passed **/
     $this->page_number = $this->start / $this->limit + 1;
     wpl_request::setVar('wplpage', $this->page_number);
     $where = array('sf_select_confirmed' => 1, 'sf_select_finalized' => 1, 'sf_select_deleted' => 0, 'sf_select_expired' => 0, 'sf_select_kind' => $this->kind);
     /** Add search conditions to the where **/
     $vars = array_merge(wpl_request::get('POST'), wpl_request::get('GET'));
     $where = array_merge($vars, $where);
     /** start search **/
     $this->model->start($this->start, $this->limit, $this->orderby, $this->order, $where, $this->kind);
     $this->model->total = $this->model->get_properties_count();
     /** validation for page_number **/
     $this->total_pages = ceil($this->model->total / $this->limit);
     if ($this->page_number <= 0 or $this->page_number > $this->total_pages) {
         $this->model->start = 0;
     }
     /** run the search **/
     $query = $this->model->query();
     $properties = $this->model->search();
     /** finish search **/
     $this->model->finish();
     $plisting_fields = $this->model->get_plisting_fields('', $this->kind);
     $wpl_properties = array();
     foreach ($properties as $property) {
         $wpl_properties[$property->id] = $this->model->full_render($property->id, $plisting_fields, $property);
     }
     /** define current index **/
     $wpl_properties['current'] = array();
     /** apply filters (This filter must place after all proccess) **/
     _wpl_import('libraries.filters');
     @extract(wpl_filters::apply('property_listing_after_render', array('wpl_properties' => $wpl_properties)));
     $this->pagination = wpl_pagination::get_pagination($this->model->total, $this->limit, true, $this->wplraw);
     $this->wpl_properties = $wpl_properties;
     if ($this->wplraw and $this->method == 'get_markers') {
         $markers = array('markers' => $this->model->render_markers($wpl_properties), 'total' => $this->model->total);
         echo json_encode($markers);
         exit;
     } elseif ($this->wplraw and $this->method == 'get_listings') {
         if ($this->return_listings) {
             return $wpl_properties;
         } else {
             echo json_encode($wpl_properties);
             exit;
         }
     }
     /** import tpl **/
     $this->tpl = wpl_flex::get_kind_tpl($this->tpl_path, $this->tpl, $this->kind);
     return parent::render($this->tpl_path, $this->tpl, false, true);
 }
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:91,代码来源:wpl_abstract.php

示例14: wpl_report_abuse_get_form

        <li class="report_abuse_link">
            <a data-realtyna-lightbox href="#wpl_pshow_lightbox_content_container" onclick="return wpl_report_abuse_get_form(<?php 
    echo $property_id;
    ?>
);"><?php 
    echo __('Report Abuse', WPL_TEXTDOMAIN);
    ?>
</a>
		</li>
        <?php 
}
?>

        <?php 
if ($show_crm) {
    _wpl_import('libraries.addon_crm');
    $crm = new wpl_addon_crm();
    ?>
        <li class="crm_link">
            <a href="<?php 
    echo $crm->URL('form');
    ?>
&pid=<?php 
    echo $property_id;
    ?>
" target="_blank"><?php 
    echo __('Contact for this Property', WPL_TEXTDOMAIN);
    ?>
</a>
        </li>
        <?php 
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:31,代码来源:default.php

示例15: defined

<?php

/** no direct access **/
defined('_WPLEXEC') or die('Restricted access');
_wpl_import('libraries.locations');
_wpl_import('libraries.pagination');
_wpl_import('libraries.settings');
class wpl_location_manager_controller extends wpl_controller
{
    public $tpl_path = 'views.backend.location_manager.tmpl';
    public $tpl;
    public function home()
    {
        /** check permission **/
        wpl_global::min_access('administrator');
        $this->level = trim(wpl_request::getVar('level')) != '' ? wpl_request::getVar('level') : 1;
        $this->parent = trim(wpl_request::getVar('sf_select_parent')) != '' ? wpl_request::getVar('sf_select_parent') : "";
        $this->enabled = trim(wpl_request::getVar('sf_select_enabled')) != '' ? wpl_request::getVar('sf_select_enabled') : 1;
        $this->text_search = trim(wpl_request::getVar('sf_text_name')) != '' ? wpl_request::getVar('sf_text_name') : '';
        $this->admin_url = wpl_global::get_wp_admin_url();
        $this->load_zipcodes = trim(wpl_request::getVar('load_zipcodes')) != '' ? 1 : 0;
        /** set show all based on level **/
        if ($this->level != 1) {
            $this->enabled = '';
        }
        $possible_orders = array('id', 'name');
        $orderby = in_array(wpl_request::getVar('orderby'), $possible_orders) ? wpl_request::getVar('orderby') : $possible_orders[0];
        $order = in_array(strtoupper(wpl_request::getVar('order')), array('ASC', 'DESC')) ? wpl_request::getVar('order') : 'ASC';
        $page_size = trim(wpl_request::getVar('page_size')) != '' ? wpl_request::getVar('page_size') : NULL;
        /** create where **/
        $vars = array_merge(wpl_request::get('POST'), wpl_request::get('GET'));
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:31,代码来源:wpl_main.php


注:本文中的_wpl_import函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。