Source for file mod_sections.php

Documentation is available at mod_sections.php

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

Documentation generated on Mon, 05 May 2008 16:21:23 +0400 by phpDocumentor 1.4.0