-
AuthorPosts
-
Sherlock Friend
Sherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
November 25, 2010 at 2:56 pm #156778For anyone who wants to show articles at a specific section, you can try as follows
Step 1) Go to the file of modulesmod_janews_fpmod_janews_fp.xml,looking for the xml tag<param name=”numberofheadlinenews” type=”text” default=”10″ label=”NUMBER OF ARTICLES” description=”NUMBER OF ARTICLES DESC” />
Add a tag below it which define the select box of sections so replace it by
<param name=”numberofheadlinenews” type=”text” default=”10″ label=”NUMBER OF ARTICLES” description=”NUMBER OF ARTICLES DESC” />
<param name=”sectionid” default=”0″ type=”section” label=”Select a section” description=”Select a section” />Step 2 ) Go to the file of modulesmod_janews_fpmod_janews_fp.php, you would see the line of codes
$bigimg_h = $params->get ( ‘bigimg_h’, 0 );
Just change it to
$bigimg_h = $params->get ( ‘bigimg_h’, 0 );
$sectionid = $params->get ( ‘sectionid’, 0 );
then looking for this line
$rows = modJANewsHelperFP::getHLNews ( $numberofheadlinenews );
change it to
$rows = modJANewsHelperFP::getHLNews ( $numberofheadlinenews, $sectionid );
Step 3) Go to the file of modulesmod_janews_fphelper.php,Looking for this line of codes[PHP]$query = “SELECT a.*,” . “n CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(‘:’, a.id, a.alias) ELSE a.id END as slug,” . “n CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(‘:’, cc.id, cc.alias) ELSE cc.id END as catslug” . “n FROM #__content AS a” . “n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id” . “n INNER JOIN #__categories AS cc ON cc.id = a.catid” . “n WHERE ( a.state = 1 AND a.sectionid > 0 ” . ‘ 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 ) . ‘ )’ . ($noauth ? ‘ AND a.access <= ‘ . ( int ) $aid . ‘ AND cc.access <= ‘ . ( int ) $aid : ”) . “n AND cc.published = 1 )” . “n ORDER BY f.ordering ASC”;[/PHP]
And change it to
[PHP]$query = “SELECT a.*,” . “n CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(‘:’, a.id, a.alias) ELSE a.id END as slug,” . “n CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(‘:’, cc.id, cc.alias) ELSE cc.id END as catslug” . “n FROM #__content AS a” . “n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id” . “n INNER JOIN #__categories AS cc ON cc.id = a.catid” . “n WHERE ( a.state = 1 AND a.sectionid > 0 ” . ‘ AND a.sectionid =’.$section.’ 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 ) . ‘ )’ . ($noauth ? ‘ AND a.access <= ‘ . ( int ) $aid . ‘ AND cc.access <= ‘ . ( int ) $aid : ”) . “n AND cc.published = 1 )” . “n ORDER BY f.ordering ASC”;[/PHP]
Now you can go to module’s back-end and select the section you want to show articles on.
-
AuthorPosts
This topic contains 1 reply, has 1 voice, and was last updated by Sherlock 14 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum