本文整理汇总了PHP中DJClassifiedsSEO::getCategoryRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP DJClassifiedsSEO::getCategoryRoute方法的具体用法?PHP DJClassifiedsSEO::getCategoryRoute怎么用?PHP DJClassifiedsSEO::getCategoryRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DJClassifiedsSEO
的用法示例。
在下文中一共展示了DJClassifiedsSEO::getCategoryRoute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paymentReturn
function paymentReturn()
{
$app = JFactory::getApplication();
$id = JRequest::getInt("id", "");
$cid = JRequest::getInt("cid", "");
$itemid = JRequest::getInt("Itemid", "");
$r = JRequest::getVar("r", "");
if ($r == 'ok') {
//$redirect= 'index.php?option=com_djclassifieds&view=item&id='.$id.'&cid='.$cid.'&Itemid='.$itemid;
$message = JTExt::_('COM_DJCLASSIFIEDS_THANKS_FOR_PAYMENT_WAIT_FOR_CONFIRMATION');
} else {
$message = JTExt::_('COM_DJCLASSIFIEDS_PAYMENT_CANCELED');
}
//$redirect= 'index.php?option=com_djclassifieds&view=items&cid=0&Itemid='.$itemid;
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message);
}
示例2: display
public function display($cachable = false, $urlparams = array())
{
$app = JFactory::getApplication();
/* $menus = JSite::getMenu();
$menu_item = $menus->getItems('link','index.php?option=com_djclassifieds&view=items&cid=0',1);
$menu_item_blog = $menus->getItems('link','index.php?option=com_djclassifieds&view=items&layout=blog&cid=0',1);
$itemid = '';
if($menu_item){
$itemid='&Itemid='.$menu_item->id;
}else if($menu_item_blog){
$itemid='&Itemid='.$menu_item_blog->id;
}
*/
JRequest::setVar('view', 'item');
$user = JFactory::getUser();
$id = JRequest::getVar('id', 0, '', 'int');
$db = JFactory::getDBO();
$query = "SELECT date_exp, user_id, published FROM #__djcf_items WHERE id=" . $id;
$db->setQuery($query);
$item = $db->loadObject();
if ($item->published == 0) {
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$message = JText::_("COM_DJCLASSIFIEDS_ITEM_NOT_AVAILABLE");
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message);
}
$date_now = JFactory::getDate();
if ($date_now < $item->date_exp || $item->user_id == $user->id) {
$query = "UPDATE `#__djcf_items` SET display=display+1 WHERE id=" . $id;
$db->setQuery($query);
$db->query();
parent::display();
} else {
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$message = JText::_("COM_DJCLASSIFIEDS_ITEM_NOT_AVAILABLE");
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message);
}
}
示例3: getItem
function getItem($id)
{
$db = JFactory::getDBO();
$app = JFactory::getApplication();
$date_now = date("Y-m-d H:i:s");
$quantity = JRequest::getInt('quantity', 0);
$query = "SELECT i.*, c.name as c_name, c.alias as c_alias FROM #__djcf_items i " . "LEFT JOIN #__djcf_categories c ON c.id=i.cat_id " . "WHERE i.id=" . $id . " AND i.published=1 AND c.published=1 AND i.date_start <= '" . $date_now . "' AND i.date_exp >= '" . $date_now . "' LIMIT 1";
$db->setQuery($query);
$item = $db->loadObject();
if (!$item) {
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$message = JText::_("COM_DJCLASSIFIEDS_ITEM_NOT_AVAILABLE");
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message);
} else {
if ($quantity > $item->quantity) {
$redirect = DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias);
$message = JText::_("COM_DJCLASSIFIEDS_NUMBER_OF_PRODUCTS_IS_LESS_THEN_SELECTED");
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message);
}
}
return $item;
}
示例4:
if ($cid == $c->id) {
$cl = 'active current';
} else {
$cl = 'active';
}
if ($c->have_childs) {
$cl .= ' deeper';
}
}
if ($c->have_childs) {
if ($cl) {
$cl .= ' ';
}
$cl .= 'parent';
}
echo '<li class="' . $cl . '"><a href="' . JRoute::_(DJClassifiedsSEO::getCategoryRoute($c->id . ':' . $c->alias)) . '">' . $c->name . '</a>';
$c_count++;
}
if ($prev_l > 0) {
for ($i = 0; $i < $prev_l; $i++) {
echo '</li></ul>';
}
}
?>
</ul>
<?php
}
if ($params->get('new_ad_link', '0') == 2) {
echo '<div class="newad_link_bottom"><a class="button" href="' . $new_ad_link . '">' . JText::_('MOD_DJCLASSIFIEDS_MENU_NEW_ADD') . '</a></div>';
}
示例5:
}
echo '</div>';
}
}
if ($icon_fav) {
echo ' <img src="' . JURI::base() . '/components/com_djclassifieds/assets/images/fav_a.png" width="16px" class="fav_ico"/>';
}
if ($icon_new) {
echo ' <span class="new_icon">' . JText::_('COM_DJCLASSIFIEDS_NEW') . '</span>';
}
if (strstr($i->promotions, 'p_special')) {
echo ' <img src="' . JURI::base() . '/components/com_djclassifieds/themes/' . $this->theme . '/images/promo_star.png" width="31px" class="prom_ico"/>';
}
echo '</td>';
if ($par->get('column_category', '1')) {
echo '<td class="cat_name"><a href="' . DJClassifiedsSEO::getCategoryRoute($i->cat_id . ':' . $i->c_alias) . '" >' . $i->c_name . '</a></td>';
}
if ($par->get('column_desc', '1')) {
echo '<td class="description"><a class="title" href="' . DJClassifiedsSEO::getItemRoute($i->id . ':' . $i->alias, $i->cat_id . ':' . $i->c_alias) . $anch . '">';
echo mb_substr(strip_tags($i->intro_desc), 0, $par->get('introdesc_char_limit', '120'), 'UTF-8');
echo '</a></td>';
}
if ($par->get('column_loc', '1') && $par->get('show_regions', '1')) {
echo '<td class="region"><a href="index.php?option=com_djclassifieds&view=items&se=1&se_regs[]=' . $i->region_id . '&Itemid=' . $Itemid . '">' . $i->r_name . '</td>';
}
if ($par->get('column_price', '1') && $par->get('show_price', '1')) {
echo '<td class="price">';
if ($i->price) {
echo DJClassifiedsTheme::priceFormat($i->price, $i->currency);
} else {
echo '---';
示例6: _paymentError
function _paymentError($msg)
{
$app = JFactory::getApplication();
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $msg);
}
示例7: display
function display($tpl = null)
{
$model = $this->getModel();
$par = JComponentHelper::getParams('com_djclassifieds');
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$dispatcher = JDispatcher::getInstance();
$theme = $par->get('theme', 'default');
$item = $model->getItem();
$item_images = DJClassifiedsImage::getAdsImages($item->id);
$category = $model->getCategory($item->cat_id);
$fields = $model->getFields($item->cat_id);
$fields_contact = $model->geContactFields();
$item_payments = $model->getItemPayment($item->id);
if ($item->user_id != 0) {
$user_items_c = $model->getUserItemsCount($item->user_id);
$this->assignRef('user_items_c', $user_items_c);
}
$menus = $app->getMenu('site');
$m_active = $menus->getActive();
$cat_menu_path = array();
$cid_menu = 0;
if ($m_active) {
if (strstr($m_active->link, 'com_djclassifieds') && strstr($m_active->link, 'items')) {
$cid_menu = $m_active->query['cid'];
if ($cid_menu > 0) {
$cat_menu_path = DJClassifiedsCategory::getParentPath(1, $cid_menu);
}
}
}
$main_cat_id = $item->cat_id;
$pathway = $app->getPathway();
$cat_path = array();
$cat_theme = '';
if ($category->id != 0) {
$cat_path = DJClassifiedsCategory::getParentPath(1, $category->id);
$main_cat_id = $cat_path[count($cat_path) - 1]->id;
for ($c = count($cat_path); $c > 0; $c--) {
$to_b = 1;
if (count($cat_menu_path)) {
foreach ($cat_menu_path as $cm) {
if ($cm->id == $cat_path[$c - 1]->id) {
$to_b = 0;
break;
}
}
}
if ($to_b) {
$pathway->addItem($cat_path[$c - 1]->name, DJClassifiedsSEO::getCategoryRoute($cat_path[$c - 1]->id . ':' . $cat_path[$c - 1]->alias));
}
}
foreach ($cat_path as $cp) {
if ($cp->theme) {
$cat_theme = $cp->theme;
}
}
}
DJClassifiedsTheme::includeCSSfiles($cat_theme);
if ($cat_theme) {
$this->_addPath('template', JPATH_COMPONENT . '/themes/' . $cat_theme . '/views/item');
$theme = $cat_theme;
}
$regions = $model->getRegions();
$country = '';
$city = '';
$region_name = '';
if ($item->region_id != 0 && $par->get('show_regions', '1')) {
$address = '';
$rid = $item->region_id;
if ($rid != 0) {
while ($rid != 0) {
foreach ($regions as $li) {
if ($li->id == $rid) {
$rid = $li->parent_id;
$address .= $li->name . ', ';
if ($li->country) {
$country = $li->name;
}
if ($li->city) {
$city = $li->name;
}
if (!$region_name) {
$region_name = $li->name;
}
break;
}
}
if ($rid == $item->region_id) {
break;
}
}
}
$address = substr($address, 0, -2);
}
$profile = '';
if ($item->user_id) {
$profile = $model->getProfile($item->user_id);
}
if ($item->metakey != '') {
$document->setMetaData('keywords', $item->metakey);
//.........这里部分代码省略.........
示例8:
echo '<li class="' . $cl . '" >';
echo '<div class="title">';
echo '<a href="' . DJClassifiedsSEO::getCategoryRoute($c->id . ':' . $c->alias) . '">' . $cat_img . '</a>';
echo '<div class="cat_title_desc">';
echo '<h2><a href="' . DJClassifiedsSEO::getCategoryRoute($c->id . ':' . $c->alias) . '">' . $c->name . $items_in_c . '</a></h2>';
if ($c->description) {
echo '<div class="cat_desc">' . $c->description . '</div>';
}
echo '</div>';
echo '</div>';
} else {
if ($cl) {
$cl = 'class="' . $cl . '"';
}
echo '<li ' . $cl . '>';
echo '<a href="' . DJClassifiedsSEO::getCategoryRoute($c->id . ':' . $c->alias) . '">';
echo $cat_img . '<span class="cat_name">' . $c->name . $items_in_c . '</span>';
echo '</a>';
echo $ll_coma;
}
$c_count++;
}
if ($prev_l > 0) {
for ($i = 0; $i < $prev_l; $i++) {
echo '</li></ul>';
}
}
?>
</ul>
<div class="clear_both"></div>
示例9: onAlbumPrepare
/**
* Plugin that returns the object list for DJ-Mediatools album
*
* Each object must contain following properties (mandatory): title, description, image
* Optional properties: link, target (_blank or _self), alt (alt attribute for image)
*
* @param object The album params
*/
public function onAlbumPrepare(&$source, &$params)
{
// Lets check the requirements
$check = $this->onCheckRequirements($source);
if (is_null($check) || is_string($check)) {
return null;
}
$app = JFactory::getApplication();
$default_image = $params->get('plg_classifieds_image');
require_once JPATH_BASE . '/modules/mod_djclassifieds_items/helper.php';
require_once JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_djclassifieds' . DS . 'lib' . DS . 'djtheme.php';
require_once JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_djclassifieds' . DS . 'lib' . DS . 'djseo.php';
$mparams = new JRegistry();
foreach ($params->toArray() as $key => $value) {
if (strpos($key, 'plg_classifieds_') !== FALSE) {
$nkey = substr($key, 16);
switch ($nkey) {
case 'catid':
$mparams->set('cat_id', $value);
break;
case 'follow_category':
$mparams->set('fallow_category', $value);
break;
case 'follow_region':
$mparams->set('fallow_region', $value);
break;
case 'only_promoted':
foreach ($value as $promo) {
$mparams->set('only_' . $promo, 1);
}
break;
default:
$mparams->set($nkey, $value);
break;
}
}
}
// override number of items
$mparams->set('items_nr', $params->get('max_images'));
// we need ads only with images
if (empty($default_image)) {
$mparams->set('only_with_img', 1);
}
//$this->debug($mparams);
$items = modDjClassifiedsItems::getItems($mparams);
$types = modDjClassifiedsItems::getTypes();
$slides = array();
if ($items) {
foreach ($items as $i) {
$slide = (object) array();
if (!empty($i->img_path) && !empty($i->img_name) && !empty($i->img_ext)) {
// DJ-Classifieds 3.2+
$slide->image = $i->img_path . $i->img_name . '_thb.' . $i->img_ext;
} else {
if (!empty($i->image_url)) {
// DJ-Classifieds version < 3.2
$images = explode(';', $i->image_url);
$slide->image = 'components/com_djclassifieds/images/' . $images[0];
} else {
if (!empty($default_image)) {
$slide->image = $default_image;
} else {
continue;
}
}
}
// we got image now take extra information
$slide->extra = '';
if ($mparams->get('show_date') == 1) {
$slide->extra .= '<div class="date">';
if (method_exists('DJClassifiedsTheme', 'formatDate')) {
$slide->extra .= DJClassifiedsTheme::formatDate(strtotime($i->date_start));
} else {
$slide->extra .= DJClassifiedsTheme::dateFormatFromTo(strtotime($i->date_start));
}
$slide->extra .= '</div>';
}
if ($mparams->get('show_cat') == 1) {
$slide->extra .= '<div class="category">';
if ($mparams->get('cat_link') == 1) {
$slide->extra .= '<a class="title_cat" href="' . JRoute::_(DJClassifiedsSEO::getCategoryRoute($i->cat_id . ':' . $i->c_alias)) . '">' . $i->c_name . '</a>';
} else {
$slide->extra .= $i->c_name;
}
$slide->extra .= '</div>';
}
if ($mparams->get('show_type') && $i->type_id > 0) {
if (isset($types[$i->type_id])) {
$slide->extra .= '<div class="type">';
$type = $types[$i->type_id];
if ($type->params->bt_class) {
$bt_class = ' ' . $type->params->bt_class;
//.........这里部分代码省略.........
示例10: defined
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DJ Classifieds. If not, see <http://www.gnu.org/licenses/>.
*
*/
defined('_JEXEC') or die('Restricted access');
$par = JComponentHelper::getParams('com_djclassifieds');
$max_level = $params->get('max_level', '0');
$config = JFactory::getConfig();
if ($params->get('results_itemid', 0)) {
$se_results_link = 'index.php?option=com_djclassifieds&view=items&cid=0&Itemid=' . $params->get('results_itemid', 0);
$se_results_link = JRoute::_($se_results_link);
} else {
$se_results_link = JRoute::_(DJClassifiedsSEO::getCategoryRoute('0:all'));
}
if ($config->get('sef')) {
$se_results_link .= '?se=1&re=1&se_regs=';
} else {
$se_results_link .= '&se=1&re=1&se_regs=';
}
?>
<div class="djcf_menu djcf_regions">
<?php
if ($regs) {
?>
<ul class="menu nav">
<?php
$r_count = 0;
示例11: display
function display($tpl = null)
{
$model = $this->getModel();
$par = JComponentHelper::getParams('com_djclassifieds');
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$dispatcher = JDispatcher::getInstance();
$theme = $par->get('theme', 'default');
$user = JFactory::getUser();
$item = $model->getItem();
if ($item->user_id != $user->id) {
$groups_acl = ',' . implode(',', $user->getAuthorisedViewLevels()) . ',';
if (!strstr($groups_acl, ',' . $item->c_access_view . ',') || !$item) {
DJClassifiedsTheme::djAccessRestriction('category');
} else {
if ($item->access_view == 0) {
if (!strstr($groups_acl, ',' . $item->c_access_item_view . ',')) {
DJClassifiedsTheme::djAccessRestriction();
}
} else {
if (!strstr($groups_acl, ',' . $item->access_view . ',')) {
DJClassifiedsTheme::djAccessRestriction();
}
}
}
}
$item_images = DJClassifiedsImage::getAdsImages($item->id);
$category = $model->getCategory($item->cat_id);
$fields = $model->getFields($item->cat_id);
$fields_contact = $model->geContactFields();
$item_payments = $model->getItemPayment($item->id);
$item_options = $model->getItemOptions($item->id);
$bids = $model->getBids($item->id, $par->get('bids_displayed', 5));
if ($item->user_id != 0) {
$user_items_c = $model->getUserItemsCount($item->user_id);
$this->assignRef('user_items_c', $user_items_c);
}
$menus = $app->getMenu('site');
$m_active = $menus->getActive();
$cat_menu_path = array();
$cid_menu = 0;
if ($m_active) {
if (strstr($m_active->link, 'com_djclassifieds') && strstr($m_active->link, 'items')) {
$cid_menu = $m_active->query['cid'];
if ($cid_menu > 0) {
$cat_menu_path = DJClassifiedsCategory::getParentPath(1, $cid_menu);
}
}
}
$warning18 = '';
$main_cat_id = $item->cat_id;
$pathway = $app->getPathway();
$cat_path = array();
$cat_theme = '';
if ($category->id != 0) {
$cat_path = DJClassifiedsCategory::getParentPath(1, $category->id);
$main_cat_id = $cat_path[count($cat_path) - 1]->id;
for ($c = count($cat_path); $c > 0; $c--) {
$to_b = 1;
if (count($cat_menu_path)) {
foreach ($cat_menu_path as $cm) {
if ($cm->id == $cat_path[$c - 1]->id) {
$to_b = 0;
break;
}
}
}
if ($to_b) {
$pathway->addItem($cat_path[$c - 1]->name, DJClassifiedsSEO::getCategoryRoute($cat_path[$c - 1]->id . ':' . $cat_path[$c - 1]->alias));
}
}
foreach ($cat_path as $cp) {
if ($cp->theme) {
$cat_theme = $cp->theme;
}
if ($cp->restriction_18) {
$warning18 = 1;
}
}
}
DJClassifiedsTheme::includeCSSfiles($cat_theme);
if ($cat_theme) {
$this->_addPath('template', JPATH_COMPONENT . '/themes/' . $cat_theme . '/views/item');
$theme = $cat_theme;
}
$regions = $model->getRegions();
$country = '';
$city = '';
$region_name = '';
if ($item->region_id != 0 && $par->get('show_regions', '1')) {
$address = '';
$rid = $item->region_id;
if ($rid != 0) {
while ($rid != 0) {
foreach ($regions as $li) {
if ($li->id == $rid) {
$rid = $li->parent_id;
$address .= $li->name . ', ';
if ($li->country) {
$country = $li->name;
//.........这里部分代码省略.........
示例12: deleteToken
function deleteToken()
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$db = JFactory::getDBO();
$token = JRequest::getCmd('token', '');
$query = "SELECT i.* FROM #__djcf_items i " . "WHERE i.user_id=0 AND i.token=" . $db->Quote($db->escape($token));
$db->setQuery($query);
$item = $db->loadObject();
if (!$item) {
$message = JText::_("COM_DJCLASSIFIEDS_WRONG_AD");
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message, 'error');
}
$query = "SELECT * FROM #__djcf_images WHERE item_id=" . $item->id . " AND type='item' ";
$db->setQuery($query);
$item_images = $db->loadObjectList('id');
if ($item_images) {
foreach ($item_images as $item_img) {
$path_to_delete = JPATH_ROOT . $item_img->path . $item_img->name;
if (JFile::exists($path_to_delete . '.' . $item_img->ext)) {
JFile::delete($path_to_delete . '.' . $item_img->ext);
}
if (JFile::exists($path_to_delete . '_ths.' . $item_img->ext)) {
JFile::delete($path_to_delete . '_ths.' . $item_img->ext);
}
if (JFile::exists($path_to_delete . '_thm.' . $item_img->ext)) {
JFile::delete($path_to_delete . '_thm.' . $item_img->ext);
}
if (JFile::exists($path_to_delete . '_thb.' . $item_img->ext)) {
JFile::delete($path_to_delete . '_thb.' . $item_img->ext);
}
}
}
$query = "DELETE FROM #__djcf_items WHERE id = " . $item->id;
$db->setQuery($query);
$db->query();
$query = "DELETE FROM #__djcf_fields_values WHERE item_id = " . $item->id;
$db->setQuery($query);
$db->query();
$query = "DELETE FROM #__djcf_payments WHERE item_id = " . $item->id;
$db->setQuery($query);
$db->query();
$query = "DELETE FROM #__djcf_images WHERE item_id=" . $item->id . " AND type='item' ";
$db->setQuery($query);
$db->query();
$message = JText::_('COM_DJCLASSIFIEDS_AD_DELETED');
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$redirect = JRoute::_($redirect, false);
$app->redirect($redirect, $message);
}
示例13: djAccessRestriction
public static function djAccessRestriction($type = '')
{
$app = JFactory::getApplication();
$par = JComponentHelper::getParams('com_djclassifieds');
if ($type == 'category') {
$message = JText::_("COM_DJCLASSIFIEDS_YOU_ARE_NOT_AUTHORIZED_TO_VIEW_THIS_CATEGORY");
} else {
$message = JText::_("COM_DJCLASSIFIEDS_YOU_ARE_NOT_AUTHORIZED_TO_VIEW_THIS_ADVERT");
}
if ($par->get('acl_redirect', '0') == 1) {
JError::raiseWarning(403, $message);
$redirect = JURI::base();
} else {
if ($par->get('acl_redirect', '0') == 2 && $par->get('acl_red_article_id', '0') > 0) {
$db = JFactory::getDBO();
$query = "SELECT a.id, a.alias, a.catid, c.alias as c_alias FROM #__content a " . "LEFT JOIN #__categories c ON c.id=a.catid " . "WHERE a.state=1 AND a.id=" . $par->get('acl_red_article_id', '0');
$db->setQuery($query);
$acl_article = $db->loadObject();
if ($acl_article) {
require_once JPATH_ROOT . '/components/com_content/helpers/route.php';
$slug = $acl_article->id . ':' . $acl_article->alias;
$cslug = $acl_article->catid . ':' . $acl_article->c_alias;
$article_link = ContentHelperRoute::getArticleRoute($slug, $cslug);
$redirect = JRoute::_($article_link);
} else {
$redirect = JURI::base();
}
} else {
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
}
}
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message, 'error');
return null;
}
示例14: getItem
function getItem()
{
$app = JFactory::getApplication();
$id = JRequest::getVar('id', 0, '', 'int');
$user = JFactory::getUser();
$db = JFactory::getDBO();
$query = "SELECT i.*,c.alias as c_alias FROM #__djcf_items i " . "LEFT JOIN #__djcf_categories c ON c.id=i.cat_id " . "WHERE i.user_id=" . $user->id . " AND i.id=" . $id . " ";
$db->setQuery($query);
$item = $db->loadObject();
if (!$item) {
$message = JText::_("COM_DJCLASSIFIEDS_WRONG_AD");
$redirect = DJClassifiedsSEO::getCategoryRoute('0:all');
$redirect = JRoute::_($redirect);
$app->redirect($redirect, $message, 'error');
}
return $item;
}
示例15: mb_substr
if ($title_c > 0 && strlen($i->name) > $title_c) {
$i->name = mb_substr($i->name, 0, $title_c, 'utf-8') . ' ...';
}
echo '<a class="title" href="' . JRoute::_(DJClassifiedsSEO::getItemRoute($i->id . ':' . $i->alias, $i->cat_id . ':' . $i->c_alias)) . '">' . $i->name . '</a>';
}
if ($params->get('show_date') == 1 || $params->get('show_cat') == 1 || $params->get('show_price') == 1 || $params->get('show_type', '1')) {
echo '<div class="date_cat">';
if ($params->get('show_date') == 1) {
echo '<span class="date">';
echo DJClassifiedsTheme::formatDate(strtotime($i->date_start), '', $cfpar->get('date_format_type_modules', 0));
echo '</span>';
}
if ($params->get('show_cat') == 1) {
echo '<span class="category">';
if ($params->get('cat_link') == 1) {
echo '<a class="title_cat" href="' . JRoute::_(DJClassifiedsSEO::getCategoryRoute($i->cat_id . ':' . $i->c_alias)) . '">' . $i->c_name . '</a>';
} else {
echo $i->c_name;
}
echo '</span>';
}
if ($params->get('show_type', '1') && $i->type_id > 0) {
if (isset($types[$i->type_id])) {
echo '<span class="type">';
$type = $types[$i->type_id];
if ($type->params->bt_class) {
$bt_class = ' ' . $type->params->bt_class;
} else {
$bt_class = '';
}
if ($type->params->bt_use_styles) {