Мне кажется довольно полезная вещь, например для вывода фотографий определенной темы в нужном месте сайта.
<?php
<?php
if (!defined("DNREAD")) exit();
global $db,$basepref,$api,$setting;
$bc = '';
$bs = array(
'col' => array('lang'=>'all_col',
'form'=>'text',
'value'=>1,
'default'=>1),
'row' => array('lang'=>'who_col_all',
'form'=>'select',
'value'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8','9'=>'9','10'=>'10','11'=>'11','12'=>'12'),
'default'=>1),
'date' => array('lang'=>'all_data',
'form'=>'checkbox',
'value'=>'yes',
'default'=>'yes'),
'rating' => array('lang'=>'all_rating',
'form'=>'checkbox',
'value'=>'yes',
'default'=>'yes'),
'sort' => array('lang'=>'all_sorting',
'form'=>'select',
'value'=>array('photosid'=>'ID','title'=>'all_name','public'=>'all_data','hits'=>'all_hits','comments'=>'menu_comment'),
'default'=>'photosid'),
'order' => array('lang'=>'all_sorting',
'form'=>'select',
'value'=>array('desc'=>'all_desc','asc'=>'all_acs'),
'default'=>'desc'),
'random' => array('lang'=>'photos_random',
'form'=>'checkbox',
'value'=>'yes',
'default'=>'no'),
'albom' => array('lang'=>'albom_block_test',
'form'=>'text',
'value'=>1,
'default'=>1)
);
if (defined('SETTING')) {
return $bs;
}
if (isset($setting['bsarray']) && is_array($setting['bsarray'])) {
$bs = $setting['bsarray'];
}
if (!is_array($setting['bsarray'])) {
$bc.= '<div class="alert alert-info">Ѕлок не настроен!</div>';
} else {
$inq = $db->query("SELECT * FROM ".$basepref."_photos WHERE albumid=".$bs['albom']." AND act='yes' ORDER BY ".(($bs['random'] == 'yes') ? 'MD5(RAND())' : $bs['sort'].' '.$bs['order'])." LIMIT ".$bs['col']);
$photoarr = array();
if ($db->numrows($inq) > 0) {
$tm->unmanule['date'] = $bs['date'];
$tm->unmanule['rating'] = ($setting['photosrate'] == 'yes' && $bs['rating'] == 'yes') ? 'yes' : 'no';
$ins['template'] = $tm->parsein($tm->create('mod/photos/photos.standart'));
while ($photos = $db->fetchrow($inq)) {
$ins['alt'] = ($photos['image_alt']) ? $api->siteuni($photos['image_alt']) : '';
$ins['img'] = '<img src="'.$setting['site_url'].'/'.$photos['image'].'" alt="'.$ins['alt'].'" />';
$ins['cpu'] = ($siteglobal['seourl'] == 1 && $photos['cpu']) ? '&cpu='.$photos['cpu'] : '';
$ins['image'] = ($ins['img']) ? '<a href="'.$setting['site_url'].'/photos/image-.html'.$photos['photosid'].$ins['cpu'].'" data-toggle="tooltip" title="'.$api->siteuni($photos['title']).'">'.$ins['img'].'</a>' : '';
if ($tm->unmanule['rating'] == 'yes') {
$rate = @round($photos['totalrating'] / $photos['rating']);
$star = '';
for ($i = 1; $i < 6; $i ++ ) {
$star.= ($rate >= $i) ? '<i class="icon-star"></i>' : '<i class="icon-star-empty"></i>';
}
$ins['rating'] = '<span class="rating text-primary" data-toggle="tooltip" title="'.$lang['down_rate'].': '.(($rate == 0) ? $lang['all_no'] : $lang['down_rate_'.$rate.'']).'">'.$star.'</span>';
} else {
$ins['rating'] = '';
}
$photoarr[] = $tm->parse(
array(
'imgpublic'=>$api->sitetime($photos['public'],0,1),
'timedate'=>$api->timedate($photos['public'],0),
'image'=>$ins['image'],
'rating'=>$ins['rating'],
'contype'=>($photos['contype'] == 'video') ? '<i class="icon-facetime-video" data-toggle="tooltip" title="видео"></i>' : '<i class="icon-camera" data-toggle="tooltip" title="фото"></i>'
),
$ins['template']);
}
$bc.= $tm->columnprint($photoarr, $bs['row'], true);
}
}
return $api->siteuni($bc);
?>
Файл прикрепить не могу, не укладываюсь в лимиты.