[ PHPXref.com ] [ Generated: Sun Jul 20 18:31:57 2008 ] [ Mambo 4.6 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/modules/ -> mod_sections.php (source)

   1  <?php
   2  /**
   3  * @package Mambo Open Source
   4  * @copyright (C) 2005 - 2006 Mambo Foundation Inc.
   5  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
   6  *
   7  * Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure
   8  * that Mambo remained free Open Source software owned and managed by the community.
   9  * Mambo is Free Software
  10  */
  11  
  12  global $mosConfig_offset;
  13  
  14  //** ensure this file is being included by a parent file */
  15  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  16  
  17  $count = intval( $params->get( 'count', 20 ) );
  18  $access = !$mainframe->getCfg( 'shownoauth' );
  19  $now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 );
  20  
  21  $database->setQuery(
  22  "SELECT a.id AS id, a.title AS title, COUNT(b.id) as cnt"
  23  . "\n FROM #__sections as a"
  24  . "\n LEFT JOIN #__content as b"
  25  . "\n ON a.id=b.sectionid"
  26  . ($access ? "\n AND b.access<='$my->gid'" : "" )
  27  . "\n AND (b.publish_up = '0000-00-00 00:00:00' OR b.publish_up <= '". $now ."' )"
  28  . "\n AND (b.publish_down = '0000-00-00 00:00:00' OR b.publish_down >= '". $now ."' )"
  29  . "\n WHERE a.scope='content'"
  30  . "\n AND a.published='1'"
  31  . ($access ? "\n AND a.access<='$my->gid'" : "" )
  32  . "\n GROUP BY a.id"
  33  . "\n HAVING COUNT(b.id)>0"
  34  . "\n ORDER BY a.ordering"
  35  . "\n LIMIT $count"
  36  );
  37  
  38  $rows = $database->loadObjectList();
  39  echo "<ul>\n";
  40  if ($rows) {
  41      foreach ($rows as $row) {
  42          echo "  <li><a href=\"" . sefRelToAbs("index.php?option=com_content&task=blogsection&id=".$row->id) . "\">" . $row->title . "</a></li>\n";
  43      }
  44      echo "</ul>\n";
  45  }
  46  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]