test
Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • mrfast Friend
    #168055

    Hi all,
    I have used component ja_comment with modules ja_latest_comment version newest. With modules ja_latest_comment
    when use module mode “show popular comment“, every article show many time(if have many comment). That is mean if I limit “Count” about 3-5 then just one article(have most comment) can show.
    But Ja_Staff say

    Nhat Nguyen Xuan
    It’s a feature of mod_jaclatest_comments. It shows all latest comments even their replies.

    I think it’s a stupid feature because It shows all latest comments even their replies then user just know one or two article. I want every article just display one time(with latest comment) and order by “Count” descending.

    Everybody can let me know, how can do that.
    Thanks

    p/s: you will see this feature very very stupid if you config just display title of content(Module mode show popular comment).

    mrfast Friend
    #411107

    Modules ja_latest_comment(module mode popular) work not good. I think it have mistake logical while coding. With popular option everybody will think article with the most comment must go on top. But ja_latest_comment do not work like that, in this case it do not showing !!!.

    I see function getList() in mod_jalatest_commentshelper.php I think it have problem.
    [php]
    function getList(&$params) {
    global $mainframe;
    $source = $params->get(“type”, “com_content”);
    $items = array();

    $order = ”;
    $type = $params->get(“sort_type”, 1);
    if($type == “1”){
    $order = ” cm.id”;
    }else{
    $order = ” cm.voted”;
    }

    $count = $params->get(“count”, 1);

    switch ($source){
    case “com_content”:
    $items = modJACLatestItemsHelper::getLatestFromContent($params, $order, $count);
    break;
    case “com_k2”:
    $items = modJACLatestItemsHelper::getLatestFromk2($params,$order,$count);
    break;
    default:
    $items = modJACLatestItemsHelper::getLatestFromOther($params, $order,$count);
    }
    return $items;
    }
    [/php]
    I don’t understand why are they order by voted???. I want order by number of comments(count), I have find in table #__comments_items but do not have any field count comment. Anybody have suggestion for this issue???
    Thanks
    15657

    Everybody can view full stupid feature at: http://zeolite2.fast.com.vn


    1. module-mode-popular
    Sherlock Friend
    #411158

    Hi mrfast,

    if you want to order by the number of comments(count), you can open the file of modulesmod_jaclatest_commentsmod_jaclatest_comments.php

    change this line of code
    [PHP]
    modJACLatestItemsHelper::parseItems($params,$list);

    [/PHP]

    to this

    [PHP]
    modJACLatestItemsHelper::parseItems($params,$list);

    for($i=0;$i<count($list);$i++){
    for($j=0;$j<(count($list)-1-$i);$j++){
    if($list[$j]->commentcount < $list[$j+1]->commentcount){

    $temp = $list[$j+1];
    $list[$j+1] = $list[$j];
    $list[$j] = $temp;
    }
    }
    }
    [/PHP]

    Hope that make sense !

    mrfast Friend
    #411382

    Thanks for your reply. But your code not work, Nothing changed after insert your code. You can test at http://zeolite2.fast.com.vn. More detail website please review ID ticket: DYE-594-25131.

    15691


    1. counter-comment
    Sherlock Friend
    #411486

    <em>@mrfast 266119 wrote:</em><blockquote>Thanks for your reply. But your code not work, Nothing changed after insert your code. You can test at http://zeolite2.fast.com.vn. More detail website please review ID ticket: DYE-594-25131.

    15691</blockquote>

    I saw that your module is showing one item which has totally 7 comments so how can you see the order, kindly change setting to show more than one items…

    mrfast Friend
    #411536

    <em>@Dat Hoang 266257 wrote:</em><blockquote>I saw that your module is showing one item which has totally 7 comments so how can you see the order, kindly change setting to show more than one items…</blockquote>
    Oh my God!!!
    Order by total comment is mean article with the most comments will go on top. In this case if module work true logic so the article have total 8 comment(Leo felis vitae sollicitudin Aenean) will go on top despite I config display how many items showing(greater than or equal 1). Because if article have total 49 comment and other article have total 50 comment, so must I configuration how many number for article have total 50 comment go on top???

    I think you must find better solutions for issue.

    Sherlock Friend
    #411613

    Hi mrfast,

    when you select popular mode in the module back-end then the module would show out the most voted comments in the front-end.
    you should keep in mind that the module is for showing most popular comments (which is voted most) not for showing popular articles.
    My solution only help to order those comments by the number of comment of the article they belong to.

    I hope you understand !

    mrfast Friend
    #411615

    Hi all,
    I have receive reply from support ticket: #BQL-378-25799

    Dat Hoang Quoc Posted on: 09 September 2011 09:07 AM
    Hi mrfast,

    when you select popular mode in the module back-end then the module would show out the most voted comments in the front-end.
    you should keep in mind that the module is for showing most popular comments (which is voted most) not for showing popular articles.
    My solution only help to order those comments by the number of comment of the article they belong to.

    I hope you understand !
    Sincerely,

    Dat Hoang Quoc
    JoomlArt Customer Service.
    ——————————–
    J.O.O.M Solutions Co., Ltd
    http://www.joomlart.comhttp://www.joomlancers.com

    I know what are you saying and I understand about that. At present just have two option order by newest and most vote for module jalatest_comments. And now I need add one more option order by most comments. Please let me know how can I do that.

    If can not full fix this issue at lest you must have quick solution for that(except above solution).

    p/s: don’t say with me is out of your scope. Please understand my customers are your customer too, they don’t want hear any explain and don’t care programmer’s problem.

    TomC Moderator
    #411975

    <em>@mrfast 266421 wrote:</em><blockquote>Hi all,
    I have receive reply from support ticket: #BQL-378-25799

    I know what are you saying and I understand about that. At present just have two option order by newest and most vote for module jalatest_comments. And now I need add one more option order by most comments. Please let me know how can I do that.[/quote]
    Is this a feature that is not an available option within the selectable component parameters?

    <em>@mrfast 266421 wrote:</em><blockquote>p/s: don’t say with me is out of your scope. Please understand my customers are your customer too, they don’t want hear any explain and don’t care programmer’s problem.</blockquote>
    If this is a custom feature that you are requesting that is not within the core capabilities of this component, then such is, in fact, beyong the scope of JoomlArt Technical Support. Our Technical Support services are dedicated for bug fixing, products maintenance and/or general advice on how to use the products only. All custom work that requires to extend products’ core features are not subject to Support coverage and should be handled by clients.

    While there may be someone here who may be able/willing to put in the extra time to try to investigate the root cause of your function issues, another possible resource for you might be one of the freelance boards –> joomlancers.com, scriptlance.com, or freelancer.com – for example.

    mrfast Friend
    #412107

    The first of all, thank for your reply Tom Crawford.

    TomC
    Is this a feature that is not an available option within the selectable component parameters?
    [/quote]
    My answer is YES if you want hear about that and it make you happy. I’ll not to argue with you that feature is not an available option or that is an available option.

    But this request(or wish list) come from an available option, mode “Show popular comments”. With feature, the most people will think article with the most comment will go on top, but because of have not any field store count comment should be can not order number of comment, and the fact it just order by vote this makes the program not flexible if don’t want to say it have mistake logical.

    I know it’s not easy but it’s not too hard and can solve this issue with three step:
    1. Add once more field for store count comment to table #__comments_items(like field vote)
    2. Update store procedure when insert, update, and delete comments
    3. Just oder by count comment.

    With step 2 I can not work perfect because I don’t know how many store procedure and relationship of them. If I(or another resource) customization too dept(without support from JA Team) I’m afraid can not update to next version, will be better if you or JA Team help me do that.

    If this is a custom feature that you are requesting that is not within the core capabilities of this component, then such is, in fact, beyong the scope of JoomlArt Technical Support. Our Technical Support services are dedicated for bug fixing, products maintenance and/or general advice on how to use the products only. All custom work that requires to extend products’ core features are not subject to Support coverage and should be handled by clients.

    I know and understand about that but this is clearly a limitation of the program and my requirements perfectly legitimate because only require improved functionality available. I have paid and worthy of receiving the support when required(wish list) plausible.

    Sherlock Friend
    #412116

    Hi mrfash,

    How can you store the comment count into the #__comments_items table, because that field belong to each article not belong to comment items, anyway you can try this solution

    open the file of modulesmod_jaclatest_commentshelper.php , look for this function
    [PHP]
    function getLatestFromContent($params, $order ,$count){
    global $mainframe;
    $db = JFactory::getDBO ();

    $content_category = $params->get(“content_category”, array());

    $where = ” AND cm.type = 1″;
    $where .= ” AND cm.option = ‘com_content'”;
    $where .= ” AND c.state != -2″;

    // ++ NhatNX on 20110509
    if (!is_array($content_category)) {
    $content_category = array($content_category);
    }
    // — NhatNX on 20110509

    if(count($content_category) <=1){
    if(count($content_category) == 1)
    $where .= ” AND c.catid = {$content_category[0]}”;
    }else{
    $where .= ” AND c.catid in (“.implode(‘,’, $content_category).”)”;
    }

    $query = “SELECT cm.*, c.title AS content_title 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 );

    $db->setQuery ( $query );
    return $db->loadObjectList ();
    }
    [/PHP]

    change it to

    [PHP]
    function getLatestFromContent($params, $order ,$count){
    global $mainframe;
    $db = JFactory::getDBO ();

    $content_category = $params->get(“content_category”, array());

    $where = ” AND cm.type = 1″;
    $where .= ” AND cm.option = ‘com_content'”;
    $where .= ” AND c.state != -2″;

    // ++ NhatNX on 20110509
    if (!is_array($content_category)) {
    $content_category = array($content_category);
    }
    // — NhatNX on 20110509

    if(count($content_category) <=1){
    if(count($content_category) == 1)
    $where .= ” AND c.catid = {$content_category[0]}”;
    }else{
    $where .= ” AND c.catid in (“.implode(‘,’, $content_category).”)”;
    }

    $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 count DESC”
    . “n LIMIT ” . intval( $count );

    $db->setQuery ( $query );

    return $db->loadObjectList ();
    }
    [/PHP]

    I hope this would help !

    mrfast Friend
    #412293

    Hi Dat,
    After update your code mode “show popular comments” work fine, but mode “show latest comments” stop work. I have customization a little.
    modulesmod_jaclatest_commentshelper.php

    In function getLatestFromContent()
    change
    [php]
    . “n ORDER BY count DESC”
    [/php]
    by
    [php]
    . “n ORDER BY “{$order}” DESC”
    [/php]

    And in function getList()
    change
    [php]
    $order = ” cm.voted”;
    [/php]
    by
    [php]
    $order = ” count”;
    [/php]

    After update mode “show latest comments” work better but article with latest comment still not up to the top position, article with latest comment always below article with most comment. Need more better solutions to this problem?.

    for test case: http://zeolite2.fast.com.vn

    Sherlock Friend
    #412561

    Hi mrfash,

    okay, you just need to remove the snap of code that i gave you before

    [PHP]
    for($i=0;$i<count($list);$i++){
    for($j=0;$j<(count($list)-1-$i);$j++){
    if($list[$j]->commentcount < $list[$j+1]->commentcount){

    $temp = $list[$j+1];
    $list[$j+1] = $list[$j];
    $list[$j] = $temp;
    }
    }
    }
    [/PHP]

    I think that would help !

    mrfast Friend
    #412580

    Thanks for your tips. And now the remaining problem: with mode “Show popular comments” every article display with every comment. it means with this mode it’s just can display one article have the most comment(replay many times).

    To solve this issue, I think must check if article have appear with last version then disappear with older comments in mode “show popular comment”, it’s mean just display article have the most comment AND not listed.

    modulesmod_jaclatest_commentstmpldefault.php
    [php]
    <?php foreach ($list as $item):?>
    /*
    *
    * I think need check here before list
    * If(mode show popular comments && not listed)
    *
    */
    <li class=”jac-has-layout”>
    <?php if($params->get(“show_content_title”,1)):?>
    <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 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;?>[/php]

    Please let me know how can get mode and check not listed?

    Sherlock Friend
    #412768

    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 !

Viewing 15 posts - 1 through 15 (of 21 total)

This 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