Annotation of /mambo/branches/4.6/modules/mod_sections.php
Parent Directory
|
Revision Log
Revision 1432 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | elpie | 964 | * @package Mambo |
| 4 : | alwarren | 1432 | * @author Mambo Foundation Inc see README.php |
| 5 : | * @copyright Mambo Foundation Inc. | ||
| 6 : | * See COPYRIGHT.php for copyright notices and details. | ||
| 7 : | * @license GNU/GPL Version 2, see LICENSE.php | ||
| 8 : | * Mambo is free software; you can redistribute it and/or | ||
| 9 : | * modify it under the terms of the GNU General Public License | ||
| 10 : | * as published by the Free Software Foundation; version 2 of the License. | ||
| 11 : | */ | ||
| 12 : | csouza | 297 | |
| 13 : | alwarren | 1432 | global $mosConfig_offset, $Itemid; |
| 14 : | root | 1 | |
| 15 : | //** ensure this file is being included by a parent file */ | ||
| 16 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 17 : | |||
| 18 : | $count = intval( $params->get( 'count', 20 ) ); | ||
| 19 : | $access = !$mainframe->getCfg( 'shownoauth' ); | ||
| 20 : | $now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 ); | ||
| 21 : | |||
| 22 : | $database->setQuery( | ||
| 23 : | "SELECT a.id AS id, a.title AS title, COUNT(b.id) as cnt" | ||
| 24 : | . "\n FROM #__sections as a" | ||
| 25 : | . "\n LEFT JOIN #__content as b" | ||
| 26 : | . "\n ON a.id=b.sectionid" | ||
| 27 : | . ($access ? "\n AND b.access<='$my->gid'" : "" ) | ||
| 28 : | . "\n AND (b.publish_up = '0000-00-00 00:00:00' OR b.publish_up <= '". $now ."' )" | ||
| 29 : | . "\n AND (b.publish_down = '0000-00-00 00:00:00' OR b.publish_down >= '". $now ."' )" | ||
| 30 : | . "\n WHERE a.scope='content'" | ||
| 31 : | . "\n AND a.published='1'" | ||
| 32 : | . ($access ? "\n AND a.access<='$my->gid'" : "" ) | ||
| 33 : | . "\n GROUP BY a.id" | ||
| 34 : | . "\n HAVING COUNT(b.id)>0" | ||
| 35 : | . "\n ORDER BY a.ordering" | ||
| 36 : | . "\n LIMIT $count" | ||
| 37 : | ); | ||
| 38 : | |||
| 39 : | $rows = $database->loadObjectList(); | ||
| 40 : | echo "<ul>\n"; | ||
| 41 : | if ($rows) { | ||
| 42 : | foreach ($rows as $row) { | ||
| 43 : | alwarren | 1432 | echo " <li><a href=\"" . sefRelToAbs("index.php?option=com_content&task=blogsection&id=".$row->id) . ($Itemid ? "&Itemid=$Itemid" : '') . "\">" . $row->title . "</a></li>\n"; |
| 44 : | root | 1 | } |
| 45 : | echo "</ul>\n"; | ||
| 46 : | } | ||
| 47 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

