test
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Francisco Friend
    #126435

    I’ve asked this question twice before (here and here), but I haven’t got a satisfactory answer. Here is my question:

    In the JA News module, is it possible to use the order defined in each section for the stories or does it have to be ordered from newest story to oldest story? The site I’m working on needs to have the ability to define the order of the stories without changing the order in which they are entered (since this takes a lot of extra time). I may not be understanding the way JA News module orders the stories, so perhaps someone could explain the ordering. To be clear, I’m not talking about the Headline area.

    In response to my second thread Menalto partially answered this question when they wrote:
    <blockquote>I belive it takes ordering from the new to old, but i am not sure about it. Maybe the creator of the module can give you some tips around it.</blockquote>

    I then noticed on another thread that someone was talking about making the order of the stories random and in a response, someone posted this PHP code from line 191 of mod_janews.php:
    [PHP]. “n ORDER BY a.created DESC limit ” . ($linksitem+1); [/PHP]

    So, I guess I have three further questions. Who is the developer of the JA-News? Can they tell me whether the PHP I’ve included below will actually help? Finally, would they be able to tell me how to change the PHP to make the order match what is shown in the content manager?

    Please, this is a very, very important problem I’m having and I need it fixed before I can launch this site. I’m nearly ready to launch the site and this is almost the last item on my launch checklist.

    Francisco Friend
    #241669

    I talked with a friend who is a much better PHP programmer than I am (not a difficult task) and he found the solution. So for the sake of any others with the same problem, I’ll past the code we changed from mod_janews.php. This is line 164 – 192:

    [PHP]if ($cols > 0) {
    echo “<div class=”ja-newscatwrap”>”;
    $modwidth = round(100 / $cols, 2) ;
    $l = 0;
    $modStyle = JA_News::calModStyle ($cols);
    $isrowopen = false;
    for ($k=0;$k<count($catids);++$k){
    $query = “SELECT a.images, a.introtext, a.id, a.title, a.sectionid, a.catid, cc.title as cattitle, cc.description as catdesc, sc.title as sectitle, sc.description as secdescription, a.ordering”
    . “n FROM #__content AS a”
    . “n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id”
    . “n INNER JOIN #__categories AS cc ON cc.id = a.catid”
    . “n INNER JOIN #__sections AS sc ON sc.id = a.sectionid”
    . “n WHERE ( a.state = 1 AND a.sectionid > 0 “
    . “n AND ( a.publish_up = ‘$nullDate’ OR a.publish_up <= ‘$now’ )”
    . “n AND ( a.publish_down = ‘$nullDate’ OR a.publish_down >= ‘$now’ )”;
    if($catorsec){
    $query .= ( $access ? “n AND a.access <= $my->gid AND cc.access <= $my->gid” : ” )
    . ( $catids ? “n AND ( a.catid = {$catids[$k]} )” : “” )
    . ( isset($headlineid) ? “n AND a.id <> $headlineid” : “” )
    . “n AND cc.published = 1 )”
    . “n ORDER BY a.ordering ASC limit ” . ($linksitem+1);
    }
    else{
    $query .= ( $access ? “n AND a.access <= $my->gid AND sc.access <= $my->gid” : ” )
    . ( $catids ? “n AND ( a.sectionid = {$catids[$k]} )” : “” )
    . ( isset($headlineid) ? “n AND a.id <> $headlineid” : “” )
    . “n AND sc.published = 1 )”
    . “n ORDER BY a.ordering ASC limit ” . ($linksitem+1);
    }[/PHP]

    This will cause JA News to order the stories by the order defined in the content item manager.

    loganmandala Friend
    #241699

    Hi Reporter,

    I’m not a PHP programmer and i met a little problem between Ja-News and Alphacontent :
    http://www.joomlart.com/forums/topic/links-problem-between-ja-news-and-alphacontent/

    At your own, do you think it’s possible to find a solution ?

    Regards

    PS: Sorry for my english

    Michael

    polpetta Friend
    #242120

    I’ve got the same problem, but your solution doesn’t work for me. If i change the code (I found it in line 327) only headline is published.

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

This topic contains 4 replies, has 3 voices, and was last updated by  polpetta 16 years, 9 months ago.

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