Selasa, 09 November 2010

Simple modul Joomla 15

defined('_JEXEC') or die('Restricted access');

$items = $params->get('items', 1);
$db =& JFactory::getDBO();
$query = "SELECT id, title, author, synopsis FROM #__books WHERE published = '1' ORDER BY id DESC";
$db->setQuery( $query, 0 , $items ); // hanya mencetak sebuah record yang ada
$rows = $db->loadObjectList();
foreach($rows as $row)
{
echo 'id.'&task=view&title='.$row->title).'">'.$row->title.'';
echo '('.$row->author.')
';
echo substr($row->synopsis,0,25).'...
';
}

0 Comments:

Post a Comment