НОВИНИ

Веб-конференции

11.04.2013 16:51

  • 1){
    $count_news_page=$count_news*($page-1)+1;
    }else{
    $page=1;
    }

    $sql=db_query(“SELECT n.nid,n.title,f.filepath AS img FROM node n
    LEFT JOIN image_attach ia ON n.nid=ia.nid
    LEFT JOIN image i ON ia.iid=i.nid AND i.image_size=’480′
    LEFT JOIN files f ON i.fid=f.fid
    WHERE n.type=’online’ AND n.status=1 ORDER BY n.created DESC LIMIT 1”);
    $row=db_fetch_object($sql);
    $main_photo_nid=$row->nid;
    $main_photo_title=$row->title;
    $main_photo_img=$row->img;

    $sql=db_query(“SELECT n.created,n.nid,n.title,f.filepath AS img FROM node n
    LEFT JOIN image_attach ia ON n.nid=ia.nid
    LEFT JOIN image i ON ia.iid=i.nid AND i.image_size=’240′
    LEFT JOIN files f ON i.fid=f.fid
    WHERE n.type=’online’ AND n.status=1 ORDER BY n.created DESC LIMIT $count_news_page,$count_news”);
    while($row=db_fetch_object($sql)){
    $photo_nid[]=$row->nid;
    $photo_title[]=$row->title;
    $photo_img[]=$row->img;
    $photo_time[]=$row->created;

    }

    $nid=db_result(db_query(“SELECT COUNT(*) FROM node n
    LEFT JOIN image_attach ia ON n.nid=ia.nid
    LEFT JOIN image i ON ia.iid=i.nid AND i.image_size=’240′
    LEFT JOIN files f ON i.fid=f.fid
    WHERE n.type=’online’ AND n.status=1 ORDER BY n.created DESC”));

    $count_page=ceil($nid/$count_news);
    ?>

    Читай нас також у Viber та Telegram, поширюй новину на своїй сторінці:
    Поширити: