Архів відео

27.02.2017 16:49
  • nid;
    $title_video_main=$row->title;
    $code_video_main=$row->video;
    $time_video_main=$row->created;

    $preg=preg_match(“/(v)\/([A-Za-z0-9_\-]{1,11})/”, $code_video_main, $matches);
    if(!$preg){
    $preg=preg_match(“/(embed)\/([A-Za-z0-9_\-]{1,11})/”, $code_video_main, $matches);
    }
    $regForImgId = explode(“/”,$matches[0]);
    $img_video_main=’http://i2.ytimg.com/vi/’.$regForImgId[1].’/hqdefault.jpg’;
    }

    /** Gets all videos which were created since 01.01.2017 */
    $sql=db_query(“SELECT n.title,n.nid,ctv.field_video_code_value AS video,n.created FROM node n
    INNER JOIN content_type_video ctv ON ctv.nid=n.nid
    WHERE n.type=’video’ AND n.status=1 AND n.created < 1483228800 ORDER BY n.created DESC LIMIT $count_news_page,$count_news"); while($row=db_fetch_object($sql)){ $nid_video[]=$row->nid;
    $title_video[]=$row->title;
    $code_video[]=$row->video;
    $time_video[]=$row->created;
    $preg=preg_match(“/(v)\/([A-Za-z0-9_\-]{1,11})/”, $row->video, $matches);
    if(!$preg){
    $preg=preg_match(“/(embed)\/([A-Za-z0-9_\-]{1,11})/”, $row->video, $matches);
    }
    $regForImgId = explode(“/”,$matches[0]);
    if($regForImgId[1]) {
    $img_video[]=’http://i2.ytimg.com/vi/’.$regForImgId[1].’/mqdefault.jpg’;
    } else {
    $img_video[]=$base_url.’/themes/garland/images/no_image2.png’;
    }
    }

    /** Gets count of videos which were created since 01.01.2017 */
    $nid=db_result(db_query(“SELECT COUNT(*) FROM node n
    INNER JOIN content_type_video ctv ON ctv.nid=n.nid
    WHERE n.type=’video’ AND n.status=1 AND n.created < 1483228800 ORDER BY n.created DESC"));$count_page=ceil($nid/$count_news); ?>

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