• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP osc_item_category_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中osc_item_category_id函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_item_category_id函数的具体用法?PHP osc_item_category_id怎么用?PHP osc_item_category_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osc_item_category_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: voting_item_detail

/**
 * Show form to vote an item. (itemDetail)
 */
function voting_item_detail()
{
    if (osc_is_this_category('voting', osc_item_category_id()) && osc_get_preference('item_voting', 'voting') == '1') {
        $aux_vote = ModelVoting::newInstance()->getItemAvgRating(osc_item_id());
        $aux_count = ModelVoting::newInstance()->getItemNumberOfVotes(osc_item_id());
        $vote['vote'] = $aux_vote['vote'];
        $vote['total'] = $aux_count['total'];
        $hash = '';
        if (osc_logged_user_id() == 0) {
            $hash = $_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR'];
            $hash = sha1($hash);
        } else {
            $hash = null;
        }
        $vote['can_vote'] = true;
        if (osc_get_preference('user', 'voting') == 1) {
            if (!osc_is_web_user_logged_in()) {
                $vote['can_vote'] = false;
            }
        }
        if (!can_vote(osc_item_id(), osc_logged_user_id(), $hash)) {
            $vote['can_vote'] = false;
        }
        require 'item_detail.php';
    }
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:29,代码来源:index.php


示例2: digitalgoods_item_detail

function digitalgoods_item_detail()
{
    if (osc_is_this_category('digitalgoods', osc_item_category_id())) {
        $dg_files = DGModel::newInstance()->getFilesFromItem(osc_item_id());
        require_once 'item_detail.php';
    }
}
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:7,代码来源:index.php


示例3: allSeo_description_filter

function allSeo_description_filter($text)
{
    // CLEAN EXISTING DESCRIPTION
    $text = '';
    // HOME PAGE
    if (osc_is_home_page()) {
        $text = osc_page_description();
    }
    // STATIC PAGE
    if (osc_is_static_page()) {
        if (GetPageDesc() == '') {
            $text = osc_highlight(osc_static_page_text(), 140, '', '');
        } else {
            $text = GetPageDesc();
        }
    }
    // SEARCH & CATEGORY PAGE
    if (osc_is_search_page()) {
        $cat = osc_search_category_id();
        $cat_id = $cat[0];
        $cat_field = Category::newInstance()->findByPrimaryKey($cat_id);
        $country = GetCtrDesc(osc_search_country()) ? GetCtrDesc(osc_search_country()) : osc_search_country();
        $region = GetRegDesc(osc_search_region()) ? GetRegDesc(osc_search_region()) : osc_search_region();
        $city = osc_search_city();
        if (GetCatDesc($cat_id) != '') {
            $desc = GetCatDesc($cat_id);
        } else {
            $desc = $cat_field['s_name'];
        }
        $text = $desc;
        // ADD LOCATION DESCRIPTION
        if ($country != '') {
            $text .= ($text != '' ? ' - ' : '') . $country;
        }
        if ($region != '') {
            $text .= ($text != '' ? ' - ' : '') . $region;
        }
        if ($city != '') {
            $text .= ($text != '' ? ' - ' : '') . $city;
        }
        // Improve search/category title adding part of listings in this category/search
        if (osc_get_preference('allSeo_search_improve_desc', 'plugin-all_in_one') == 1) {
            osc_reset_custom_items();
            osc_query_item(array("category" => $cat_id, "country_name" => $country, "region_name" => $region, "city_name" => $city));
            while (osc_has_custom_items()) {
                $item = Item::newInstance()->findByPrimaryKey(osc_item_id());
                $con = strip_tags($item['s_description']);
                if (osc_item_city() != '') {
                    $text .= ' - ' . osc_item_city();
                }
                if ($con != '') {
                    $text .= ', ' . osc_highlight($con, 100);
                }
            }
        }
        $text = osc_highlight($text, 500);
        osc_reset_items();
    }
    // Listing page
    if (osc_is_ad_page()) {
        if (GetItemDesc() == '') {
            if (GetCatDesc(osc_item_category_id()) != '') {
                $desc = GetCatDesc(osc_item_category_id());
            } else {
                $desc = osc_item_category();
            }
            $item = Item::newInstance()->findByPrimaryKey(osc_item_id());
            $text = $desc . ' - ' . osc_highlight($item['s_description'], 120) . ', ' . SeoLocationShow();
        } else {
            $text = GetItemDesc();
        }
    }
    return $text;
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:74,代码来源:index.php


示例4: osclasswizards_item_star_rating

              <?php 
        if (is_voting_enabled()) {
            ?>
              <div class="rate_me rate_me_star">
                <?php 
            osclasswizards_item_star_rating(osc_item_id());
            ?>
                <span><?php 
            echo osclasswizards_item_avg_rating(osc_item_id());
            ?>
</span> </div>
              <?php 
        }
        ?>
              <div class="attribute_list"> <span class="category"><i class="fa fa-<?php 
        echo osclasswizards_category_icon(osc_item_category_id());
        ?>
"></i><?php 
        echo osc_item_category();
        ?>
</span> <span class="location"><i class="fa fa-map-marker"></i> <?php 
        echo osc_item_city();
        ?>
                <?php 
        if (osc_item_region() != '') {
            ?>
                (<?php 
            echo osc_item_region();
            ?>
)
                <?php 
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:loop-user-alerts-list.php


示例5:

     if ($open == 1) {
         if (can_vote($itemId, $userId, $hash)) {
             ModelVoting::newInstance()->insertItemVote($itemId, $userId, $iVote, $hash);
         }
     } else {
         if ($user == 1 && is_null($hash)) {
             if (can_vote($itemId, $userId, $hash)) {
                 ModelVoting::newInstance()->insertItemVote($itemId, $userId, $iVote, $hash);
             }
         }
     }
 }
 // return updated voting
 $item = Item::newInstance()->findByPrimaryKey($itemId);
 View::newInstance()->_exportVariableToView('item', $item);
 if (osc_is_this_category('voting', osc_item_category_id())) {
     $aux_vote = ModelVoting::newInstance()->getItemAvgRating(osc_item_id());
     $aux_count = ModelVoting::newInstance()->getItemNumberOfVotes(osc_item_id());
     $vote['vote'] = $aux_vote['vote'];
     $vote['total'] = $aux_count['total'];
     $vote['can_vote'] = true;
     if (osc_get_preference('user', 'voting') == 1) {
         if (!osc_is_web_user_logged_in()) {
             $vote['can_vote'] = false;
         }
     }
     if (!can_vote(osc_item_id(), osc_logged_user_id(), $hash)) {
         $vote['can_vote'] = false;
     }
     require 'view_votes.php';
 }
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:ajax.php


示例6: logbee_header

function logbee_header()
{
    $location = Rewrite::newInstance()->get_location();
    $section = Rewrite::newInstance()->get_section();
    if ($location == 'item' && $section == '') {
        echo '
<style type="text/css">
  .logbee ul { margin: 10px 0; list-style: none; }
  .logbee ul li { float: left; }
  .logbee .clear { clear:both; }
</style>';
        // meta-tags
        $address_array = array();
        if (osc_item_address() != "") {
            $address_array[] = osc_item_address();
        }
        if (osc_item_city_area() != "") {
            $address_array[] = osc_item_city_area();
        }
        if (osc_item_zip() != "") {
            $address_array[] = osc_item_zip();
        }
        if (osc_item_city() != "") {
            $address_array[] = osc_item_city();
        }
        if (osc_item_region() != "") {
            $address_array[] = osc_item_region();
        }
        if (osc_item_country() != "") {
            $address_array[] = osc_item_country();
        }
        $address = implode(", ", $address_array);
        $price = '';
        if (osc_item_formated_price() != "") {
            $price = osc_item_formated_price();
        }
        $email = '';
        if (osc_item_show_email()) {
            $email = osc_item_contact_email();
        }
        echo '
 <meta property="logbee:title" content="' . osc_esc_html(osc_item_title()) . '"/>
 <meta property="logbee:url"   content="' . osc_esc_html(osc_item_url()) . '"/>
 <meta property="logbee:desc"  content="' . osc_esc_html(osc_item_description()) . '"/>
 <meta property="logbee:addr"  content="' . osc_esc_html($address) . '"/>
 <meta property="logbee:email" content="' . osc_esc_html($email) . '"/>
 <meta property="logbee:price" content="' . osc_esc_html($price) . '"/>';
        // do we have the cars_plugin enabled?
        if (osc_plugin_is_enabled('cars_attributes/index.php')) {
            require_once osc_plugin_path('') . '/cars_attributes/ModelCars.php';
            if (osc_is_this_category('cars_plugin', osc_item_category_id())) {
                $detail = ModelCars::newInstance()->getCarAttr(osc_item_id());
                echo '
 <meta property="logbee:type" content="car"/>
 <meta property="logbee:mileage" content="' . osc_esc_html(@$detail['i_mileage']) . '"/>
 <meta property="logbee:firstreg" content="' . osc_esc_html(@$detail['i_year']) . '"/>';
            }
        }
        // do we have the realestate_plugin enabled?
        if (osc_plugin_is_enabled('realestate_attributes/index.php')) {
            require_once osc_plugin_path('') . '/realestate_attributes/ModelRealEstate.php';
            if (osc_is_this_category('realestate_plugin', osc_item_category_id())) {
                $detail = ModelRealEstate::newInstance()->getAttributes(osc_item_id());
                echo '
 <meta property="logbee:type" content="realty"/>
 <meta property="logbee:rooms" content="' . osc_esc_html(@$detail['i_num_rooms']) . '"/>
 <meta property="logbee:size" content="' . osc_esc_html(@$detail['s_square_meters']) . ' sqm"/>';
            }
        }
        // images
        osc_reset_resources();
        $images_array = array();
        for ($i = 0; osc_has_item_resources(); $i++) {
            $images_array[] = osc_esc_html(osc_resource_url());
        }
        $images = implode("|", $images_array);
        echo '
 <meta property="logbee:imgurl" content="' . $images . '"/>
 ';
        osc_reset_resources();
        echo "\n";
    }
}
开发者ID:bomvendador,项目名称:soroka_r,代码行数:83,代码来源:index.php


示例7: breadcrumbs

function breadcrumbs($separator = '/')
{
    $text = '';
    $location = Rewrite::newInstance()->get_location();
    $section = Rewrite::newInstance()->get_section();
    $separator = ' ' . trim($separator) . ' ';
    $page_title = '<a href="' . osc_base_url() . '"><span class="bc_root">' . osc_page_title() . '</span></a>';
    switch ($location) {
        case 'item':
            switch ($section) {
                case 'item_add':
                    break;
                default:
                    $aCategories = Category::newInstance()->toRootTree((string) osc_item_category_id());
                    $category = '';
                    if (count($aCategories) == 0) {
                        break;
                    }
                    $deep = 1;
                    foreach ($aCategories as $aCategory) {
                        $list[] = '<a href="' . breadcrumbs_category_url($aCategory['pk_i_id']) . '"><span class="bc_level_' . $deep . '">' . $aCategory['s_name'] . '</span></a>';
                        $deep++;
                    }
                    $category = implode($separator, $list) . $separator;
                    $category = preg_replace('|' . trim($separator) . '\\s*$|', '', $category);
                    break;
            }
            switch ($section) {
                case 'item_add':
                    $text = $page_title . $separator . '<span class="bc_last">' . __('Publish an item', 'breadcrumbs');
                    break;
                case 'item_edit':
                    $text = $page_title . $separator . $category . $separator . '<a href="' . osc_item_url() . '"><span class="bc_item">' . osc_item_title() . '</span></a>' . $separator . '<span class="bc_last">' . __('Edit your item', 'breadcrumbs') . '</span>';
                    break;
                case 'send_friend':
                    $text = $page_title . $separator . $category . $separator . '<a href="' . osc_item_url() . '"><span class="bc_item">' . osc_item_title() . '</span></a>' . $separator . '<span class="bc_last">' . __('Send to a friend', 'breadcrumbs') . '</span>';
                    break;
                case 'contact':
                    $text = $page_title . $separator . $category . $separator . '<a href="' . osc_item_url() . '"><span class="bc_item">' . osc_item_title() . '</span></a>' . $separator . '<span class="bc_last">' . __('Contact seller', 'breadcrumbs') . '</span>';
                    break;
                default:
                    $text = $page_title . $separator . $category . $separator . '<span class="bc_last">' . osc_item_title() . '</span>';
                    break;
            }
            break;
        case 'page':
            $text = $page_title . $separator . '<span class="bc_last">' . osc_static_page_title() . '</span>';
            break;
        case 'search':
            $region = osc_search_region();
            $city = osc_search_city();
            $pattern = osc_search_pattern();
            $category = osc_search_category_id();
            $category = count($category) == 1 ? $category[0] : '';
            $b_show_all = $pattern == '' && $category == '' && $region == '' && $city == '';
            $b_category = $category != '';
            $b_pattern = $pattern != '';
            $b_region = $region != '';
            $b_city = $city != '';
            $b_location = $b_region || $b_city;
            if ($b_show_all) {
                $text = $page_title . $separator . '<span class="bc_last">' . __('Search', 'breadcrumbs') . '</span>';
                break;
            }
            // init
            $result = $page_title . $separator;
            if ($b_category) {
                $list = array();
                $aCategories = Category::newInstance()->toRootTree($category);
                if (count($aCategories) > 0) {
                    $deep = 1;
                    foreach ($aCategories as $single) {
                        $list[] = '<a href="' . breadcrumbs_category_url($single['pk_i_id']) . '"><span class="bc_level_' . $deep . '">' . $single['s_name'] . '</span></a>';
                        $deep++;
                    }
                    // remove last link
                    if (!$b_pattern && !$b_location) {
                        $list[count($list) - 1] = preg_replace('|<a href.*?>(.*?)</a>|', '$01', $list[count($list) - 1]);
                    }
                    $result .= implode($separator, $list) . $separator;
                }
            }
            if ($b_location) {
                $list = array();
                $params = array();
                if ($b_category) {
                    $params['sCategory'] = $category;
                }
                if ($b_city) {
                    $aCity = City::newInstance()->findByName($city);
                    if (count($aCity) == 0) {
                        $params['sCity'] = $city;
                        $list[] = '<a href="' . osc_search_url($params) . '"><span class="bc_city">' . $city . '</span></a>';
                    } else {
                        $aRegion = Region::newInstance()->findByPrimaryKey($aCity['fk_i_region_id']);
                        $params['sRegion'] = $aRegion['s_name'];
                        $list[] = '<a href="' . osc_search_url($params) . '"><span class="bc_region">' . $aRegion['s_name'] . '</span></a>';
                        $params['sCity'] = $aCity['s_name'];
                        $list[] = '<a href="' . osc_search_url($params) . '"><span class="bc_city">' . $aCity['s_name'] . '</span></a>';
                    }
//.........这里部分代码省略.........
开发者ID:oanav,项目名称:closetshare,代码行数:101,代码来源:index.php


示例8: osc_item_category_id

    echo osc_item_category_id();
    ?>
)" >
                            <div  style="padding-bottom:4px;text-align:center;color:#000;">
                                <!--<img class="img-responsive" src="<?php 
    echo osc_base_url() . 'oc-content/themes/classified/images/down.jpg';
    ?>
">-->
                                <span class="glyphicon glyphicon-chevron-down"></span>
                            </div>
                        </a>
                        <a href="javascript:void(0);" class="hideAll_<?php 
    echo osc_item_category_id();
    ?>
" onClick="hideAllSubcategories(<?php 
    echo osc_item_category_id();
    ?>
)" style="display:none;">
                            <div  style="padding-bottom:4px;text-align:center;color:#000">
                                <span class="glyphicon glyphicon-chevron-up"></span>
                            </div>
                        </a>
                        
                        
                    </div>
                </div>  
            <?php 
}
?>
 
    <?php 
开发者ID:jhalendra,项目名称:classmandu,代码行数:31,代码来源:popular-categories1.php


示例9: osc_item_formated_price

        if (osc_price_enabled_at_items()) {
            ?>
 <small><strong><?php 
            echo osc_item_formated_price();
            ?>
</strong></small> &middot; <?php 
        }
        ?>
<a href="<?php 
        echo osc_item_url();
        ?>
"><?php 
        echo osc_item_title();
        ?>
</a> <span class="label"><a href="<?php 
        echo osc_item_category_url(osc_item_category_id());
        ?>
"><?php 
        echo osc_item_category();
        ?>
</a></span> <?php 
        if (osc_item_is_premium()) {
            ?>
 <span class="label success"><?php 
            _e('Premium', 'twitter');
            ?>
</span><?php 
        }
        ?>
</h3>
            <p><?php 
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:31,代码来源:search_list.php


示例10: republish_url

function republish_url()
{
    $conn = getConnection();
    $pCats = $conn->osc_dbFetchResult("SELECT * FROM %st_plugin_category WHERE s_plugin_name = '%s' AND fk_i_category_id = '%d'", DB_TABLE_PREFIX, 'adManage', osc_item_category_id());
    $pCatCount = count($pCats);
    $adManage_url = '';
    $rSecret = $conn->osc_dbFetchResult("SELECT * FROM %st_item_adManage_limit WHERE fk_i_item_id = '%d'", DB_TABLE_PREFIX, osc_item_id());
    if (($rSecret['r_times'] < osc_adManage_repubTimes() || osc_adManage_repubTimes() == 0) && $pCatCount != 0) {
        if (osc_item_is_expired()) {
            $adManage_url = osc_base_url() . 'oc-content/plugins/advanced_ad_management/item_republish.php?repub=republish&id=' . osc_item_id() . '&rSecret=' . $rSecret['r_secret'];
        }
    }
    return $adManage_url;
}
开发者ID:oanav,项目名称:closetshare,代码行数:14,代码来源:index.php


示例11: osc_item_category_description

function osc_item_category_description($locale = "")
{
    if ($locale == "") {
        $locale = osc_current_user_locale();
    }
    $category = Category::newInstance()->findByPrimaryKey(osc_item_category_id());
    return osc_field($category, "s_description", $locale);
}
开发者ID:hashemgamal,项目名称:OSClass,代码行数:8,代码来源:hItems.php


示例12: osc_item_category_price_enabled

/**
 * Checks to see if the price is enabled for this category.
 *
 * @param string $locale
 * @return string
 */
function osc_item_category_price_enabled($catId = null)
{
    if ($catId == null) {
        $category = Category::newInstance()->findByPrimaryKey(osc_item_category_id());
    } else {
        $category = Category::newInstance()->findByPrimaryKey($catId);
    }
    return $category['b_price_enabled'] == 1 ? true : false;
}
开发者ID:mylastof,项目名称:os-class,代码行数:15,代码来源:hItems.php


示例13: osc_static_page_url

/**
 * Gets current page url
 *
 * @param string $locale
 * @return string
 */
function osc_static_page_url($locale = '')
{
    if (osc_rewrite_enabled()) {
        $sanitized_categories = array();
        $cat = Category::newInstance()->hierarchy(osc_item_category_id());
        for ($i = count($cat); $i > 0; $i--) {
            $sanitized_categories[] = $cat[$i - 1]['s_slug'];
        }
        $url = str_replace('{PAGE_TITLE}', osc_static_page_title(), str_replace('{PAGE_ID}', osc_static_page_id(), str_replace('{PAGE_SLUG}', urlencode(osc_static_page_slug()), osc_get_preference('rewrite_page_url'))));
        if ($locale != '') {
            $path = osc_base_url() . $locale . "/" . $url;
        } else {
            $path = osc_base_url() . $url;
        }
    } else {
        if ($locale != '') {
            $path = osc_base_url(true) . "?page=page&id=" . osc_static_page_id() . "&lang=" . $locale;
        } else {
            $path = osc_base_url(true) . "?page=page&id=" . osc_static_page_id();
        }
    }
    return $path;
}
开发者ID:mylastof,项目名称:os-class,代码行数:29,代码来源:hPage.php


示例14: osc_item_url

/**
 * Create automatically the url of the item details page
 *
 * @return string
 */
function osc_item_url($locale = '')
{
    if (osc_rewrite_enabled()) {
        $sanitized_title = osc_sanitizeString(osc_item_title());
        $sanitized_category = '';
        $cat = Category::newInstance()->hierarchy(osc_item_category_id());
        for ($i = count($cat); $i > 0; $i--) {
            $sanitized_category .= $cat[$i - 1]['s_slug'] . '/';
        }
        if ($locale != '') {
            $path = osc_base_url() . sprintf('%s_%s%s_%d', $locale, $sanitized_category, $sanitized_title, osc_item_id());
        } else {
            $path = osc_base_url() . sprintf('%s%s_%d', $sanitized_category, $sanitized_title, osc_item_id());
        }
    } else {
        //$path = osc_base_url(true) . sprintf('?page=item&id=%d', osc_item_id()) ;
        $path = osc_item_url_ns(osc_item_id(), $locale);
    }
    return $path;
}
开发者ID:hashemgamal,项目名称:OSClass,代码行数:25,代码来源:hDefines.php


示例15: init

 public function init()
 {
     if (in_array($this->getLocation(), array('item', 'page', 'search', 'login', 'register', 'user', 'contact'))) {
         $l = array('url' => osc_base_url(), 'title' => osc_page_title());
         $this->addLevel($l);
     }
     switch ($this->getLocation()) {
         case 'item':
             if ($this->getSection() == 'item_add') {
                 $l = array('title' => $this->title['item_add']);
                 $this->addLevel($l);
                 break;
             }
             $aCategory = osc_get_category('id', osc_item_category_id());
             // remove
             View::newInstance()->_erase('categories');
             View::newInstance()->_erase('subcategories');
             View::newInstance()->_exportVariableToView('category', $aCategory);
             $l = array('url' => osc_search_category_url(), 'title' => osc_category_name());
             $this->addLevel($l);
             switch ($this->getSection()) {
                 case 'item_edit':
                     $l = array('url' => osc_item_url(), 'title' => osc_item_title());
                     $this->addLevel($l);
                     $l = array('title' => $this->title['item_edit']);
                     $this->addLevel($l);
                     break;
                 case 'send_friend':
                     $l = array('url' => osc_item_url(), 'title' => osc_item_title());
                     $this->addLevel($l);
                     $l = array('title' => $this->title['item_send_friend']);
                     $this->addLevel($l);
                     break;
                 case 'contact':
                     $l = array('url' => osc_item_url(), 'title' => osc_item_title());
                     $this->addLevel($l);
                     $l = array('title' => $this->title['item_contact']);
                     $this->addLevel($l);
                     break;
                 case '':
                     $l = array('title' => osc_item_title());
                     $this->addLevel($l);
                     break;
             }
             break;
         case 'search':
             $region = osc_search_region();
             $city = osc_search_city();
             $pattern = osc_search_pattern();
             $category = osc_search_category_id();
             $category = count($category) == 1 ? $category[0] : '';
             $b_show_all = $pattern == '' && $category == '' && $region == '' && $city == '';
             $b_category = $category != '';
             $b_pattern = $pattern != '';
             $b_region = $region != '';
             $b_city = $city != '';
             $b_location = $b_region || $b_city;
             // show all
             if ($b_show_all) {
                 $l = array('title' => $this->title['search']);
                 $this->addLevel($l);
                 break;
             }
             // category
             if ($b_category) {
                 $aCategories = Category::newInstance()->toRootTree($category);
                 foreach ($aCategories as $c) {
                     View::newInstance()->_erase('categories');
                     View::newInstance()->_erase('subcategories');
                     View::newInstance()->_exportVariableToView('category', $c);
                     $l = array('url' => osc_search_category_url(), 'title' => osc_category_name());
                     $this->addLevel($l);
                 }
             }
             // location
             if ($b_location) {
                 $params = array();
                 if ($b_category) {
                     $params['sCategory'] = $category;
                 }
                 if ($b_city) {
                     //print_r("~~~~~~~~~~~~~~~~~~~".$city."~~~~~~~~~~~~~~~~~~~~");
                     $aCity = City::newInstance()->findByName($city);
                     if (count($aCity) == 0) {
                         $params['sCity'] = $city;
                         $l = array('url' => osc_search_url($params), 'title' => $city);
                         $this->addLevel($l);
                     } else {
                         $aRegion = Region::newInstance()->findByPrimaryKey($aCity['fk_i_region_id']);
                         $params['sRegion'] = $aRegion['s_name'];
                         $l = array('url' => osc_search_url($params), 'title' => $aRegion['s_name']);
                         $this->addLevel($l);
                         $params['sCity'] = $aCity['s_name'];
                         $l = array('url' => osc_search_url($params), 'title' => $aCity['s_name']);
                         $this->addLevel($l);
                     }
                 } else {
                     if ($b_region) {
                         $params['sRegion'] = $region;
                         $l = array('url' => osc_search_url($params), 'title' => $region);
//.........这里部分代码省略.........
开发者ID:jmcclenon,项目名称:Osclass,代码行数:101,代码来源:Breadcrumb.php


示例16: osc_item_category_description

/**
 * Gets category description from current item, if $locale is unspecified $locale is current user locale
 *
 * @param type $locale
 * @return string 
 */
function osc_item_category_description($locale = "")
{
    if ($locale == "") {
        $locale = osc_current_user_locale();
    }
    if (!View::newInstance()->_exists('item_category')) {
        View::newInstance()->_exportVariableToView('item_category', Category::newInstance()->findByPrimaryKey(osc_item_category_id()));
    }
    $category = View::newInstance()->_get('item_category');
    return osc_field($category, "s_description", $locale);
}
开发者ID:randomecho,项目名称:OSClass,代码行数:17,代码来源:hItems.php


示例17: osc_get_category

<?php

$category = osc_get_category('id', osc_item_category_id());
$category_url = osc_search_url(array('sCategory' => $category['s_slug']));
?>
<div class="item <?php 
echo $class;
if (osc_item_is_premium()) {
    echo ' premium';
}
?>
">
    <?php 
if (osc_images_enabled_at_items()) {
    ?>
        <?php 
    if (osc_count_item_resources()) {
        ?>
            <a class="" href="<?php 
        echo osc_item_url();
        ?>
" title="<?php 
        echo osc_esc_html(osc_item_title());
        ?>
"><img src="<?php 
        echo osc_resource_original_url();
        ?>
" title="" alt="<?php 
        echo osc_esc_html(osc_item_title());
        ?>
" width="220" ></a>
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:31,代码来源:loop-single.php


示例18: category_two_selects

    public static function category_two_selects($categories = null, $item = null, $default_item = null, $parent_selectable = false)
    {
        $categoryID = Params::getParam('catId');
        if (osc_item_category_id() != null) {
            $categoryID = osc_item_category_id();
        }
        if (Session::newInstance()->_getForm('catId') != '') {
            $categoryID = Session::newInstance()->_getForm('catId');
        }
        $subcategoryID = '';
        if (!Category::newInstance()->isRoot($categoryID)) {
            $subcategoryID = $categoryID;
            $category = Category::newInstance()->findRootCategory($categoryID);
            $categoryID = $category['pk_i_id'];
        }
        if ($categories == null) {
            if (View::newInstance()->_exists('categories')) {
                $categories = View::newInstance()->_get('categories');
            } else {
                $categories = osc_get_categories();
            }
        }
        if ($item == null) {
            $item = osc_item();
        }
        $subcategory = array();
        ?>
            <select id="parentCategory" name="parentCatId">
                <option value=""><?php 
        _e('Select Category');
        ?>
</option>
                <?php 
        foreach ($categories as $_category) {
            $selected = isset($item["fk_i_category_id"]) && $item["fk_i_category_id"] == $_category['pk_i_id'] || isset($categoryID) && $categoryID == $_category['pk_i_id'];
            if ($selected) {
                $subcategory = $_category;
            }
            echo '<option value="' . $_category['pk_i_id'] . '" ' . ($selected ? 'selected="selected"' : '') . '>' . $_category['s_name'] . '</option>';
        }
        ?>
            </select>
            <select id="catId" name="catId">
                <?php 
        if (!empty($subcategory)) {
            if (count($subcategory['categories']) > 0) {
                echo '<option value="">' . __('Select Subcategory') . '</option>';
                foreach ($subcategory['categories'] as $c) {
                    $selected = isset($item["fk_i_category_id"]) && $item["fk_i_category_id"] == $c['pk_i_id'] || isset($subcategoryID) && $subcategoryID == $c['pk_i_id'];
                    echo '<option value="' . $c['pk_i_id'] . '" ' . ($selected ? 'selected="selected"' : '') . '>' . $c['s_name'] . '</option>';
                }
            } else {
                echo '<option value="' . $categoryID . '" >' . __('No Subcategory') . '</option>';
            }
        } else {
            echo '<option value="">' . __('Select Subcategory') . '</option>';
        }
        ?>
            </select>
            <script type="text/javascript" charset="utf-8">
            <?php 
        foreach ($categories as $c) {
            if (count($c['categories']) > 0) {
                $subcategory = array();
                for ($i = 0; $i < count($c['categories']); $i++) {
                    $subcategory[] = array($c['categories'][$i]['pk_i_id'], $c['categories'][$i]['s_name']);
                }
                printf('var categories_%1$s = %2$s;', $c['pk_i_id'], json_encode($subcategory));
                echo PHP_EOL;
            }
        }
        ?>

                osc.item_post = {};
                osc.item_post.category_id    = '<?php 
        echo $categoryID;
        ?>
';
                osc.item_post.subcategory_id = '<?php 
        echo $subcategoryID;
        ?>
';

                $(document).ready(function(){
                    $("#parentCategory").bind('change', function(){
                        var categoryID = $(this).val();
                        if( categoryID == 0 ) {
                            return false;
                        }
                        categories = window['categories_' + categoryID];
                        if( categories==null || !$.isArray(categories) ) {
                            var options = '<option value="' + categoryID + '" >' + osc.langs.no_subcategory + '</option>';
                        } else {
                            var options = '<option value="' + categoryID + '" >' + osc.langs.select_subcategory + '</option>';
                            $.each(categories, function(index, value){
                                options += '<option value="' + value[0] + '">' + value[1] + '</option>';
                            });
                        };
                        $('#catId').html(options);
                        $("#catId").next("a").find(".select-box-label").text(osc.langs.select_subcategory);
//.........这里部分代码省略.........
开发者ID:jmcclenon,项目名称:Osclass,代码行数:101,代码来源:Item.form.class.php


示例19: related_listings

 function related_listings()
 {
     View::newInstance()->_exportVariableToView('items', array());
     $mSearch = new Search();
     $mSearch->addCategory(osc_item_category_id());
     $mSearch->addRegion(osc_item_region());
     $mSearch->addItemConditions(sprintf("%st_item.pk_i_id < %s ", DB_TABLE_PREFIX, osc_item_id()));
     $mSearch->limit('0', '3');
     $aItems = $mSearch->doSearch();
     $iTotalItems = count($aItems);
     if ($iTotalItems == 3) {
         View::newInstance()->_exportVariableToView('items', $aItems);
         return $iTotalItems;
     }
     unset($mSearch);
     $mSearch = new Search();
     $mSearch->addCategory(osc_item_category_id());
     $mSearch->addItemConditions(sprintf("%st_item.pk_i_id != %s ", DB_TABLE_PREFIX, osc_item_id()));
     $mSearch->limit('0', '3');
     $aItems = $mSearch->doSearch();
     $iTotalItems = count($aItems);
     if ($iTotalItems > 0) {
         View::newInstance()->_exportVariableToView('items', $aItems);
         return $iTotalItems;
     }
     unset($mSearch);
     return 0;
 }
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:28,代码来源:functions.php


示例20: osc_item_url

        $item_url = osc_item_url();
        $img_title = osc_item_title();
        if (!empty($resource) || $resource != "") {
            $resource_path = osc_apply_filter('resource_path', osc_base_url() . $resource[0]['s_path']);
            $img_source = (string) $resource_path . $resource[0]['pk_i_id'] . "." . $resource[0]['s_extension'];
        } else {
            $img_source = osc_current_web_theme_url('images/no-image-available.png');
        }
        $total_listing = get_total_listing_by_parent($sa['cat_id']);
        $total_item_views = get_total_item_views($sa['cat_id']);
        if ($total_item_views == null || empty($total_item_views)) {
            $total_item_views = '0';
        } else {
            $total_item_views = $total_item_views[0]['TotalViews'];
        }
        $category_name = get_parent_category_name(osc_item_category_id());
    }
    ?>
                <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                    <div class="automobile">
                        <h5 class="auto"><?php 
    echo $category_name;
    ?>
</h5>
                            <a href="<?php 
    echo $item_url;
    ?>
">
                                <img src="<?php 
    echo $img_source;
    ?>
开发者ID:jhalendra,

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP osc_item_city函数代码示例发布时间:2022-05-15
下一篇:
PHP osc_item_category函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap