本文整理汇总了PHP中osc_item_category_id函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_item_category_id函数的具体用法?PHP osc_item_category_id怎么用?PHP osc_item_category_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_item_category_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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';
}
}
示例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';
}
}
示例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;
}
示例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
示例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';
}
示例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";
}
}
示例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>';
}
//.........这里部分代码省略.........
示例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
示例9: osc_item_formated_price
if (osc_price_enabled_at_items()) {
?>
<small><strong><?php
echo osc_item_formated_price();
?>
</strong></small> · <?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
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
//.........这里部分代码省略.........