function bannerHitsbyID($id) { $b = dbGetFields('cms_banners', 'id=' . $id, 'maxhits, hits'); if (!$b['maxhits']) { return $b['hits']; } else { return $b['hits'] . '/' . $b['maxhits']; } }
<p> <input name="opt" type="hidden" id="opt" value="saveconfig" /> <input name="save" type="submit" id="save" value="Сохранить" /> <input name="back" type="button" id="back" value="Отмена" onclick="window.location.href='index.php?view=components';"/> </p> </form> <?php } //=================================================================================================// //=================================================================================================// if ($opt == 'import_xls') { cpAddPathway('Импорт из MS Excel', $_SERVER['REQUEST_URI']); echo '<h3>Импорт из MS Excel</h3>'; if ($inCore->inRequest('cat_id')) { //load category fields structure $cat = dbGetFields('cms_uc_cats', 'id=' . $_REQUEST['cat_id'], 'title, fieldsstruct, view_type'); $fstruct = unserialize($cat['fieldsstruct']); ?> <form action="index.php?view=components&do=config&id=<?php echo $_REQUEST['id']; ?> " method="POST" enctype="multipart/form-data" name="addform"> <p><strong>Рубрика:</strong> <a href="index.php?view=components&do=config&id=<?php echo $_REQUEST['id']; ?> &opt=import_xls"><?php echo $cat['title']; ?> </a></p> <p>Выберите файл Excel, в котором находится таблица с характеристиками записей</p> <table width="650" border="0" cellspacing="5" class="proptable">
$admin_id = $inCore->request('admin_id', 'int'); $clubtype = $inCore->request('clubtype', 'str'); $maxsize = $inCore->request('maxsize', 'int'); $enabled_blogs = $inCore->request('enabled_blogs', 'int'); $enabled_photos = $inCore->request('enabled_photos', 'int'); $date = explode('.', $_REQUEST['pubdate']); $pubdate = $date[2] . '-' . $date[1] . '-' . $date[0]; //upload logo if (isset($_FILES['picture'])) { require PATH . '/includes/graphic.inc.php'; $uploaddir = PATH . '/images/clubs/'; if (!is_dir($uploaddir)) { @mkdir($uploaddir); } $realfile = $_FILES['picture']['name']; $lid = dbGetFields('cms_clubs', 'id>0', 'id', 'id DESC'); $lastid = $lid['id'] + 1; $filename = md5($lastid) . '.jpg'; $uploadphoto = $uploaddir . $filename; $uploadthumb = $uploaddir . 'small/' . $filename; if ($inCore->moveUploadedFile($_FILES['picture']['tmp_name'], $uploadphoto, $_FILES['picture']['error'])) { if (!isset($cfg['watermark'])) { $cfg['watermark'] = 0; } @img_resize($uploadphoto, $uploadthumb, $cfg['thumb1'], $cfg['thumb1'], $cfg['thumbsqr']); @img_resize($uploadphoto, $uploadphoto, $cfg['thumb2'], $cfg['thumb2'], $cfg['thumbsqr']); } else { $msg = $inCore->uploadError(); } } else { $filename = '';
$album = $model->getAlbumThumbsData($photo['album_id']); $titlemode = $inCore->request('titlemode', 'str'); $loaded_files = array(); ////////// $list_files = array(); foreach ($_FILES['upfile'] as $key => $value) { foreach ($value as $k => $v) { $list_files['upfile' . $k][$key] = $v; } } foreach ($list_files as $key => $data_array) { $error = $data_array['error']; if ($error == UPLOAD_ERR_OK) { $realfile = $data_array['name']; $tmp_name = $data_array['tmp_name']; $lid = dbGetFields('cms_photo_files', 'id>0', 'id', 'id DESC'); $lastid = $lid['id'] + 1; $filename = md5($realfile . '-' . $inUser->id . '-' . time()) . '.jpg'; $uploadfile = $uploaddir . $realfile; $uploadphoto = $uploaddir . $filename; $uploadthumb = $uploaddir . 'small/' . $filename; $uploadthumb2 = $uploaddir . 'medium/' . $filename; $photo['filename'] = $filename; if (move_uploaded_file($tmp_name, $uploadphoto)) { $loaded_files[] = $realfile; @img_resize($uploadphoto, $uploadthumb, $album['thumb1'], $album['thumb1'], $album['thumbsqr']); @img_resize($uploadphoto, $uploadthumb2, $album['thumb2'], $album['thumb2'], false, $cfg['watermark']); if ($cfg['watermark']) { @img_add_watermark($uploadphoto); } if (@(!$inCore->inRequest('saveorig'))) {
} $content = $inCore->request('content', 'str'); $published = $inCore->request('published', 'int'); $city = $inCore->request('city', 'str'); $obtype = $inCore->request('obtype', 'str'); $title = str_ireplace($obtype, '', $title); $pubdays = $inCore->request('pubdays', 'int'); $pubdate = $inCore->request('pubdate', 'str'); $pubdate = explode('.', $pubdate); $pubdate = $pubdate[2] . '-' . $pubdate[1] . '-' . $pubdate[0]; $user_id = $inUser->id; if (isset($_FILES['picture']['tmp_name'])) { if (@move_uploaded_file($_FILES['picture']['tmp_name'], $uploadphoto)) { $uploaddir = PATH . '/images/board/'; $realfile = $_FILES['picture']['name']; $lid = dbGetFields('cms_board_items', 'id>0', 'id', 'id DESC'); $lastid = $lid['id'] + 1; $filename = md5($lastid) . '.jpg'; $uploadfile = $uploaddir . $realfile; $uploadphoto = $uploaddir . $filename; $uploadthumb = $uploaddir . 'small/' . $filename; $uploadthumb2 = $uploaddir . 'medium/' . $filename; if (!isset($cfg['watermark'])) { $cfg['watermark'] = 0; } $sql_album = "SELECT thumb1, thumb2, thumbsqr FROM cms_board_cats WHERE id = {$category_id}"; $rs_album = dbQuery($sql_album) or die('Error retrieving category information'); if (mysql_num_rows($rs_album) == 1) { $cat = mysql_fetch_assoc($rs_album); } else { die('Error retrieving category information');