本文整理汇总了PHP中DJClassifiedsSEO::getItemRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP DJClassifiedsSEO::getItemRoute方法的具体用法?PHP DJClassifiedsSEO::getItemRoute怎么用?PHP DJClassifiedsSEO::getItemRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DJClassifiedsSEO
的用法示例。
在下文中一共展示了DJClassifiedsSEO::getItemRoute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getObjectInfo
function getObjectInfo($id, $language = null)
{
$info = new JCommentsObjectInfo();
$routerHelper = JPATH_ROOT . '/administrator/components/com_djclassifieds/lib/djseo.php';
if (is_file($routerHelper)) {
require_once $routerHelper;
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('a.id, a.alias, a.name, a.user_id');
$query->from('#__djcf_items AS a');
$query->select('c.id AS category_id, c.alias AS category_alias');
$query->join('LEFT', '#__djcf_categories AS c ON c.id = a.cat_id');
$query->where('a.id = ' . (int) $id);
$db->setQuery($query);
$row = $db->loadObject();
if (!empty($row)) {
$slug = $row->alias ? $row->id . ':' . $row->alias : $row->id;
$catslug = $row->category_alias ? $row->category_id . ':' . $row->category_alias : $row->category_id;
$info->title = $row->name;
$info->category_id = $row->category_id;
$info->userid = $row->user_id;
$info->link = JRoute::_(DJClassifiedsSEO::getItemRoute($slug, $catslug));
}
}
return $info;
}
示例2: display
function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$Itemid = JRequest::getVar('Itemid', 0, 'int');
//$document->link = JRoute::_(WeblinksHelperRoute::getCategoryRoute(JRequest::getVar('id', null, '', 'int')));
JRequest::setVar('limit', $app->getCfg('feed_limit'));
$siteEmail = $app->getCfg('mailfrom');
$fromName = $app->getCfg('fromname');
$document->editor = $fromName;
$document->editorEmail = $siteEmail;
// Get some data from the model
$model = $this->getModel();
$cat_id = JRequest::getVar('cid', 0, '', 'int');
$catlist = '';
$maincat = '';
if ($cat_id > 0) {
$main_cat = $model->getMainCat($cat_id);
$document->title = $main_cat->name;
$cats = DJClassifiedsCategory::getSubCatIemsCount($cat_id, 1);
$catlist = $cat_id;
foreach ($cats as $c) {
$catlist .= ',' . $c->id;
}
}
$items = $model->getItems($catlist);
foreach ($items as $item) {
// strip html from feed item title
$title = $this->escape($item->name);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
// url link to article
//$link = JRoute::_('index.php?option=com_djclassifieds&view=item&cid='.$item->cat_id.'&id='.$item->id.'&Itemid='.$Itemid);
if (!$item->alias) {
$item->alias = DJClassifiedsSEO::getAliasName($item->name);
}
if (!$item->c_alias) {
$item->c_alias = DJClassifiedsSEO::getAliasName($item->c_name);
}
$link = JRoute::_(DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias));
//echo $link;die();
// strip html from feed item description text
$description = $item->intro_desc;
$date = $item->date_start ? date('r', strtotime($item->date_start)) : '';
if ($item->image_url != '') {
$images = explode(';', $item->image_url);
$description .= '<img align="right" src="' . JURI::base() . '/components/com_djclassifieds/images/' . $images[0] . '.ths.jpg" />';
}
// load individual item creator class
$feeditem = new JFeedItem();
$feeditem->title = $title;
$feeditem->link = $link;
$feeditem->description = $description;
$feeditem->date = $date;
$feeditem->category = $item->c_name;
// loads item info into rss array
$document->addItem($feeditem);
}
}
示例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: str_ireplace
if ($order->i_name) {
echo '<div class="item_col icon first" style="width:' . $icon_col_w . 'px" >';
echo '<a href="' . DJClassifiedsSEO::getItemRoute($order->item_id . ':' . $order->i_alias, $order->cat_id . ':' . $order->c_alias) . '">';
if (count($order->images)) {
echo '<img src="' . JURI::base() . $order->images[0]->thumb_s . '"';
echo ' alt ="' . str_ireplace('"', "'", $order->images[0]->caption) . '" ';
echo '/>';
} else {
echo '<img src="' . JURI::base() . '/components/com_djclassifieds/assets/images/no-image.png" ';
echo ' alt ="' . str_ireplace('"', "'", $order->i_name) . '" ';
echo '/>';
}
echo '</a>';
echo '</div>';
echo '<div class="item_col name">';
echo '<h3><a class="title" href="' . DJClassifiedsSEO::getItemRoute($order->item_id . ':' . $order->i_alias, $order->cat_id . ':' . $order->c_alias) . '" >' . $order->i_name . '</a></h3>';
echo '</div>';
} else {
echo '<div class="item_col icon first" style="width:' . $icon_col_w . 'px" >';
echo '<img src="' . JURI::base() . '/components/com_djclassifieds/assets/images/no-image.png" ';
echo ' alt ="' . str_ireplace('"', "'", $order->item_name) . '" ';
echo '/>';
echo '</div>';
echo '<div class="item_col name">';
echo '<h3>' . $order->item_name . '</a></h3>';
echo '</div>';
}
?>
<div class="item_col">
<div class="djcf_prow_desc_row djcf_prow_price">
<span class="djcf_prow_desc_label" ><?php
示例5: foreach
<?php
$modules_djcf =& JModuleHelper::getModules('djcf-delete-top');
if (count($modules_djcf) > 0) {
echo '<div class="djcf-war-top clearfix">';
foreach (array_keys($modules_djcf) as $m) {
echo JModuleHelper::renderModule($modules_djcf[$m], $mod_attribs);
}
echo '</div>';
}
?>
<div class="djcf_war_content">
<?php
echo JText::_('COM_DJCLASSIFIEDS_DELETE_CONFIRM');
?>
<?php
echo ' "<a class="" href="' . DJClassifiedsSEO::getItemRoute($this->item->id . ':' . $this->item->alias, $this->item->cat_id . ':' . $this->item->c_alias) . '">';
echo $this->item->name;
echo '</a>"';
?>
</div>
<?php
$modules_djcf =& JModuleHelper::getModules('djcf-delete-center');
if (count($modules_djcf) > 0) {
echo '<div class="djcf-war-center clearfix">';
foreach (array_keys($modules_djcf) as $m) {
echo JModuleHelper::renderModule($modules_djcf[$m], $mod_attribs);
}
echo '</div>';
}
?>
示例6:
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" class="prom_ico" alt="special" />';
echo '<span class="prom_ico" ></span>';
}
if ($i->auction) {
echo '<span class="auction_icon" ></span>';
}
echo '</div>';
if ($par->get('column_category', '1')) {
echo '<div class="item_col cat_name"><a href="' . DJClassifiedsSEO::getCategoryRoute($i->cat_id . ':' . $i->c_alias) . '" >' . $i->c_name . '</a></div>';
}
if ($par->get('column_desc', '1')) {
echo '<div class="item_col 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></div>';
}
if ($par->get('column_loc', '1') && $par->get('show_regions', '1')) {
echo '<div class="item_col region"><a href="index.php?option=com_djclassifieds&view=items&se=1&se_regs[]=' . $i->region_id . '&Itemid=' . $Itemid . '">' . $i->r_name . '</a></div>';
}
if ($par->get('column_price', '1') && $par->get('show_price', '1')) {
echo '<div class="item_col price">';
if ($i->price) {
echo DJClassifiedsTheme::priceFormat($i->price, $i->currency);
} else {
echo '---';
}
echo '</div>';
}
示例7: parseMessageBody
public static function parseMessageBody($message, $message_id, $item, $reciver = '', $bidder = '', $bid = '', $bcontact_message = '', $bowner = '', $contact_message = '', $contact_author = '', $abuse_message = '', $abuse_author = '', $buyer = '', $quantity = '', $contact_fields_message = '', $payment_info = array())
{
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onAdminBeforeParseEmailBody', array(&$message, $message_id, &$item, &$reciver, &$bidder, &$bid, &$bcontact_message, &$bowner, $contact_message, &$contact_author, &$abuse_message, &$abuse_author, &$buyer, &$quantity, &$contact_fields_message));
$u = JURI::getInstance(JURI::root());
if ($item) {
if ($u->getScheme()) {
$link = $u->getScheme() . '://';
} else {
$link = 'http://';
}
$link .= $u->getHost() . JRoute::_(DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias));
$link = str_ireplace('administrator/', '', $link);
$message = str_ireplace('[[advert_id]]', $item->id, $message);
$message = str_ireplace('[[advert_link]]', '<a href="' . $link . '">' . $link . '</a>', $message);
$message = str_ireplace('[[advert_title]]', $item->name, $message);
$message = str_ireplace('[[advert_title_link]]', '<a href="' . $link . '">' . $item->name . '</a>', $message);
$message = str_ireplace('[[advert_category]]', $item->c_name, $message);
$message = str_ireplace('[[advert_intro_desc]]', $item->intro_desc, $message);
$message = str_ireplace('[[advert_desc]]', $item->description, $message);
if ($item->user_id) {
$message = str_ireplace('[[advert_author_name]]', $item->u_name, $message);
$message = str_ireplace('[[advert_author_email]]', $item->u_email, $message);
} else {
$message = str_ireplace('[[advert_author_name]]', JText::_('COM_DJCLASSIFIEDS_GUEST'), $message);
$message = str_ireplace('[[advert_author_email]]', $item->email, $message);
}
if ($item->published) {
$message = str_ireplace('[[advert_status]]', JText::_('COM_DJCLASSIFIEDS_PUBLISHED'), $message);
} else {
$message = str_ireplace('[[advert_status]]', JText::_('COM_DJCLASSIFIEDS_WAITING_FOR_PUBLISH'), $message);
}
}
if ($reciver) {
$message = str_ireplace('[[user_id]]', $reciver->id, $message);
$message = str_ireplace('[[user_name]]', $reciver->name, $message);
$message = str_ireplace('[[user_username]]', $reciver->username, $message);
$message = str_ireplace('[[user_email]]', $reciver->email, $message);
}
if ($bid) {
$message = str_ireplace('[[bid_value]]', $bid, $message);
}
if ($bidder) {
$message = str_ireplace('[[bidder_id]]', $bidder->id, $message);
$message = str_ireplace('[[bidder_name]]', $bidder->name, $message);
$message = str_ireplace('[[bidder_username]]', $bidder->username, $message);
$message = str_ireplace('[[bidder_email]]', $bidder->email, $message);
}
if ($bcontact_message) {
$message = str_ireplace('[[bcontact_message]]', $bcontact_message, $message);
}
if ($bowner) {
$message = str_ireplace('[[bcontact_author_name]]', $bowner->name, $message);
}
if ($contact_fields_message) {
$message = str_ireplace('[[contact_custom_fields_message]]', $contact_fields_message, $message);
}
if ($contact_message) {
$message = str_ireplace('[[contact_message]]', $contact_message, $message);
}
if ($contact_author) {
$message = str_ireplace('[[contact_author_name]]', $contact_author['name'], $message);
$message = str_ireplace('[[contact_author_email]]', $contact_author['email'], $message);
}
if ($abuse_message) {
$message = str_ireplace('[[abuse_message]]', $abuse_message, $message);
}
if ($abuse_author) {
$message = str_ireplace('[[abuse_author_name]]', $abuse_author->name, $message);
}
if ($buyer) {
$message = str_ireplace('[[buyer_name]]', $buyer->name, $message);
$message = str_ireplace('[[buyer_email]]', $buyer->email, $message);
}
if ($quantity) {
$message = str_ireplace('[[buynow_quantity]]', $quantity, $message);
$message = str_ireplace('[[buynow_price]]', $item->price, $message);
$dispatcher->trigger('onAdminPriceParseEmailBody', array(&$message, $message_id, $item, $buyer, &$price_total));
$price_total = $quantity * $item->price;
$message = str_ireplace('[[buynow_price_total]]', $price_total, $message);
}
if (count($payment_info)) {
$message = str_ireplace('[[payment_item_name]]', $payment_info['itemname'], $message);
$message = str_ireplace('[[payment_price]]', $payment_info['amount'], $message);
$message = str_ireplace('[[payment_info]]', $payment_info['info'], $message);
$message = str_ireplace('[[payment_id]]', $payment_info['id'], $message);
}
$dispatcher->trigger('onAdminParseEmailBody', array(&$message, $message_id, $item, $buyer));
return $message;
}
示例8:
}
if ($params->get('show_price') == 1 && $i->price) {
echo '<span class="price">';
echo DJClassifiedsTheme::priceFormat($i->price, $i->currency);
echo '</span>';
}
echo '</div>';
}
echo '</div>';
if ($params->get('show_description') == 1) {
echo '<div class="desc">';
if ($params->get('desc_source', '0') == 1) {
echo $i->description;
} else {
if ($params->get('desc_link') == 1) {
echo '<a href="' . JRoute::_(DJClassifiedsSEO::getItemRoute($i->id . ':' . $i->alias, $i->cat_id . ':' . $i->c_alias)) . '">';
}
$desc_c = $params->get('char_desc_nr');
if ($desc_c != 0 && $i->intro_desc != '' && strlen($i->intro_desc) > $desc_c) {
echo mb_substr($i->intro_desc, 0, $desc_c, 'utf-8') . ' ...';
} else {
echo $i->intro_desc;
}
if ($params->get('desc_link') == 1) {
echo '</a>';
}
}
echo '</div>';
}
echo '</div>';
}
示例9: activateMoveToTopPromotion
function activateMoveToTopPromotion($id)
{
$app = JFactory::getApplication();
$par = JComponentHelper::getParams('com_djclassifieds');
$user = JFactory::getUser();
$db = JFactory::getDBO();
$id = JRequest::getInt('id', 0);
$query = "SELECT i.*, c.points as c_points, c.autopublish as c_autopublish, c.alias as c_alias FROM #__djcf_items i " . "LEFT JOIN #__djcf_categories c ON c.id=i.cat_id " . "WHERE i.id=" . $id . " LIMIT 1";
$db->setQuery($query);
$item = $db->loadObject();
$redirect_a = 0;
if (!$item) {
$redirect_a = 1;
$message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD');
}
if ($item->user_id != $user->id) {
$redirect_a = 1;
$message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD');
}
if ($user->id == 0) {
$redirect_a = 1;
$message = JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN');
}
if ($redirect_a) {
$redirect = "index.php?option=com_djclassifieds&view=items&cid=0";
$redirect = JRoute::_($redirect, false);
$app->redirect($redirect, $message);
}
$query = "SELECT SUM(p.points)FROM #__djcf_users_points p " . "WHERE p.user_id='" . $user->id . "' ";
$db->setQuery($query);
$message = JText::_('COM_DJCLASSIFIEDS_POINTS_PAYMENT_CONFIRMED_PROMOTION_MOVE_TO_TOP_ACTIVATED');
$redirect = DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias);
$date_sort = date("Y-m-d H:i:s");
$query = "UPDATE #__djcf_items SET date_sort='" . $date_sort . "' " . "WHERE id=" . $item->id . " ";
$db->setQuery($query);
$db->query();
$redirect = JRoute::_($redirect, false);
$app->redirect($redirect, $message);
}
示例10: str_ireplace
} else {
if (strstr($field, 'http://') || strstr($field, 'https://')) {
echo '<a ' . $this->custom_fields[$f_id]->params . ' href="' . $field . '">' . str_ireplace(array("http://", "https://"), array('', ''), $field) . '</a>';
} else {
echo '<a ' . $this->custom_fields[$f_id]->params . ' href="http://' . $field . '">' . $field . '</a>';
}
}
} else {
echo $field;
}
}
echo '</div>';
}
}
if ($par->get('blog_readmore', '1')) {
echo '<div class="see_details_box"><a class="see_details" href="' . DJClassifiedsSEO::getItemRoute($i->id . ':' . $i->alias, $i->cat_id . ':' . $i->c_alias) . $anch . '" >' . JText::_('COM_DJCLASSIFIEDS_SEE_DETAILS') . '</a></div>';
}
echo '</div>';
if (strstr($i->promotions, 'p_special')) {
echo '<span class="p_special_img"> </span>';
}
echo '</div></div></div></div></div>';
}
?>
<?php
echo '<div style="clear:both" ></div>';
if (count($this->items) == 0) {
echo '<div class="no_results" style="padding-left:30px;">';
if ($se > 0) {
echo JText::_('COM_DJCLASSIFIEDS_NO_RESULTS');
示例11:
<?php
$class = '';
if ($par->get('column_desc', '1') == '2') {
$class .= ' hide_mobile';
} else {
if ($par->get('column_desc', '1') == '3') {
$class .= ' hide_tablet hide_mobile';
}
}
?>
<div class="item_desc<?php
echo $class;
?>
">
<a href="<?php
echo DJClassifiedsSEO::getItemRoute($i->id . ':' . $i->alias, $i->cat_id . ':' . $i->c_alias) . $anch;
?>
" >
<?php
echo mb_substr(strip_tags($i->intro_desc), 0, $par->get('introdesc_char_limit', '120'), 'UTF-8');
?>
</a>
</div>
<?php
}
?>
<?php
if ($i->event->afterDJClassifiedsDisplayContent) {
?>
<div class="djcf_after_content">
<?php
示例12: process
//.........这里部分代码省略.........
$item = $db->loadObject();
if(!isset($item)){
$message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD');
$redirect="index.php?option=com_djclassifieds&view=items&cid=0";
}
$query = 'DELETE FROM #__djcf_payments WHERE item_id= "'.$id.'" ';
$db->setQuery($query);
$db->query();
$query = 'INSERT INTO #__djcf_payments ( item_id,user_id,method, status)' .
' VALUES ( "'.$id.'" ,"'.$user->id.'","'.$ptype.'" ,"Start" )'
;
$db->setQuery($query);
$db->query();
$amount = 0;
if(strstr($item->pay_type, 'cat')){
$amount += $item->c_price/100;
}
if(strstr($item->pay_type, 'duration_renew')){
$query = "SELECT d.price_renew FROM #__djcf_days d "
."WHERE d.days=".$item->exp_days;
$db->setQuery($query);
$amount += $db->loadResult();
}else if(strstr($item->pay_type, 'duration')){
$query = "SELECT d.price FROM #__djcf_days d "
."WHERE d.days=".$item->exp_days;
$db->setQuery($query);
$amount += $db->loadResult();
}
$query = "SELECT p.* FROM #__djcf_promotions p "
."WHERE p.published=1 ORDER BY p.id ";
$db->setQuery($query);
$promotions=$db->loadObjectList();
foreach($promotions as $prom){
if(strstr($item->pay_type, $prom->name)){
$amount += $prom->price;
}
}
*/
if ($user->id) {
$mailto = $user->email;
$mailfrom = $app->getCfg('mailfrom');
$fromname = $config->get('config.sitename') . ' - ' . str_ireplace('administrator/', '', JURI::base());
$subject = JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_INFRORMATIONS') . ' ' . $config->get('config.sitename');
$m_message = JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_INFRORMATIONS') . ' ' . $config->get('config.sitename') . "<br /><br />";
if ($type == 'points') {
$m_message .= JText::_('PLG_DJCFBANKTRANSFER_POINTS_PACKAGE') . ': ' . $itemname . "<br /><br />";
} else {
$m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_NAME') . ': ' . $itemname . "<br /><br />";
}
$m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PRICE_TO_PAY') . ': ' . $amount . ' ' . $par->get('unit_price', '') . "<br /><br />";
$m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PAY_INFORMATION') . ': <br /><br />' . JHTML::_('content.prepare', nl2br($this->params["pay_info"])) . "<br /><br />";
if ($type == '') {
$u = JURI::getInstance(JURI::base());
$link = $u->getHost() . JRoute::_(DJClassifiedsSEO::getItemRoute($item_slug, $cat_slug));
$m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_LINK') . ': <a href="' . $link . '">' . $link . '</a><br /><br />';
$m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_ID') . ': ' . $id . '<br /><br />';
}
$m_message .= JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_ID') . ': ' . $item_id;
$mailer = JFactory::getMailer();
$mailer->sendMail($mailfrom, $fromname, $mailto, $subject, $m_message, $mode = 1);
}
echo '<div id="dj-classifieds" class="clearfix">';
echo '<table width="98%" cellspacing="0" cellpadding="0" border="0" class="paymentdetails first">';
echo '<tr><td class="td_title"><h2>' . $this->params["payment_method"] . '</h2></td></tr>';
echo '<tr><td class="td_pdetails">';
echo '<div class="pd_row">';
if ($type == 'points') {
echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_POINTS_PACKAGE') . ':</span>';
} else {
echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_NAME') . ':</span>';
}
echo '<span class="djcfpay_value">' . $itemname . '</span>';
echo '</div>';
echo '<div class="pd_row">';
echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PRICE_TO_PAY') . ':</span>';
echo '<span class="djcfpay_value">' . $amount . ' ' . $par->get('unit_price', '') . '</span>';
echo '</div>';
echo '<div class="pd_row">';
if ($type == 'points') {
echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_POINTS_ID') . ':</span>';
} else {
echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_AD_ID') . ':</span>';
}
echo '<span class="djcfpay_value">' . $item_id . '</span>';
echo '</div>';
echo '<div class="pd_row">';
echo '<span class="djcfpay_label">' . JText::_('PLG_DJCFBANKTRANSFER_PAYMENT_PAY_INFORMATION') . ': </span><br /><br />';
echo '<span class="djcfpay_value">' . JHTML::_('content.prepare', nl2br($this->params["pay_info"])) . '</span>';
echo '</div>';
echo '</td></tr>';
echo '</table>';
echo '</div>';
}
示例13: removeFavourite
function removeFavourite()
{
$app = JFactory::getApplication();
$id = JRequest::getInt('id', 0);
$cid = JRequest::getVar('cid', 0, '', 'int');
$db = JFactory::getDBO();
$user = JFactory::getUser();
$itemid = JRequest::getVar('Itemid');
$par = JComponentHelper::getParams('com_djclassifieds');
$query = "SELECT i.id, i.name, i.alias,i.cat_id,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;
$db->setQuery($query);
$item = $db->loadObject();
if (!$item->alias) {
$item->alias = DJClassifiedsSEO::getAliasName($item->name);
}
if (!$item->c_alias) {
$item->c_alias = DJClassifiedsSEO::getAliasName($item->c_name);
}
$link = DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias);
$m_type = '';
if ($par->get('favourite', '1')) {
if ($user->id > 0) {
$query = "DELETE FROM #__djcf_favourites WHERE item_id=" . $id . " AND user_id=" . $user->id . " ";
$db->setQuery($query);
$db->query();
$msg = JText::_('COM_DJCLASSIFIEDS_AD_REMOVED_FROM_FAVOURITES');
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN');
$m_type = 'error';
}
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_FUNCTION_NOT_AVAILABLE');
$m_type = 'error';
}
//$link = 'index.php?option=com_djclassifieds&view=item&cid='.$cid.'&id='.$id.'&Itemid='.$itemid;
$link = JRoute::_($link);
$app->redirect($link, $msg, $m_type);
}
示例14: display
//.........这里部分代码省略.........
if ($m_active->params->get('menu-meta_description')) {
$document->setMetaData('keywords', $m_active->params->get('menu-meta_description'));
}
}
}
}
if ($item->metadesc != '') {
$document->setDescription($item->metadesc);
} else {
if ($par->get('seo_item_metadesc', '0') == 0) {
$document->setDescription($item->intro_desc);
} else {
if ($category->metadesc != '') {
$document->setDescription($category->metadesc);
} else {
if ($m_active) {
if ($m_active->params->get('menu-meta_keywords')) {
$document->setDescription($m_active->params->get('menu-meta_keywords'));
}
}
}
}
}
$c_title = $document->getTitle();
$cat_name = $category->name;
$item_name = $item->name;
$seo_cat_path = '';
$seo_title_separator = $par->get('seo_title_separator', ' - ');
foreach ($cat_path as $cp) {
if ($seo_cat_path) {
$seo_cat_path .= $seo_title_separator;
}
$seo_cat_path .= $cp->name;
}
$seo_title_from = array('|', '<default_title>', '<category_name>', '<category_path>', '<item_name>', '<region_name>');
$seo_title_to = array($seo_title_separator, $c_title, $cat_name, $seo_cat_path, $item_name, $region_name);
$seo_title = str_ireplace($seo_title_from, $seo_title_to, $par->get('seo_title_item', '<item_name>|<category_name>|<default_title>'));
$document->setTitle($seo_title);
$document->setMetaData('og:title', $item->name);
$document->setMetaData('og:description', $item->intro_desc);
if ($item_images) {
$document->setMetaData('og:image', JURI::base() . $item_images[0]->thumb_b);
}
if ($par->get('comments', '0') == 1 && $par->get('fb_comments_admin', '') != '') {
$document->addCustomTag('<meta property="fb:admins" content="' . $par->get('fb_comments_admin', '') . '" />');
}
$anch = $par->get('showitem_jump', 0) ? '#dj-classifieds' : '';
$correct_link = JRoute::_(DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias)) . $anch;
$document->setMetaData('canonical', $correct_link);
/* plugins */
if ($category) {
$item->c_alias = $category->alias;
}
$results = $dispatcher->trigger('onPrepareItemDescription', array(&$item, &$par, 'item'));
$item->event = new stdClass();
$resultsAfterTitle = $dispatcher->trigger('onAfterDJClassifiedsDisplayTitle', array(&$item, &$par, 'item'));
$item->event->afterDJClassifiedsDisplayTitle = trim(implode("\n", $resultsAfterTitle));
$resultsBeforeContent = $dispatcher->trigger('onBeforeDJClassifiedsDisplayContent', array(&$item, &$par, 'item'));
$item->event->beforeDJClassifiedsDisplayContent = trim(implode("\n", $resultsBeforeContent));
$resultsAfterContent = $dispatcher->trigger('onAfterDJClassifiedsDisplayContent', array(&$item, &$par, 'item'));
$item->event->afterDJClassifiedsDisplayContent = trim(implode("\n", $resultsAfterContent));
$resultsAfterAuthorProfile = $dispatcher->trigger('onAfterDJClassifiedsDisplayAdvertAuthor', array(&$item, &$par, 'item'));
$item->event->onAfterDJClassifiedsDisplayAdvertAuthor = trim(implode("\n", $resultsAfterAuthorProfile));
$pathway->addItem($item->name);
$this->assignRef('item', $item);
$this->assignRef('item_images', $item_images);
$this->assignRef('item_options', $item_options);
$this->assignRef('fields', $fields);
$this->assignRef('fields_contact', $fields_contact);
$this->assignRef('country', $country);
$this->assignRef('city', $city);
$this->assignRef('address', $address);
$this->assignRef('main_cat_id', $main_cat_id);
$this->assignRef('item_payments', $item_payments);
$this->assignRef('category', $category);
$this->assignRef('profile', $profile);
$this->assignRef('theme', $theme);
$this->assignRef('bids', $bids);
$this->assignRef('custom_ask_seller', $custom_ask_seller);
if ($warning18 && !isset($_COOKIE["djcf_warning18"])) {
$warning18_link = '';
if ($par->get('restriction_18_art_id', 0)) {
require_once JPATH_SITE . '/components/com_content/helpers/route.php';
$terms_article = $model->getTermsLink($par->get('restriction_18_art_id', 0));
if ($terms_article) {
$slug = $terms_article->id . ':' . $terms_article->alias;
$cslug = $terms_article->catid . ':' . $terms_article->c_alias;
$warning18_link = ContentHelperRoute::getArticleRoute($slug, $cslug);
if ($par->get('restriction_18_art', 0) == 2) {
$warning18_link .= '&tmpl=component';
}
$warning18_link = JRoute::_($warning18_link);
}
}
$this->assignRef('terms_link', $warning18_link);
parent::display('terms');
} else {
parent::display($tpl);
}
}
示例15: delBid
function delBid()
{
header("Content-type: text/html; charset=utf-8");
$app = JFactory::getApplication();
$id = JRequest::getInt('id', 0);
$cid = JRequest::getInt('cid', 0);
$bid = JRequest::getFloat('bid', 0);
$db = JFactory::getDBO();
$user = JFactory::getUser();
$itemid = JRequest::getVar('Itemid');
$par = JComponentHelper::getParams('com_djclassifieds');
$m_type = '';
$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 . " ";
$db->setQuery($query);
$item = $db->loadObject();
if (!$item->alias) {
$item->alias = DJClassifiedsSEO::getAliasName($item->name);
}
if (!$item->c_alias) {
$item->c_alias = DJClassifiedsSEO::getAliasName($item->c_name);
}
$link = DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias);
if ($user->id > 0) {
if ($item) {
if ($item->user_id == $user->id && $item->user_id > 0) {
$query = "DELETE FROM #__djcf_auctions WHERE item_id = " . $item->id . " AND id=" . $bid;
$db->setQuery($query);
$db->query();
$price_start = $item->price_start;
$query = "SELECT a.* FROM #__djcf_auctions a " . " WHERE a.item_id=" . $item->id . " ORDER BY a.date DESC LIMIT 1";
$db->setQuery($query);
$last_bid = $db->loadObject();
if ($last_bid) {
$price_start = $last_bid->price;
}
$query = "UPDATE #__djcf_items SET price='" . $price_start . "' " . " WHERE id=" . $item->id;
$db->setQuery($query);
$db->query();
$msg = JText::_('COM_DJCLASSIFIEDS_BID_DELETED');
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_WRONG_AD');
$m_type = 'error';
}
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_WRONG_AD');
$m_type = 'error';
}
} else {
$msg = JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN');
$m_type = 'error';
}
$link = JRoute::_($link);
$app->redirect($link, $msg, $m_type);
die('aaaa');
}