本文整理汇总了PHP中wpl_global::check_addon方法的典型用法代码示例。如果您正苦于以下问题:PHP wpl_global::check_addon方法的具体用法?PHP wpl_global::check_addon怎么用?PHP wpl_global::check_addon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wpl_global
的用法示例。
在下文中一共展示了wpl_global::check_addon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
* Data validation
* @return boolean
*/
public function validate()
{
if (wpl_global::check_addon('mobile_application') == false) {
$this->error = "Addon mobile application not installed";
return false;
}
return true;
}
示例2: get_view
/**
* Detects WPL view from URL (Query String)
* @author Howard R <howard@realtyna.com>
* @static
* @param string $query_string
* @param string $separator
* @return string
*/
public static function get_view($query_string = '', $separator = '')
{
/** first validations **/
if (trim($query_string) == '') {
$query_string = wpl_global::get_wp_qvar('wpl_qs');
}
if (trim($separator) == '') {
$separator = wpl_global::get_setting('sef_main_separator');
}
if (trim($query_string) != '') {
$ex = explode($separator, $query_string);
if (trim($ex[0]) == '') {
$view = 'property_listing';
} else {
$exp = explode('-', $ex[0]);
if (is_numeric($exp[0])) {
$view = 'property_show';
} elseif ($ex[0] == 'features') {
$view = 'features';
} elseif ($ex[0] == 'v') {
if ($ex[1] == 'members') {
$view = 'addon_membership';
} elseif ($ex[1] == 'manager') {
$view = 'property_manager';
} else {
$view = $ex[1];
}
} elseif ($ex[0] == 'search' and wpl_global::check_addon('save_searches')) {
/** Import Library **/
_wpl_import('libraries.addon_save_searches');
$save_searches = new wpl_addon_save_searches();
$exp = explode('-', $ex[1]);
$search_id = $exp[0];
$save_search = $save_searches->get($search_id);
$criteria = json_decode($save_search['criteria'], true);
$view = 'property_listing';
foreach ($criteria as $key => $value) {
wpl_request::setVar($key, $value);
}
} elseif ($ex[0] == 'crm') {
$view = 'addon_crm';
} elseif (strpos($ex[0], ':') === false) {
$view = 'profile_show';
} else {
$view = 'property_listing';
}
}
} else {
$view = wpl_request::getVar('wplview', '');
if (trim($view) == '') {
self::set_view();
}
$view = wpl_request::getVar('wplview', '');
}
/** Set View **/
wpl_request::setVar('wplview', $view);
return $view;
}
示例3: define
define('DS', DIRECTORY_SEPARATOR);
}
/** WPL ABS PATH **/
define('WPL_ABSPATH', dirname(__FILE__) . DS);
define('WPL_BASENAME', basename(WPL_ABSPATH));
define('WPL_UP_ABSPATH', ABSPATH . 'wp-content' . DS . 'uploads' . DS . 'WPL' . DS);
define('WPL_TEXTDOMAIN', 'wpl');
/** WPL textdomain for language **/
define('WPL_VERSION', '2.3.0');
/** WPL version **/
require WPL_ABSPATH . 'config.php';
_wpl_import('global');
_wpl_import('libraries.request');
_wpl_import('libraries.file');
_wpl_import('libraries.folder');
_wpl_import('libraries.db');
_wpl_import('libraries.html');
_wpl_import('libraries.sef');
_wpl_import('libraries.property');
_wpl_import('libraries.users');
_wpl_import('controller');
_wpl_import('extensions');
/** include addon libraries **/
if (wpl_global::check_addon('pro')) {
_wpl_import('libraries.addon_pro');
}
if (wpl_global::check_addon('franchise')) {
_wpl_import('libraries.addon_franchise');
}
/** request controller **/
_wpl_import('request_controller');
示例4: uninstall_wpl
/**
* Uninstalling WPL
* @author Howard <howard@realtyna.com>
* @return boolean
*/
public function uninstall_wpl()
{
$tables = wpl_db::select('SHOW TABLES');
$database = wpl_db::get_DBO();
foreach ($tables as $table_name => $table) {
if (strpos($table_name, $database->prefix . 'wpl_') !== false) {
/** drop table **/
wpl_db::q("DROP TABLE `{$table_name}`");
}
}
/** delete options **/
wpl_db::q("DELETE FROM `#__options` WHERE `option_name` LIKE 'wpl_%' AND `option_name` NOT LIKE 'wpl_theme%'", 'delete');
/** remove WPL upload directory **/
if (function_exists('is_multisite') and is_multisite() and wpl_global::check_addon('multisite')) {
$original_blog_id = wpl_global::get_current_blog_id();
// Get all blogs
$blogs = wpl_db::select("SELECT `blog_id` FROM `#__blogs`", 'loadColumn');
foreach ($blogs as $blog) {
if (!isset($blog->blog_id)) {
continue;
}
switch_to_blog($blog->blog_id);
$upload_path = wpl_global::get_upload_base_path($blog->blog_id);
if (wpl_folder::exists($upload_path)) {
wpl_folder::delete($upload_path);
}
}
switch_to_blog($original_blog_id);
} else {
$upload_path = wpl_global::get_upload_base_path();
if (wpl_file::exists($upload_path)) {
wpl_file::delete($upload_path);
}
}
return true;
}
示例5: generate_wizard_form
/**
* Generates wizard form using dbst fields
* @author Howard R <howard@realtyna.com>
* @param objects $fields
* @param array $values
* @param int $item_id
* @param array $finds
* @return void
*/
public function generate_wizard_form($fields, $values, $item_id = 0, &$finds = array())
{
/** first validation **/
if (!$fields) {
return;
}
/** get files **/
$path = WPL_ABSPATH . DS . 'libraries' . DS . 'dbst_wizard';
$files = array();
if (wpl_folder::exists($path)) {
$files = wpl_folder::files($path, '.php$', false, false);
}
$wpllangs = wpl_global::check_multilingual_status() ? wpl_addon_pro::get_wpl_languages() : array();
$has_more_details = false;
foreach ($fields as $key => $field) {
if (!$field) {
return;
}
$done_this = false;
$type = $field->type;
$label = $field->name;
$mandatory = $field->mandatory;
$options = json_decode($field->options, true);
$value = isset($values[$field->table_column]) ? stripslashes($values[$field->table_column]) : NULL;
$kind = isset($values['kind']) ? $values['kind'] : NULL;
$display = '';
/** Specific **/
if (trim($field->listing_specific) != '') {
$specified_listings = explode(',', trim($field->listing_specific, ', '));
self::$category_listing_specific_array[$field->id] = $specified_listings;
if (!in_array($values['listing'], $specified_listings)) {
$display = 'display: none;';
}
} elseif (trim($field->property_type_specific) != '') {
$specified_property_types = explode(',', trim($field->property_type_specific, ', '));
self::$category_property_type_specific_array[$field->id] = $specified_property_types;
if (!in_array($values['property_type'], $specified_property_types)) {
$display = 'display: none;';
}
} elseif (trim($field->user_specific) != '') {
$specified_user_types = explode(',', trim($field->user_specific, ', '));
self::$category_user_specific_array[$field->id] = $specified_user_types;
if (!in_array($values['membership_type'], $specified_user_types)) {
$display = 'display: none;';
}
} elseif (isset($options['access'])) {
foreach ($options['access'] as $access) {
if (!wpl_global::check_access($access)) {
$display = 'display: none;';
break;
}
}
}
/** More Details **/
if ($type == 'more_details' and !$has_more_details) {
echo '<div class="wpl_listing_field_container wpl-pwizard-prow-' . $type . '" id="wpl_listing_field_container' . $field->id . '">';
echo '<label for="wpl_c_' . $field->id . '"><span>' . __($label, WPL_TEXTDOMAIN) . '</span></label>';
echo '<div id="wpl_more_details' . $field->id . '" style="display: none;" class="wpl-fields-more-details-block">';
$has_more_details = true;
} elseif ($type == 'more_details' and $has_more_details) {
/** Only one details field is acceptable in each category **/
continue;
}
/** Accesses **/
if (isset($field->accesses) and trim($field->accesses) != '' and wpl_global::check_addon('membership')) {
$accesses = explode(',', trim($field->accesses, ', '));
$cur_membership_id = wpl_users::get_user_membership();
if (!in_array($cur_membership_id, $accesses) and trim($field->accesses_message) == '') {
continue;
} elseif (!in_array($cur_membership_id, $accesses) and trim($field->accesses_message) != '') {
echo '<div class="prow wpl_listing_field_container prow-' . $type . '" id="wpl_listing_field_container' . $field->id . '" style="' . $display . '">';
echo '<label for="wpl_c_' . $field->id . '">' . __($label, WPL_TEXTDOMAIN) . '</label>';
echo '<span class="wpl-access-blocked-message">' . __($field->accesses_message, WPL_TEXTDOMAIN) . '</span>';
echo '</div>';
continue;
}
}
/** js validation **/
self::$wizard_js_validation[$field->id] = self::generate_js_validation($field);
if (isset($finds[$type])) {
echo '<div class="prow wpl_listing_field_container prow-' . $type . '" id="wpl_listing_field_container' . $field->id . '" style="' . $display . '">';
include $path . DS . $finds[$type];
echo '</div>';
continue;
}
echo '<div class="prow wpl_listing_field_container prow-' . $type . '" id="wpl_listing_field_container' . $field->id . '" style="' . $display . '">';
foreach ($files as $file) {
include $path . DS . $file;
if ($done_this) {
$finds[$type] = $file;
break;
//.........这里部分代码省略.........
示例6: save_dbst
private function save_dbst()
{
$dbst_id = wpl_request::getVar('dbst_id', 0);
$post = wpl_request::get('post');
$mode = 'edit';
/** insert new field **/
if (!$dbst_id) {
$mode = 'add';
$dbst_id = wpl_flex::create_default_dbst();
}
$q = '';
foreach ($post as $field => $value) {
if (substr($field, 0, 4) != 'fld_') {
continue;
}
$key = substr($field, 4);
if (trim($key) == '') {
continue;
}
$q .= "`{$key}`='{$value}', ";
}
/** add options to query **/
$options = wpl_flex::get_encoded_options($post, 'opt_', wpl_flex::get_field_options($dbst_id));
$q .= "`options`='" . wpl_db::escape($options) . "', ";
$q = trim($q, ", ");
$query = "UPDATE `#__wpl_dbst` SET " . $q . " WHERE `id`='{$dbst_id}'";
wpl_db::q($query, 'update');
$dbst_type = wpl_flex::get_dbst_key('type', $dbst_id);
$dbst_kind = wpl_flex::get_dbst_key('kind', $dbst_id);
/** run queries **/
if ($mode == 'add') {
wpl_flex::run_dbst_type_queries($dbst_id, $dbst_type, $dbst_kind, 'add');
}
/** Multilingual **/
if (wpl_global::check_addon('pro')) {
wpl_addon_pro::multilingual($dbst_id);
}
/** trigger event **/
wpl_global::event_handler('dbst_modified', array('id' => $dbst_id, 'mode' => $mode, 'kind' => $dbst_kind, 'type' => $dbst_type));
/** echo response **/
echo json_encode(array('success' => 1, 'message' => __('Field saved.', WPL_TEXTDOMAIN), 'data' => NULL));
exit;
}
示例7: check_multilingual_status
/**
* Check Multilingual Status
* @author Howard <howard@realtyna.com>
* @static
* @return boolean
*/
public static function check_multilingual_status()
{
$pro = wpl_global::check_addon('pro');
$status = 0;
if ($pro) {
$status = wpl_global::get_setting('multilingual_status');
}
if ($pro and $status) {
return true;
} else {
return false;
}
}
示例8: wpl_generate_rss
function wpl_generate_rss()
{
var rss = '';
rss = wpl_update_qs('wplpage', '', wpl_listing_request_str);
rss = wpl_update_qs('wplview', '', rss);
rss = wpl_update_qs('wplpagination', '', rss);
window.open("<?php
echo wpl_property::get_property_rss_link();
?>
?"+rss);
}
<?php
if (wpl_global::check_addon('aps')) {
?>
function map_view_toggle_listing()
{
if(wplj('.map_view_handler').hasClass('op'))
{
wplj('.wpl_property_listing_list_view_container').animate({'margin-right': '-220px'}, function()
{
wplj('.map_view_handler').toggleClass('op');
});
}
else
{
wplj('.wpl_property_listing_list_view_container').animate({'margin-right': '0.5%'}, function()
{
wplj('.map_view_handler').toggleClass('op');
示例9: isset
$latitude = $location_point[0];
$longitude = $location_point[1];
} else {
$latitude = isset($vars['sf_radiussearch_lat']) ? $vars['sf_radiussearch_lat'] : 0;
$longitude = isset($vars['sf_radiussearch_lng']) ? $vars['sf_radiussearch_lng'] : 0;
}
if ($latitude and $longitude and $radius and $unit_id) {
$unit = wpl_units::get_unit($unit_id);
if ($unit) {
$tosi = 6371 * 1000 / $unit['tosi'];
$radius_si = $radius * $unit['tosi'];
$query .= " AND (( " . $tosi . " * acos( cos( radians(" . $latitude . ") ) * cos( radians( googlemap_lt ) ) * cos( radians( googlemap_ln ) - radians(" . $longitude . ") ) + sin( radians(" . $latitude . ") ) * sin( radians( googlemap_lt ) ) ) ) < " . $radius . ") AND `show_address`='1'";
}
}
$done_this = true;
} elseif ($format == 'polygonsearch' and wpl_global::check_addon('aps') and !$done_this) {
/** importing library **/
_wpl_import('libraries.addon_aps');
$raw_points = isset($vars['sf_polygonsearchpoints']) ? $vars['sf_polygonsearchpoints'] : '[]';
if (version_compare(wpl_db::version(), '5.6.1', '>=')) {
$sql_function = 'ST_Contains';
} else {
$sql_function = 'Contains';
}
$APS = new wpl_addon_aps();
$polygons = $APS->toPolygons($raw_points);
$qq = array();
foreach ($polygons as $polygon) {
$polygon_str = '';
foreach ($polygon as $polygon_point) {
$polygon_str .= $polygon_point[1] . ' ' . $polygon_point[0] . ', ';
示例10: json_encode
$this->properties_str = $this->_wpl_render($this->tpl_path . '.assets.default_listings', true);
if ($this->wplraw == 1) {
echo $this->properties_str;
exit;
}
$this->listview_str = $this->_wpl_render($this->tpl_path . '.assets.default_listings_listview', true);
if ($this->wplraw == 2) {
echo json_encode(array('total_pages' => $this->total_pages, 'current_page' => $this->page_number, 'html' => $this->listview_str));
exit;
}
$this->_wpl_import($this->tpl_path . '.scripts.js', true, true);
if ($this->wplpagination == 'scroll' and $this->property_listview and wpl_global::check_addon('pro')) {
$this->_wpl_import($this->tpl_path . '.scripts.js_scroll', true, true);
}
/** Save Search Add-on **/
if (wpl_global::check_addon('save_searches')) {
$this->_wpl_import($this->tpl_path . '.scripts.addon_save_searches', true, true);
}
?>
<div class="wpl_property_listing_container <?php
if (isset($this->property_css_class) and $this->property_css_class == 'map_box') {
echo 'wpl-property-listing-mapview';
}
?>
" id="wpl_property_listing_container">
<?php
/** load position1 **/
wpl_activity::load_position('plisting_position1', array('wpl_properties' => $this->wpl_properties));
?>
<?php
示例11: isset
$this->overviewmap = isset($params['overviewmap']) ? $params['overviewmap'] : 0;
$this->show_marker = 1;
/** unset current key **/
unset($wpl_properties['current']);
$this->markers = wpl_property::render_markers($wpl_properties);
/** load js codes **/
$this->_wpl_import($this->tpl_path . '.scripts.js', true, true);
$this->_wpl_import($this->tpl_path . '.scripts.default', true, true);
/** Demographic **/
$this->demographic_status = isset($params['demographic']) ? $params['demographic'] : 0;
if ($this->demographic_status and wpl_global::check_addon('demographic')) {
$this->_wpl_import($this->tpl_path . '.scripts.addon_demographic', true, true);
}
/** Map Search **/
$this->map_search_status = isset($params['map_search']) ? $params['map_search'] : 0;
if ($this->map_search_status and wpl_global::check_addon('aps')) {
$this->_wpl_import($this->tpl_path . '.scripts.addon_aps', true, true);
}
?>
<div class="wpl_googlemap_container wpl_googlemap_plisting" id="wpl_googlemap_container<?php
echo $this->activity_id;
?>
" data-wpl-height="<?php
echo $this->map_height;
?>
">
<div class="wpl_map_canvas" id="wpl_map_canvas<?php
echo $this->activity_id;
?>
" style="height: <?php
echo $this->map_height;
示例12: __
?>
value="<?php
echo $property_type['id'];
?>
"><?php
echo __($property_type['name'], WPL_TEXTDOMAIN);
?>
</option>
<?php
}
?>
</select>
</div>
<?php
if (wpl_global::check_addon('complex')) {
?>
<div>
<label for="<?php
echo $this->get_field_id('data_parent');
?>
"><?php
echo __('Parent', WPL_TEXTDOMAIN);
?>
: </label>
<input type="text" id="<?php
echo $this->get_field_id('data_parent');
?>
" title="<?php
echo __('Listing ID of parent property', WPL_TEXTDOMAIN);
?>
示例13: add_watermark_image
/**
* Add watermark to an image
* @author Francis R <francis@realtyna.com>
* @param string $source: source file string path
* @param string $dest : destination file string path
* @param int $watermark: 0 if watermark is disable, 1 if watermark is enable
* @param array $options: array consist of status, opacity, position and user_logo
* @return string : destination file path
*/
public static function add_watermark_image($source, $dest, $options = '')
{
if ($options == '') {
$options['status'] = 0;
}
if ($options['status'] != 1) {
return;
}
$filename = $source;
//default path for watermark
$watermark = WPL_ABSPATH . 'assets' . DS . 'img' . DS . 'system' . DS;
if (trim($options['url']) != '') {
$watermark .= trim($options['url']);
}
if (!wpl_file::exists($watermark)) {
return;
}
$source = strtolower($source);
$extension = wpl_file::getExt($source);
$w_extension = wpl_file::getExt($watermark);
list($w_width, $w_height, $w_type, $w_attr) = getimagesize($filename);
list($markwidth, $markheight, $w_type1, $w_attr1) = getimagesize($watermark);
switch ($extension) {
case 'jpg':
case 'jpeg':
$w_dest = imagecreatefromjpeg($filename);
break;
case 'gif':
$w_dest = imagecreatefromgif($filename);
break;
case 'png':
$w_dest = imagecreatefrompng($filename);
break;
default:
return;
}
switch ($w_extension) {
case 'jpg':
case 'jpeg':
$w_src = imagecreatefromjpeg($watermark);
break;
case 'gif':
$w_src = imagecreatefromgif($watermark);
break;
case 'png':
$w_src = imagecreatefrompng($watermark);
break;
default:
return;
}
// Copy and merge
$opacity = $options['opacity'];
$position = strtolower($options['position']);
switch ($position) {
case 'center':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth >> 1, $w_height - $markheight >> 1, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'left':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth > 1, $w_height - $markheight >> 1, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'right':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth, $w_height - $markheight >> 1, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'top':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth >> 1, $w_height - $markheight > 1, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'bottom':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth >> 1, $w_height - $markheight, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'top-left':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth > 1, $w_height - $markheight > 1, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'top-right':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth, $w_height - $markheight > 1, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'bottom-left':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth > 1, $w_height - $markheight, 0, 0, $markwidth, $markheight, $opacity);
break;
case 'bottom-right':
wpl_images::imagecopymerge_alpha($w_dest, $w_src, $w_width - $markwidth, $w_height - $markheight, 0, 0, $markwidth, $markheight, $opacity);
break;
}
if ($extension == 'jpg' || $extension == 'jpeg') {
$quality = 95;
if (wpl_global::check_addon('optimizer') && wpl_global::get_client() === 0) {
$quality = wpl_addon_optimizer::optimize_image(wpl_addon_optimizer::IMAGE_JPEG, $w_dest);
}
ob_start();
imagejpeg($w_dest, NULL, $quality);
$out_image = ob_get_clean();
wpl_file::write($dest, $out_image);
//.........这里部分代码省略.........
示例14: __
$return['field_id'] = $field->id;
$return['type'] = $field->type;
$return['name'] = __($field->name, WPL_TEXTDOMAIN);
$rendered_price = wpl_render::render_price($value, $values[$field->table_column . '_unit']);
$return['value'] = $rendered_price;
$return['price_only'] = $rendered_price;
$price_period = array();
if (isset($values[$field->table_column . '_period'])) {
$price_period = wpl_property::render_field($values[$field->table_column . '_period'], wpl_flex::get_dbst_id($field->table_column . '_period', $field->kind));
}
if (isset($price_period['value'])) {
$return['value'] .= ' ' . $price_period['value'];
$return['price_period'] = $price_period['value'];
}
/** Add "From" to Vacation Rental Properties **/
if (wpl_global::check_addon('calendar')) {
$listing_types = wpl_global::get_listing_types_by_parent(3);
foreach ($listing_types as $listing) {
$vacational_listing_types[] = $listing['id'];
}
if (is_array($vacational_listing_types) and in_array($values['listing'], $vacational_listing_types)) {
$return['value'] = __('From', WPL_TEXTDOMAIN) . ' ' . $return['value'];
}
}
if (isset($options['if_zero']) and $options['if_zero'] == 2 and !trim($value)) {
$return['value'] = __($options['call_text'], WPL_TEXTDOMAIN);
}
if (isset($options['if_zero']) and !$options['if_zero'] and !trim($value)) {
$return = array();
}
$done_this = true;
示例15: is_object
<?php
} else {
?>
<?php
echo $wp_user->user_login;
?>
<?php
}
?>
</td>
<td><?php
echo is_object($wpl_data) ? $wpl_data->first_name . ' ' . $wpl_data->last_name : '';
?>
</td>
<?php
if (wpl_global::check_addon('membership')) {
?>
<td>
<?php
if ($wp_user->id) {
?>
<select data-without-chosen name="membership_id_<?php
echo $wp_user->ID;
?>
" id="membership_id_<?php
echo $wp_user->ID;
?>
" onChange="wpl_change_membership(<?php
echo $wp_user->ID;
?>
);" autocomplete="off">