Source for file mod_popular.php

Documentation is available at mod_popular.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. /** 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. $query "SELECT a.hits, a.id, a.sectionid, a.title, a.created, u.name"
  19. "\n FROM #__content AS a"
  20. "\n LEFT JOIN #__users AS u ON u.id=a.created_by"
  21. "\n WHERE a.state <> '-2'"
  22. "\n ORDER BY hits DESC"
  23. "\n LIMIT 10"
  24. ;
  25. $database->setQuery$query );
  26. $rows $database->loadObjectList();
  27. ?>
  28.  
  29. <table class="adminlist">
  30. <tr>
  31.     <th class="title">
  32.     <?php echo T_('Most Popular Items')?>
  33.     </th>
  34.     <th class="title">
  35.     <?php echo T_('Created')?>
  36.     </th>
  37.     <th class="title">
  38.     <?php echo T_('Hits')?>
  39.     </th>
  40. </tr>
  41. <?php
  42. if ($rows{
  43.     foreach ($rows as $row{
  44.         if $row->sectionid == {
  45.             $link 'index2.php?option=com_typedcontent&amp;task=edit&amp;hidemainmenu=1&amp;id='$row->id;
  46.         else {
  47.             $link 'index2.php?option=com_content&amp;task=edit&amp;hidemainmenu=1&amp;id='$row->id;
  48.         }
  49.         ?>
  50.         <tr>
  51.             <td>
  52.             <a href="<?php echo $link?>">
  53.             <?php echo htmlspecialchars($row->titleENT_QUOTES);?>
  54.             </a>
  55.             </td>
  56.             <td>
  57.             <?php echo MosFormatdate($row->created'Y-m-d H:i:s');?>
  58.             </td>
  59.             <td>
  60.             <?php echo $row->hits;?>
  61.             </td>
  62.         </tr>
  63.         <?php
  64.     }    
  65. else {
  66.     ?>
  67.     <tr>
  68.         <td colspan="3"><?php echo T_('Nothing to show')?></td>
  69.     </tr>
  70.     <?php
  71. }
  72. ?>
  73. </table>

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