Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • sergiv Friend
    #147348

    Hello.
    Help solve the following problem. How to make a module ja_news2, in the first section of the World By default, all categories.


    1. problem
    Saguaros Moderator
    #328361

    Hello guy!

    Now, you open the file modules/ja_news2/helper.php find codes at line 21:
    [PHP]
    var $_usersetting = array ();
    [/PHP]
    Replace:
    [PHP]
    var $_usersetting = array ();
    var $_countSection = 0;
    [/PHP]

    2) find function named is”function loadCategories($id)”, remove codes of this function and replace by:
    [PHP]
    function loadCategories($sid) {

    $categories = array ();
    $catids = $this->getUserSetting ( $sid, ‘categories’ );

    $where = ”;
    $limit = 0;
    if ($catids) {
    if (is_array ( $catids ))
    $where .= ” AND `id` in (” . implode ( ‘,’, $catids ) . “)”;
    } else {
    if($this->_countSection !=0 ){
    if (is_array ( $this->getUserSetting ( $sid ) ))
    $where = ” AND 0″;
    else
    $limit = ( int ) $this->get ( ‘cols’, 2 );
    }else {
    // show all category in the first section
    $limit=999999;
    $this->_countSection++;
    }
    }
    $db = & JFactory::getDBO ();
    $query = “SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(“:”, `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=” . ( int ) $sid . $where;
    $db->setQuery ( $query, 0, $limit );
    $rows = $db->loadObjectList ( ‘id’ );
    foreach ( $rows as $cid => $row ) {
    $obj = new stdclass ( );
    $obj->category = $row;
    $categories [] = $obj;
    }
    return $categories;
    }
    [/PHP]

    Good luck

    sergiv Friend
    #328366

    Thank you very much! Everything works.
    But I was never able to solve yet another problem with the module ja_news2.
    When I try to sort through the material function Article order, when one of these types of “Created Date” or “Modified Date” in Internet Explorer 8 is not correctly displayed home page – do not see the module ja_news2

    Saguaros Moderator
    #328367

    Yes, please give me the link to your site,

    sergiv Friend
    #328371

    sent the url in private messages.
    I hope for your help.

    Saguaros Moderator
    #328515

    Hello guy!

    Your site seem to work well 🙂

    sergiv Friend
    #328560

    Yes, now there is no problem.
    But the problem is not solved. At the moment, sorting materials specified by default. But if you set the output function by creation date or modification date, then the Internet Explorer problem appears again.
    sorry for my English.

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

This topic contains 7 replies, has 2 voices, and was last updated by  sergiv 14 years, 10 months ago.

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