Пример #1
0
    $args['tax_query'][] = array('taxonomy' => ET_AdLocation::AD_LOCATION, 'field' => 'id', 'terms' => array(intval($ad_local)));
}
$ads = new WP_Query($args);
$count = count($ads->posts);
echo '<div class="wrap-roll">';
echo '<h2 class="title title-roll widget-title">' . $title . '</h2>';
if ($ads->have_posts()) {
    echo '<div class="flexslider">';
    echo '<ul id="ce_roll" class="list-adroll slides">';
    $i = 1;
    while ($ads->have_posts()) {
        $ads->the_post();
        global $post;
        $location = get_post_meta(get_the_ID(), 'et_full_location', true);
        $user = get_userdata((int) $post->post_author);
        $ad = CE_Ads::convert($post);
        $full_location = get_post_meta(get_the_ID(), $et_global['db_prefix'] . 'full_location', true);
        if ($i % $number == 1) {
            echo '<li class="item-slide">';
        }
        ?>
			<div class="item-roll">
				<div class="left-item-roll">				
					<a target="_blank" title = "<?php 
        the_title();
        ?>
" href="<?php 
        the_permalink();
        ?>
">
						<?php 
Пример #2
0
 function ebay_load_ads()
 {
     $paged = isset($_POST['paged']) ? $_POST['paged'] : 1;
     $args = array('post_type' => CE_AD_POSTTYPE, 'meta_key' => 'ce_ebay_item_id', 'paged' => $paged, 'meta_query' => array(array('key' => 'ce_ebay_item_id', 'value' => 1, 'compare' => '>=')));
     $ads = CE_Ads::query($args);
     $items = array();
     $paginator_html = ce_ebay_pagination($ads, $paged);
     $current = array('EUR' => '&euro;', 'USD' => '$', 'CAD' => 'CA $', 'GBP' => '&pound;', 'SGD' => 'S$', 'PHP' => '&#8369;', 'AUD' => 'AU $', 'PLN' => 'zł', 'CHF' => 'CHF', 'INR' => 'INR');
     if ($ads->have_posts()) {
         $price_key = CE_ET_PRICE;
         while ($ads->have_posts()) {
             $ads->the_post();
             global $post;
             $ad = CE_Ads::convert($post);
             if (isset($ad->location[0])) {
                 $ad->et_location = $ad->location[0]->name;
             }
             $currentcy = get_post_meta($ad->ID, 'et_currency', true);
             $nt = isset($current[$currentcy]) ? $current[$currentcy] : $currentcy;
             $ad->price = $nt . $ad->{$price_key};
             $items[] = $ad;
         }
         $resp = array('success' => true, 'msg' => __('List ads imported from ebay.com', ET_DOMAIN), 'data' => $items, 'paging' => $paginator_html);
     } else {
         $resp = array('success' => false, 'msg' => __('Your list is empty.'));
     }
     wp_send_json($resp);
 }
Пример #3
0
    function get_alert_message($cats, $locals, $number_ads)
    {
        $option = new CE_Options();
        $website_logo = $option->get_website_logo();
        $customize = $option->get_customization();
        $logo = apply_filters('ce_alert_set_logo_url', $website_logo[0]);
        $header = '<html class="no-js" lang="en">
			<body style="margin: 0px; font-family: ' . $customize['font-text'] . ', sans-serif; font-size: 13px; line-height: 1.3;">
				<div style="margin: 0px auto; width:600px; border: 1px solid ' . $customize['background'] . '">

					<table width="100%" cellspacing="0" cellpadding="0">
						<tr style="background-color: ' . $customize['header'] . '; display:block; padding:10px 0px; vertical-align: middle; box-shadow: 0 2px 0 2px #E3E3E3;">
							<td style="padding: 0 10px 0 20px; width: 0px;">
								<a href="' . home_url() . '" target="_blank">
									<img title="" alt="' . get_option('blogname') . '" src="' . $logo . '" />
								</a>
							</td>
							<td style="padding-bottom: 3px;">
								<span style="text-shadow: 0 0 1px #151515; color: #b0b0b0;">' . get_option('blogdescription') . '</span>
							</td>
							<td style="padding-right: 20px; width : 25%">
								<!-- see more button -->
								<a href="' . home_url() . '" target="_blank" style="display: block; position: relative; box-shadow: 0 1px 2px #222; -moz-box-shadow: 0 1px 2px #222; -webkit-box-shadow: 0 1px 2px #222; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; text-decoration: none; padding: 0 10px; height: 40px; line-height: 40px; background-repeat: repeat-x; background: ' . $customize['action'] . ';">
									<span style="color: #fff; font-size: 12px; font-weight: bold; text-shadow: 1px -1px 1px #9e4230;">
										' . __("VIEW MORE ADS", ET_DOMAIN) . '
									</span>
								</a>
							</td>
						</tr>
						<tr style="height: 3px; background-color: ' . $customize['background'] . '"><td colspan="3"></td></tr>
						<tr>
							<td colspan="3" style="padding: 10px 20px">
								<table>
									<tr>
										<td colspan="2" style="line-height : 26px ;font-size : 18px; color: #5c5c5c; padding-bottom: 10px; font-weight: normal; font-family :' . $customize['font-heading'] . ';">
											' . sprintf(__('Re-discover your potentials. Re-vision your future. Meet Success. Let %s take you there!', ET_DOMAIN), get_option('blogname')) . '
										</td>
									</tr>';
        $ad_content = '';
        $ad_arg = array('post_type' => 'ad', 'post_status' => 'publish', 'posts_per_page' => $number_ads);
        if ($cats) {
            $ad_arg['tax_query'][] = array('taxonomy' => 'ad_category', 'field' => 'id', 'terms' => $cats, 'operator' => 'IN');
        }
        if ($locals) {
            $ad_arg['tax_query'][] = array('taxonomy' => 'ad_location', 'field' => 'id', 'terms' => $locals, 'operator' => 'IN');
        }
        if ($cats && $locals) {
            $ad_arg['tax_query']['relation'] = 'AND';
        }
        $ads = new WP_Query($ad_arg);
        while ($ads->have_posts()) {
            $ads->the_post();
            global $post;
            $url = TEMPLATEURL . '/img/no_image.gif';
            if ($website_logo) {
                $url = $website_logo[0];
            }
            $url = apply_filters('ce_alert_no_thumbnail_url', $url);
            if (has_post_thumbnail()) {
                $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'ad-thumbnail-grid');
                $url = $thumb['0'];
            }
            $ad = CE_Ads::convert($post);
            $ad_content .= '<tr>
							<td style="padding: 8px 10px 15px 0;">
								<a style="display: block; padding: 5px; text-decoration:none; height: 70px; border-radius: 3px; text-decoration: none; -moz-border-radius: 3px; -webkit-border-radius: 3px; -moz-box-shadow: 0 3px 3px #E9E9E9; -webkit-box-shadow: 0 3px 3px #E9E9E9; box-shadow: 0 3px 3px #E9E9E9; border-bottom:2px solid #E9E9E9;">
								<img width="auto" style= "max-width:153px; max-height:111px" height="auto" title="" alt="" src="' . $url . '" /></a>
							</td>
							<td valign="top" style="padding: 10px 0;">
								<a href="' . get_permalink() . '" style="font-size :13px; color: #3399CC; font-family :' . $customize['font-heading'] . '; text-decoration: none; display: block; font-weight: 700; margin-bottom: 10px; text-transform: uppercase;">' . get_the_title() . '</a>
								<div style="color: #909090;font-family :' . $customize['font-text'] . '; font-size :12px;">
									<span style="color=' . $customize['action_2'] . '" >' . $ad->price . '</span> <br />
									' . get_the_excerpt() . '
								</div>
							</td>
						</tr>';
        }
        // end while
        wp_reset_query();
        $info = apply_filters('ce_mail_footer_contact_info', get_option('blogname') . ' <br>' . get_option('admin_email') . ' <br>');
        $footer = '</table>
							</td>
								</tr>
								<tr style="padding: 10px 20px; color: #909090; height: 89px; background-repeat: repeat-x; background-color:#f7f7f7; border-top:1px solid #eaeaea">
									<td colspan="3">
										<table width="100%" cellspacing="0" cellpadding="0" bo>
											<tr>
												<td style="text-align: left; padding: 10px 20px; width:123px;">
													<a href="' . home_url() . '" target="_blank" style="display: block; position: relative; box-shadow: 0 1px 2px #999; -moz-box-shadow: 0 1px 2px #999; -webkit-box-shadow: 0 1px 2px #999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; text-decoration: none; padding: 0 10px; height: 40px; line-height: 40px; background-repeat: repeat-x; background: ' . $customize['action'] . ';">
														<span style="color: #fff; font-size: 12px; font-weight: bold; text-shadow: 1px -1px 1px #9e4230;">
															' . __("VIEW MORE ADS", ET_DOMAIN) . '
														</span>
													</a>
												</td>
												<td style="text-align: left; padding: 10px 20px;">
													<table>
														<tr>
															<td>' . $option->get_copyright() . '</td>
														</tr>
														<tr>
															<td style="text-align:center;"><a class="link-unsubscriber" style="text-decoration:none" href="[unsubscribe_link]">' . __('Unsubscribe from this newsletter.', ET_DOMAIN) . '</a> 
															</td>
														</tr>
													</table>
												</td>
												<td style="text-align: right; padding: 10px 20px;">
													' . $info . '
												</td>
											</tr>
										</table>
									</td>

								</tr>
							</table>

						</div>

					</body>
					</html>';
        if ($ad_content != '') {
            $header_email = apply_filters("ce_alert_header_email", $header);
            $footer_email = apply_filters("ce_alert_footer_email", $footer);
            return $header_email . $ad_content . $footer_email;
        } else {
            return '';
        }
    }