function showOne() { $news_id = web::getThis(); db::table('news'); db::where('news_pub', '1'); $news = db::assoc(); if (db::rows() == 0) { web::error404(); } $news['news_date'] = dt::date2print('%d %F %Y', $news['news_date']); s::set('page_title', $news['news_title']); s::set('page_header', $news['news_title']); s::set($news); }
function showSection() { $section_id = web::getThis(); $item_id = web::getEvent(); if ($item_id !== false) { buffer::setTmpl('card.html'); self::showCard($item_id, $section_id); return false; } $dir = IMAGES_ROOT . 'sections/'; $dir_path = IMAGES_PATH . 'sections/'; db::table('catalog_sections'); db::where('section_id', $section_id); $section = db::assoc(); if (db::rows() == 0) { web::error404(); } s::set($section); s::set('page_title', $section['section_name']); s::set('page_header', $section['section_name']); $file = $dir . $section['section_id'] . '.jpg'; if (file_exists($file)) { s::set('section_img', '<img src="' . $dir_path . $section['section_id'] . '.jpg' . '" />'); } db::table('catalog_items'); db::where('section_id', $section_id); $r = db::select('item_name', 'item_id', 'item_desc'); $i = 0; while ($a = mysql_fetch_assoc($r)) { $i++; if ($i % 2) { s::roll('items1', $a); } else { s::roll('items2', $a); } } }