本文整理汇总了PHP中get_awpcp_option函数的典型用法代码示例。如果您正苦于以下问题:PHP get_awpcp_option函数的具体用法?PHP get_awpcp_option怎么用?PHP get_awpcp_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_awpcp_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: generate_html
protected function generate_html($template_type = '')
{
$post_ids = array();
foreach ($this->search_results['items'] as $item_id => $item_html) {
$post_ids[] = $item_id;
}
$conditions = array();
$conditions[] = "ad_id IN ( " . implode(',', $post_ids) . " ) ";
$args = array();
$ads = AWPCP_Ad::get_enabled_ads($args, $conditions);
$parity = array('displayaditemseven', 'displayaditemsodd');
if ('ajax' == $template_type) {
$layout = buddyboss_global_search_buffer_template_part('loop/' . $this->type, $template_type, false);
} else {
$layout = get_awpcp_option('displayadlayoutcode');
if (empty($layout)) {
$layout = awpcp()->settings->get_option_default_value('displayadlayoutcode');
}
}
if (!empty($ads)) {
foreach ($ads as $i => $listing) {
$rendered_listing = awpcp_do_placeholders($listing, $layout, $context);
$rendered_listing = str_replace("\$awpcpdisplayaditems", $parity[$i % 2], $rendered_listing);
if (function_exists('awpcp_featured_ads')) {
$rendered_listing = awpcp_featured_ad_class($listing->ad_id, $rendered_listing);
}
$rendered_listing = apply_filters('awpcp-render-listing-item', $rendered_listing, $i + 1, $template_type);
$result = array('id' => $listing->ad_id, 'type' => $this->type, 'title' => $listing->ad_title, 'html' => $rendered_listing);
$this->search_results['items'][$listing->ad_id] = $result;
}
}
}
开发者ID:tvolmari,项目名称:hammydowns,代码行数:32,代码来源:class.BBoss_Global_Search_AWPCP.php
示例2: restore_missing_pages
public function restore_missing_pages()
{
$shortcodes = awpcp_pages();
$missing_pages = $this->missing_pages_finder->find_missing_pages();
$pages_to_restore = array_merge($missing_pages['not-found'], $missing_pages['not-referenced']);
$page_refs = awpcp_get_properties($pages_to_restore, 'page');
// If we are restoring the main page, let's do it first!
if (($p = array_search('main-page-name', $page_refs)) !== FALSE) {
// put the main page as the first page to restore
array_splice($pages_to_restore, 0, 0, array($pages_to_restore[$p]));
array_splice($pages_to_restore, $p + 1, 1);
}
$restored_pages = array();
foreach ($pages_to_restore as $page) {
$refname = $page->page;
$name = get_awpcp_option($refname);
if (strcmp($refname, 'main-page-name') == 0) {
awpcp_create_pages($name, $subpages = false);
} else {
awpcp_create_subpage($refname, $name, $shortcodes[$refname][1]);
}
$restored_pages[] = $page;
}
update_option('awpcp-flush-rewrite-rules', true);
return $restored_pages;
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:26,代码来源:class-pages-creator.php
示例3: menu
/**
* Register Ad Management Panel menu
*/
public function menu()
{
/* Profile Menu */
// We are using read as an alias for edit_classifieds_listings. If a user can `read`,
// he or she can `edit_classifieds_listings`.
$capability = 'read';
// Account Balance
if (awpcp_payments_api()->credit_system_enabled() && !awpcp_current_user_is_admin()) {
$parts = array($this->account->title, $this->account->menu, $this->account->page);
$hook = add_users_page($parts[0], $parts[1], $capability, $parts[2], array($this->account, 'dispatch'));
add_action("admin_print_styles-{$hook}", array($this->account, 'scripts'));
}
$current_user_is_non_admin_moderator = awpcp_current_user_is_moderator() && !awpcp_current_user_is_admin();
if (get_awpcp_option('enable-user-panel') != 1 || $current_user_is_non_admin_moderator) {
return;
}
/* Ad Management Menu */
$slug = 'awpcp-panel';
$title = sprintf(__('%s Ad Management Panel', 'AWPCP'), get_bloginfo());
$menu = __('Ad Management', 'AWPCP');
$hook = add_menu_page($title, $menu, $capability, $slug, array($this->listings, 'dispatch'), MENUICO);
// Listings
$title = __('Manage Ad Listings', 'AWPCP');
$menu = __('Listings', 'AWPCP');
$hook = add_submenu_page($slug, $title, $menu, $capability, $slug, array($this->listings, 'dispatch'));
add_action("admin_print_styles-{$hook}", array($this->listings, 'scripts'));
do_action('awpcp_panel_add_submenu_page', $slug, $capability);
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:31,代码来源:user-panel.php
示例4: notices
public function notices()
{
if (!awpcp_current_user_is_admin()) {
return;
}
if (awpcp_request_param('page', false) == 'awpcp-admin-upgrade') {
return;
}
if (get_option('awpcp-pending-manual-upgrade')) {
ob_start();
include AWPCP_DIR . '/admin/templates/admin-pending-manual-upgrade-notice.tpl.php';
$html = ob_get_contents();
ob_end_clean();
echo $html;
return;
}
$show_quick_start_quide_notice = get_awpcp_option('show-quick-start-guide-notice');
$show_drip_autoresponder = get_awpcp_option('show-drip-autoresponder');
if ($show_quick_start_quide_notice && is_awpcp_admin_page() && !$show_drip_autoresponder) {
ob_start();
include AWPCP_DIR . '/admin/templates/admin-quick-start-guide-notice.tpl.php';
$html = ob_get_contents();
ob_end_clean();
echo $html;
}
if (get_awpcp_option('show-widget-modification-notice')) {
ob_start();
include AWPCP_DIR . '/admin/templates/admin-widget-modification-notice.tpl.php';
$html = ob_get_contents();
ob_end_clean();
echo $html;
}
do_action('awpcp-admin-notices');
}
开发者ID:Owchzzz,项目名称:Devbox,代码行数:34,代码来源:admin-panel.php
示例5: render
public function render($params)
{
extract($params = wp_parse_args($params, array('context' => 'default', 'name' => 'category', 'label' => __('Ad Category', 'AWPCP'), 'required' => true, 'selected' => null, 'placeholders' => array())));
if ($context == 'search') {
$placeholders = array_merge(array('default-option-first-level' => __('All Categories', 'AWPCP'), 'default-option-second-level' => __('All Sub-categories', 'AWPCP')), $placeholders);
} else {
if (get_awpcp_option('noadsinparentcat')) {
$second_level_option_placeholder = __('Select a Sub-category', 'AWPCP');
} else {
$second_level_option_placeholder = __('Select a Sub-category (optional)', 'AWPCP');
}
$placeholders = array_merge(array('default-option-first-level' => __('Select a Category', 'AWPCP'), 'default-option-second-level' => $second_level_option_placeholder), $placeholders);
}
$categories = awpcp_categories_collection()->get_all();
$categories_hierarchy = awpcp_build_categories_hierarchy($categories);
$chain = $this->get_category_parents($selected, $categories);
$use_multiple_dropdowns = get_awpcp_option('use-multiple-category-dropdowns');
// export categories list to JavaScript, but don't replace an existing categories list
awpcp()->js->set('categories', $categories_hierarchy, false);
ob_start();
include AWPCP_DIR . '/frontend/templates/html-widget-category-dropdown.tpl.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:25,代码来源:categories-dropdown.php
示例6: get_panel_url
protected function get_panel_url()
{
if (awpcp_current_user_is_moderator() || !get_awpcp_option('enable-user-panel')) {
return awpcp_get_admin_listings_url();
}
return awpcp_get_user_panel_url();
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:7,代码来源:page-renew-ad.php
示例7: maybe_enable_listing
private function maybe_enable_listing($listing, $transaction, $trigger_actions)
{
if ($listing->disabled && $this->should_enable_listing($listing, $transaction)) {
$should_approve_listing_images = get_awpcp_option('imagesapprove') ? false : true;
$listing->enable($should_approve_listing_images, $trigger_actions);
}
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:7,代码来源:class-listing-payment-transaction-handler.php
示例8: get_payment_terms
public function get_payment_terms()
{
global $wpdb;
if (!awpcp_payments_api()->payments_enabled()) {
return array($this->get_free_payment_term());
}
$order = get_awpcp_option('fee-order');
$direction = get_awpcp_option('fee-order-direction');
switch ($order) {
case 1:
$orderby = array('adterm_name', $direction);
break;
case 2:
$orderby = array("amount {$direction}, adterm_name", $direction);
break;
case 3:
$orderby = array("imagesallowed {$direction}, adterm_name", $direction);
break;
case 5:
$orderby = array("_duration_interval {$direction}, rec_period {$direction}, adterm_name", $direction);
break;
}
if (awpcp_current_user_is_admin()) {
$args = array('orderby' => $orderby[0], 'order' => $orderby[1]);
} else {
$args = array('where' => 'private = 0', 'orderby' => $orderby[0], 'order' => $orderby[1]);
}
return AWPCP_Fee::query($args);
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:29,代码来源:payment-term-fee-type.php
示例9: awpcp_users_field
function awpcp_users_field()
{
if (get_awpcp_option('user-field-widget') == 'dropdown') {
return awpcp_users_dropdown();
} else {
return awpcp_users_autocomplete();
}
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:8,代码来源:class-user-field.php
示例10: validate_group_settings
public function validate_group_settings($options, $group)
{
if (isset($options['enable-email-verification']) && $options['enable-email-verification'] && get_awpcp_option('requireuserregistration')) {
$message = __("Email verification was not enabled because Require Registration is on. Registered users don't need to verify the email address used for contact information.", 'AWPCP');
awpcp_flash($message, 'error');
$options['enable-email-verification'] = 0;
}
return $options;
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:9,代码来源:class-listings-moderation-settings.php
示例11: normalize_query
private function normalize_query($user_query)
{
$query = wp_parse_args($user_query, array('context' => 'default', 'fields' => '*', 'raw' => false, 'id' => null, 'title' => null, 'keyword' => null, 'category_id' => null, 'exclude_category_id' => null, 'include_listings_in_children_categories' => true, 'user' => null, 'user_id' => null, 'contact_name' => null, 'price' => null, 'min_price' => null, 'max_price' => null, 'region' => '', 'country' => '', 'state' => '', 'city' => '', 'county' => '', 'regions' => array(), 'payment_status' => null, 'payer_email' => null, 'disabled_date' => null, 'end_date' => null, 'disabled' => null, 'verified' => null, 'featured' => null, 'flagged' => null, 'awaiting_approval' => null, 'have_media_awaiting_approval' => null, 'reviewed' => null, 'limit' => 0, 'offset' => 0, 'orderby' => 'default', 'order' => 'DESC'));
if (!is_array($query['context'])) {
$query['context'] = array($query['context']);
}
$query['regions'] = $this->normalize_regions_query($query);
$query['limit'] = $query['limit'] === 0 ? get_awpcp_option('adresultsperpage', 10) : $query['limit'];
return $query;
}
开发者ID:Owchzzz,项目名称:Devbox,代码行数:10,代码来源:class-listings-finder.php
示例12: __construct
public function __construct($regions, $options)
{
// we need at least one region, even if its empty
if (empty($regions)) {
$this->regions = array(array('country' => '', 'county' => '', 'state' => '', 'city' => ''));
} else {
$this->regions = $regions;
}
$this->options = wp_parse_args($options, array('maxRegions' => 1, 'showTextField' => false, 'showExistingRegionsOnly' => get_awpcp_option('buildsearchdropdownlists'), 'hierarchy' => array('country', 'county', 'state', 'city'), 'enabled_fields' => awpcp_get_enabled_region_fields()));
$this->options['maxRegions'] = max($this->options['maxRegions'], count($regions));
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:11,代码来源:multiple-region-selector.php
示例13: awpcp_display_listings
/**
* @since 3.4
*/
function awpcp_display_listings($query, $context, $options)
{
$options = wp_parse_args($options, array('show_intro_message' => false, 'show_menu_items' => false, 'show_category_selector' => false, 'show_pagination' => false, 'before_content' => '', 'before_pagination' => '', 'before_list' => '', 'after_pagination' => '', 'after_content' => ''));
if (has_action('awpcp_browse_ads_template_action') || has_filter('awpcp_browse_ads_template_filter')) {
do_action('awpcp_browse_ads_template_action');
return apply_filters('awpcp_browse_ads_template_filter');
}
$results_per_page = absint(awpcp_request_param('results', get_awpcp_option('adresultsperpage', 10)));
$results_offset = absint(awpcp_request_param('offset', 0));
if (empty($query['limit']) && $results_per_page) {
$query['limit'] = $results_per_page;
}
if (empty($query['offset']) && $query['limit']) {
$query['offset'] = $results_offset;
}
$listings_collection = awpcp_listings_collection();
$listings = $listings_collection->find_enabled_listings_with_query($query);
$listings_count = $listings_collection->count_enabled_listings_with_query($query);
$before_content = apply_filters('awpcp-content-before-listings-page', $options['before_content'], $context);
$before_pagination = array();
if ($options['show_category_selector']) {
$before_pagination[15]['category-selector'] = awpcp_render_category_selector(array('required' => false));
}
if (is_array($options['before_pagination'])) {
$before_pagination = awpcp_array_merge_recursive($before_pagination, $options['before_pagination']);
} else {
$before_pagination[20]['user-content'] = $options['before_pagination'];
}
$before_pagination = apply_filters('awpcp-listings-before-content', $before_pagination, $context);
ksort($before_pagination);
$before_pagination = awpcp_flatten_array($before_pagination);
$before_list = apply_filters('awpcp-display-ads-before-list', $options['before_list'], $context);
if ($listings_count > 0) {
$pagination_options = array('results' => $results_per_page, 'offset' => $results_offset, 'total' => $listings_count);
$pagination = $options['show_pagination'] ? awpcp_pagination($pagination_options, awpcp_current_url()) : '';
$items = awpcp_render_listings_items($listings, $context);
} else {
$pagination = '';
$items = array();
}
$after_pagination = array('user-content' => $options['after_pagination']);
$after_pagination = apply_filters('awpcp-listings-after-content', $after_pagination, $context);
$after_content = apply_filters('awpcp-content-after-listings-page', $options['after_content'], $context);
ob_start();
include AWPCP_DIR . '/templates/frontend/listings.tpl.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
开发者ID:Owchzzz,项目名称:Devbox,代码行数:52,代码来源:listings.php
示例14: create
public function create($args)
{
extract(wp_parse_args($args, array('enabled' => true, 'status' => null, 'is_primary' => false)));
$image_mime_types = awpcp_get_image_mime_types();
if (is_null($status)) {
if (!awpcp_current_user_is_moderator() && in_array($mime_type, $image_mime_types) && get_awpcp_option('imagesapprove')) {
$status = AWPCP_Media::STATUS_AWAITING_APPROVAL;
} else {
$status = AWPCP_Media::STATUS_APPROVED;
}
}
$data = compact('ad_id', 'name', 'path', 'mime_type', 'enabled', 'status', 'is_primary');
if ($insert_id = $this->save($data)) {
return $this->find_by_id($insert_id);
} else {
return null;
}
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:18,代码来源:class-media-api.php
示例15: render
public function render($value, $errors, $listing, $context)
{
$characters_limit = $this->get_characters_limit_for_listing($listing);
if ($characters_limit['characters_allowed'] == 0) {
$characters_allowed_text = _x('No characters limit.', 'ad details form', 'AWPCP');
$remaining_characters_text = '';
} else {
$characters_allowed_text = _x('characters left.', 'ad details form', 'AWPCP');
$remaining_characters_text = $characters_limit['remaining_characters'];
}
if ($this->is_required()) {
$validators = 'required';
} else {
$validators = '';
}
$params = array('required' => $this->is_required(), 'value' => $this->format_value($value), 'errors' => $errors, 'label' => $this->get_label(), 'help_text' => nl2br(get_awpcp_option('htmlstatustext')), 'validators' => $validators, 'characters_allowed' => $characters_limit['characters_allowed'], 'characters_allowed_text' => $characters_allowed_text, 'remaining_characters' => $characters_limit['remaining_characters'], 'remaining_characters_text' => $remaining_characters_text, 'html' => array('id' => str_replace('_', '-', $this->get_slug()), 'name' => $this->get_slug(), 'readonly' => false));
return awpcp_render_template('frontend/form-fields/listing-details-form-field.tpl.php', $params);
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:18,代码来源:class-listing-details-form-field.php
示例16: render_shortcode_content
private function render_shortcode_content($attrs)
{
extract($attrs);
$category = $id > 0 ? AWPCP_Category::find_by_id($id) : null;
$children = awpcp_parse_bool($children);
if (is_null($category)) {
return __('Category ID must be valid for Ads to display.', 'category shortcode', 'AWPCP');
}
if ($children) {
$categories_list = awpcp_categories_list_renderer()->render(array('parent_category_id' => $category->id, 'show_listings_count' => true));
$options = array('before_pagination' => array(10 => array('categories-list' => $categories_list)));
} else {
$options = array();
}
$query = array('context' => 'public-listings', 'category_id' => $category->id, 'include_listings_in_children_categories' => $children, 'limit' => absint($this->request->param('results', $items_per_page)), 'offset' => absint($this->request->param('offset', 0)), 'orderby' => get_awpcp_option('groupbrowseadsby'));
// required so awpcp_display_ads shows the name of the current category
$_REQUEST['category_id'] = $category->id;
return awpcp_display_listings_in_page($query, 'category-shortcode', $options);
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:19,代码来源:class-category-shortcode.php
示例17: stripslashes_deep
<div id="classiwrapper">
<?php
if ($config['show_intro']) {
?>
<div class="uiwelcome"><?php
echo stripslashes_deep(get_awpcp_option('uiwelcome'));
?>
</div>
<?php
}
?>
<?php
if ($config['show_menu']) {
?>
<?php
echo awpcp_menu_items();
?>
<?php
}
?>
<?php
echo join('', $before_content);
?>
<?php
echo $pagination_block;
?>
<div class="awpcp-listings awpcp-clearboth"><?php
echo join('', $items);
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:31,代码来源:listings.tpl.php
示例18: awpcp_send_listing_was_flagged_notification
/**
* @since 3.4
*/
function awpcp_send_listing_was_flagged_notification($listing)
{
if (!get_awpcp_option('send-listing-flagged-notification-to-administrators')) {
return false;
}
$query_args = array('page' => 'awpcp-listings', 'filterby' => 'flagged', 'filter' => 1);
$flagged_listings_url = add_query_arg($query_args, awpcp_get_admin_panel_url());
$params = array('site_name' => get_bloginfo('name'), 'flagged_listings_url' => $flagged_listings_url);
$template = AWPCP_DIR . '/templates/email/listing-was-flagged.plain.tpl.php';
$mail = new AWPCP_Email();
$mail->to = awpcp_admin_email_to();
$mail->subject = str_replace('<listing-title>', $listing->get_title(), __('Listing <listing-title> was flagged', 'AWPCP'));
$mail->prepare($template, $params);
return $mail->send();
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:18,代码来源:notifications.php
示例19: upload_images_form
public function upload_images_form($ad, $params = array())
{
$show_preview = (bool) get_awpcp_option('show-ad-preview-before-payment');
$pay_first = (bool) get_awpcp_option('pay-before-place-ad');
extract($params);
if ($images_uploaded > 0 && $pay_first) {
$next = __('Finish', 'AWPCP');
} else {
if ($images_uploaded == 0 && false == $pay_first && $show_preview) {
$next = __('Preview Ad', 'AWPCP');
} else {
if ($images_uploaded == 0) {
$next = __('Place Ad', 'AWPCP');
} else {
if ($show_preview) {
$next = __('Preview Ad', 'AWPCP');
} else {
$next = __('Checkout', 'AWPCP');
}
}
}
}
$params = array_merge($params, array('listing' => $ad, 'files' => awpcp_media_api()->find_by_ad_id($ad->ad_id), 'messages' => $this->messages, 'next' => $next));
$template = AWPCP_DIR . '/frontend/templates/page-place-ad-upload-images-step.tpl.php';
return $this->render($template, $params);
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:26,代码来源:page-place-ad.php
示例20: awpcp_create_captcha
function awpcp_create_captcha($type = 'default')
{
switch ($type) {
case 'recaptcha':
$site_key = get_awpcp_option('recaptcha-public-key');
$secret_key = get_awpcp_option('recaptcha-private-key');
return new AWPCP_reCAPTCHA($site_key, $secret_key, awpcp_request());
case 'default':
default:
$max = get_awpcp_option('math-captcha-max-number');
return new AWPCP_DefaultCAPTCHA($max);
}
}
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:13,代码来源:captcha.php
注:本文中的get_awpcp_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论