test
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • todhost Friend
    #191385

    Latest article module on position Home-10 shows most popular article instead of most recent article. Could this be an error? Any fix?

    Wall Crasher Developer
    #509006

    Hi todhost,

    The latest module is working well.
    It is not really the latest module.
    We have custom it so that it will have a different behavior as below:
    1. We will select 4 (or the number articles setting in module) latest articles.
    2. We will pick the most read article among them (by hits count)
    3. Display the most read article as the spotlight one, and also display 3 related article with this article.
    4. Display the rest articles at bottom of module.

    You can try to create 4 news articles and check for this behavior.

    Regards

    todhost Friend
    #509042

    Hello,
    Please how can change things to have the most recent article display as the spotlight image nstead of the most read

    Thank you for helping.

    Wall Crasher Developer
    #509104

    Hi todhost,

    It is easy to change the behavior. Please open templatesja_magzhtmlmod_articles_latestfocus.php and comment out these two lines of code:

    //sort those latest article by hits
    $compare = create_function('$a, $b', ' if ($a->hits == $b->hits) { return 0; } return ($a->hits < $b->hits) ? 1 : -1; ');
    uasort($list, $compare);

    Regards

    todhost Friend
    #509124

    Thanks. Fixed.

    todhost Friend
    #509542

    Issue resolved.

    2capjob Friend
    #515722

    <em>@Wall Crasher 393756 wrote:</em><blockquote>Hi todhost,

    It is easy to change the behavior. Please open templatesja_magzhtmlmod_articles_latestfocus.php and comment out these two lines of code:

    //sort those latest article by hits
    $compare = create_function('$a, $b', ' if ($a->hits == $b->hits) { return 0; } return ($a->hits < $b->hits) ? 1 : -1; ');
    uasort($list, $compare);

    Regards</blockquote>

    I have a question. hello.
    and can be more accurate to say? what to do with the code? Thank you.

    Comment out what it means?

    2capjob Friend
    #515723

    <em>@todhost 394309 wrote:</em><blockquote>Issue resolved.</blockquote>

    I have a question. hello.
    and can be more accurate to say? what to do with the code? Thank you.

    Comment out what it means?

    Wall Crasher Developer
    #515795

    Hi 2capjob,

    <blockquote>Comment out what it means?</blockquote>

    I mean you can turn these line of code to php comment statement
    http://www.w3schools.com/php/php_syntax.asp

    Or you can simply delete it.

    angie00 Friend
    #521009

    If codes is left as is, it shows most recent 4 articles in alphabetical order with main showing introtext.

    If I comment out those two lines, it does show most recent 4 articles ordered by recently published but also shows related links under main article.

    What I would like to have is most recent published article as main with intro text without related links.

    How do I do this?

    Thanks!


    1. Capture
    Wall Crasher Developer
    #521037

    @ angie00,

    If you do not want to show related links, just change (line 28)

    $related = MagzHelper::related($focus);

    to

    $related = array();

    Hope it helps.

Viewing 11 posts - 1 through 11 (of 11 total)

This topic contains 11 replies, has 4 voices, and was last updated by  Wall Crasher 10 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum