Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @package DJ-Reviews
- * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
- * @license http://www.gnu.org/licenses GNU/GPL
- * @author url: http://dj-extensions.com
- * @author email contact@dj-extensions.com
- *
- * DJ-Reviews is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * DJ-Reviews 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-Reviews. If not, see <http://www.gnu.org/licenses/>.
- *
- */
- defined('_JEXEC') or die('Restricted access');
- $db= JFactory::getDBO();
- $query = "SELECT * FROM #__djcf_types WHERE published=1";
- $db->setQuery($query);
- $types=$db->loadObjectList('id');
- foreach($types as $type){
- $registry = new JRegistry();
- $registry->loadString($type->params);
- $type->params = $registry->toObject();
- }
- //echo '<pre>';print_r($types);die();
- $anch = '#dj-classifieds';
- $par = JComponentHelper::getParams( 'com_djclassifieds' );
- $params_ = JComponentHelper::getParams( 'com_djreviews' );
- ?>
- <div class="djrv_listing row-striped mod_djreviews">
- <?php if (count($data)) {?>
- <?php foreach ($data as $item) {
- $i = $item->user_info;
- $last_rew = $item->last_rev;
- if ($item->name && $i->id) {
- ?>
- <div class="djrv_single_review row-fluid djrv_clearfix" style="margin-bottom: 25px;">
- <div class="span3">
- <?php if (!empty($item->main_image->thumb_s)) {?>
- <img src="<?php echo $item->main_image->thumb_s; ?>" alt="<?php echo htmlspecialchars($item->name);?>" />
- <?php } ?>
- </div>
- <div class="span9">
- <div class="item_title">
- <?php
- echo '<h3>
- <a class="title" href="'.DJClassifiedsSEO::getItemRoute($i->id.':'.$i->alias,$i->cat_id.':'.$i->c_alias,$i->region_id.':'.$i->r_name,$i->extra_cats).$anch.'" >'.$i->name.'</a>';
- if(isset($types[$i->type_id])){
- $type = $types[$i->type_id];
- if($type->params->bt_class){
- $bt_class = ' '.$type->params->bt_class;
- }else{
- $bt_class = '';
- }
- echo '<span class="item_type" style="text-align:center" >';
- if($type->params->bt_use_styles){
- $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.'"';
- echo '<span class="type_button'.$bt_class.'" '.$style.' >'.$type->name.'</span>';
- }else{
- echo '<span class="type_label'.$bt_class.'" >'.$type->name.'</span>';
- }
- echo '</span>';
- echo '<div class="item_category" style="font-size: 14px; font-weight: 300;">' . $i->address . '</div>';
- }
- echo '</h3>';
- ?>
- <div class="djrv_rating small">
- <span class="djrv_stars">
- <?php /*for ($i = 1; $i <= 5; $i++) {?>
- <span class="djrv_star <?php if ($i <= $item->avg_rate || ($item->avg_rate - $i) >= -0.5) echo 'active';?>"></span>
- <?php }*/ ?>
- <span class="djrv_stars_sprite"><span class="djrv_stars_sprite_rating" style="width:<?php echo 100 * ($item->avg_rate / 5); ?>%;"></span></span>
- <span class="djrv_avg">
- <?php echo $item->avg_rate; ?>
- <?php echo '('.$item->review_count.')'; ?>
- </span>
- </span>
- </div>
- <div class="item_cat_region_outer">
- <?php if($par->get('column_category','1')){ ?>
- <?php $class='';
- if($par->get('column_category','1')=='2'){$class.=' hide_mobile';}
- else if($par->get('column_category','1')=='3'){$class.=' hide_tablet hide_mobile';} ?>
- <div class="item_category<?php echo $class;?>">
- <?php echo '<a href="'.DJClassifiedsSEO::getCategoryRoute($i->cat_id.':'.$i->c_alias).'" >'.$i->c_name.'</a>'; ?>
- </div>
- <?php } ?>
- <?php if($par->get('column_category','1') && ($par->get('column_loc','1') && $par->get('show_regions','1'))){ ?>
- <span class="item_cat_region_separator"></span>
- <?php }?>
- </div>
- <div class="clear_both"></div>
- </div>
- <?php if ($last_rew->user_login) {?>
- <div class="djrv_single_review row-fluid djrv_clearfix" style="margin-top: 10px">
- <div class="span2">
- <?php
- $iterUser = JFactory::getUser($last_rew->created_by);
- $customFields = FieldsHelper::getFields('com_users.user', $iterUser, true);
- if ($customFields[0]->value) {
- ?>
- <div class="profile_img" style="width:50px!important"><?php echo $customFields[0]->value; ?></div>
- <?php } else {
- $avatar = $params_->get('public_avatar');
- $avatar = JUri::base(true).'/media/djreviews/avatars/'.$avatar;
- ?>
- <div class="profile_img" style="width:50px!important"><img alt="<?php echo $item->user_login; ?>" src="<?php echo $avatar; ?>" /></div>
- <?php
- }
- ?>
- </div>
- <div class="span10">
- <?php if ($last_rew->user_login) {?>
- <div class="djrv_post_info">
- <div class="djrv_poster small">
- <?php echo JText::sprintf('MOD_DJREVIEWS_POSTED_BY_ON', '<span itemprop="author">'.htmlspecialchars($last_rew->user_login).'</span>', JHtml::_('date', $last_rew->created, $params->get('date_format', 'd-m-Y H:i'))); ?>
- </div>
- </div>
- <?php } ?>
- <?php if ($last_rew->title) {?>
- <div class="djrv_review_title">
- <strong><a href="<?php echo JRoute::_($last_rew->object_url); ?>"><?php echo htmlspecialchars($item->title); ?></a></strong>
- </div>
- <?php } ?>
- <?php if ($last_rew->message) {?>
- <div class="djrv_review_message">
- <div class="box">
- <div>
- <p><?php
- $str = mb_strimwidth($last_rew->message, 0, 150, "...");
- echo nl2br($str);
- ?></p>
- </div>
- </div>
- </div>
- <?php } ?>
- </div>
- </div>
- <?php } ?>
- <?php } ?>
- </div>
- </div>
- <?php } ?>
- <?php }?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement