-
AuthorPosts
-
January 5, 2010 at 9:24 pm #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.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
January 6, 2010 at 3:49 am #328361Hello 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
1 user says Thank You to Saguaros for this useful post
January 6, 2010 at 4:28 am #328366Thank 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_news2Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
January 6, 2010 at 4:31 am #328367Yes, please give me the link to your site,
January 6, 2010 at 4:53 am #328371sent the url in private messages.
I hope for your help.Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
January 7, 2010 at 7:13 am #328515Hello guy!
Your site seem to work well 🙂
January 7, 2010 at 11:35 am #328560Yes, 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.AuthorPostsViewing 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
Help with ja_news2
Viewing 7 posts - 1 through 7 (of 7 total)