-
AuthorPosts
-
zorroh Friend
zorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
October 9, 2009 at 10:12 am #145036Is 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 articlesUsers who are set up front page showing
– ja news2 shows the categories in such a way as they wanted to seeCan anyone guide me how to do this?
zorroh Friendzorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
October 14, 2009 at 12:56 pm #320483any toughts about this?
hariorama Friendhariorama
- Join date:
- April 2009
- Posts:
- 174
- Downloads:
- 0
- Uploads:
- 33
- Thanks:
- 50
- Thanked:
- 15 times in 1 posts
zorroh Friendzorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
November 7, 2009 at 11:25 pm #322906Users who havent set up their personal category showing on frontpage:
– ja news2 showing automatically in first order categories with newest articlesUsers who are set up front page showing
– ja news2 shows the categories in such a way as they wanted to seeAnonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
November 11, 2009 at 9:18 am #323209Hi all,
please check this thread: http://www.joomlart.com/forums/topic/ja-news-2-order-categories/
zorroh Friendzorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
November 17, 2009 at 3:27 am #323858this solution doing something but not this what i ask… this solution not sowing in news2 categories with newest articles
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
November 19, 2009 at 7:47 am #324201Hi 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 Friendzorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
November 19, 2009 at 9:18 am #324233i 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 Friendsjmorris
- Join date:
- March 2009
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 5
- Thanked:
- 2 times in 1 posts
November 20, 2009 at 4:08 am #324330Hi,
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 Friendzorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
December 1, 2009 at 5:16 pm #325427any update?
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
December 2, 2009 at 9:26 am #325517Hi 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 Friendzorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
December 2, 2009 at 2:08 pm #325540Im 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 articleswhat 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 articlesNeeded 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 placenofre Friendnofre
- Join date:
- September 2009
- Posts:
- 16
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 7
- Thanked:
- 7 times in 3 posts
December 2, 2009 at 9:39 pm #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 articleswhat 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 articlesNeeded 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.1 user says Thank You to nofre for this useful post
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
December 3, 2009 at 10:46 am #325626Hi 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. -
AuthorPosts
This topic contains 20 replies, has 7 voices, and was last updated by zorroh 14 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum