echo ' - ' . $plan->points . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT') . ''; } ?> </span> <div class="clear_both"></div> </div> <div class="djcf_prow_desc_row"> <span class="djcf_prow_desc_label" ><?php echo JText::_("COM_DJCLASSIFIEDS_COST_PER_ADVERT"); ?> :</span> <span class="djcf_prow_desc_value" > <?php $price_per_ad = round($plan->price / $plan_params->ad_limit, 2); echo DJClassifiedsTheme::priceFormat($price_per_ad, $par->get('unit_price', '')); ?> <?php if ($plan->points > 0 && $points_a) { $points_per_ad = round($plan->points / $plan_params->ad_limit, 2); echo ' - ' . $points_per_ad . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT') . ''; } ?> </span> <div class="clear_both"></div> </div> <div class="djcf_prow_desc_row djcf_prow_main_desc"> <?php echo $plan->description; ?>
echo JText::_('COM_DJCLASSIFIEDS_PAYMENT_DETAILS'); ?> </h2> </td> </tr> <tr> <td class="td_pdetails"> <?php echo '<div class="pd_row"><span>' . JText::_('COM_DJCLASSIFIEDS_POINTS_PACKAGE') . '</span>'; echo '<span class="price">' . $this->points->name . '</span></div>'; echo '<div class="pd_row"><span>' . JText::_('COM_DJCLASSIFIEDS_POINTS') . '</span>'; echo '<span class="price">' . $this->points->points . '</span></div>'; echo '<div class="pd_row"><span>' . JText::_('COM_DJCLASSIFIEDS_COST_PER_POINT') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat(round($this->points->price / $this->points->points, 2), $par->get('unit_price', '')) . '</span></div>'; echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->points->price, $par->get('unit_price', '')) . '</span></div>'; ?> </td> </tr> </table> <table cellpadding="0" cellspacing="0" width="98%" border="0" class="paymentdetails"> <tr> <td class="td_title"> <h2><?php echo JText::_("COM_DJCLASSIFIEDS_PAYMENT_METHODS"); ?> </h2> </td> </tr> <tr> <td class="table_payment">
* the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * DJ Classifieds is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * 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'); if (!defined("DS")) { define('DS', DIRECTORY_SEPARATOR); } require_once JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_djclassifieds' . DS . 'lib' . DS . 'djtheme.php'; require_once dirname(__FILE__) . DS . 'helper.php'; $app = JFactory::getApplication(); $user = JFactory::getUser(); $menus = $app->getMenu('site'); $menu_upoints_itemid = $menus->getItems('link', 'index.php?option=com_djclassifieds&view=userpoints', 1); $menu_ppackages_itemid = $menus->getItems('link', 'index.php?option=com_djclassifieds&view=points', 1); if (JRequest::getVar('option') != 'com_djclassifieds') { DJClassifiedsTheme::includeCSSfiles(); } $user_points = 0; if ($user->id) { $user_points = modDjClassifiedsUserPoints::getUserPoints(); } require JModuleHelper::getLayoutPath('mod_djclassifieds_user_points');
/** * 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; } else { $bt_class = ''; } if ($type->params->bt_use_styles) { if ($mparams->get('show_type') == 2) { $style = 'style="display:inline-block;' . 'border:' . (int) $type->params->bt_border_size . 'px solid ' . $type->params->bt_border_color . ';' . 'background:' . $type->params->bt_bg . ';' . 'color:' . $type->params->bt_color . ';' . $type->params->bt_style . '"'; $slide->extra .= '<div class="type_button' . $bt_class . '" ' . $style . ' >' . $type->name . '</div>'; } else { $slide->extra .= '<div class="type_label' . $bt_class . '" >' . $type->name . '</div>'; } } else { $slide->extra .= '<div class="type_label' . $bt_class . '" >' . $type->name . '</div>'; } $slide->extra .= '</div>'; } } if ($mparams->get('show_region') == 1) { $slide->extra .= '<div class="region">'; $slide->extra .= $i->r_name; $slide->extra .= '</div>'; } if ($mparams->get('show_price') == 1 && $i->price) { $slide->extra .= '<div class="price">'; $slide->extra .= DJClassifiedsTheme::priceFormat($i->price, $i->currency); $slide->extra .= '</div>'; } // finish getting extra information $slide->title = $i->name; $slide->description = $i->intro_desc; if (empty($slide->description)) { $slide->description = $i->description; } $slide->full_desc = $i->description; $slide->link = JRoute::_(DJClassifiedsSEO::getItemRoute($i->id . ':' . $i->alias, $i->cat_id . ':' . $i->c_alias)); $slides[] = $slide; } } return $slides; }
echo '<div class="item_col price">'; if ($i->price) { echo DJClassifiedsTheme::priceFormat($i->price, $i->currency); } else { echo '---'; } echo '</div>'; } if ($par->get('column_date_a', '1')) { echo '<div class="item_col date_start">'; echo DJClassifiedsTheme::formatDate(strtotime($i->date_start), '', $par->get('date_format_type', 0)); echo '</div>'; } if ($par->get('column_date_e', '1')) { echo '<div class="item_col date_exp">'; echo DJClassifiedsTheme::formatDate(strtotime($i->date_exp), '', $par->get('date_format_type', 0)); echo '</div>'; } if ($par->get('column_displayed', '1')) { echo '<div class="item_col date_exp last" align="center">' . $i->display . '</div>'; } if ($par->get('column_distance', '0')) { echo '<div class="item_col col_distance">'; if ($i->latitude && $i->longitude) { if (isset($_COOKIE["djcf_latlon"])) { echo '<span class="Tips1" title="' . JText::_('COM_DJCLASSIFIEDS_IN_A_STRAIGHT_LINE') . '">'; echo round($i->distance_latlon) . ' '; if ($par->get('column_distance_unit', 'km') == 'km') { echo JText::_('COM_DJCLASSIFIEDS_KM'); } else { echo JText::_('COM_DJCLASSIFIEDS_MI');
echo '<span class="price">' . DJClassifiedsTheme::priceFormat($par->get('promotion_move_top_price', 0), $par->get('unit_price', 'EUR')); if ($par->get('promotion_move_top_points', 0) && $points_a) { echo ' - ' . $par->get('promotion_move_top_points', 0) . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; if ($par->get('vat_value', '-1') > -1) { $p_net = round($par->get('promotion_move_top_price', 0) / (1 + $par->get('vat_value', '-1') * 0.01), 2); echo '<div class="pd_row_net"><span>' . JText::_('COM_DJCLASSIFIEDS_NET_COST') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; echo '<div class="pd_row_tax"><span>' . JText::_('COM_DJCLASSIFIEDS_TAX') . ' (' . $par->get('vat_value', '-1') . '%)</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($par->get('promotion_move_top_price', 0) - $p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; } echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($par->get('promotion_move_top_price', 0), $par->get('unit_price', 'EUR')); if ($par->get('promotion_move_top_points', 0) && $points_a) { echo ' - ' . $par->get('promotion_move_top_points', 0) . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; ?> </td> </tr> </table> <?php $modules_djcf =& JModuleHelper::getModules('djcf-payment-middle'); if (count($modules_djcf) > 0) { echo '<div class="djcf-payment-middle clearfix">'; foreach (array_keys($modules_djcf) as $m) { echo JModuleHelper::renderModule($modules_djcf[$m], $mod_attribs); }
echo '<span class="type_label' . $bt_class . '" >' . $type->name . '</span>'; } } else { echo '<span class="type_label' . $bt_class . '" >' . $type->name . '</span>'; } echo '</span>'; } } if ($params->get('show_region') == 1) { echo '<span class="region">'; echo $i->r_name; echo '</span>'; } 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) {
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; } 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); } $custom_ask_seller = $model->getCustomAskSellerFields(); if ($item->metakey != '') { $document->setMetaData('keywords', $item->metakey); } else { if ($category->metakey != '') { $document->setMetaData('keywords', $category->metakey); } else { if ($m_active) { 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); } }
document.id('extra_char_price').innerHTML = char_label_prices[document.id('exp_days').value]; descCharsLimit(); }); <?php } foreach ($this->days as $day) { if ($day->char_price_default == 0) { $char_price = DJClassifiedsTheme::priceFormat($day->char_price, $par->get('unit_price')); if ($points_a && $day->char_points > 0) { $char_price .= ' - ' . $day->char_points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'char_label_prices[' . $day->days . ']="' . addslashes($char_price) . '"; '; echo 'char_prices[' . $day->days . ']="' . addslashes($day->char_price) . '"; '; echo 'char_points[' . $day->days . ']="' . addslashes($day->char_points) . '"; '; } else { $char_price = DJClassifiedsTheme::priceFormat($par->get('desc_char_price', '0'), $par->get('unit_price')); if ($points_a && $par->get('desc_char_price_points', '0') > 0) { $char_price .= ' - ' . $par->get('desc_char_price_points', '0') . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'char_label_prices[' . $day->days . ']="' . addslashes($char_price) . '"; '; echo 'char_prices[' . $day->days . ']="' . addslashes($par->get('desc_char_price', '0')) . '"; '; echo 'char_points[' . $day->days . ']="' . addslashes($par->get('desc_char_price_points', '0')) . '"; '; } } ?> var desc_chars_limit = <?php echo $par->get('pay_desc_chars_limit', 0); ?> ; var desc_chars_free_limit = <?php
if ($user->id) { if ($item->bid_min > 0) { $bid_v = $min_bid + $item->bid_min; } else { $bid_v = $min_bid + 1; } ?> <div class="bids_box"> <div class="bids_info"> <span class="bid_label"><?php echo JText::_('COM_DJCLASSIFIEDS_PLACE_BID'); ?> </span> <?php if ($item->bid_max) { echo '<span class="bid_max">' . JText::_('COM_DJCLASSIFIEDS_MAX_BIDDING') . ' ' . DJClassifiedsTheme::priceFormat($item->bid_max, $item->currency) . '</span>'; } ?> </div> <div class="bids_input"> <?php if ($par->get('unit_price_position', '0') == 1) { echo $item->currency ? $item->currency : $par->get('unit_price'); } ?> <input class="inputbox input-small" id="djbid_value" type="text" name="bid_max" id="bid_max" size="30" maxlength="250" value="<?php echo $bid_v; ?> " />
function saveBid() { header("Content-type: text/html; charset=utf-8"); $app = JFactory::getApplication(); $id = JRequest::getInt('id', 0); $bid = JRequest::getFloat('bid', 0); $db = JFactory::getDBO(); $user = JFactory::getUser(); $itemid = JRequest::getVar('Itemid'); $par = JComponentHelper::getParams('com_djclassifieds'); $bid_error = 0; $error_show_form = 0; $error_price = 0; $bid_message = JText::_('COM_DJCLASSIFIEDS_OFFER_PUBLISHED'); if ($user->id > 0) { $date_now = date("Y-m-d H:i:s"); $query = "SELECT * FROM #__djcf_items i " . "WHERE i.id = " . $id . " AND i.published=1 AND i.date_start <= '" . $date_now . "' AND i.date_exp >= '" . $date_now . "' "; $db->setQuery($query); $item = $db->loadObject(); if ($item) { if ($bid > 0) { $query = "SELECT a.*, u.name as u_name FROM #__djcf_auctions a, #__users u " . " WHERE a.user_id=u.id AND a.item_id=" . $id . " ORDER BY a.date DESC LIMIT 1"; $db->setQuery($query); $last_bid = $db->loadObject(); if ($item->buynow) { $min_bid = $item->price_start; } else { $min_bid = $item->price; } if ($last_bid) { if ($last_bid->user_id == $user->id) { $bid_error = 1; $bid_message = JText::_('COM_DJCLASSIFIEDS_YOUR_OFFER_IS_LAST_YOU_CAN_BID_ONLY_OTHER_USERS'); } $min_bid = $last_bid->price; } if ($item->user_id == $user->id) { $bid_error = 1; $bid_message = JText::_('COM_DJCLASSIFIEDS_YOU_CANT_BID_YOUR_ADVERT'); } if ($bid_error == 0) { if (!$item->bid_min) { $item->bid_min = 1; } $min_bid = $min_bid + $item->bid_min; if ($bid < $min_bid) { $bid_error = 1; $error_show_form = 1; $error_price = $min_bid; $bid_message = JText::_('COM_DJCLASSIFIEDS_OFFER_SMALLER_THAN_LIMIT') . ' ' . DJClassifiedsTheme::priceFormat($error_price, $item->currency); } if ($bid_error == 0) { if ($item->bid_max > 0) { $max_bid = $min_bid + $item->bid_max; if ($item->bid_max && $bid > $max_bid) { $bid_error = 1; $error_show_form = 1; $error_price = $max_bid; $bid_message = JText::_('COM_DJCLASSIFIEDS_OFFER_BIGGER_THAN_LIMIT') . ' ' . DJClassifiedsTheme::priceFormat($error_price, $item->currency); } } } if ($bid_error == 0) { $user_ip = $_SERVER['REMOTE_ADDR']; $win = 0; if ($bid >= $item->price_reserve && $item->bid_autoclose == 1) { $win = 1; } $query = "INSERT INTO #__djcf_auctions (`item_id`, `user_id`, `ip_address`, `price`,`win`)" . " VALUES ( '" . $id . "', '" . $user->id . "','" . $user_ip . "', '" . $bid . "', '" . $win . "' )"; $db->setQuery($query); $db->query(); $price_start = ''; if (!$last_bid) { $price_start = " price_start='" . $item->price . "' "; } $win_notifi = ''; if ($win) { if ($price_start || $item->buynow) { $win_notifi = ", "; } $win_notifi .= "notify=2 "; } $price_new = ''; if ($item->buynow == 0) { $price_new = " price='" . $bid . "' "; if ($price_start) { $price_start = ',' . $price_start; } } if ($price_start || $win_notifi || $price_new) { $query = "UPDATE #__djcf_items SET " . $price_new . $price_start . $win_notifi . " WHERE id=" . $item->id; $db->setQuery($query); $db->query(); } DJClassifiedsNotify::notifyAuctionsBidAuthor($id, $user, $bid); DJClassifiedsNotify::notifyAuctionsBidBidder($id, $user, $bid); if ($last_bid) { DJClassifiedsNotify::notifyAuctionsBidOutbid($id, $user, $bid, $last_bid); } if ($win) { DJClassifiedsNotify::notifyAuctionsWinAuthor($id, $user, $bid); DJClassifiedsNotify::notifyAuctionsWinBidder($id, $user, $bid); } } } } else { $bid_error = 1; $bid_message = JText::_('COM_DJCLASSIFIEDS_PLEASE_ENTER_PRICE_VALUE'); } $query = "SELECT a.*, u.name as u_name FROM #__djcf_auctions a, #__users u " . " WHERE a.user_id=u.id AND a.item_id=" . $id . " ORDER BY a.date DESC LIMIT " . $par->get('bids_displayed', 5); $db->setQuery($query); $bids = $db->loadObjectList(); ?> <div class="auction" id="djauctions"> <div class="auction_bids"> <div class="bids_title"><h2><?php echo JText::_('COM_DJCLASSIFIEDS_CURRENT_BIDS'); ?> </h2></div> <?php if (isset($bids[0]) && $item->price_reserve) { if ($bids[0]->price < $item->price_reserve) { ?> <div class="bids_subtitle"><?php echo JText::_('COM_DJCLASSIFIEDS_RESERVE_PRICE_NOT_REACHED'); ?> </div> <?php } } ?> <div class="bids_list"> <?php if ($bids) { ?> <div class="bids_row bids_row_title"> <div class="bids_col bids_col_name"><?php echo JText::_('COM_DJCLASSIFIEDS_NAME'); ?> :</div> <div class="bids_col bids_col_date"><?php echo JText::_('COM_DJCLASSIFIEDS_DATE'); ?> :</div> <div class="bids_col bids_col_bid"><?php echo JText::_('COM_DJCLASSIFIEDS_BID'); ?> :</div> <div class="clear_both"></div> </div> <?php foreach ($bids as $bid) { if ($bid->price > $min_bid) { $min_bid = $bid->price; } if ($par->get('mask_bidder_name', '0') == 1) { $bid->u_name = substr($bid->u_name, 0, 1) . '.....' . substr($bid->u_name, -1, 1); } ?> <div class="bids_row"> <div class="bids_col bids_col_name"><?php echo $bid->u_name; ?> </div> <div class="bids_col bids_col_date"><?php echo DJClassifiedsTheme::formatDate(strtotime($bid->date)); ?> </div> <div class="bids_col bids_col_bid"><?php echo DJClassifiedsTheme::priceFormat($bid->price, $item->currency); ?> </div> <div class="clear_both"></div> </div> <?php } ?> <?php } else { ?> <div class="bids_row no_bids_row"><?php echo JText::_('COM_DJCLASSIFIEDS_NO_SUBMITTED_BIDS'); ?> </div> <?php } ?> <div class="clear_both"></div> </div> </div> <?php if ($error_show_form) { ?> <div class="bids_form" id="djbids_form"> <div class="bids_box"> <div class="bids_info"> <span class="bid_label"><?php echo JText::_('COM_DJCLASSIFIEDS_PLACE_BID'); ?> </span> </div> <div class="bids_input"> <?php if ($par->get('unit_price_position', '0') == 1) { echo $item->currency ? $item->currency : $par->get('unit_price'); } ?> <input class="inputbox" id="djbid_value" type="text" name="bid_max" id="bid_max" size="30" maxlength="250" value="<?php echo $error_price; ?> " /> <?php if ($par->get('unit_price_position', '0') == 0) { echo $item->currency ? $item->currency : $par->get('unit_price'); } ?> </div> <div class="bids_button"> <button class="button" id="bid_submit"><?php echo JText::_('COM_DJCLASSIFIEDS_PLACE_BID'); ?> </button> </div> <div class="clear_both"></div> </div> <div class="clear_both"></div> </div> <?php } ?> <div id="djbid_alert"> <?php if ($bid_error) { echo $bid_message; } ?> </div> <div id="djbid_message"> <?php if (!$bid_error) { echo $bid_message; } ?> </div> </div> <?php } else { echo '<div class="auction" id="djauctions"><div id="djbid_alert" >'; echo JText::_('COM_DJCLASSIFIEDS_WRONG_AD'); echo '</div></div>'; } } else { echo '<div class="auction" id="djauctions"><div id="djbid_alert" >'; echo JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN'); echo '</div></div>'; } die; }
echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->plan->price, $par->get('unit_price', 'EUR')); if ($this->plan->points && $points_a) { echo ' - ' . $this->plan->points . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; if ($par->get('vat_value', '-1') > -1) { $p_net = round($this->plan->price / (1 + $par->get('vat_value', '-1') * 0.01), 2); echo '<div class="pd_row_net"><span>' . JText::_('COM_DJCLASSIFIEDS_NET_COST') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; echo '<div class="pd_row_tax"><span>' . JText::_('COM_DJCLASSIFIEDS_TAX') . ' (' . $par->get('vat_value', '-1') . '%)</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->plan->price - $p_net, $par->get('unit_price', '')) . '</span>'; echo '</div>'; } echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($this->plan->price, $par->get('unit_price', 'EUR')); if ($this->plan->points && $points_a) { echo ' - ' . $this->plan->points . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; ?> </td> </tr> </table> <?php $modules_djcf =& JModuleHelper::getModules('djcf-payment-middle'); if (count($modules_djcf) > 0) { echo '<div class="djcf-payment-middle clearfix">'; foreach (array_keys($modules_djcf) as $m) { echo JModuleHelper::renderModule($modules_djcf[$m], $mod_attribs); }
public static function formatDate($from, $to = null, $date_format = 0) { $par = JComponentHelper::getParams('com_djclassifieds'); if ($from == '2145913200') { return JText::_('COM_DJCLASSIFIEDS_NEVER_EXPIRE'); } else { if ($date_format) { return DJClassifiedsTheme::dateFormatFromTo($from, $to); } else { if ($par->get('date_persian', 0)) { return mds_date($par->get('date_format', 'Y-m-d H:i:s'), $from, 1); } else { return date($par->get('date_format', 'Y-m-d H:i:s'), $from); } } } }
</div> <div class="djcf_prow_desc_row"> <span class="djcf_prow_desc_label" ><?php echo JText::_("COM_DJCLASSIFIEDS_QUANTITY"); ?> :</span> <span class="djcf_prow_desc_value" ><?php echo $iorder->quantity; ?> </span> <div class="clear_both"></div> </div> </div> <div class="item_col"> <?php echo DJClassifiedsTheme::formatDate(strtotime($iorder->date)); ?> </div> <?php echo '</div>'; } ?> </div> </div> </div></div> <?php } echo '</div>'; } ?>
function process($id) { $db = JFactory::getDBO(); $app = JFactory::getApplication(); $Itemid = JRequest::getInt("Itemid", '0'); $par = JComponentHelper::getParams('com_djclassifieds'); $user = JFactory::getUser(); $config = JFactory::getConfig(); $ptype = JRequest::getVar('ptype'); $type = JRequest::getVar('type', ''); $row = JTable::getInstance('Payments', 'DJClassifiedsTable'); if ($type == 'prom_top') { $query = "SELECT i.* FROM #__djcf_items i " . "WHERE i.id=" . $id . " LIMIT 1"; $db->setQuery($query); $item = $db->loadObject(); if (!isset($item)) { $message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD'); $redirect = "index.php?option=com_djclassifieds&view=items&cid=0"; } $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $par->get('promotion_move_top_price', 0); $row->type = 2; $row->store(); $amount = $par->get('promotion_move_top_price', 0); $itemname = $item->name; $item_id = $row->id; $item_cid = '&cid=' . $item->cat_id; } else { if ($type == 'points') { $query = "SELECT p.* FROM #__djcf_points p " . "WHERE p.id=" . $id . " LIMIT 1"; $db->setQuery($query); $points = $db->loadObject(); if (!isset($item)) { $message = JText::_('COM_DJCLASSIFIEDS_WRONG_POINTS_PACKAGE'); $redirect = "index.php?option=com_djclassifieds&view=items&cid=0"; } $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $points->price; $row->type = 1; $row->store(); $amount = $points->price; $itemname = $points->name; $item_id = $row->id; $item_cid = ''; } else { if ($type == 'plan') { $query = "SELECT p.* FROM #__djcf_plans p " . "WHERE p.id=" . $id . " LIMIT 1"; $db->setQuery($query); $plan = $db->loadObject(); if (!isset($plan)) { $message = JText::_('COM_DJCLASSIFIEDS_SUBSCRIPTION_PLAN'); $redirect = "index.php?option=com_djclassifieds&view=plans"; } $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $plan->price; $row->type = 3; $row->store(); $amount = $plan->price; $itemname = $plan->name; $item_id = $row->id; $item_cid = ''; } else { $query = "SELECT i.*, c.price as c_price, 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(); if (!isset($item)) { $message = JText::_('COM_DJCLASSIFIEDS_WRONG_AD'); $redirect = "index.php?option=com_djclassifieds&view=items&cid=0"; } $amount = 0; if (strstr($item->pay_type, 'cat')) { $amount += $item->c_price / 100; } $query = "SELECT * FROM #__djcf_days d " . "WHERE d.days=" . $item->exp_days . " LIMIT 1"; $db->setQuery($query); $day = $db->loadObject(); if (strstr($item->pay_type, 'duration_renew')) { $amount += $day->price_renew; } else { if (strstr($item->pay_type, 'duration')) { $amount += $day->price; } } if (strstr($item->pay_type, 'extra_img_renew')) { if ($day->img_price_default) { $amount += $par->get('img_price_renew', '0') * $item->extra_images_to_pay; } else { $amount += $day->img_price_renew * $item->extra_images_to_pay; } } else { if (strstr($item->pay_type, 'extra_img')) { if ($day->img_price_default) { $amount += $par->get('img_price', '0') * $item->extra_images_to_pay; } else { $amount += $day->img_price * $item->extra_images_to_pay; } } } if (strstr($item->pay_type, 'extra_chars_renew')) { if ($day->char_price_default) { $amount += $par->get('desc_char_price_renew', '0') * $item->extra_chars_to_pay; } else { $amount += $day->char_price_renew * $item->extra_chars_to_pay; } } else { if (strstr($item->pay_type, 'extra_chars')) { if ($day->char_price_default) { $amount += $par->get('desc_char_price', '0') * $item->extra_chars_to_pay; } else { $amount += $day->char_price * $item->extra_chars_to_pay; } } } $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; } } /*$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();*/ $row->item_id = $id; $row->user_id = $user->id; $row->method = $ptype; $row->status = 'Start'; $row->ip_address = $_SERVER['REMOTE_ADDR']; $row->price = $amount; $row->type = 0; $row->store(); $itemname = $item->name; $item_id = $row->id; $item_cid = '&cid=' . $item->cat_id; $item_slug = $item->id . ':' . $item->alias; $cat_slug = $item->cat_id . ':' . $item->c_alias; } } } /* $query ="SELECT i.*, c.price as c_price, 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(); 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);*/ $payment_info = array(); $payment_info['id'] = $item_id; $payment_info['itemname'] = $itemname; $payment_info['amount'] = DJClassifiedsTheme::priceFormat($amount, $par->get('unit_price', '')); $payment_info['info'] = $this->params["pay_info"]; DJClassifiedsNotify::notifyUserPayment($type, $id, $payment_info); } 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">' . $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>'; }
</span> </div> <?php } ?> <?php if ($item->date_mod != '0000-00-00 00:00:00') { ?> <div class="row_gd"> <span class="row_label"><?php echo JText::_('COM_DJCLASSIFIEDS_AD_MODIFIED'); ?> :</span> <span class="row_value"> <?php echo DJClassifiedsTheme::formatDate(strtotime($item->date_mod), '', $par->get('date_format_type_item', 0)); ?> </span> </div> <?php } if ($par->get('showauthor', '1') == 1) { echo $this->loadTemplate('profile'); } /* <div class="row"> <span><?php echo JText::_('Email:'); ?></span><?php echo $item->email; ?> </div> */ if ($par->get('ask_seller_position', 0) == 1) { //general details end
echo '<td class="price">'; if ($i->price) { echo DJClassifiedsTheme::priceFormat($i->price, $i->currency); } else { echo '---'; } echo '</td>'; } if ($par->get('column_date_a', '1')) { echo '<td class="date_start">'; echo DJClassifiedsTheme::formatDate(strtotime($i->date_start)); echo '</td>'; } if ($par->get('column_date_e', '1')) { echo '<td class="date_exp">'; echo DJClassifiedsTheme::formatDate(strtotime($i->date_exp)); echo '</td>'; } if ($par->get('column_displayed', '1')) { echo '<td class="date_exp last" align="center">' . $i->display . '</td>'; } if ($par->get('column_distance', '0')) { echo '<td class="col_distance">'; if ($i->latitude && $i->longitude) { if (isset($_COOKIE["djcf_latlon"])) { echo '<span class="Tips1" title="' . JText::_('COM_DJCLASSIFIEDS_IN_A_STRAIGHT_LINE') . '">'; echo round($i->distance_latlon) . ' '; if ($par->get('column_distance_unit', 'km') == 'km') { echo JText::_('COM_DJCLASSIFIEDS_KM'); } else { echo JText::_('COM_DJCLASSIFIEDS_MI');
function display($tpl = null) { JHTML::_('behavior.modal'); $document = JFactory::getDocument(); $par = JComponentHelper::getParams('com_djclassifieds'); $app = JFactory::getApplication(); $user = JFactory::getUser(); $model = $this->getModel(); $dispatcher = JDispatcher::getInstance(); $config = JFactory::getConfig(); $cat_id = JRequest::getVar('cid', 0, '', 'int'); $uid = JRequest::getVar('uid', 0, '', 'int'); $se = JRequest::getVar('se', 0, '', 'int'); $reset = JRequest::getVar('reset', 0, '', 'int'); $layout = JRequest::getVar('layout', ''); $order = JRequest::getCmd('order', $par->get('items_ordering', 'date_e')); $ord_t = JRequest::getCmd('ord_t', $par->get('items_ordering_dir', 'desc')); $theme = $par->get('theme', 'default'); if ($layout == 'favourites') { if ($user->id == '0') { $uri = JFactory::getURI(); $app->redirect('index.php?option=com_users&view=login&return=' . base64_encode($uri), JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN')); } JRequest::setVar('fav', '1'); } if ($reset) { $items = $model->resetSearchFilters(); } $catlist = ''; if ($cat_id > 0) { $cats = DJClassifiedsCategory::getSubCatIemsCount($cat_id, 1, $par->get('subcats_ordering', 'ord'), $par->get('subcats_hide_empty', 0)); $catlist = $cat_id; foreach ($cats as $c) { $catlist .= ',' . $c->id; } } else { $cats = DJClassifiedsCategory::getCatAllItemsCount(1, $par->get('subcats_ordering', 'ord'), $par->get('subcats_hide_empty', 0)); } $subcats = ''; $cat_images = ''; foreach ($cats as $c) { if ($c->parent_id == $cat_id) { $subcats .= $c->id . ','; } } if ($subcats) { $subcats = substr($subcats, 0, -1); $cat_images = $model->getCatImages($subcats); } $items = $model->getItems($catlist); $countitems = $model->getCountItems($catlist); $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')) { if (isset($m_active->query['cid'])) { $cid_menu = $m_active->query['cid']; if ($cid_menu > 0) { $cat_menu_path = DJClassifiedsCategory::getParentPath(1, $cid_menu); } } } } if ($uid > 0 || $se || $order != $par->get('items_ordering', 'date_e') || $ord_t != $par->get('items_ordering_dir', 'desc')) { $document->setMetaData('robots', 'NOINDEX, FOLLOW'); } $warning18 = ''; $cat_id = JRequest::getVar('cid', 0, '', 'int'); $main_cat = ''; if ($cat_id > 0) { $main_cat = $model->getMainCat($cat_id); if (!$main_cat) { DJClassifiedsTheme::djAccessRestriction('category'); } if ($main_cat->metakey != '') { $document->setMetaData('keywords', $main_cat->metakey); } else { if ($m_active) { if ($m_active->params->get('menu-meta_keywords')) { $document->setMetaData('keywords', $m_active->params->get('menu-meta_keywords')); } } } if ($main_cat->metadesc != '') { $document->setDescription($main_cat->metadesc); } else { if ($m_active) { if ($m_active->params->get('menu-meta_description')) { $document->setDescription($m_active->params->get('menu-meta_description')); } } } $cat_path = array(); $pathway = $app->getPathway(); if ($main_cat->parent_id == 0) { if ($cid_menu != $cat_id) { $pathway->addItem($main_cat->name); } $cat_path[] = $main_cat; } else { $cat_path = DJClassifiedsCategory::getParentPath(1, $main_cat->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)); } } } $cat_theme = ''; 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/items'); $theme = $cat_theme; } $c_title = $document->getTitle(); $cat_name = $main_cat->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>'); $seo_title_to = array($seo_title_separator, $c_title, $cat_name, $seo_cat_path); $seo_title = str_ireplace($seo_title_from, $seo_title_to, $par->get('seo_title_items', '<category_path>|<default_title>')); $document->setTitle($seo_title); } else { if ($se && isset($_GET['se_cats'])) { if (is_array($_GET['se_cats'])) { $se_cat_id = end($_GET['se_cats']); if ($se_cat_id == '' && count($_GET['se_cats']) > 2) { $se_cat_id = $_GET['se_cats'][count($_GET['se_cats']) - 2]; } } else { $se_cat_ids = explode(',', JRequest::getVar('se_cats')); $se_cat_id = end($se_cat_ids); } $se_cat_id = (int) str_ireplace('p', '', $se_cat_id); if ($se_cat_id > 0) { $main_cat = $model->getMainCat($se_cat_id); } } } $re = JRequest::getVar('re', 0, '', 'int'); $reg_id = 0; if (isset($_GET['se_regs'])) { if (is_array($_GET['se_regs'])) { $reg_id = end($_GET['se_regs']); if ($reg_id == '' && count($_GET['se_regs']) > 2) { $reg_id = $_GET['se_regs'][count($_GET['se_regs']) - 2]; } } else { $reg_ids = explode(',', JRequest::getVar('se_regs')); $reg_id = end($reg_ids); } $reg_id = (int) $reg_id; } if ($reg_id) { $main_reg = $model->getMainRegions($reg_id); } else { $main_reg = ''; } $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='; } if ($uid > 0) { $u_name = $model->getUserName($uid); $this->assignRef('u_name', $u_name); } if ($par->get('show_types', '0')) { $types = $model->getTypes(); $this->assignRef('types', $types); } $limit = JRequest::getVar('limit', $par->get('limit_djitem_show'), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $pagination = new JPagination($countitems, $limitstart, $limit); // $main_name = $model->makePathway($cat_list); if ($par->get('rss_feed', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); } if (!isset($_COOKIE["djcf_warning18"])) { $cats_all = DJClassifiedsCategory::getCategories(); foreach ($items as $item) { if (isset($cats_all[$item->cat_id])) { if ($cats_all[$item->cat_id]->restriction_18) { $warning18 = 1; break; } } } } 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); $this->assignRef('theme', $theme); parent::display('terms'); } else { if ($cat_id > 0) { $correct_link = DJClassifiedsSEO::getCategoryRoute($main_cat->id . ':' . $main_cat->alias); $document->setMetaData('canonical', JRoute::_($correct_link)); } /* plugins */ if ($layout == 'blog') { $event_view = 'items.blog'; } else { $event_view = 'items.table'; } JPluginHelper::importPlugin('djclassifieds'); foreach ($items as $item) { $results = $dispatcher->trigger('onPrepareItemDescription', array(&$item, &$par, 'items')); $item->event = new stdClass(); $resultsAfterTitle = $dispatcher->trigger('onAfterDJClassifiedsDisplayTitle', array(&$item, &$par, $event_view)); $item->event->afterDJClassifiedsDisplayTitle = trim(implode("\n", $resultsAfterTitle)); $resultsBeforeContent = $dispatcher->trigger('onBeforeDJClassifiedsDisplayContent', array(&$item, &$par, $event_view)); $item->event->beforeDJClassifiedsDisplayContent = trim(implode("\n", $resultsBeforeContent)); $resultsAfterContent = $dispatcher->trigger('onAfterDJClassifiedsDisplayContent', array(&$item, &$par, $event_view)); $item->event->afterDJClassifiedsDisplayContent = trim(implode("\n", $resultsAfterContent)); } if (!$tpl && $layout != 'blog') { $itemid = JRequest::getVar('Itemid', ''); $menu_tpl = -1; if ($itemid) { $menu = $app->getMenu('site'); $menu_item = $menu->getItem($itemid); if ($menu_item) { $menu_tpl = $menu_item->params->get('table_type', '-1'); } } if ($menu_tpl != -1) { if ($menu_tpl != 'classic') { $tpl = $menu_tpl; } } else { if ($menu_tpl == -1 && $par->get('table_type', '')) { $tpl = $par->get('table_type', ''); } } } $custom_fields = $model->getCustomFields(); $this->assignRef('cats', $cats); $this->assignRef('cat_path', $cat_path); $this->assignRef('cat_images', $cat_images); $this->assignRef('items', $items); $this->assignRef('custom_fields', $custom_fields); $this->assignRef('countitems', $countitems); $this->assignRef('main_cat', $main_cat); $this->assignRef('main_reg', $main_reg); $this->assignRef('se_results_link', $se_results_link); $this->assignRef('pagination', $pagination); $this->assignRef('theme', $theme); parent::display('cat'); parent::display($tpl); } }
echo '<img src="' . JURI::base() . '/components/com_djclassifieds/assets/images/sort_asc.gif" />'; } } else { echo '<img src="' . JURI::base() . '/components/com_djclassifieds/assets/images/sort.gif" />'; } ?> </a> </th> </tr> <?php foreach ($this->points as $point) { $row = $r == TRUE ? '0' : '1'; $r = !$r; echo '<tr class="row' . $row . '">'; echo '<td class="first">' . $point->description . '</td>'; echo '<td class="points">' . $point->points . '</td>'; echo '<td class="date">' . DJClassifiedsTheme::formatDate(strtotime($point->date)) . '</td>'; echo '</tr>'; } ?> </table> <div class="pagination"> <?php echo $this->pagination->getPagesLinks(); ?> </div> </div> </div>
} else { echo $f->value; } } else { if ($f->type == 'checkbox') { if ($f->value == '') { echo '---'; } else { echo str_ireplace(';', ', ', substr($f->value, 1, -1)); } } else { if ($f->type == 'date') { if ($f->value_date == '0000-00-00') { echo '---'; } else { echo DJClassifiedsTheme::formatDate(strtotime($f->value_date)); } } else { if ($f->type == 'link') { if ($f->value == '') { echo '---'; } else { if (strstr($f->value, 'http://') || strstr($f->value, 'https://')) { echo '<a ' . $f->params . ' href="' . $f->value . '">' . str_ireplace(array("http://", "https://"), array('', ''), $f->value) . '</a>'; } else { echo '<a ' . $f->params . ' href="http://' . $f->value . '">' . $f->value . '</a>'; } } } else { if ($f->value == '') { echo '---';
<h3><?php echo $point->name; ?> </h3> <?php echo JText::_("COM_DJCLASSIFIEDS_POINTS") . ': ' . $point->points; ?> <br /> <?php echo JText::_("COM_DJCLASSIFIEDS_COST_PER_POINT") . ': ' . DJClassifiedsTheme::priceFormat(round($point->price / $point->points, 2), $par->get('unit_price', '')); ?> </td> <td width="100" align="center" class="td3"> <div class="pp_price"><?php echo DJClassifiedsTheme::priceFormat($point->price, $par->get('unit_price', '')); ?> </div> <a class="button" href="index.php?option=com_djclassifieds&view=payment&type=points&id=<?php echo $point->id; ?> " style="text-decoration:none;"> <?php echo JText::_('COM_DJCLASSIFIEDS_BUY_NOW'); ?> </a> </td> </tr> </table> </tr> <?php
foreach ($this->promotions as $prom) { if (strstr($this->item->pay_type, $prom->name)) { echo '<div class="pd_row"><span>' . JText::_($prom->label) . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($prom->price, $par->get('unit_price', '')); if ($points_a && $prom->points) { echo ' / ' . $prom->points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span></div>'; $p_total += $prom->price; $points_total += $prom->points; $p_count++; } } if ($p_count > 1) { echo '<div class="pd_row_total"><span>' . JText::_('COM_DJCLASSIFIEDS_TOTAL') . '</span>'; echo '<span class="price">' . DJClassifiedsTheme::priceFormat($p_total, $par->get('unit_price', '')); if ($points_a && $points_total) { echo ' / ' . $points_total . ' ' . JTEXT::_('COM_DJCLASSIFIEDS_POINTS'); } echo '</span></div>'; } ?> </td> </tr> </table> <table cellpadding="0" cellspacing="0" width="98%" border="0" class="paymentdetails"> <tr> <td class="td_title"> <h2><?php echo JText::_("COM_DJCLASSIFIEDS_PAYMENT_METHODS"); ?>
function display($tpl = null) { JHTML::_('behavior.modal'); $document = JFactory::getDocument(); $par = JComponentHelper::getParams('com_djclassifieds'); $app = JFactory::getApplication(); $user = JFactory::getUser(); $model = $this->getModel(); $cat_id = JRequest::getVar('cid', 0, '', 'int'); $uid = JRequest::getVar('uid', 0, '', 'int'); $se = JRequest::getVar('se', 0, '', 'int'); $reset = JRequest::getVar('reset', 0, '', 'int'); $layout = JRequest::getVar('layout', ''); $order = JRequest::getCmd('order', $par->get('items_ordering', 'date_e')); $ord_t = JRequest::getCmd('ord_t', $par->get('items_ordering_dir', 'desc')); $theme = $par->get('theme', 'default'); if ($layout == 'favourites') { if ($user->id == '0') { $uri = JFactory::getURI(); $app->redirect('index.php?option=com_users&view=login&return=' . base64_encode($uri), JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN')); } JRequest::setVar('fav', '1'); } if ($reset) { $items = $model->resetSearchFilters(); } $catlist = ''; if ($cat_id > 0) { $cats = DJClassifiedsCategory::getSubCatIemsCount($cat_id, 1, $par->get('subcats_ordering', 'ord'), $par->get('subcats_hide_empty', 0)); $catlist = $cat_id; foreach ($cats as $c) { $catlist .= ',' . $c->id; } } else { $cats = DJClassifiedsCategory::getCatAllItemsCount(1, $par->get('subcats_ordering', 'ord'), $par->get('subcats_hide_empty', 0)); } $subcats = ''; $cat_images = ''; foreach ($cats as $c) { if ($c->parent_id == $cat_id) { $subcats .= $c->id . ','; } } if ($subcats) { $subcats = substr($subcats, 0, -1); $cat_images = $model->getCatImages($subcats); } $items = $model->getItems($catlist); $countitems = $model->getCountItems($catlist); $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')) { if (isset($m_active->query['cid'])) { $cid_menu = $m_active->query['cid']; if ($cid_menu > 0) { $cat_menu_path = DJClassifiedsCategory::getParentPath(1, $cid_menu); } } } } if ($uid > 0 || $se || $order != $par->get('items_ordering', 'date_e') || $ord_t != $par->get('items_ordering_dir', 'desc')) { $document->setMetaData('robots', 'NOINDEX, FOLLOW'); } $cat_id = JRequest::getVar('cid', 0, '', 'int'); $main_cat = ''; if ($cat_id > 0) { $main_cat = $model->getMainCat($cat_id); if ($main_cat->metakey != '') { $document->setMetaData('keywords', $main_cat->metakey); } else { if ($m_active) { if ($m_active->params->get('menu-meta_description')) { $document->setMetaData('keywords', $m_active->params->get('menu-meta_description')); } } } if ($main_cat->metadesc != '') { $document->setDescription($main_cat->metadesc); } else { if ($m_active) { if ($m_active->params->get('menu-meta_keywords')) { $document->setDescription($m_active->params->get('menu-meta_keywords')); } } } $cat_path = array(); $pathway = $app->getPathway(); if ($main_cat->parent_id == 0) { if ($cid_menu != $cat_id) { $pathway->addItem($main_cat->name); } $cat_path[] = $main_cat; } else { $cat_path = DJClassifiedsCategory::getParentPath(1, $main_cat->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)); } } } $cat_theme = ''; 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/items'); $theme = $cat_theme; } $c_title = $document->getTitle(); $cat_name = $main_cat->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>'); $seo_title_to = array($seo_title_separator, $c_title, $cat_name, $seo_cat_path); $seo_title = str_ireplace($seo_title_from, $seo_title_to, $par->get('seo_title_items', '<category_path>|<default_title>')); $document->setTitle($seo_title); } else { if ($se && isset($_GET['se_cats'])) { $se_cat_id = end($_GET['se_cats']); if ($se_cat_id == '' && count($_GET['se_cats']) > 2) { $se_cat_id = $_GET['se_cats'][count($_GET['se_cats']) - 2]; } $se_cat_id = str_ireplace('p', '', $se_cat_id); if ($se_cat_id > 0) { $main_cat = $model->getMainCat($se_cat_id); } } } $re = JRequest::getVar('re', 0, '', 'int'); $reg_id = 0; if (isset($_GET['se_regs'])) { if (count($_GET['se_regs']) > 1) { $main_reg = ''; } else { $reg_id = end($_GET['se_regs']); if ($reg_id == '' && count($_GET['se_regs']) > 2) { $reg_id = $_GET['se_regs'][count($_GET['se_regs']) - 2]; } $reg_id = (int) $reg_id; if ($reg_id) { $main_reg = $model->getMainRegions($reg_id); } else { $main_reg = ''; } } } if ($uid > 0) { $u_name = $model->getUserName($uid); $this->assignRef('u_name', $u_name); } if ($par->get('show_types', '0')) { $types = $model->getTypes(); $this->assignRef('types', $types); } $limit = JRequest::getVar('limit', $par->get('limit_djitem_show'), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $pagination = new JPagination($countitems, $limitstart, $limit); // $main_name = $model->makePathway($cat_list); if ($par->get('rss_feed', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); } $custom_fields = $model->getCustomFields(); $this->assignRef('cats', $cats); $this->assignRef('cat_path', $cat_path); $this->assignRef('cat_images', $cat_images); $this->assignRef('items', $items); $this->assignRef('custom_fields', $custom_fields); $this->assignRef('countitems', $countitems); $this->assignRef('main_cat', $main_cat); $this->assignRef('main_reg', $main_reg); $this->assignRef('pagination', $pagination); $this->assignRef('theme', $theme); parent::display('cat'); parent::display($tpl); }
} <?php if ($imgfreelimit > -1 && $par->get('durations_list', '') && $id == 0 && count($this->days)) { ?> var img_prices = []; document.id('exp_days').addEvent('change', function(){ document.id('extra_img_price').innerHTML = img_prices[document.id('exp_days').value]; }); <?php foreach ($this->days as $day) { if ($day->img_price_default == 0) { $img_price = DJClassifiedsTheme::priceFormat($day->img_price, $par->get('unit_price')); if ($points_a && $day->img_points > 0) { $img_price .= ' - ' . $day->img_points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'img_prices[' . $day->days . ']="' . addslashes($img_price) . '"; '; } else { $img_price = DJClassifiedsTheme::priceFormat($par->get('img_price', '0'), $par->get('unit_price')); if ($points_a && $par->get('img_price_points', '0') > 0) { $img_price .= ' - ' . $par->get('img_price_points', '0') . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo 'img_prices[' . $day->days . ']="' . addslashes($img_price) . '"; '; } } ?> <?php } ?> </script> </div>
</div> <?php } ?> </div> <div class="additem_djform_in"> <?php foreach ($this->promotions as $prom) { ?> <div class="djform_row"> <label class="label" > <?php echo JText::_($prom->label) . '<br /><span>' . JText::_('COM_DJCLASSIFIEDS_PRICE') . ' '; echo DJClassifiedsTheme::priceFormat($prom->price, $par->get('unit_price')); if ($points_a && $prom->points > 0) { echo ' - ' . $prom->points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } echo '</span>'; ?> </label> <div class="djform_field"> <div class="djform_prom_v" > <div class="djform_prom_v_in" > <input type="radio" name="<?php echo $prom->name; ?> " value="1" <?php if (strstr($this->item->promotions, $prom->name)) {
public function getCategorySelect() { header("Content-type: text/html; charset=utf-8"); $id = JRequest::getInt('cat_id', '0'); $par = JComponentHelper::getParams('com_djclassifieds'); $db = JFactory::getDBO(); $user = JFactory::getUser(); $unit_price = $par->get('unit_price', ''); $points_a = $par->get('points', 0); if ($id > 0) { $query = "SELECT * FROM #__djcf_categories WHERE id='" . $id . "' AND published=1 "; $db->setQuery($query); $parent_cat = $db->loadObject(); $query = "SELECT * FROM #__djcf_categories WHERE parent_id='" . $id . "' AND published=1 "; $db->setQuery($query); $cats = $db->loadObjectList(); if ($cats) { $cl_select = ''; if ($parent_cat->ads_disabled) { $cl_select = ' class="cat_sel required validate-djcat" '; } echo '<div class="clear_both"></div>'; echo '<select ' . $cl_select . ' style="width:210px" name="cats[]" id="cat_' . $id . '" onchange="new_cat(' . $id . ',this.value,new Array());getFields(this.value);">'; echo '<option value="p' . $id . '">' . JTEXT::_('COM_DJCLASSIFIEDS_CATEGORY_SELECTOR_EMPTY_VALUE') . '</option>'; foreach ($cats as $cat) { if ($cat->price > 0) { $cat->price = $cat->price / 100; $cat->name .= ' (' . DJClassifiedsTheme::priceFormat($cat->price, $unit_price); if ($cat->points > 0 && $points_a) { $cat->name .= ' - ' . $cat->points . JTEXT::_('COM_DJCLASSIFIEDS_POINTS_SHORT'); } $cat->name .= ')'; } echo '<option value="' . $cat->id . '">' . str_ireplace("'", "'", $cat->name) . '</option>'; } echo '</select>'; echo "<div id=\"after_cat_{$id}\"></div>"; } } die; }
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); } else { if ($category->metakey != '') { $document->setMetaData('keywords', $category->metakey); } else { if ($m_active) { 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->image_url != '') { $images = explode(";", $item->image_url); $document->setMetaData('og:image', JURI::base() . 'components/com_djclassifieds/images/' . $images[0]); } /* plugins */ JPluginHelper::importPlugin('djclassifieds'); $results = $dispatcher->trigger('onPrepareItemDescription', array(&$item, &$par)); $item->event = new stdClass(); $resultsAfterTitle = $dispatcher->trigger('onAfterDJClassifiedsDisplayTitle', array(&$item, &$par)); $item->event->afterDJClassifiedsDisplayTitle = trim(implode("\n", $resultsAfterTitle)); $resultsBeforeContent = $dispatcher->trigger('onBeforeDJClassifiedsDisplayContent', array(&$item, &$par)); $item->event->beforeDJClassifiedsDisplayContent = trim(implode("\n", $resultsBeforeContent)); $resultsAfterContent = $dispatcher->trigger('onAfterDJClassifiedsDisplayContent', array(&$item, &$par)); $item->event->afterDJClassifiedsDisplayContent = trim(implode("\n", $resultsAfterContent)); $pathway->addItem($item->name); $this->assignRef('item', $item); $this->assignRef('item_images', $item_images); $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); parent::display($tpl); }
public static function formatDate($from, $to = null) { $par = JComponentHelper::getParams('com_djclassifieds'); if ($par->get('date_format_type', 0)) { return DJClassifiedsTheme::dateFormatFromTo($from, $to); } else { if ($par->get('date_persian', 0)) { return mds_date($par->get('date_format', 'Y-m-d H:i:s'), $from, 1); } else { return date($par->get('date_format', 'Y-m-d H:i:s'), $from); } } }
</span> <?php } ?> </div> </div> <?php } ?> <?php echo '<div class="disp_item"><img src="http://imakler.az/templates/jm-joomads/images/img-view.png" alt="Date-icon" height="20" width="20" style="padding-right: 5px;">'; echo $item->display; echo '</div>'; echo '<div class="pub_date"><img src="http://imakler.az/templates/jm-joomads/images/date.png" alt="Date-icon" height="20" width="20" style="padding-right: 5px;">'; echo DJClassifiedsTheme::formatDate(strtotime($item->date_start)); echo '</div>'; ?> <?php if ($par->get('favourite', '1')) { if ($user->id > 0 && $item->f_id) { echo '<a title="' . JText::_('COM_DJCLASSIFIEDS_DELETE_FROM_FAVOURITES') . '" href="index.php?option=com_djclassifieds&view=item&task=removeFavourite&cid=' . $item->cat_id . '&id=' . $item->id . '&Itemid=' . $Itemid . '">'; echo ' <img src="' . JURI::base() . '/components/com_djclassifieds/assets/images/fav_a.png" width="16px" class="fav_ico"/>'; echo '<span class="fav_label">' . JText::_('COM_DJCLASSIFIEDS_FAVOURITE') . '</span>'; echo '</a>'; } else { echo '<a title="' . JText::_('COM_DJCLASSIFIEDS_ADD_TO_FAVOURITES') . '" href="index.php?option=com_djclassifieds&view=item&task=addFavourite&cid=' . $item->cat_id . '&id=' . $item->id . '&Itemid=' . $Itemid . '">'; echo ' <img src="' . JURI::base() . '/components/com_djclassifieds/assets/images/fav_na.png" width="16px" class="fav_ico"/>'; echo '<span class="nfav_label">' . JText::_('COM_DJCLASSIFIEDS_ADD_TO_FAVOURITES') . '</span>'; echo '</a>'; }
echo $extra_p; } } ?> <div class="ch_row_total"> <span class="ch_label"> <?php echo JText::_('COM_DJCLASSIFIEDS_TOTAL'); ?> : </span> <span class="ch_value"> <?php $total = $item->price * $quantity; $dispatcher->trigger('onPrepareCheckouPaymentTotal', array(&$item, &$par, $quantity, &$total)); echo DJClassifiedsTheme::priceFormat($total, $item->currency); ?> </span> </div> <div class="ch_row_button"> <a class="button btn button_cancel" href="<?php echo DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $item->c_alias); ?> "> <?php echo JText::_('COM_DJCLASSIFIEDS_CANCEL'); ?> </a> <form action="index.php" method="post" name="djForm" id="djForm" class="form-validate" enctype="multipart/form-data" > <button class="button validate" type="submit" id="submit_b" ><?php echo JText::_('COM_DJCLASSIFIEDS_BUYNOW');