Файловый менеджер - Редактировать - /var/www/iplanru/data/old/www/i-plan.ru/modules/mod_searcharticle(backup)/helper.php
Назад
<?php defined ( '_JEXEC' ) or die ( 'Restricted access' ); class modSearchArticleHelper { public function getArticles($articlesCount){ $db = &JFactory::getDBO(); $query = "SELECT title, introtext, created, id, catid, sectionid FROM #__content ORDER BY created DESC;"; $db->setQuery($query); $result = $db->loadObjectList(); $i=1; $text=$_GET['text']; if ($text[0]=='!'){ $name=1; $text=substr($text,1); } $text = strtr($text, "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩљЫЬЭЮЯ", "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"); $text1 = explode(' ', $text); echo "<table>"; foreach ( $result as $row ) { if (($row->sectionid <> 1)&&($row->sectionid <> 4)){ continue; } $articletext = strip_tags($row->introtext); if ($name==1){ $articletext = $row->title; } $articletext = strtr($articletext, "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩљЫЬЭЮЯ", "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"); foreach ($text1 as $text2){ if (strpos($articletext, $text2) == 0){ continue 2; } } if ($row->sectionid == 4){ $type = "mi"; $type1 = "mi"; $imgext = "gif"; } else { $type = ""; $type1 = "bp"; $imgext = "png"; } $price = substr($row->introtext,strpos($row->introtext,"Цена"), 24); $date = $row->created; str_split($date); $date1 = $date[8].$date[9].".".$date[5].$date[6].".".$date[2].$date[3]; $img = $type1."/".$type1."_".$row->id.".".$imgext; if ($i%2==1){ echo "<tr><td>"; } else { echo "<td>"; } echo "<table style=\"border: 1px solid #d2d2d2; width:300px; margin-bottom:5px;\"><tr><td width=\"164\"><a style=\"float:left\" href=\"$type1.php?id=$row->id\"><img src=\"images/stories/$img\" width=\"150\" alt=\"$row->title\" style=\"float:left; margin:5px; \"></a></td> <td valign=\"top\"><p>Название: $row->title</p>\n<p><a href=\"$type1.php?id=$row->id\" style=\"color:red; font-weight:bold; text-decoration:underline;\">Описание</a></p><p>Дата создания: $date1</p><p style=\"font-weight:bold;\">$price</p><p>Демо-версия:</p><p><a target=\"_blank\" href=\"pdf/$row->id.pdf\" style=\"color:red; font-weight:bold; text-decoration:underline;\">Скачать</a></p><p><a href=\"".$type."buy.php?buyid=$row->id\" style=\"color:red; font-weight:bold; text-decoration:underline;\">Купить</a></p></td></tr></table>"; if ($i%2==1){ echo "</td>"; } else { echo "</td></tr>"; } $i++; if($i > $articlesCount){break;} } if ($i%2==0){ echo "</tr>";} echo "</table>"; if($i==1){ echo "К сожалению ничего не найдено, попробуйте еще раз."; } } } ?>
| ver. 1.4 |
Github
|
.
| PHP 5.4.45-1~dotdeb+6.1 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка