示例#1
0
     echo '<div class="bsaProHeader" style="background-color:' . bsa_space($sid, 'header_bg') . '">';
     // -- START -- HEADER
     echo '<h3 class="bsaProHeader__title" style="color:' . bsa_space($sid, 'header_color') . '"><span>' . bsa_space($sid, 'title') . '</span></h3>';
     // -- HEADER -- TITLE
     echo '<a class="bsaProHeader__formUrl" href="' . $form_url . '" target="_blank" style="color:' . bsa_space($sid, 'link_color') . '"><span>' . bsa_space($sid, 'add_new') . '</span></a>';
     // -- HEADER -- LINK TO ORDERING FORM
     echo '</div>';
     // -- END -- HEADER
 }
 echo '<div class="bsaProItems ' . bsa_space($sid, "grid_system") . ' ' . (bsa_space($sid, "display_type") == 'carousel' ? 'bsa-owl-carousel bsa-owl-carousel-' . $sid : '') . '" style="background-color:' . bsa_space($sid, 'ads_bg') . '">';
 // -- START -- ITEMS
 foreach ($ads as $key => $ad) {
     if ($ad['id'] != 0 && bsa_ad($ad['id']) != NULL) {
         // -- COUNTING FUNCTION (DO NOT REMOVE!)
         $model = new BSA_PRO_Model();
         $model->bsaProCounter($ad['id']);
     }
     echo '<div class="bsaProItem ' . ($key % $col_per_row == 0 ? "bsaReset" : "") . '" data-animation="' . bsa_space($sid, "animation") . '" style="' . ((bsa_space($sid, "animation") == "none" or bsa_space($sid, "animation") == NULL) ? "opacity:1" : "") . '">';
     // -- START -- ITEM
     $url = parse_url($ad['url']);
     // -- START -- LINK
     $agency_form = get_option('bsa_pro_plugin_agency_ordering_form_url');
     if ($ad['url'] != '') {
         if (isset($example)) {
             // url to form if example in ad space
             echo '<a class="bsaProItem__url" href="' . $form_url . '" target="_blank">';
         } else {
             if (isset($type) && $type == 'agency') {
                 echo '<a class="bsaProItem__url" href="' . $agency_form . (strpos($agency_form, '?') ? '&' : '?') . 'bsa_pro_id=' . $ad['id'] . '&bsa_pro_url=1" target="_blank">';
             } else {
                 echo '<a class="bsaProItem__url" href="' . get_site_url() . (strpos(get_site_url(), '?') ? '&' : '?') . 'bsa_pro_id=' . $ad['id'] . '&bsa_pro_url=1" target="_blank">';
示例#2
0
function bsa_pro_wp_redirect()
{
    if (isset($_GET['bsa_pro_url']) && isset($_GET['bsa_pro_id'])) {
        $model = new BSA_PRO_Model();
        wp_redirect($model->bsaProCounter());
        exit;
    }
}