コード例 #1
0
ファイル: style_2.php プロジェクト: kyscastellanos/arepa
<?php

include 'style.inc.php';
?>

<blockquote id="<?php 
echo $id;
?>
" class="testimonial testimonial-image-style-2">
    <?php 
if ($image != '') {
    ?>
        <?php 
    $img_size = op_get_image_html_attribute($image);
    ?>
        <img src="<?php 
    echo $image;
    ?>
" alt="<?php 
    $name;
    ?>
" <?php 
    echo $img_size;
    ?>
 />
    <?php 
}
?>
    <img width="27" height="18" class="quote-tip" alt="" src="<?php 
echo OP_ASSETS_URL;
?>
コード例 #2
0
ファイル: style_1.php プロジェクト: kyscastellanos/arepa
        <?php 
$img_size = op_get_image_html_attribute(OP_ASSETS_URL . 'images/order_box/titles_1/' . $title);
?>
        <h2><img src="<?php 
echo OP_ASSETS_URL . 'images/order_box/titles_1/' . $title;
?>
" alt="<?php 
echo $title_1_alt;
?>
" <?php 
echo $img_size;
?>
 /></h2>

        <?php 
$img_size = op_get_image_html_attribute(OP_ASSETS_URL . 'images/order_box/headers_1/' . $header);
?>
        <img alt="<?php 
echo $header_1_alt;
?>
" src="<?php 
echo OP_ASSETS_URL . 'images/order_box/headers_1/' . $header;
?>
" <?php 
echo $img_size;
?>
 />
    </div>
    <div class="order-box-content">
        <?php 
echo $content;
コード例 #3
0
ファイル: live_editor.php プロジェクト: kyscastellanos/arepa
 /**
  *
  * Shortcode parsing method for Membership page listings
  * @param array $atts
  * @return string|void
  */
 static function membership_page_listings($atts)
 {
     // Decode encoded chars
     $atts = op_urldecode($atts);
     extract(shortcode_atts(array('style' => '', 'columns' => 1, 'product' => 0, 'category' => 0, 'subcategory' => 0, 'comments' => 0, 'drip_content' => 0, 'resize_thumb_height' => 0, 'show_children' => '', 'order' => '', 'hide_description' => 'N'), $atts));
     $product = intval($product);
     $category = intval($category);
     $subcategory = intval($subcategory);
     $parentId = 0;
     $page_id = defined('OP_PAGEBUILDER_ID') ? OP_PAGEBUILDER_ID : $post->ID;
     $title_font = op_asset_font_style($atts);
     if (!empty($title_font)) {
         $title_style = "style='" . $title_font . "'";
     } else {
         $title_style = '';
     }
     $content_font = op_asset_font_style($atts, 'content_font_');
     if (!empty($content_font)) {
         $content_style = "style='" . $content_font . "'";
     } else {
         $content_style = '';
     }
     // which children should we take?
     if (!empty($show_children)) {
         $parentId = $page_id;
     } else {
         if (!empty($product) && empty($category) && empty($subcategory)) {
             $parentId = $product;
         } else {
             if (!empty($product) && !empty($category) && empty($subcategory)) {
                 $parentId = $category;
             } else {
                 if (!empty($product) && !empty($category) && !empty($subcategory)) {
                     $parentId = $subcategory;
                 }
             }
         }
     }
     if (!empty($order)) {
         $temp = explode('|', $order);
         $order_column = $temp[0];
         $order_direction = $temp[1];
     } else {
         $order_column = 'post_title';
         $order_direction = 'asc';
     }
     $args = array('posts_per_page' => -1, 'sort_column' => $order_column, 'sort_order' => $order_direction, 'parent' => $parentId, 'hierarchical' => 0, 'post_status' => 'publish');
     $pages = get_pages($args);
     if ($order_column == 'post_title') {
         if ($order_direction == 'asc') {
             usort($pages, array("OptimizePress_LiveEditor_Assets", "sortNaturalAsc"));
         } else {
             usort($pages, array("OptimizePress_LiveEditor_Assets", "sortNaturalDesc"));
         }
     }
     if (!empty($resize_thumb_height)) {
         $img_class = ' thumb_resize ';
     } else {
         $img_class = '';
     }
     if (empty($pages) || $parentId == 0) {
         if (is_admin()) {
             return __('No child membership pages found! Note: Pages will only show in this once they are Published in Wordpress. Draft pages will not show', 'optimizepress');
         }
     }
     $html = '';
     switch ($columns) {
         case 1:
             $class = 'page-listing one-col';
             break;
         case 2:
             $class = 'page-listing two-col';
             break;
         case 3:
             $class = 'page-listing three-col';
             break;
         case 4:
             $class = 'page-listing four-col';
             break;
     }
     foreach ($pages as $page) {
         /*if (defined("WS_PLUGIN__OPTIMIZEMEMBER_VERSION")) {
               if (!is_permitted_by_optimizemember($page->ID, "page")) {
                   continue;
               }
           }*/
         // drip content
         $dripContentHtml = '';
         if (defined("WS_PLUGIN__OPTIMIZEMEMBER_VERSION")) {
             global $current_user;
             $hideContent = false;
             if (isset($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['filter_wp_query']) && 'all' === $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['filter_wp_query'][0]) {
                 $hideContent = true;
             }
             if (!is_permitted_by_optimizemember($page->ID, "page") && true === $hideContent) {
                 continue;
             }
             $unavailableContent = c_ws_plugin__optimizemember_utils_gets::get_unavailable_singular_ids_with_dripped_content($current_user);
             // getting content drip days setting
             $drip_days = get_post_meta($page->ID, "optimizemember_drip_days", true);
             if ($drip_days) {
                 // if hide links is disabled in OPM general settings, content by this ID is not available to current user and show drip content timer is checked on
                 // membership page listings element
                 if (false === $hideContent && in_array($page->ID, $unavailableContent) && !empty($drip_content) && !current_user_can('level_10')) {
                     //if ($array = is_page_protected_by_optimizemember($page->ID)) { // is it protected?
                     $time = optimizemember_paid_registration_time();
                     if (!empty($time) && $time > strtotime("-" . $drip_days . " days")) {
                         $daysTo = intval(($time + $drip_days * 86400 - time()) / 86400);
                         if (0 === $daysTo) {
                             $dripContentHtml = '<p class="pagelisting-drip-content">' . __('Less than a day left to be able to access this content', 'optimizepress') . '</p>';
                         } else {
                             $dripContentHtml = '<p class="pagelisting-drip-content">' . sprintf(_n('%d day left to be able to access this content', '%d days left to be able to access this content', $daysTo, OP_SN), $daysTo) . '</p>';
                         }
                     }
                     //}
                 }
                 // if hide links is enabled in OPM general settings, content by this ID is not available to current user and show drip content timer is disabled on
                 // membership page listings element - hide content completely
                 if (true === $hideContent && in_array($page->ID, $unavailableContent) && !current_user_can('level_10')) {
                     continue;
                 }
                 // if user is not logged in
                 if (true === $hideContent && !is_user_logged_in()) {
                     continue;
                 }
             }
         }
         $meta = get_post_meta($page->ID);
         if (!empty($meta['_' . OP_SN . '_page_thumbnail'])) {
             $image = $meta['_' . OP_SN . '_page_thumbnail'][0];
             $alt = $page->post_title;
         }
         if (!empty($comments)) {
             $comments = wp_count_comments($page->ID);
             $commentCount = $comments->approved;
             $commentHtml = '<p class="pagelisting-comment">' . sprintf(__('%d comments', 'optimizepress'), $commentCount) . '</p>';
         } else {
             $commentHtml = '';
         }
         $meta = $meta['_' . OP_SN . '_membership'][0];
         $meta = unserialize(unserialize($meta));
         $html .= '<div class="' . $class . '">';
         $html .= '
             <a href="' . get_permalink($page->ID) . '" class="pagelisting-style-' . $style . ' border">
                 <div class="thumb">';
         if ($image != '') {
             $img_size = op_get_image_html_attribute($image);
             $html .= '<img src="' . $image . '" alt="' . $alt . '" class="scale-with-grid ' . $img_class . '" ' . $img_size . ' />';
         } else {
             $img_size = op_get_image_html_attribute(OP_IMG . 'default-page-listings.png');
             $html .= '<img src="' . OP_IMG . 'default-page-listings.png" alt="' . $alt . '" class="scale-with-grid ' . $img_class . '" ' . $img_size . ' />';
         }
         $html .= '</div>
                 <div class="content">
                     <h3 ' . $title_style . '>' . $page->post_title . '</h3>' . $commentHtml . $dripContentHtml;
         if ($hide_description !== 'Y') {
             $description = stripslashes(base64_decode($meta['description']));
             if (strlen($description) > 140) {
                 $html .= '<p ' . $content_style . '>' . substr($description, 0, 140) . '...</p>';
             } else {
                 $html .= '<p ' . $content_style . '>' . $description . '</p>';
             }
         }
         $html .= '</div>
             </a>
         ';
         $html .= '</div>';
     }
     return $html;
 }
コード例 #4
0
ファイル: style_2.php プロジェクト: kyscastellanos/arepa
<div class="order-box-2"<?php 
echo $box_style;
?>
>
    <div class="order-box-2-internal cf">
        <div class="order-box-header">
            <?php 
$img_size = op_get_image_html_attribute(OP_ASSETS_URL . 'images/order_box/titles_2/' . $title);
?>
            <img src="<?php 
echo OP_ASSETS_URL . 'images/order_box/titles_2/' . $title;
?>
" alt="<?php 
echo $title_2_alt;
?>
" <?php 
echo $img_size;
?>
 />
        </div>
        <div class="order-box-content">
        <?php 
echo $content;
?>
        </div>
    </div>
</div>
コード例 #5
0
ファイル: style_3.php プロジェクト: kyscastellanos/arepa
<div class="order-box-3"<?php 
echo $box_style;
?>
>
    <div class="order-box-3-internal cf">
        <div class="order-box-header">
            <?php 
$img_size = op_get_image_html_attribute(OP_ASSETS_URL . 'images/order_box/green-tick.png');
?>
            <h2><img src="<?php 
echo OP_ASSETS_URL;
?>
images/order_box/green-tick.png" alt="" <?php 
echo $img_size;
?>
 /> <?php 
echo $title;
?>
</h2>
        </div>
        <div class="order-box-content">
            <?php 
echo $content;
?>
        </div>
    </div>
</div>
コード例 #6
0
ファイル: default.php プロジェクト: kyscastellanos/arepa
 /**
  *
  * shortcode parsing for child elements of membership download element
  */
 static function download($atts, $content)
 {
     // Decode encoded chars
     $atts = op_urldecode($atts);
     extract(shortcode_atts(array('title' => '', 'icon' => '', 'icon_folder' => 'file_download', 'file' => '', 'package' => '', 'level' => '', 'new_window' => '', 'hide_alert' => ''), $atts));
     if (empty($file)) {
         return '';
     }
     $hideAlert = '';
     $protocolMemberForce = is_ssl() ? '&s2-ssl=yes' : '';
     if (!empty($level)) {
         if (defined('WS_PLUGIN__OPTIMIZEMEMBER_VERSION')) {
             // is OPM element present and OPM activated?
             $filesDir = $GLOBALS['WS_PLUGIN__']['optimizemember']['c']['files_dir'];
             $hideFiles = false;
             if (isset($GLOBALS['WS_PLUGIN__']['optimizemember']['o']['filter_wp_query']) && 'all' === $GLOBALS['WS_PLUGIN__']['optimizemember']['o']['filter_wp_query'][0]) {
                 $hideFiles = true;
             }
             $uploads = wp_upload_dir();
             $baseUploadDir = $uploads['basedir'];
             $baseUploadUrl = $uploads['baseurl'];
             $fileNameWithFolder = str_replace($baseUploadUrl, '', $file);
             if (strpos($fileNameWithFolder, 'https') !== false) {
                 $temp = str_replace('http', 'https', $baseUploadUrl);
                 $fileNameWithFolder = str_replace($temp, '', $file);
             }
             $onlyFileName = basename($file);
             $fullFilePath = $baseUploadDir . '/' . $fileNameWithFolder;
             $attachmentId = op_get_image_id($baseUploadUrl . $fileNameWithFolder);
             // protection needed based on level or package selected
             if (!empty($package)) {
                 // if package selected, level is ignored
                 $destinationFolder = $filesDir . '/access-optimizemember-ccap-' . $package;
                 $forUrl = '/access-optimizemember-ccap-' . $package;
             } else {
                 if (!empty($level)) {
                     $destinationFolder = $filesDir . '/access-optimizemember-level' . $level;
                     $forUrl = '/access-optimizemember-level' . $level;
                 }
             }
             $amazon = false;
             if (c_ws_plugin__optimizemember_utils_conds::using_amazon_s3_storage()) {
                 $amazon = true;
             }
             if (c_ws_plugin__optimizemember_utils_conds::using_amazon_cf_storage()) {
                 $amazon = true;
             }
             if (!$amazon) {
                 if (!is_dir($destinationFolder)) {
                     mkdir($destinationFolder, 0777, true);
                 }
                 // copying only in admin
                 if (defined('OP_LIVEEDITOR')) {
                     copy($fullFilePath, $destinationFolder . '/' . $onlyFileName);
                     /// below code should be uncommented if we decide to remove the file from uploads folder
                     //rename($fullFilePath, $destinationFolder . '/' . $onlyFileName);
                     // removing image from db, too
                     //if (!empty($attachmentId)) wp_delete_attachment($attachmentId);
                 }
             }
             $protected = true;
             // hide alert?
             if (!empty($hide_alert) && $hide_alert == 'Y') {
                 $hideAlert = '&optimizemember_skip_confirmation=yes';
             }
             // dealing with level or packages
             $hideContent = false;
             if (empty($package)) {
                 if (!current_user_can("access_optimizemember_level" . $level)) {
                     $hideContent = true;
                 }
             } else {
                 if (!current_user_can("access_optimizemember_ccap_" . $package)) {
                     $hideContent = true;
                 }
             }
         } else {
             if (defined('OP_LIVEEDITOR')) {
                 return '<p>In order to use this element, you have to enable OptimizeMember plugin !!!</p>';
             } else {
                 return '';
             }
         }
     } else {
         $protected = false;
     }
     if ($protected) {
         if (!$amazon) {
             $fileLink = site_url('?optimizemember_file_download=') . $forUrl . '/' . $onlyFileName . $hideAlert . $protocolMemberForce;
         } else {
             /// below code should be uncommented if we decide to remove the file from uploads folder
             // removing file from uploads folder
             //unlink($fullFilePath);
             //if (!empty($attachmentId)) wp_delete_attachment($attachmentId);
             $fileLink = site_url('?optimizemember_file_download=') . '/' . $onlyFileName . $hideAlert . $protocolMemberForce;
         }
     } else {
         $fileLink = $file;
     }
     $blank = '';
     if (!empty($new_window) && $new_window == 'Y') {
         $blank = ' target="_blank" ';
     }
     $html = '';
     if ($protected && (false === $hideContent || false === $hideFiles)) {
         $html .= '<li>';
         $img_size = op_get_image_html_attribute(OP_ASSETS_URL . 'images/' . $icon_folder . '/icons/' . $icon);
         $html .= '<a ' . $blank . ' href="' . $fileLink . '"><img src="' . OP_ASSETS_URL . 'images/' . $icon_folder . '/icons/' . $icon . '" alt="' . $title . '" class="thumb" ' . $img_size . ' /></a>';
         $html .= '<div class="content">';
         $html .= '<a ' . $blank . 'href="' . $fileLink . '">' . $title . '</a>';
         $html .= '<p>' . urldecode($content) . '</p>';
         $html .= '</div>';
         $html .= '</li>';
     } else {
         if (!$protected) {
             $html .= '<li>';
             $img_size = op_get_image_html_attribute(OP_ASSETS_URL . 'images/' . $icon_folder . '/icons/' . $icon);
             $html .= '<a ' . $blank . ' href="' . $fileLink . '"><img src="' . OP_ASSETS_URL . 'images/' . $icon_folder . '/icons/' . $icon . '" alt="' . $title . '" class="thumb" ' . $img_size . '/></a>';
             $html .= '<div class="content">';
             $html .= '<a ' . $blank . ' href="' . $fileLink . '">' . $title . '</a>';
             $html .= '<p>' . urldecode($content) . '</p>';
             $html .= '</div>';
             $html .= '</li>';
         }
     }
     return $html;
 }