Exemple #1
0
$listcount = 0;
while (osc_has_items()) {
    if ($listcount % 3 == 0) {
        echo '</ul><ul class="row">';
    }
    $listcount++;
    $admin = false;
    if (View::newInstance()->_exists("listAdmin")) {
        $admin = true;
    }
    ?>
    <?php 
    $size = explode('x', osc_thumbnail_dimensions());
    ?>
    <li class="col-sm-6 col-md-4 <?php 
    if (osc_item_is_premium()) {
        echo ' premium';
    }
    ?>
">
        <div class="listing-card">
            <?php 
    if (osc_images_enabled_at_items()) {
        ?>
            <?php 
        if (osc_count_item_resources()) {
            ?>
            <a class="listing-thumb" href="<?php 
            echo osc_item_url();
            ?>
" title="<?php 
Exemple #2
0
/**
 * Return true if item is expired, else return false
 * 
 * @return boolean  
 */
function osc_item_is_expired()
{
    if (osc_item_is_premium()) {
        return false;
    } else {
        return osc_isExpired(osc_item_dt_expiration());
    }
}
        /**
         * Get the status of the row. There are five status:
         *     - spam
         *     - blocked
         *     - inactive
         *     - premium
         *     - active
         *
         * @since 3.2
         *
         * @return array Array with the class and text of the status of the listing in this row. Example:
         *     array(
         *         'class' => '',
         *         'text'  => ''
         *     )
         */
        private function get_row_status()
        {
            if( osc_item_is_spam() ) {
                return array(
                    'class' => 'status-spam',
                    'text'  => __('Spam')
                );
            }

            if( !osc_item_is_enabled() ) {
                return array(
                    'class' => 'status-blocked',
                    'text'  => __('Blocked')
                );
            }

            if( !osc_item_is_active() ) {
                return array(
                    'class' => 'status-inactive',
                    'text'  => __('Inactive')
                );
            }

            if( osc_item_is_premium() ) {
                return array(
                    'class' => 'status-premium',
                    'text'  => __('Premium')
                );
            }

            return array(
                'class' => 'status-active',
                'text'  => __('Active')
            );
        }
Exemple #4
0
    _e('No Latest Items', 'modern');
    ?>
</p>
                        <?php 
} else {
    ?>
                            <table border="0" cellspacing="0">
                                 <tbody>
                                    <?php 
    $class = "even";
    ?>
                                    <?php 
    while (osc_has_latest_items()) {
        ?>
                                     <tr class="<?php 
        echo $class . (osc_item_is_premium() ? " premium" : "");
        ?>
">
                                            <?php 
        if (osc_images_enabled_at_items()) {
            ?>
                                             <td class="photo">
                                                <?php 
            if (osc_count_item_resources()) {
                ?>
                                                    <a href="<?php 
                echo osc_item_url();
                ?>
">
                                                        <img src="<?php 
                echo osc_resource_thumbnail_url();
Exemple #5
0
/**
 * Return true if item is expired, else return false
 * 
 * @return boolean  
 */
function osc_item_is_expired()
{
    if (osc_item_is_premium()) {
        return false;
    } else {
        $category = Category::newInstance()->findByPrimaryKey(osc_item_category_id());
        $expiration = $category['i_expiration_days'];
        if ($expiration == 0) {
            return false;
        } else {
            $date_expiration = strtotime(date("Y-m-d H:i:s", strtotime(osc_item_pub_date())) . " +{$expiration} day");
            $now = strtotime(date('Y-m-d H:i:s'));
            if ($date_expiration < $now) {
                return true;
            } else {
                return false;
            }
        }
    }
}