Files
@ c7d7e38b2269
Branch filter:
Location: hot67beta/administrator/modules/mod_latest/mod_latest.php - annotation
c7d7e38b2269
3.0 KiB
text/x-php
Initial import of the site.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 c7d7e38b2269 | <?php
/**
* @version $Id: mod_latest.php 10867 2008-08-30 07:11:13Z willebil $
* @package Joomla
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
// Get the user object for the logged in user
$db =& JFactory::getDBO();
$user =& JFactory::getUser();
$userId = (int) $user->get('id');
$where = 'WHERE a.state <> -2';
// User Filter
switch ($params->get( 'user_id' ))
{
case 'by_me':
$where .= ' AND (created_by = ' . (int) $userId . ' OR modified_by = ' . (int) $userId . ')';
break;
case 'not_me':
$where .= ' AND (created_by <> ' . (int) $userId . ' AND modified_by <> ' . (int) $userId . ')';
break;
}
// Ordering
switch ($params->get( 'ordering' ))
{
case 'm_dsc':
$ordering = 'modified DESC, created DESC';
$dateProperty = 'modified';
break;
case 'c_dsc':
default:
$ordering = 'created DESC';
$dateProperty = 'created';
break;
}
$query = 'SELECT a.id, a.sectionid, a.title, a.created, a.modified, u.name, a.created_by_alias, a.created_by'
. ' FROM #__content AS a'
. ' LEFT JOIN #__users AS u ON u.id = a.created_by'
. ' '. $where
. ' ORDER BY '. $ordering
;
$db->setQuery( $query, 0, 10 );
$rows = $db->loadObjectList();
?>
<table class="adminlist">
<tr>
<td class="title">
<strong><?php echo JText::_( 'Latest Items' ); ?></strong>
</td>
<td class="title">
<strong><?php echo JText::_( 'Created' ); ?></strong>
</td>
<td class="title">
<strong><?php echo JText::_( 'Creator' ); ?></strong>
</td>
</tr>
<?php
if (count( $rows ))
{
foreach ($rows as $row)
{
$link = 'index.php?option=com_content&task=edit&id='. $row->id;
if ( $user->authorize( 'administration', 'manage', 'components', 'com_users' ) ) {
if ( $row->created_by_alias )
{
$author = $row->created_by_alias;
}
else
{
$linkA = 'index.php?option=com_users&task=edit&cid[]='. $row->created_by;
$author = '<a href="'. $linkA .'" title="'. JText::_( 'Edit User' ) .'">'. htmlspecialchars( $row->name, ENT_QUOTES, 'UTF-8' ) .'</a>';
}
}
else
{
if ( $row->created_by_alias )
{
$author = $row->created_by_alias;
}
else
{
$author = htmlspecialchars( $row->name, ENT_QUOTES, 'UTF-8' );
}
}
?>
<tr>
<td>
<a href="<?php echo $link; ?>">
<?php echo htmlspecialchars($row->title, ENT_QUOTES, 'UTF-8');?></a>
</td>
<td>
<?php echo JHTML::_('date', $row->$dateProperty, '%Y-%m-%d %H:%M:%S'); ?>
</td>
<td>
<?php echo $author;?>
</td>
</tr>
<?php
}
}
else
{
?>
<tr>
<td colspan="3">
<?php echo JText::_( 'No matching results' );?>
</td>
</tr>
<?php
}
?>
</table>
|