/** * Строим ссылку на файл-изображение * Формат ссылки: SITEURL.'/files/images/[folder]/[id]_[prefix][postprefix][file]' */ static function imgurl($p) { $url = bff::buildUrl($p['folder'], 'images'); if (empty($p['file'])) { //если 'file' не указан, возвращаем изображение по-умолчанию return $url . (isset($p['prefix']) ? $p['prefix'] . (isset($p['postprefix']) ? $p['postprefix'] : '') . '_' : '') . BFF_DEFAULT_IMG; } //'file' - является уже сформированнным именем файла if (!empty($p['static'])) { return $url . $p['file']; } $url .= $p['id'] !== false ? $p['id'] . '_' : ''; if (isset($p['prefix'])) { $url .= $p['prefix']; } if (isset($p['postprefix'])) { $url .= $p['postprefix']; } return $url . $p['file']; }
public function init() { parent::init(); $this->items_images_path = bff::buildPath('items', 'images'); $this->items_images_url = bff::buildUrl('items', 'images'); # nested sets tree $tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_BBS_CATEGORIES)); bff::i()->GetModule('Services'); if (bff::$isFrontend) { return; } # ! # проверяем наличие корневого элемента if ($tree->checkRootNode($nRootID)) { # если только-что создан, создаем категорию $this->db->execute('UPDATE ' . TABLE_BBS_CATEGORIES . ' SET title = ' . $this->db->str2sql('Корневой раздел') . ', created = ' . $this->db->getNOW() . ' WHERE id = ' . $nRootID); } $this->initDynprops(); }
<?php extract($aData); $get = array('item' => $id); header('Location: ' . bff::buildUrl('', 'newpage') . '?' . http_build_query($get)); ?> <div class="padBlock noBorder"> <div class="allRight">Ваше объявление успешно опубликовано</div> <div class="textPad"> <div class="advBlock"> <div class="pic"><img src="<?php echo tpl::imgurl(array('folder' => 'items', 'file' => !empty($imgfav) ? $id . 't' . $imgfav : '', 'static' => 1)); ?> " /></div> <div class="desc"> <?php if ($cat_type > 0) { ?> <b class="upper"><?php echo $cat_type_title; ?> :</b> <?php } ?> <?php if ($cat_subtype > 0) { ?> <b class="upper"><?php echo $cat_subtype_title; ?>
if ($item == $currentPage) { print 'active'; } ?> "> <?php $get['page'] = $item; ?> <a href="<?php print bff::buildUrl('', 'newpage') . '?' . http_build_query($get); ?> "><?php echo $item; ?> </a> </li> <?php } ?> <?php $get['page'] = $pages; ?> <li class=""><a href="<?php print bff::buildUrl('', 'newpage') . '?' . http_build_query($get); ?> ">»</a></li> </ul> </div> <?php }
?> <br/> <?php if ($cat_subtype) { ?> <b class="grey f12Up"><?php echo $cat_subtype_title; ?> </b> <?php } echo nl2br($descr); ?> <br/> </p> <?php if ($imgcnt) { $imgURL = bff::buildUrl('items', 'images'); $img = explode(',', $img); if (!empty($img)) { $imgfav = !empty($imgfav) ? $imgfav : current($img); ?> <div class="picCont"> <span class="left"><img src="<?php echo $imgURL . ($id . $imgfav); ?> " id="itemMainImg" /></span> <div class="smallPics"><?php foreach ($img as $i) { echo '<span class="right"><a href="' . $imgURL . ($id . $i) . '" target="_blank" onclick="$(\'#itemMainImg\').attr(\'src\',$(this).attr(\'href\')); return false;"><img src="' . $imgURL . ($id . 's' . $i) . '" /></a></span>'; } ?> </div>
<?php extract($aData); $get = $_REQUEST; ?> <div class="row-fluid"> <div class="span5"> <?php $imgURL = bff::buildUrl('items', 'images'); $imgDefaultURL = bff::buildUrl('default', 'images'); $imgDefault = $imgDefaultURL . 'no-photo-300.png'; $imgArray = explode(',', $img); ?> <div class="main-image"> <?php if ($imgfav) { ?> <img src="<?php echo $imgURL . $id . $imgfav; ?> " class="img-rounded"> <?php } else { ?> <img src="<?php echo $imgDefault; ?> " class="img-rounded" style="margin: 0 auto;">