test
Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • Sherlock Friend
    #412829

    Hi 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 Friend
    #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.vn

    I 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 Friend
    #412832

    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

    mrfast Friend
    #412846

    Posted 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.comhttp://www.joomlancers.com

    Oh, 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 Friend
    #412990

    Posted 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.comhttp://www.joomlancers.com

    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


    1. mode_show_popular_comment
    Sherlock Friend
    #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 !

Viewing 6 posts - 16 through 21 (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