isExpired()) { dbConnect(); $cookie = handleVoteCookie(); if ($tagName = getTagParam('tag')) { $tags = getTags(); $tagId = array_key_exists($tagName, $tags['pure']) ? $tags['pure'][$tagName] : NULL; if ($tagId == NULL) { header('Location: ' . BASE . 'u/search/?q=' . urlencode($tagName)); exit; } // select keywords $res = mysql_query($q= "select distinct t.tag_name from tag t, item_tag it1, item_tag it2 where it1.item_id = it2.item_id and it2.tag_id = t.tag_id and it1.tag_id = $tagId order by t.tag_name") or die(mysql_error()); $keywords = ''; while ($row = mysql_fetch_row($res)) $keywords .= str_replace('&', '&', $row[0]) . ', '; mysql_free_result($res); } else { header('HTTP/404 Not Found'); exit; } // $e = getmicrotime(); echo ''; $page = 1; if (array_key_exists('p', $_GET)) $page = trim($_GET['p']); $num = 15; if ($page < 1) { $page = 1; } handleSort(); printHeader($tagName, $tagName, htmlspecialchars($keywords, ENT_COMPAT, 'cp1251')); ?>

0 where t.tag_id = $tagId and t.item_id = i.item_id group by i.item_id order by ".$possibleSorts[$sorting]['order']) or die(mysql_error() . $q); $itemIds = '-1'; $cnt = 0; $itemCount = mysql_num_rows($res); if ($itemCount > ($page - 1) * $num) { mysql_data_seek($res, ($page - 1) * $num); } while ($row = mysql_fetch_row($res)) { if ($cnt++ < $num) { $itemIds .= ', ' . $row[0]; } } mysql_free_result($res); printItems($itemIds); printPages($itemCount, $page, $num, BASE . 'u/tag/' . getTagPath($tagName) . '/'); ?>
end(); } printFooter(); $e = getmicrotime(); echo ''; // $f = fopen($CORE_BASE.'time.txt', 'a'); // fwrite($f, $_SERVER['REQUEST_URI'].': '.($e - $b).' '.date('r')."\n"); // fclose($f); ob_end_flush(); ?>