Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • zorroh Friend
    #145036

    Is there possobility to setup automatical ordering that if new customer of site havent save personal category showing then on front page they see always catetories with new articles.

    Users who havent set up their personal category showing on frontpage
    – ja news2 showing automatically in first order that categories what includes newest articles

    Users who are set up front page showing
    – ja news2 shows the categories in such a way as they wanted to see

    Can anyone guide me how to do this?

    zorroh Friend
    #320483

    any toughts about this?

    hariorama Friend
    #320485

    another problem is, if you enable “show front page article” in ja_news_modul, it should exclude the articles which are in the ja_news_frontpage_modul.

    otherwise you have same article twice on your frontpage

    is there also a solution for this?

    zorroh Friend
    #322906

    Users who havent set up their personal category showing on frontpage:
    – ja news2 showing automatically in first order categories with newest articles

    Users who are set up front page showing
    – ja news2 shows the categories in such a way as they wanted to see

    Anonymous Moderator
    #323209
    zorroh Friend
    #323858

    this solution doing something but not this what i ask… this solution not sowing in news2 categories with newest articles

    Anonymous Moderator
    #324201

    Hi zorroh

    Open helper.php file, you will find getGroupList function (line 181). This function will get all articles of each categoty to display. In this function, you will see following code:

    //$query .= ‘ ORDER BY a.created DESC’ ;
    $query .= ‘ ORDER BY a.’ . $ordering;

    We are order articles accourding to ordering field. Here you can change to your suitable.

    zorroh Friend
    #324233

    i think because my bad english i explain bad.. anyway, this also not helping.

    what i need is that shows that categories in first order what includes newest articles..

    this solution what you have been give doing only category ordering (i think – by creating) but this is not solve problem that i post articles but ja-news2 not showing them, because i post them in that category what is not in first page.

    it is reasonable for site visitor to see newest articles and thats why i need to show in first order those categories what includes latest articles. when i post new article in some category then that category pops to first place in frontpage ja-news2.

    sjmorris Friend
    #324330

    Hi,

    Exactly – we want ja_news2 to order the categories/columns shown by the ones with the newest articles. It seems like a fairly basic query for someone who knows PHP/MySQL?

    S

    zorroh Friend
    #325427

    any update?

    Anonymous Moderator
    #325517

    Hi zorroh

    Please open modulesmod_janews2helper.php file, find following code section:


    function getGroupList($secid, $items, $ordering, $showcontentfrontpage = false) {
    global $mainframe;
    $db = & JFactory::getDBO ();
    $user = & JFactory::getUser ();
    $aid = $user->get ( 'aid', 0 );

    $contentConfig = &JComponentHelper::getParams ( 'com_content' );
    $noauth = ! $contentConfig->get ( 'shownoauth' );

    //Get category ids:
    $catids = $this->loadCategories ( $secid );

    jimport ( 'joomla.utilities.date' );
    $date = new JDate ( );
    $now = $date->toMySQL ();

    $nullDate = $db->getNullDate ();
    $result = array ();
    $j = 0;
    foreach ( $catids as $cat ) {
    $catid = $catids[$j]->category->id;
    // query to determine article count
    $query = 'SELECT a.*,u.name as creater,cc.description as catdesc, cc.title as cattitle,s.description as secdesc, s.title as sectitle,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,' . ' CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(":", s.id, s.alias) ELSE s.id END as secslug' . ' FROM #__content AS a' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' INNER JOIN #__sections AS s ON s.id = a.sectionid' . ' left JOIN #__users AS u ON a.created_by = u.id';
    $query .= ' WHERE a.state = 1 ' . ($noauth ? ' AND a.access <= ' . ( int ) $aid . ' AND cc.access <= ' . ( int ) $aid . ' AND s.access <= ' . ( int ) $aid : '') . ' AND (a.publish_up = ' . $db->Quote ( $nullDate ) . ' OR a.publish_up <= ' . $db->Quote ( $now ) . ' ) ' . ' AND (a.publish_down = ' . $db->Quote ( $nullDate ) . ' OR a.publish_down >= ' . $db->Quote ( $now ) . ' )' . "n AND cc.id=" . ( int ) $catid . ' AND cc.section = s.id' . ' AND cc.published = 1' . ' AND s.published = 1';
    if (! $showcontentfrontpage) {
    $query .= ' AND a.id not in (SELECT content_id FROM #__content_frontpage )';
    }

    //$query .= ' ORDER BY a.created DESC' ;
    $query .= ' ORDER BY a.' . $ordering;

    $db->setQuery ( $query, 0, $items );
    $rows = $db->loadObjectList ();
    global $mainframe;
    JPluginHelper::importPlugin ( 'content' );
    $dispatcher = & JDispatcher::getInstance ();
    $params = & $mainframe->getParams ( 'com_content' );
    $limitstart = JRequest::getVar ( 'limitstart', 0, '', 'int' );

    for($i = 0; $i < count ( $rows ); $i ++) {
    $rows [$i]->text = $rows [$i]->introtext;
    $results = $dispatcher->trigger ( 'onPrepareContent', array (& $rows [$i], & $params, $limitstart ) );
    $rows [$i]->introtext = $rows [$i]->text;
    }

    $catids[$j]->contents = $rows;
    $j++;
    }
    return $catids;
    }

    and change to:


    function getGroupList($secid, $items, $ordering, $showcontentfrontpage = false) {
    global $mainframe;
    $db = & JFactory::getDBO ();
    $user = & JFactory::getUser ();
    $aid = $user->get ( 'aid', 0 );

    $contentConfig = &JComponentHelper::getParams ( 'com_content' );
    $noauth = ! $contentConfig->get ( 'shownoauth' );

    //Get category ids:
    $catids = $this->loadCategories ( $secid );

    jimport ( 'joomla.utilities.date' );
    $date = new JDate ( );
    $now = $date->toMySQL ();

    $nullDate = $db->getNullDate ();
    $result = array ();
    $j = 0;
    foreach ( $catids as $cat ) {
    $catid = $catids[$j]->category->id;
    // query to determine article count
    $query = 'SELECT a.*,u.name as creater,cc.description as catdesc, cc.title as cattitle,s.description as secdesc, s.title as sectitle,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,' . ' CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(":", s.id, s.alias) ELSE s.id END as secslug' . ' FROM #__content AS a' . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' INNER JOIN #__sections AS s ON s.id = a.sectionid' . ' left JOIN #__users AS u ON a.created_by = u.id';
    $query .= ' WHERE a.state = 1 ' . ($noauth ? ' AND a.access <= ' . ( int ) $aid . ' AND cc.access <= ' . ( int ) $aid . ' AND s.access <= ' . ( int ) $aid : '') . ' AND (a.publish_up = ' . $db->Quote ( $nullDate ) . ' OR a.publish_up <= ' . $db->Quote ( $now ) . ' ) ' . ' AND (a.publish_down = ' . $db->Quote ( $nullDate ) . ' OR a.publish_down >= ' . $db->Quote ( $now ) . ' )' . "n AND cc.id=" . ( int ) $catid . ' AND cc.section = s.id' . ' AND cc.published = 1' . ' AND s.published = 1';
    if (! $showcontentfrontpage) {
    $query .= ' AND a.id not in (SELECT content_id FROM #__content_frontpage )';
    }

    $query .= ' ORDER BY a.created DESC' ;
    //$query .= ' ORDER BY a.' . $ordering;

    $db->setQuery ( $query, 0, $items );
    $rows = $db->loadObjectList ();
    global $mainframe;
    JPluginHelper::importPlugin ( 'content' );
    $dispatcher = & JDispatcher::getInstance ();
    $params = & $mainframe->getParams ( 'com_content' );
    $limitstart = JRequest::getVar ( 'limitstart', 0, '', 'int' );

    for($i = 0; $i < count ( $rows ); $i ++) {
    $rows [$i]->text = $rows [$i]->introtext;
    $results = $dispatcher->trigger ( 'onPrepareContent', array (& $rows [$i], & $params, $limitstart ) );
    $rows [$i]->introtext = $rows [$i]->text;
    }

    $catids[$j]->contents = $rows;
    $j++;
    }
    return $catids;
    }

    zorroh Friend
    #325540

    Im very thankful that You want help me!

    This solution dont change anything…

    Example i have:
    [] one section
    [] 10 categories in that section
    [] 5 of them are with articles, other categories are empty.
    [] cat 1 with aricles, cat 2 with articles, cat 3 is empty, cat 4 with articles, cat 5-8 are empty, cat 9-10 are with articles

    what Ja News 2 is doing or not doing:
    [] shows on frontpage 3 categories (what i set up in backend)
    [] shows 2 categories with articles and 1 empty category (shows cat 1, 2, 3 , but it must show 5, 1,2, because i just posted new aricle in cat 5)
    [] not showing automatically all three with articles
    [] when i post article in to cat 5(what are empty), then ja news not ordering that category to first place
    [] not reordering that categories to first place where i or my users posted articles

    Needed solutions:
    [] when i set up frontpage to show 3 categories then it shows 3 categories with newest articles, if there is so much categories with articles
    [] when i or someone else post article in some category then that category automatically moves to first place

    nofre Friend
    #325568

    <em>@zorroh 155382 wrote:</em><blockquote>Im very thankful that You want help me!

    This solution dont change anything…

    Example i have:
    [] one section
    [] 10 categories in that section
    [] 5 of them are with articles, other categories are empty.
    [] cat 1 with aricles, cat 2 with articles, cat 3 is empty, cat 4 with articles, cat 5-8 are empty, cat 9-10 are with articles

    what Ja News 2 is doing or not doing:
    [] shows on frontpage 3 categories (what i set up in backend)
    [] shows 2 categories with articles and 1 empty category (shows cat 1, 2, 3 , but it must show 5, 1,2, because i just posted new aricle in cat 5)
    [] not showing automatically all three with articles
    [] when i post article in to cat 5(what are empty), then ja news not ordering that category to first place
    [] not reordering that categories to first place where i or my users posted articles

    Needed solutions:
    [] when i set up frontpage to show 3 categories then it shows 3 categories with newest articles, if there is so much categories with articles
    [] when i or someone else post article in some category then that category automatically moves to first place</blockquote>

    I second this…
    This function is probably need a deeper rewrite but that’s the only really logical solution for a Ja News type front-page modul.

    Anonymous Moderator
    #325626

    Hi zorroh

    As you are requesting heavy customization, I am afraid that you have to handle the changes at your end.
    Alternatively, please take into consideration to post your requirements on Joomlancers.com to find a talent freelancer for your project.
    I am sorry for not being of much help in this case.

    zorroh Friend
    #325659

    ok, i’ll try to talk with my friend who can me help with this..

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

This topic contains 20 replies, has 7 voices, and was last updated by  zorroh 13 years, 8 months ago.

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