| Current Path : /var/www/iplanru/data/old/www/i-plan.ru/modules/mod_preview/ |
| Current File : /var/www/iplanru/data/old/www/i-plan.ru/modules/mod_preview/helper.php |
<?php
defined ( '_JEXEC' ) or die ( 'Restricted access' );
class modPreviewHelper {
public function getArticles($previewCount, $link){
$config = &JFactory::getConfig();
$db = &JFactory::getDBO();
/* $query = "SELECT title, introtext, created, id, sectionid, catid FROM #__content WHERE sectionid = 1 OR sectionid = 4 ORDER BY created DESC;";
$db->setQuery($query);
$result = $db->loadObjectList();
$i=1;
foreach ( $result as $row ) {
$date = $row->created;
str_split($date);
$date1 = $date[8].$date[9].".".$date[5].$date[6].".".$date[2].$date[3];
//echo "<font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date1</font> <font color=\"#757863\">|</font>\n";
if ($link == 1){
if($config->getValue('sef')==1){
if($row->sectionid == 1){echo "<a href=\"bp.php?id=$row->id\"><font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date1</font> <font color=\"#757863\">|</font>\n$row->title</a>\n<br /><br />";}
else{echo "<a href=\"mi.php?id=$row->id\"><font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date1</font> <font color=\"#757863\">|</font>\n$row->title</a>\n<br /><br />";}
}
else{
echo "<a href=\"index.php?option=com_content&catid=$row->catid&id=$row->id&view=article&Itemid=2\"><font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date1</font> <font color=\"#757863\">|</font>\n$row->title</a>\n<br /><br />";
}
}
else {echo "$row->title\n";}
$i++;
if($i > $previewCount){break;}
}
echo "<div width=\"100%\" style=\"text-align:right; padding-right:5px;\"><a class=\"all\" href=\"index.php?option=com_content&layout=form&view=article&Itemid=11\">Все анонсы</a></div>";
if($config->getValue('newsystem')==1){*/
$query = "SELECT * FROM #__articles ORDER BY date DESC;";
$db->setQuery($query);
$result = $db->loadObjectList();
$i=1;
echo "<noindex>";
foreach ( $result as $row ) {
$date = $row->date;
$date = $date[8].$date[9].".".$date[5].$date[6].".".$date[2].$date[3];
//echo "<font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date1</font> <font color=\"#757863\">|</font>\n";
if ($link == 1){
if($config->getValue('sef')==1){
if($row->type == "bp"){echo "<a href=\"bp.php?id=$row->id\"><font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date</font> <font color=\"#757863\">|</font>\n$row->title</a>\n<br /><br />";}
else{echo "<a href=\"mi.php?id=$row->id\"><font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date</font> <font color=\"#757863\">|</font>\n$row->title</a>\n<br /><br />";}
}
else{
echo "<a href=\"index.php?option=com_content&id=$row->id&view=article&Itemid=2\"><font style=\"font-size:11px; font-weight:bold;\" color=\"#70B519\">$date1</font> <font color=\"#757863\">|</font>\n$row->title</a>\n<br /><br />";
}
}
else {echo "$row->title\n";}
$i++;
if($i > $previewCount){break;}
}
echo "<div width=\"100%\" style=\"text-align:right; padding-right:5px;\"><a class=\"all\" href=\"index.php?option=com_content&layout=form&view=article&Itemid=11\">Все анонсы</a></div>";
echo "</noindex>";
//}
}
}
?>