本文整理汇总了PHP中osc_count_item_resources函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_count_item_resources函数的具体用法?PHP osc_count_item_resources怎么用?PHP osc_count_item_resources使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_count_item_resources函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: google_cars
function google_cars()
{
echo '<rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>' . osc_page_title() . '</title>
<description>' . osc_page_description() . '</description>
<link>' . osc_base_url() . '</link>';
if (osc_count_items()) {
while (osc_has_items()) {
$item = feed_get_car_data(osc_item());
$date = date('d/m/Y');
$time = date('H:i');
if (preg_match('|([0-9]{4})-([0-9]{2})-([0-9]{2})|', osc_item_pub_date(), $tmp)) {
$date = $tmp[3] . "/" . $tmp[2] . "/" . $tmp[1];
}
echo '<item>
<title>' . osc_item_title() . '</title>
<description>' . osc_item_description() . '</description>
<g:id>' . osc_item_id() . '</g:id>
<link>' . osc_item_url() . '</link>
<g:location>' . (osc_item_address() != '' ? osc_item_address() : '') . ', ' . (osc_item_city() != '' ? osc_item_city() : '') . ', ' . (osc_item_region() != '' ? osc_item_region() : '') . ', ' . (osc_item_zip() != '' ? osc_item_zip() : '') . ' ' . (osc_item_country() != '' ? osc_item_country() : '') . '</g:location>
<g:publish_date>' . $date . '</g:publish_date>
<g:color>' . (isset($item['s_color']) ? $item['s_color'] : '') . '</g:color>
<g:condition>' . (isset($item['b_new']) && $item['b_new'] == 1 ? 'new' : 'used') . '</g:condition>';
if (osc_count_item_resources() > 0) {
while (osc_has_item_resources()) {
if (strpos(osc_resource_type(), 'image') !== FALSE) {
echo '<g:image_link>' . osc_resource_path() . '</g:image_link>';
}
}
}
echo '<g:make>' . (isset($item['s_make']) ? $item['s_make'] : '') . '</g:make>
<g:mileage>' . (isset($item['i_mileage']) ? $item['i_mileage'] : '') . '</g:mileage>
<g:model>' . (isset($item['s_model']) ? $item['s_model'] : '') . '</g:model>
<g:price>' . (osc_item_price() != '' ? osc_item_price() : '') . '</g:price>
<g:vehicle_type>' . (isset($item['s_name']) ? $item['s_name'] : '') . '</g:vehicle_type>
<g:year>' . (isset($item['i_year']) ? $item['i_year'] : '') . '</g:year>
</item>';
}
}
echo '</channel>
</rss>';
}
示例2: getImage
function getImage()
{
if (getUrl() == osc_base_url()) {
if (file_exists(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
$image = osc_current_web_theme_url('images/logo.jpg');
} else {
$image = osc_current_web_theme_url('images/default-logo.jpg');
}
} else {
if (osc_images_enabled_at_items()) {
if (osc_count_item_resources() > 0) {
$image = osc_resource_url();
} else {
$image = osc_current_web_theme_url('images/logo.jpg');
}
} else {
$image = osc_current_web_theme_url('images/logo.jpg');
}
}
return $image;
}
示例3: while
?>
<?php
} else {
?>
<?php
while (osc_has_latest_items()) {
?>
<div class="item wow fadeInUp animated">
<div class="list">
<?php
if (osc_images_enabled_at_items()) {
?>
<div class="image">
<div>
<?php
if (osc_count_item_resources()) {
?>
<a href="<?php
echo osc_item_url();
?>
"><img src="<?php
echo osc_resource_preview_url();
?>
" alt="<?php
echo osc_item_title();
?>
" class="img-responsive" /></a>
<?php
} else {
?>
<a href="<?php
示例4: doModel
//.........这里部分代码省略.........
break;
}
}
$p_iOrderType = $orderType;
}
}
// FILTERING USER
if ($p_sUser != '') {
$this->mSearch->fromUser($p_sUser);
}
// FILTERING IF WE ONLY WANT ITEMS WITH PICS
if ($p_bPic) {
$this->mSearch->withPicture(true);
}
//FILTERING BY RANGE PRICE
$this->mSearch->priceRange($p_sPriceMin, $p_sPriceMax);
//ORDERING THE SEARCH RESULTS
$this->mSearch->order($p_sOrder, $allowedTypesForSorting[$p_iOrderType]);
//SET PAGE
$this->mSearch->page($p_iPage, $p_iPageSize);
osc_run_hook('search_conditions', Params::getParamsAsArray());
if (!Params::existParam('sFeed')) {
// RETRIEVE ITEMS AND TOTAL
$aItems = $this->mSearch->doSearch();
$iTotalItems = $this->mSearch->count();
$iStart = $p_iPage * $p_iPageSize;
$iEnd = min(($p_iPage + 1) * $p_iPageSize, $iTotalItems);
$iNumPages = ceil($iTotalItems / $p_iPageSize);
osc_run_hook('search', $this->mSearch);
//preparing variables...
$regionName = $p_sRegion;
if (is_numeric($p_sRegion)) {
$r = Region::newInstance()->findByPrimaryKey($p_sRegion);
if ($r) {
$regionName = $r['s_name'];
}
}
$cityName = $p_sCity;
if (is_numeric($p_sCity)) {
$c = City::newInstance()->findByPrimaryKey($p_sCity);
if ($c) {
$cityName = $c['s_name'];
}
}
//$this->_exportVariableToView('non_empty_categories', $aCategories) ;
$this->_exportVariableToView('search_start', $iStart);
$this->_exportVariableToView('search_end', $iEnd);
$this->_exportVariableToView('search_category', $p_sCategory);
// hardcoded - non pattern and order by relevance
$p_sOrder = $old_order;
$this->_exportVariableToView('search_order_type', $p_iOrderType);
$this->_exportVariableToView('search_order', $p_sOrder);
$this->_exportVariableToView('search_pattern', $p_sPattern);
$this->_exportVariableToView('search_from_user', $p_sUser);
$this->_exportVariableToView('search_total_pages', $iNumPages);
$this->_exportVariableToView('search_page', $p_iPage);
$this->_exportVariableToView('search_has_pic', $p_bPic);
$this->_exportVariableToView('search_region', $regionName);
$this->_exportVariableToView('search_city', $cityName);
$this->_exportVariableToView('search_price_min', $p_sPriceMin);
$this->_exportVariableToView('search_price_max', $p_sPriceMax);
$this->_exportVariableToView('search_total_items', $iTotalItems);
$this->_exportVariableToView('items', $aItems);
$this->_exportVariableToView('search_show_as', $p_sShowAs);
$this->_exportVariableToView('search', $this->mSearch);
// json
$json = $this->mSearch->toJson();
$this->_exportVariableToView('search_alert', base64_encode($json));
//calling the view...
$this->doView('search.php');
} else {
$this->mSearch->page(0, osc_num_rss_items());
// RETRIEVE ITEMS AND TOTAL
$iTotalItems = $this->mSearch->count();
$aItems = $this->mSearch->doSearch();
$this->_exportVariableToView('items', $aItems);
if ($p_sFeed == '' || $p_sFeed == 'rss') {
// FEED REQUESTED!
header('Content-type: text/xml; charset=utf-8');
$feed = new RSSFeed();
$feed->setTitle(__('Latest listings added') . ' - ' . osc_page_title());
$feed->setLink(osc_base_url());
$feed->setDescription(__('Latest listings added in') . ' ' . osc_page_title());
if (osc_count_items() > 0) {
while (osc_has_items()) {
if (osc_count_item_resources() > 0) {
osc_has_item_resources();
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"), 'description' => osc_item_description(), 'dt_pub_date' => osc_item_pub_date(), 'image' => array('url' => htmlentities(osc_resource_thumbnail_url(), ENT_COMPAT, "UTF-8"), 'title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"))));
} else {
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"), 'description' => osc_item_description(), 'dt_pub_date' => osc_item_pub_date()));
}
}
}
osc_run_hook('feed', $feed);
$feed->dumpXML();
} else {
osc_run_hook('feed_' . $p_sFeed, $aItems);
}
}
}
示例5: doModel
//.........这里部分代码省略.........
foreach ($p_sCityArea as $city_area) {
$this->mSearch->addCityArea($city_area);
}
$p_sCityArea = implode(", ", $p_sCityArea);
//FILTERING CITY
foreach ($p_sCity as $city) {
$this->mSearch->addCity($city);
}
$p_sCity = implode(", ", $p_sCity);
//FILTERING REGION
foreach ($p_sRegion as $region) {
$this->mSearch->addRegion($region);
}
$p_sRegion = implode(", ", $p_sRegion);
//FILTERING COUNTRY
foreach ($p_sCountry as $country) {
$this->mSearch->addCountry($country);
}
$p_sCountry = implode(", ", $p_sCountry);
// FILTERING PATTERN
if ($p_sPattern != '') {
$this->mSearch->addConditions(sprintf("MATCH(d.s_title, d.s_description) AGAINST('%s' IN BOOLEAN MODE)", $p_sPattern));
$osc_request['sPattern'] = $p_sPattern;
}
// FILTERING USER
if ($p_sUser != '') {
$this->mSearch->fromUser(explode(",", $p_sUser));
}
// FILTERING IF WE ONLY WANT ITEMS WITH PICS
if ($p_bPic) {
$this->mSearch->withPicture(true);
}
//FILTERING BY RANGE PRICE
$this->mSearch->priceRange($p_sPriceMin, $p_sPriceMax);
//ORDERING THE SEARCH RESULTS
$this->mSearch->order($p_sOrder, $allowedTypesForSorting[$p_iOrderType]);
//SET PAGE
$this->mSearch->page($p_iPage, $p_iPageSize);
osc_run_hook('search_conditions', Params::getParamsAsArray());
if (!Params::existParam('sFeed')) {
// RETRIEVE ITEMS AND TOTAL
$aItems = $this->mSearch->doSearch();
$iTotalItems = $this->mSearch->count();
$iStart = $p_iPage * $p_iPageSize;
$iEnd = min(($p_iPage + 1) * $p_iPageSize, $iTotalItems);
$iNumPages = ceil($iTotalItems / $p_iPageSize);
osc_run_hook('search', $this->mSearch);
//preparing variables...
//$this->_exportVariableToView('non_empty_categories', $aCategories) ;
$this->_exportVariableToView('search_start', $iStart);
$this->_exportVariableToView('search_end', $iEnd);
$this->_exportVariableToView('search_category', $p_sCategory);
$this->_exportVariableToView('search_order_type', $p_iOrderType);
$this->_exportVariableToView('search_order', $p_sOrder);
$this->_exportVariableToView('search_pattern', $p_sPattern);
$this->_exportVariableToView('search_from_user', $p_sUser);
$this->_exportVariableToView('search_total_pages', $iNumPages);
$this->_exportVariableToView('search_page', $p_iPage);
$this->_exportVariableToView('search_has_pic', $p_bPic);
$this->_exportVariableToView('search_region', $p_sRegion);
$this->_exportVariableToView('search_city', $p_sCity);
$this->_exportVariableToView('search_price_min', $p_sPriceMin);
$this->_exportVariableToView('search_price_max', $p_sPriceMax);
$this->_exportVariableToView('search_total_items', $iTotalItems);
$this->_exportVariableToView('items', $aItems);
$this->_exportVariableToView('search_show_as', $p_sShowAs);
$this->_exportVariableToView('search', $this->mSearch);
$this->_exportVariableToView('search_alert', base64_encode(serialize($this->mSearch)));
//calling the view...
$this->doView('search.php');
} else {
$this->mSearch->page(0, osc_num_rss_items());
// RETRIEVE ITEMS AND TOTAL
$iTotalItems = $this->mSearch->count();
$aItems = $this->mSearch->doSearch();
$this->_exportVariableToView('items', $aItems);
if ($p_sFeed == '' || $p_sFeed == 'rss') {
// FEED REQUESTED!
header('Content-type: text/xml; charset=utf-8');
$feed = new RSSFeed();
$feed->setTitle(__('Latest items added') . ' - ' . osc_page_title());
$feed->setLink(osc_base_url());
$feed->setDescription(__('Latest items added in') . ' ' . osc_page_title());
if (osc_count_items() > 0) {
while (osc_has_items()) {
if (osc_count_item_resources() > 0) {
osc_has_item_resources();
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url()), 'description' => osc_item_description(), 'dt_pub_date' => osc_item_pub_date(), 'image' => array('url' => htmlentities(osc_resource_thumbnail_url()), 'title' => osc_item_title(), 'link' => htmlentities(osc_item_url()))));
} else {
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url()), 'description' => osc_item_description(), 'dt_pub_date' => osc_item_pub_date()));
}
}
}
osc_run_hook('feed', $feed);
$feed->dumpXML();
} else {
osc_run_hook('feed_' . $p_sFeed, $aItems);
}
}
}
示例6: osc_resource_url
" /> </a>
<div class="thumbs">
<?php
for ($i = 0; osc_has_item_resources(); $i++) {
?>
<a href="<?php
echo osc_resource_url();
?>
" class="fancybox" data-fancybox-group="group" title="<?php
_e('Image', 'osclasswizards');
?>
<?php
echo $i + 1;
?>
/ <?php
echo osc_count_item_resources();
?>
"> <img src="<?php
echo osc_resource_thumbnail_url();
?>
" width="75" alt="<?php
echo osc_item_title();
?>
" title="<?php
echo osc_item_title();
?>
" class="img-responsive" /> </a>
<?php
}
?>
</div>
示例7: doModel
//.........这里部分代码省略.........
$iTotalItems = null;
if ($cache) {
$aItems = $cache['aItems'];
$iTotalItems = $cache['iTotalItems'];
} else {
$aItems = $this->mSearch->doSearch();
$iTotalItems = $this->mSearch->count();
$_cache['aItems'] = $aItems;
$_cache['iTotalItems'] = $iTotalItems;
osc_cache_set($key, $_cache, OSC_CACHE_TTL);
}
$iStart = $p_iPage * $p_iPageSize;
$iEnd = min(($p_iPage + 1) * $p_iPageSize, $iTotalItems);
$iNumPages = ceil($iTotalItems / $p_iPageSize);
// works with cache enabled ?
osc_run_hook('search', $this->mSearch);
//preparing variables...
$countryName = $p_sCountry;
if (strlen($p_sCountry) == 2) {
$c = Country::newInstance()->findByCode($p_sCountry);
if ($c) {
$countryName = $c['s_name'];
}
}
$regionName = $p_sRegion;
if (is_numeric($p_sRegion)) {
$r = Region::newInstance()->findByPrimaryKey($p_sRegion);
if ($r) {
$regionName = $r['s_name'];
}
}
$cityName = $p_sCity;
if (is_numeric($p_sCity)) {
$c = City::newInstance()->findByPrimaryKey($p_sCity);
if ($c) {
$cityName = $c['s_name'];
}
}
$this->_exportVariableToView('search_start', $iStart);
$this->_exportVariableToView('search_end', $iEnd);
$this->_exportVariableToView('search_category', $p_sCategory);
// hardcoded - non pattern and order by relevance
$p_sOrder = $old_order;
$this->_exportVariableToView('search_order_type', $p_iOrderType);
$this->_exportVariableToView('search_order', $p_sOrder);
$this->_exportVariableToView('search_pattern', $p_sPattern);
$this->_exportVariableToView('search_from_user', $p_sUser);
$this->_exportVariableToView('search_total_pages', $iNumPages);
$this->_exportVariableToView('search_page', $p_iPage);
$this->_exportVariableToView('search_has_pic', $p_bPic);
$this->_exportVariableToView('search_only_premium', $p_bPremium);
$this->_exportVariableToView('search_country', $countryName);
$this->_exportVariableToView('search_region', $regionName);
$this->_exportVariableToView('search_city', $cityName);
$this->_exportVariableToView('search_price_min', $p_sPriceMin);
$this->_exportVariableToView('search_price_max', $p_sPriceMax);
$this->_exportVariableToView('search_total_items', $iTotalItems);
$this->_exportVariableToView('items', $aItems);
$this->_exportVariableToView('search_show_as', $p_sShowAs);
$this->_exportVariableToView('search', $this->mSearch);
// json
$json = $this->mSearch->toJson();
$encoded_alert = base64_encode(osc_encrypt_alert($json));
// Create the HMAC signature and convert the resulting hex hash into base64
$stringToSign = osc_get_alert_public_key() . $encoded_alert;
$signature = hex2b64(hmacsha1(osc_get_alert_private_key(), $stringToSign));
$server_signature = Session::newInstance()->_set('alert_signature', $signature);
$this->_exportVariableToView('search_alert', $encoded_alert);
// calling the view...
if (count($aItems) === 0) {
header('HTTP/1.1 404 Not Found');
}
osc_run_hook("after_search");
if (!Params::existParam('sFeed')) {
$this->doView('search.php');
} else {
if ($p_sFeed == '' || $p_sFeed == 'rss') {
// FEED REQUESTED!
header('Content-type: text/xml; charset=utf-8');
$feed = new RSSFeed();
$feed->setTitle(__('Latest listings added') . ' - ' . osc_page_title());
$feed->setLink(osc_base_url());
$feed->setDescription(__('Latest listings added in') . ' ' . osc_page_title());
if (osc_count_items() > 0) {
while (osc_has_items()) {
if (osc_count_item_resources() > 0) {
osc_has_item_resources();
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"), 'description' => osc_item_description(), 'country' => osc_item_country(), 'region' => osc_item_region(), 'city' => osc_item_city(), 'city_area' => osc_item_city_area(), 'category' => osc_item_category(), 'dt_pub_date' => osc_item_pub_date(), 'image' => array('url' => htmlentities(osc_resource_thumbnail_url(), ENT_COMPAT, "UTF-8"), 'title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"))));
} else {
$feed->addItem(array('title' => osc_item_title(), 'link' => htmlentities(osc_item_url(), ENT_COMPAT, "UTF-8"), 'description' => osc_item_description(), 'country' => osc_item_country(), 'region' => osc_item_region(), 'city' => osc_item_city(), 'city_area' => osc_item_city_area(), 'category' => osc_item_category(), 'dt_pub_date' => osc_item_pub_date()));
}
}
}
osc_run_hook('feed', $feed);
$feed->dumpXML();
} else {
osc_run_hook('feed_' . $p_sFeed, $aItems);
}
}
}
示例8: _e
?>
</div>
<?php
if (osc_images_enabled_at_items()) {
?>
<div class="box photos">
<h2><?php
_e('Photos', 'modern');
?>
</h2>
<?php
ItemForm::photos();
?>
<div id="photos">
<?php
if (osc_max_images_per_item() == 0 || osc_max_images_per_item() != 0 && osc_count_item_resources() < osc_max_images_per_item()) {
?>
<div class="row">
<input type="file" name="photos[]" />
</div>
<?php
}
?>
</div>
<a href="#" onclick="addNewPhoto(); return false;"><?php
_e('Add new photo', 'modern');
?>
</a>
</div>
<?php
}
示例9: _e
?>
" />
<figcaption class="orbit-caption show-for-sr"><?php
_e('Image', 'osclassclsx');
?>
<?php
echo $i + 1;
?>
/ <?php
echo osc_count_item_resources();
?>
</figcaption>
</li>
<?php
// Save the thumbnails
$orbit_bullets .= sprintf($bullet_format, $i == 0 ? 'is-active' : '', $i, _('Image', 'osclassclsx') . ' / ' . osc_count_item_resources(), _('Image', 'osclassclsx') . ' / ' . osc_count_item_resources(), osc_resource_thumbnail_url(), osc_item_title(), osc_item_title());
?>
<?php
}
?>
</ul>
<nav class="orbit-bullets">
<?php
echo $orbit_bullets;
?>
</nav>
</div>
</div>
<?php
}
?>
示例10: oodle_realstate
function oodle_realstate()
{
echo '<?xml version="1.0" encoding="utf-8"?><listings>';
if (osc_count_items()) {
while (osc_has_items()) {
$item = feed_get_house_data(osc_item());
$time = explode(" ", osc_item_pub_date());
if (isset($item['s_square_meters'])) {
$lot_size = $item['s_square_meters'] * 10.7639104;
} else {
$lot_size = 0;
}
$amenities = array();
if (isset($item['b_heating']) && $item['b_heating']) {
$amenities[] = __('Heating', 'extra_feeds');
}
if (isset($item['b_air_condition']) && $item['b_air_condition']) {
$amenities[] = __('Air condition', 'extra_feeds');
}
if (isset($item['b_elevator']) && $item['b_elevator']) {
$amenities[] = __('Elevator', 'extra_feeds');
}
if (isset($item['b_terrace']) && $item['b_terrace']) {
$amenities[] = __('Terrace', 'extra_feeds');
}
if (isset($item['b_parking']) && $item['b_parking']) {
$amenities[] = __('Parking', 'extra_feeds');
}
echo '<listing>
<category>' . osc_item_category() . '</category>
<description><![CDATA[' . osc_item_description() . ']]></description>
<id>' . osc_item_id() . '</id>
<title><![CDATA[' . osc_item_title() . ']]></title>
<url>' . osc_item_url() . '</url>
<address>' . osc_item_address() . '</address>
<city>' . osc_item_city() . '</city>
<country>' . osc_item_country_code() . '</country>
<neighborhood>' . osc_item_city_area() . '</neighborhood>
<state>' . osc_item_region() . '</state>
<zip_code>' . osc_item_zip() . '</zip_code>
<longitude>' . osc_item_longitude() . '</longitude>
<latitude>' . osc_item_latitude() . '</latitude>
<amenities>' . implode(", ", $amenities) . '</amenities>
<bathrooms>' . @$item['i_num_bathrooms'] . '</bathrooms>
<bedrooms>' . @$item['i_num_rooms'] . '</bedrooms>
<condition>' . @$item['e_status'] . '</condition>
<create_time>' . $time[0] . '</create_time>
<currency>' . osc_item_currency() . '</currency>
<furnished>' . (@$item['b_furnished'] ? 'Furnished' : '') . '</furnished>';
if (osc_count_item_resources() > 0) {
if (strpos(osc_resource_type(), 'image') !== FALSE) {
echo '<image_url><![CDATA[' . osc_resource_path() . ']]></image_url>';
}
}
echo '<lot_size>' . $lot_size . '</lot_size>
<lot_size_units>square feet</lot_size_units>
<price>' . osc_item_price() . '</price>
<seller_email>' . osc_item_contact_email() . '</seller_email>
<seller_name><![CDATA[' . osc_item_contact_name() . ']]></seller_name>
<year>' . @$item['i_year'] . '</year>
</listing>';
}
}
echo '</listings>';
}
示例11: osc_item_meta_value
echo osc_item_meta_value();
?>
</p>
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
osc_run_hook('item_detail', osc_item());
?>
<?php
if (osc_images_enabled_at_items() && osc_count_item_resources() > 0) {
?>
<div class="photos">
<ul class="media-grid">
<?php
while (osc_has_item_resources()) {
?>
<li>
<a rel="image_group" href="<?php
echo osc_resource_url();
?>
"><img src="<?php
echo osc_resource_thumbnail_url();
?>
" width="150" alt="<?php
echo osc_item_title();
示例12: while
while (osc_has_custom_items()) {
?>
<div class="item <?php
if ($ltd == osc_item_id()) {
echo "current";
}
?>
clearfix">
<div class="row">
<?php
if (osc_images_enabled_at_items()) {
?>
<div class="col-md-4 col-sm-4 col-xs-4 picture">
<?php
if (osc_count_item_resources() >= 1) {
?>
<a href="<?php
echo osc_item_url();
?>
"><img class="img-responsive" src="<?php
echo osc_resource_thumbnail_url();
?>
" alt="<?php
echo osc_item_title();
?>
" /></a>
<?php
} else {
?>
<a href="<?php
示例13: trovit_cars
function trovit_cars()
{
echo '<?xml version="1.0" encoding="utf-8"?>
<trovit>';
if (osc_count_items()) {
while (osc_has_items()) {
$item = feed_get_car_data(osc_item());
$date = date('d/m/Y');
$time = date('H:i');
if (preg_match('|([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})|', osc_item_pub_date(), $tmp)) {
$date = $tmp[3] . "/" . $tmp[2] . "/" . $tmp[1];
$time = $tmp[4] . ":" . $tmp[5];
}
echo '<ad>
<id><![CDATA[' . osc_item_id() . ']]></id>
<url><![CDATA[' . osc_item_url() . ']]></url>
<title><![CDATA[' . osc_item_title() . ']]></title>
<content><![CDATA[' . osc_item_description() . ']]></content>
<price><![CDATA[' . osc_item_price() . ']]></price>
<make><![CDATA[' . (isset($item['s_make']) ? $item['s_make'] : '') . ']]></make>
<model><![CDATA[' . (isset($item['s_model']) ? $item['s_model'] : '') . ']]></model>
<color><![CDATA[' . (isset($item['s_color']) ? $item['s_color'] : '') . ']]></color>
<mileage><![CDATA[' . (isset($item['i_mileage']) ? $item['i_mileage'] : '') . ']]></mileage>
<doors><![CDATA[' . (isset($item['i_doors']) ? $item['i_doors'] : '') . ']]></doors>
<fuel><![CDATA[' . (isset($item['e_fuel']) ? $item['e_fuel'] : '') . ']]></fuel>
<transmission><![CDATA[' . (isset($item['e_transmission']) ? $item['e_transmission'] : '') . ']]></transmission>
<engine_size><![CDATA[' . (isset($item['i_engine_size']) ? $item['i_engine_size'] : '') . ']]></engine_size>
<cylinders><![CDATA[' . (isset($item['i_cylinders']) ? $item['i_cylinders'] : '') . ']]></cylinders>
<power unit="' . (isset($item['e_power_unit']) ? $item['e_power_unit'] : '') . '"><![CDATA[' . (isset($item['i_power']) ? $item['i_power'] : '') . ']]></power>
<seats><![CDATA[' . (isset($item['i_seats']) ? $item['i_seats'] : '') . ']]></seats>
<gears><![CDATA[' . (isset($item['i_gears']) ? $item['i_gears'] : '') . ']]></gears>
<address><![CDATA[' . (osc_item_address() != '' ? osc_item_address() : '') . ']]></address>
<city><![CDATA[' . (osc_item_city() != '' ? osc_item_city() : '') . ']]></city>
<city_area><![CDATA[' . (osc_item_city_area() != '' ? osc_item_city_area() : '') . ']]></city_area>
<postcode><![CDATA[' . (osc_item_zip() != '' ? osc_item_zip() : '') . ']]></postcode>
<region><![CDATA[' . (osc_item_region() != '' ? osc_item_region() : '') . ']]></region>
<latitude><![CDATA[' . (osc_item_latitude() != '' ? osc_item_latitude() : '') . ']]></latitude>
<longitude><![CDATA[' . (osc_item_longitude() != '' ? osc_item_longitude() : '') . ']]></longitude>';
$res_string = '';
if (osc_count_item_resources() > 0) {
while (osc_has_item_resources()) {
if (strpos(osc_resource_type(), 'image') !== FALSE) {
$res_string .= '<picture>
<picture_url><![CDATA[' . osc_resource_path() . ']]></picture_url>
<picture_title><![CDATA[' . osc_resource_name() . ']]></picture_title>
</picture>';
}
}
}
if ($res_string != '') {
echo '<pictures>' . $res_string . '</pictures>';
}
echo '
<date><![CDATA[' . $date . ']]></date>
<time><![CDATA[' . $time . ']]></time>
</ad>';
}
}
echo '</trovit>';
}