Файл: modules/search/plugins/photos.php
Строк: 20
<?php
$column = db::get_column("SELECT COUNT(DISTINCT `PHOTOS`.`ID`) AS `count_photos` FROM `PHOTOS` LEFT JOIN `PHOTOS_DIR` ON (`PHOTOS_DIR`.`ID` = `PHOTOS`.`ID_DIR` OR `PHOTOS_DIR`.`ID_DIR` = `PHOTOS`.`ID_DIR`) WHERE `PRIVATE` = '0' AND (`PHOTOS`.`NAME` LIKE ? OR `PHOTOS`.`MESSAGE` LIKE ?)", ['%'.SEARCH.'%', '%'.SEARCH.'%']);
$spage = spage($column, PAGE_SETTINGS);
$page = page($spage);
$limit = PAGE_SETTINGS * $page - PAGE_SETTINGS;
?>
<div class='search-main-optimize'>
<form method='post' class='ajax-form2' action='/m/search/?type=photos'>
<input type='text' name='search' class='search-main' placeholder='<?=lg('Что ищем?')?>' value='<?=SEARCH?>'>
<button class="search-main-button ajax-button-search"><?=icons('search', 20)?></button>
</form>
</div>
<div class='list'>
<b><?=lg('Поиск фото')?></b>
</div>
<?
if ($column == 0){
html::empty('Поиск не дал результатов', 'search');
}else{
?>
<div class='list-body'>
<?
}
$data = db::get_string_all("SELECT `PHOTOS`.`ID`,`PHOTOS`.`EXT`,`PHOTOS`.`NAME`,`PHOTOS`.`SHIF` FROM `PHOTOS` LEFT JOIN `PHOTOS_DIR` ON (`PHOTOS_DIR`.`ID` = `PHOTOS`.`ID_DIR` OR `PHOTOS_DIR`.`ID_DIR` = `PHOTOS`.`ID_DIR`) WHERE `PRIVATE` = '0' AND (`PHOTOS`.`NAME` LIKE ? OR `PHOTOS`.`MESSAGE` LIKE ?) GROUP BY `PHOTOS`.`ID` ORDER BY `PHOTOS`.`TIME` DESC LIMIT ".$limit.", ".PAGE_SETTINGS, ['%'.SEARCH.'%', '%'.SEARCH.'%']);
while ($list = $data->fetch()){
require (ROOT.'/modules/photos/plugins/list.php');
echo $photos_list;
}
if ($column > 0){
?></div><?
}
get_page('/m/search/?type=photos&', $spage, $page, 'list');
back('/m/search/');
acms_footer();