<?php $category = (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and is_numeric($_REQUEST['category'])) ? $_REQUEST['category'] : '1'; $page = (isset($_REQUEST['page']) and !empty($_REQUEST['page']) and is_numeric($_REQUEST['page'])) ? $_REQUEST['page'] : '1'; if (!($res = $DB->fetch($DB->query("SELECT " . ($lang == 'rus' ? 'cat_name_rus' : 'cat_name_eng') . " AS name\n\tFROM `" . PREF . "category`\n\tWHERE cat_id='" . mysql_real_escape_string($category) . "'\n\tLIMIT 1")))) { header("Location: http://" . $_SERVER['SERVER_NAME'] . "/"); exit; } $t = new e_Template('s_catalog', ROOT . "/tpl/"); $title = $res['name']; $cats = array(1 => 'still-life', 2 => 'portraits', 3 => 'landscape', 4 => 'silk', 5 => 'interior'); $t->assign('language', $lang == 'rus' ? 'en' : 'rus'); $t->assign('image', $category . ($lang == 'rus' ? '_r' : '')); $t->assign('m', array('about' => $lang == 'rus' ? 'на юбрнпе' : 'ABOUT THE ARTIST', 'lang' => $lang == 'rus' ? 'юмцкхияйхи' : 'RUSSIAN', 'home' => $lang == 'rus' ? 'днлни' : 'HOME', 'links' => $lang == 'rus' ? 'яяшкйх' : 'LINKS', 'contact' => $lang == 'rus' ? 'йнмрюйрш' : 'CONTACTS', 'guest' => $lang == 'rus' ? 'усднфеярбеммюъ ндефдю' : 'WEARABLE ART', 'ex' => $lang == 'rus' ? 'бшярюбйх' : 'EXHIBITIONS', 'portraits' => $lang == 'rus' ? 'онпрперш' : 'PORTRAITS', 'stillife' => $lang == 'rus' ? 'мюрчплнпрш' : 'STILL-LIFES', 'landscape' => $lang == 'rus' ? 'оеигюфх' : 'LANDSCAPES', 'silk' => $lang == 'rus' ? 'пняохяэ он ьекйс' : 'PAINTINGS═ON═SILK', 'interior' => $lang == 'rus' ? 'пюанрш б хмрепэепе' : 'INTERIOR DECORATION')); $t->parse('topmenu'); $ress = $DB->query("SELECT `pr`.`p_id` AS PID, " . ($lang == 'rus' ? "`pr`.`p_name_r`" : "`pr`.`p_name_e`") . " AS pname,\n\t\t\t(SELECT COUNT(*)\n\t\t\t\tFROM `" . PREF . "img`\n\t\t\t\tWHERE img_project_id=pr.p_id) AS cnt,\n\t\t\timg_filename AS file, img_width_s AS width, img_height_s AS height, img_id AS imid,\n\t\t\timg_width_b AS bwidth, img_height_b AS bheight\n\t\t\tFROM `" . PREF . "projects` AS pr\n\t\t\t\tINNER JOIN `" . PREF . "img`\n\t\t\t\tON img_project_id=pr.p_id\n\t\t\tWHERE pr.p_cat_id='" . mysql_real_escape_string($category) . "'\n\t\t\t\tAND img_order=1\n\t\t\tGROUP BY `pr`.`p_id`\n\t\t\tORDER BY pr.p_order ASC"); if ($num = mysql_num_rows($ress)) { $pages = ceil($num / 4); if ($pages > 0) { for ($i = 1; $i <= $pages; $i++) { $t->assign('p', array('category' => $cats[$category], 'num' => $i)); if ($i == $page) { $t->assign('class', ' class="active"'); } else { $t->assign('class', ''); } $t->parse('catalog.paginator.page'); } $t->parse('catalog.paginator'); } if ($pages >= $page) {
<?php $project = (isset($_REQUEST['id']) and !empty($_REQUEST['id']) and is_numeric($_REQUEST['id'])) ? $_REQUEST['id'] : '1'; $q1 = "SELECT " . ($lang == 'rus' ? "`pr`.`p_name_r`" : "`pr`.`p_name_e`") . " AS pname\n\tFROM `" . PREF . "projects` AS pr\n\tWHERE `pr`.`p_id`='" . mysql_real_escape_string($project) . "'\n\tLIMIT 1"; $q2 = "SELECT I.img_id AS id, I.img_filename AS file,\n\tI.img_width_s AS width, I.img_height_s AS height,\n\tI.img_width_b AS bwidth, I.img_height_b AS bheight\n\tFROM `" . PREF . "img` AS I\n\tWHERE I.img_project_id='" . mysql_real_escape_string($project) . "'\n\tORDER BY I.img_order"; if (!($pname = $DB->fetch($DB->query($q1)))) { exit; } $pname = $pname['pname']; $t = new e_Template('s_project', ROOT . "/tpl/"); $res = $DB->query($q2); $total = mysql_num_rows($res); $row = $DB->fetch($res); $t->assign('b', array('file' => $row['file'], 'width' => $row['bwidth'], 'height' => $row['bheight'])); $t->assign('title', $pname); $t->parse('projectLeader'); mysql_data_seek($res, 0); $i = 1; while ($row = $DB->fetch($res)) { $q = "SELECT V." . ($lang == 'rus' ? 'value_name_rus' : 'value_name_eng') . " AS value,\n\t\t\tK." . ($lang == 'rus' ? 'key_name_rus' : 'key_name_eng') . " AS keyname,\n\t\t\tK.key_show AS keyshow\n\t\t\tFROM " . PREF . "kvi_links AS L\n\t\t\tINNER JOIN " . PREF . "values AS V\n\t\t\t\tON L.link_value=V.value_id\n\t\t\tINNER JOIN " . PREF . "keys AS K\n\t\t\t\tON K.key_id=L.link_key\n\t\t\tWHERE L.link_img='" . $row['id'] . "'\n\t\tORDER BY V.value_sort"; $params = $DB->query($q); while ($param = $DB->fetch($params)) { $t->assign('d', array('key' => $param['keyshow'] ? $param['keyname'] . ": " : '', 'value' => $param['value'])); $t->parse('images.row.thumb.description'); } $t->assign('i', array('thumb' => $row['file'], 'width' => $row['width'], 'height' => $row['height'], 'bwidth' => $row['bwidth'], 'bheight' => $row['bheight'])); $t->parse('images.row.thumb'); if ($i % 3 == 0 or $i == $total) { $t->parse('images.row'); } ++$i;
<?php $page = (isset($_REQUEST['page']) and !empty($_REQUEST['page']) and is_numeric($_REQUEST['page'])) ? $_REQUEST['page'] : '1'; $t = new e_Template('s_links', ROOT . '/tpl/'); $t->assign('language', $lang == 'rus' ? 'en' : 'rus'); $t->assign('image', 'link' . ($lang == 'rus' ? '_r' : '')); $t->assign('m', array('about' => $lang == 'rus' ? 'на юбрнпе' : 'ABOUT THE ARTIST', 'lang' => $lang == 'rus' ? 'юмцкхияйхи' : 'RUSSIAN', 'home' => $lang == 'rus' ? 'днлни' : 'HOME', 'links' => $lang == 'rus' ? 'яяшкйх' : 'LINKS', 'contact' => $lang == 'rus' ? 'йнмрюйрш' : 'CONTACTS', 'guest' => $lang == 'rus' ? 'усднфеярбеммюъ ндефдю' : 'WEARABLE ART', 'ex' => $lang == 'rus' ? 'бшярюбйх' : 'EXHIBITIONS', 'portraits' => $lang == 'rus' ? 'онпрперш' : 'PORTRAITS', 'stillife' => $lang == 'rus' ? 'мюрчплнпрш' : 'STILL-LIFES', 'landscape' => $lang == 'rus' ? 'оеигюфх' : 'LANDSCAPES', 'silk' => $lang == 'rus' ? 'пняохяэ он ьекйс' : 'PAINTINGS═ON═SILK', 'interior' => $lang == 'rus' ? 'пюанрш б хмрепэепе' : 'INTERIOR DECORATION')); $t->parse('topmenu'); $total = $DB->fetch($DB->query("SELECT COUNT(*) AS cnt FROM " . PREF . "links")); $total = $total['cnt']; $q = "SELECT url, description" . ($lang == 'rus' ? '_r' : '_e') . " AS description\n\tFROM " . PREF . "links\n\tORDER BY sort\n\tLIMIT %s, 14"; $res = $DB->query(sprintf($q, 14 * ($page - 1))); for ($i = 1; $i <= ceil($total / 14); $i++) { $t->assign('p', array('num' => $i, 'name' => ($i - 1) * 14 + 1 . " - " . (($i - 1) * 14 + 14))); $t->parse('links.paginator.page'); } $t->parse('links.paginator'); while ($row = $DB->fetch($res)) { $url = $row['url']; $urls = explode(",", $url); foreach ($urls as $url) { $t->assign('url', trim($url)); $t->parse('links.row.url'); } $t->assign('description', $row['description']); $t->parse('links.row'); } $t->parse('links'); $t->assign('title', $lang == 'rus' ? 'яЯШКЙХ' : 'Links'); $t->parse(); echo $t->out();
<?php $tpl = new e_Template('adm_links', ROOT . "/tpl/"); $tpl->parse('script'); $gt->assign('morehead', $tpl->out('script')); $l = $DB->query("SELECT id, url, description_e e, description_r r\n\tFROM `" . PREF . "links`\n\tORDER BY `sort`"); while ($li = $DB->fetch($l)) { $tpl->assign('l', array('id' => $li['id'], 'url' => $li['url'], 'eng' => $li['e'], 'rus' => $li['r'])); $tpl->parse('form.row.url'); $tpl->parse('form.row'); } $tpl->parse('form'); $output .= $tpl->out('form'); $gt->assign('title', 'Links');
$ep->assign('pname_r', htmlspecialchars($r['p_name_r'])); $ep->assign('pname_e', htmlspecialchars($r['p_name_e'])); $ep->assign('pid', $r['p_id']); $ep->parse('form'); $output .= $ep->out('form'); $gt->assign('title', 'Editing project'); break; case "list": default: $list = new e_Template('adm_projectlist', ROOT . "/tpl/"); $list->parse('script'); $gt->assign('morehead', $list->out('script')); $res = $DB->query("SELECT `pr`.`p_id`, `pr`.`p_name_e`, `pr`.`p_name_r`, `cat`.`cat_name_eng`, `cat`.`cat_name_rus`, `cat`.`cat_id`, (SELECT COUNT(*) FROM `" . PREF . "img` AS img WHERE img.img_project_id=pr.p_id) AS cnt\n\t\t\tFROM `" . PREF . "projects` AS pr, `" . PREF . "category` AS cat\n\t\t\tWHERE pr.p_cat_id=cat.cat_id\n\t\t\tORDER BY pr.p_cat_id, pr.p_order ASC"); if (mysql_num_rows($res)) { $projects = array(); while ($row = $DB->fetch($res)) { $projects[$row['cat_id']][$row['p_id']] = $row; } foreach ($projects as $category => $project) { foreach ($project as $row) { $list->assign('p', array('id' => $row['p_id'], 'name_eng' => $row['p_name_e'], 'name_rus' => $row['p_name_r'], 'cat_name_eng' => $row['cat_name_eng'], 'cat_name_rus' => $row['cat_name_rus'], 'count' => $row['cnt'])); $list->parse('projects.plist.row', 1); } $list->parse('projects.plist', 1); } } $list->parse('projects'); $output .= $list->out('projects'); $gt->assign('title', 'All your projects'); break; }
<?php if (!defined("SITE")) { header("Location: http://" . $_SERVER['SERVER_NAME'] . "/"); exit; } $t = new e_Template('s_home', ROOT . "/tpl/"); switch ($lang) { case "rus": $t->assign('lang', 'en'); $t->assign('i', array('lang' => 'Eng_1', 'lang_h' => 'Eng_2', 'about' => 'LD_2_r', 'copy' => 'Авторское право на все представленные на данной странице работы принадлежит Лене Дик', 'guest' => 'Guest_1_r', 'guest_h' => 'Guest_2_r', 'links' => 'Links_1_r', 'links_h' => 'Links_2_r', 'ex' => 'Exhibitions1_r', 'ex_h' => 'Exhibitions2_r', 'stillife' => 'Still-lifes_r', 'stillife_h' => 'Still-lifes2_r', 'portraits' => 'Portraits_r', 'portraits_h' => 'Portraits2_r', 'landscape' => 'Landscapes_r', 'landscape_h' => 'Landscapes2_r', 'silkpaint' => 'Paintings_on_silk_r', 'silkpaint_h' => 'Paintings_on_silk2_r', 'decorate' => 'Interior_Decoration_r', 'decorate_h' => 'Interior_Decoration2_r')); $t->assign('t', array('lang' => 'Английский', 'about' => 'Об Авторе', 'links' => 'Ссылки', 'ex' => 'Выставки', 'guest' => 'Художественная одежда', 'stillife' => 'Натюрморты', 'portraits' => 'Портреты', 'landscape' => 'Пейзажи', 'silkpaint' => 'Роспись по шелку', 'decorate' => 'Работы в интерьере')); break; case "en": default: $t->assign('lang', 'rus'); $t->assign('i', array('lang' => 'Rus_1', 'lang_h' => 'Rus_2', 'about' => 'LD_2', 'copy' => 'All work on this page - Copyright© - Liena Dieck', 'guest' => 'Guest_1', 'guest_h' => 'Guest_2', 'links' => 'Links_1', 'links_h' => 'Links_2', 'ex' => 'Exhibitions1', 'ex_h' => 'Exhibitions2', 'stillife' => 'Still-lifes', 'stillife_h' => 'Still-lifes2', 'portraits' => 'Portraits', 'portraits_h' => 'Portraits2', 'landscape' => 'Landscapes', 'landscape_h' => 'Landscapes2', 'silkpaint' => 'Paintings_on_silk', 'silkpaint_h' => 'Paintings_on_silk2', 'decorate' => 'Interior_Decoration', 'decorate_h' => 'Interior_Decoration2')); $t->assign('t', array('lang' => 'Russian', 'about' => 'About Author', 'links' => 'Links', 'ex' => 'Exhibitions', 'guest' => 'Wearable Art', 'stillife' => 'Still-Lifes', 'portraits' => 'Portraits', 'landscape' => 'Landscapes', 'silkpaint' => 'Paintings on Silk', 'decorate' => 'Interior Decoration')); break; } $t->parse(); echo $t->out();
<?php error_reporting(0); require_once "../cfg.php"; $sql = new mysql($sql); $auth = new adm_authorize($sql); if (!$auth->check()) { $GLOBALS['_RESULT'] = array("q" => "You are not logged in"); exit; } $gt->assign('title', 'About Author'); $tpl = new e_Template('adm_about', ROOT . "/tpl/"); $tpl->parse('script'); $gt->assign('morehead', $tpl->out('script')); if (isset($_REQUEST['text_r']) and !empty($_REQUEST['text_r'])) { $fp = fopen(ROOT . '/data/about_r.dat', 'w'); fwrite($fp, stripslashes($_REQUEST['text_r'])); fclose($fp); } if (isset($_REQUEST['text_e']) and !empty($_REQUEST['text_e'])) { $fp = fopen(ROOT . '/data/about.dat', 'w'); fwrite($fp, stripslashes($_REQUEST['text_e'])); fclose($fp); } $aboutr = htmlspecialchars(file_get_contents(ROOT . "/data/about_r.dat")); $aboute = htmlspecialchars(file_get_contents(ROOT . "/data/about.dat")); $tpl->assign('t', array('about_e' => $aboute, 'about_r' => $aboutr)); $tpl->parse('form'); $output .= $tpl->out('form');
$w2 = $row['ws']; $h1 = $row['h']; $h2 = $row['hs']; if (!$row['kid']) { continue; } $select = array(); foreach ($html as $key_id => $keys) { $select[$key_id] = "<option value=" . $key_id; if ($key_id == $row['kid']) { $select[$key_id] .= " selected=\"selected\""; } $select[$key_id] .= ">" . $keys['0'] . " | " . $keys['1'] . "</option>"; } $sel = "<select name=\"image_key_" . $row['id'] . "\">" . implode("\n", $select) . "</select>"; $t->assign('r', array('id' => $_REQUEST['id'], 'vid' => $row['id'], 'k' => $sel, 'v_e' => $row['vn_e'], 'v_r' => $row['vn_r'])); $t->parse('form.row'); } $t->assign('file', $file); $t->assign('size', array('w1' => $w1, 'w2' => $w2, 'h1' => $h1, 'h2' => $h2)); } $select = array(); foreach ($html as $key_id => $keys) { $select[$key_id] = "<option value=" . $key_id . ">" . $keys['0'] . " | " . $keys['1'] . "</option>"; } $sel = "<select name=\"image_key_new\">" . implode("\n", $select) . "</select>"; $t->assign('ns', $sel); $t->assign('fileid', $_REQUEST['id']); $t->parse('form'); $output .= $t->out('form'); $gt->assign('title', 'Editing Image Preferences');
<?php $tpl = new e_Template('adm_ex', ROOT . "/tpl/"); $tpl->parse('script'); $gt->assign('morehead', $tpl->out('script')); $l = $DB->query("SELECT id, description_e de, description_r dr,\n\tlocation_e le, location_r lr,\n\tdate_from df, date_to dt\n\tFROM `" . PREF . "exhibitions`\n\tORDER BY `date_from` DESC, `date_to` DESC"); while ($li = $DB->fetch($l)) { $tpl->assign('l', array('id' => $li['id'], 'eng' => $li['de'], 'rus' => $li['dr'], 'loc_e' => $li['le'], 'loc_r' => $li['lr'], 'd1' => $li['df'], 'd2' => $li['dt'])); $tpl->parse('form.row'); } $tpl->parse('form'); $output .= $tpl->out('form'); $gt->assign('title', 'Exhibitions');
break; case "links": require_once ROOT . "/admin/links.php"; break; case "exhibitions": require_once ROOT . "/admin/exh.php"; break; case "about": require_once ROOT . "/admin/about.php"; break; case "keys": require_once ROOT . "/admin/keys.php"; break; case "pr": require_once ROOT . "/admin/project.php"; break; // uploading files // uploading files case "upi": require_once ROOT . "/admin/upload.php"; break; case "home": default: $gt->assign('title', 'Welcome to administrator interface'); break; } //$gt->assign('title', $title); $gt->assign('content', $output); $gt->parse(); echo $gt->out(); ob_flush();
<?php $tpl = new e_Template('adm_login', ROOT . "/tpl/"); $tpl->parse(); $gt = new e_Template('adm', ROOT . "/tpl/"); $gt->assign('title', "Enter to Admin Area"); $gt->assign('content', $tpl->out()); $gt->parse(); echo $gt->out(); exit;
<?php $t = new e_Template('adm_keys', ROOT . "/tpl/"); $t->parse('script'); $gt->assign('morehead', $t->out('script')); $res = $DB->query("SELECT key_id AS id, key_show AS sh, key_name_eng AS name_e, key_name_rus AS name_r\n\tFROM " . PREF . "keys"); if (mysql_num_rows($res) > 0) { while ($row = $DB->fetch($res)) { $t->assign('r', array('id' => $row['id'], 'checked_0' => $row['sh'] == 0 ? ' checked="checked"' : '', 'checked_1' => $row['sh'] == 1 ? ' checked="checked"' : '', 'name_e' => $row['name_e'], 'name_r' => $row['name_r'])); $t->parse('form.row'); } } $t->parse('form'); $output .= $t->out('form'); $gt->assign('title', 'Editing Keys for image data');