# Yeah, that sucks, but it's pretty much all we need here mysql_connect("localhost", "rock", "nla3YjQ0pL"); mysql_select_db("rock"); mysql_query("SET NAMES 'utf8';"); ?>
![]() |
|||||||
|
function pub_block($id, $count=5, $show_all=false){
if (! is_array($id)) {
$cat=mysql_fetch_assoc(mysql_query("SELECT * from categories WHERE id=$id"));
?>
=$cat['name']?>$id = array ($id); } else { ?>Новые материалы на сайте} $id = implode (',', $id); ?>
$pubs=mysql_query("SELECT p.id, p.title, m.ID_MSG, m.ID_TOPIC, m.ID_MEMBER, m.posterName, p.brief, p.timestamp, p.uri as uri, c.id as cid, c.urlname as c_urlname FROM publications p, smf_messages m, categories c WHERE p.id_post=m.ID_MSG AND p.id_category=c.id AND id_category IN($id) AND p.display=1 ORDER BY p.timestamp DESC LIMIT $count");
$first = true;
while($art=mysql_fetch_assoc($pubs)) {
$date=date("d.m.y H:i",$art['timestamp']);
if ($art['uri'] == '') $art['uri'] = $art['id'];
?>
}
?>
pub_block(1, 5); ?>
pub_block(3, 5); ?>
pub_block(array (2,4,5), 15); ?>
=$art['title']?>
if ($first OR $show_all) {
$first = false;
?>
/* |