-
AuthorPosts
-
Sherlock Friend
Sherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 15, 2011 at 9:53 am #412829Hi mrfash,
Just try this
open the file of modulesmod_jaclatest_commentstmpldefault.php and replace it’s content by below content
[PHP]
<?php // no direct access
defined(‘_JEXEC’) or die(‘Restricted access’);
$
show = array();
?>
<?php if($list):?>
<div id=”jac-lasmod<?php echo $module->id;?>” class=”jac-lasmod”>
<div class=”ja-box-ct clearfix”>
<ul class=”jac-lasmod-main”>
<?php foreach ($list as $item):?>
<li class=”jac-has-layout”>
<?php if($params->get(“show_content_title”,1)):?>
<?php if(!isset( $show[$item->contentid])) :
$show[$item->contentid] = true;
?>
<h4 class=”jac-lasmod-title”>
<a href=”<?php echo $item->referer;?>”>
<?php echo $item->contenttitle;?><?php if($params->get(“showcommentcount”,1)):?>(<?php echo $item->commentcount;?>)<?php endif;?>
</a>
</h4>
<?php endif ?>
<?php endif;?>
<?php if($params->get(“avatar”, “1”)):?>
<?php
$avartaSize = $params->get(“avatar_size”, “”);
if($avartaSize){
$avartaSize = “width:”.$avartaSize.”px;height:”.$avartaSize.”px”;
}
?>
<?php if(is_array($item->avatar[0])):?>
<img alt=”<?php echo $item->author_info;?>” src=”<?php echo $item->avatar[0][0];?>” style=”<?php echo $avartaSize;?>”>
<?php else:?>
<img alt=”<?php echo $item->author_info;?>” src=”<?php echo $item->avatar[0];?>” style=”<?php echo $avartaSize;?>”>
<?php endif;?>
<?php endif;?>
<?php if($params->get(“show_author_info”,1)):?>
<span class=”jac-lasmod-author”><?php echo $item->author_info;?></span>
<?php endif;?>
<?php if($params->get(“show_date”,1)):?>
<span class=”jac-lasmod-time”><?php echo $item->date;?></span>
<?php endif;?><?php if($params->get(“showcontent”,1)):?>
<br />
<div class=”jac-lasmod-title”>
<?php echo $item->comment;?>
</div>
<?php endif;?>
<?php if($params->get(“show_vote”,1)):?>
<p class=”jac-lasmod-vote”>
<?php echo JText::_(“Number of vote:”).$item->voted;?>
</p>
<?php endif;?>
</li>
<?php endforeach;?>
</ul>
</div>
</div>
<?php endif;?>
[/PHP]hope that help !
mrfast Friendmrfast
- Join date:
- November 2010
- Posts:
- 100
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 5
- Thanked:
- 4 times in 1 posts
September 15, 2011 at 9:53 am #412830<em>@Dat Hoang 267838 wrote:</em><blockquote>Hi mrfash,
you can open the file of modulesmod_jaclatest_commentstmpldefault.php and replace it’s content by below content
[PHP]
<?php // no direct access
defined(‘_JEXEC’) or die(‘Restricted access’);
$show = array();
?>
<?php if($list):?>
<div id=”jac-lasmod<?php echo $module->id;?>” class=”jac-lasmod”>
<div class=”ja-box-ct clearfix”>
<ul class=”jac-lasmod-main”>
<?php foreach ($list as $item):?>
<li class=”jac-has-layout”>
<?php if($params->get(“show_content_title”,1)):?>
<?php if(!isset( $show[$item->contentid])) :
$show[$item->contentid] = true;
?>
<h4 class=”jac-lasmod-title”>
<a href=”<?php echo $item->referer;?>”>
<?php echo $item->contenttitle;?><?php if($params->get(“showcommentcount”,1)):?>(<?php echo $item->commentcount;?>)<?php endif;?>
</a>
</h4>
<?php endif ?>
<?php endif;?>
<?php if($params->get(“avatar”, “1”)):?>
<?php
$avartaSize = $params->get(“avatar_size”, “”);
if($avartaSize){
$avartaSize = “width:”.$avartaSize.”px;height:”.$avartaSize.”px”;
}
?>
<?php if(is_array($item->avatar[0])):?>
<img alt=”<?php echo $item->author_info;?>” src=”<?php echo $item->avatar[0][0];?>” style=”<?php echo $avartaSize;?>”>
<?php else:?>
<img alt=”<?php echo $item->author_info;?>” src=”<?php echo $item->avatar[0];?>” style=”<?php echo $avartaSize;?>”>
<?php endif;?>
<?php endif;?>
<?php if($params->get(“show_author_info”,1)):?>
<span class=”jac-lasmod-author”><?php echo $item->author_info;?></span>
<?php endif;?>
<?php if($params->get(“show_date”,1)):?>
<span class=”jac-lasmod-time”><?php echo $item->date;?></span>
<?php endif;?><?php if($params->get(“showcontent”,1)):?>
<br />
<div class=”jac-lasmod-title”>
<?php echo $item->comment;?>
</div>
<?php endif;?>
<?php if($params->get(“show_vote”,1)):?>
<p class=”jac-lasmod-vote”>
<?php echo JText::_(“Number of vote:”).$item->voted;?>
</p>
<?php endif;?>
</li>
<?php endforeach;?>
</ul>
</div>
</div>
<?php endif;?>
[/PHP]hope that help !</blockquote>
Hi Dat,
After update your code, it’s work so bad view http://zeolite2.fast.com.vnI need listed article with count comment descending and do not duplicate.
every article just display one time with count comment and order by total comment. Please remember: “every article just display one time” different with “just display one article with most comment”Example
– Article 1(10 comment)
– Article 2(5 comment)
– Articlle 3(2 comment)
-…My English not well but I think it do not difficult to understand.
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 15, 2011 at 10:00 am #412832Hi mrfast,
yeah, my change would help to display every article just one time, i checked your site and saw that the Mode latest comment module is working well
mrfast Friendmrfast
- Join date:
- November 2010
- Posts:
- 100
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 5
- Thanked:
- 4 times in 1 posts
September 15, 2011 at 11:09 am #412846Posted on: 15 September 2011 05:02 PM
Hi mrfast,yeah, my change would help to display every article just one time, i checked your site and saw that the Mode latest comment module is working well
Sincerely,Dat Hoang Quoc
JoomlArt Customer Service.
——————————–
J.O.O.M Solutions Co., Ltd
http://www.joomlart.com – http://www.joomlancers.comOh, My God!!!.
I don’t complain with mode “show latest comment”.I need mode “show popular comment” must order by total comment descending, do not duplicate, and just display latest comment(do not show older comments in every article)
If I configuration show number items is three then mode “show popular comment” must work like
Example
– Lorem ipsum dolor (9)
– Apple Mac Air (7)
– Welcome to JA Zeolite (2)at present it(mode “show popular comment”) can order by total comment descending and show article with all comment, i want just show every article with once latest comment.
mrfast Friendmrfast
- Join date:
- November 2010
- Posts:
- 100
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 5
- Thanked:
- 4 times in 1 posts
September 16, 2011 at 2:03 am #412990Posted on: 16 September 2011 08:22 AM
Hi mrfast,My solution would help to not duplicate the articles, please kindly check it again
Sincerely,
Dat Hoang Quoc
JoomlArt Customer Service.
——————————–
J.O.O.M Solutions Co., Ltd
http://www.joomlart.com – http://www.joomlancers.comAt present mode “show popular comment” not duplicate article title => OK, but it show all comment of every article => NOT OK.
Now, I need every article just display once latest comment.
15848
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 16, 2011 at 7:22 am #413050<em>@mrfast 268113 wrote:</em><blockquote>At present mode “show popular comment” not duplicate article title => OK, but it show all comment of every article => NOT OK.
Now, I need every article just display once latest comment.
15848</blockquote>Look for this snap of code in the file modulesmod_jaclatest_commentshelper.php
[PHP] $query = “SELECT cm.*, c.title AS content_title,(select count(*) from #__jacomment_items where contentid = cm.contentid) as count FROM #__jacomment_items as cm ”
. “n LEFT JOIN #__content as c ON cm.contentid = c.id”
. “n WHERE 1 {$where} ”
. “n ORDER BY {$order} DESC ”
. “n LIMIT ” . intval( $count );[/PHP]change it to
[PHP]
if($params->get(“sort_type”, 1) == “1”){$query = “SELECT cm.*, c.title AS content_title,(select count(*) from #__jacomment_items where contentid = cm.contentid) as count FROM #__jacomment_items as cm ”
. “n LEFT JOIN #__content as c ON cm.contentid = c.id”
. “n WHERE 1 {$where} ”
. “n ORDER BY {$order} DESC ”
. “n LIMIT ” . intval( $count );
}else{$query = “SELECT cm.*, c.title AS content_title,(select count(*) from #__jacomment_items where contentid = cm.contentid) as count FROM #__jacomment_items as cm ”
. “n LEFT JOIN #__content as c ON cm.contentid = c.id”
. “n WHERE 1 {$where} and cm.id = (select max(id) from #__jacomment_items where contentid = cm.contentid) ”
. “n ORDER BY {$order} DESC ”
. “n LIMIT ” . intval( $count );}
[/PHP]hope that should help !
AuthorPostsThis topic contains 21 replies, has 3 voices, and was last updated by Sherlock 13 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum