PHP - Checking Validity Of Youtube Video With Php
Hello,
I embed some YouTube videos on my site. Sometimes a video is deleted from YouTube and I have no way of knowing. Does anyone know if there is some php script or by using their API you can check if a video has: - video has been removed - video is not embeddable any more any ideas? Thanks /df Similar Tutorialshello guys i am a newbie want help with how to upload a youtube in your script and in database i know about the $_files thing but how do i give a link please help me out !! I can search for videos by keyword and can fetch videos list from youtube using its api in php. I can fetch video title, description, thumbnail etc. but how can i fetch video url not like this -> youtube.com/watch?id=xyz...
Example: ytpak[dot]com
Hi, Thanks in advance, I want to update youtube videos. here is my code. let me tell you firstly, i am very new to php. public function updateVideo($title,$description) { $title="Hello"; $description="Updating video info"; $result=$this->clientLoginAuth($this->username,$this->pass); //$fdata = file_get_contents($fullFilePath); $tmpdata = '<?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <media:group> <media:title type="plain">'.$title.'</media:title> <media:description type="plain">'.$description.'</media:description> <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category><media:keywords>Breathe Parkour Magazine</media:keywords> </media:group> <yt:accessControl action="comment" permission="allowed"/> <yt:accessControl action="commentVote" permission="allowed"/> <yt:accessControl action="videoRespond" permission="allowed"/> <yt:accessControl action="rate" permission="allowed"/> <yt:accessControl action="list" permission="allowed"/> <yt:accessControl action="embed" permission="allowed"/> <yt:accessControl action="syndicate" permission="allowed"/> </entry> '; $url = 'http://gdata.youtube.com/feeds/api/users/breathparkour/uploads/6yStkCdeLEU'; //echo $url; $data = '--f93dcbA3 Content-Type: application/atom+xml; charset=UTF-8 '.$tmpdata.' --f93dcbA3 Content-Type: video/quicktime'; //echo $data; return $this->make_update_request($url,$data); } public function make_update_request($url,$data){ //echo $url; $token = $this->accessToken; $developerKey = $this->developerKey; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if($this->authType == 'GoogleLogin') $curlheader[0] = "Authorization: ".$this->authType." auth=\"$token\""; else $curlheader[0] = "Authorization: ".$this->authType." token=\"$token\""; $curlheader[1] = "X-GData-Key: key=\"$developerKey\""; $curlheader[2] = "Host: gdata.youtube.com"; $curlheader[3] = "Content-Type: application/atom+xml"; $curlheader[4] = "Content-Length: ".strlen($data); $curlheader[5] = "GData-Version: 2"; curl_setopt($ch, CURLOPT_HTTPHEADER, $curlheader); //curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_PUT, true); $output = curl_exec($ch); curl_close($ch); print_r($output); $validresult = $this->checkErrors($output); print_r($validresult); //echo $output; if($validresult['is_error'] == 'No') { unset($validresult); return "Success"; } else { $result = array(); $result['is_error'] = $validresult['is_error']; $result['error'] = $validresult['error']; unset($validresult); return $result; } } i am getting this error. GDataParseExceptionPremature end of file Please help me. i have spent almost 6 hours on this issue. Pleazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzz Hi, I want to get a latest video from Youtube Playlist. I look it on Google API, and the other solutions, but I think dont undestand quit good what I need to do. For example a have a playlist: https://www.youtube.com/playlist?list=PLW8l7rX2YaXkaSI8GGbmqPjOEmfzd2hz3 And I want to see always only a latest uploaded video, so I need a link (embed - watch, or "youtu.be/xy"): https://www.youtube.com/watch?v=LyzziLETNUw&list=PLW8l7rX2YaXkaSI8GGbmqPjOEmfzd2hz3 Thanks in advanced, T I'm not sure if this is possible
Previously I had a problem of outputting rows of a specific query
This was the solution that was given to me
$txt .= $date . " " . $stratoparse . "\n\n";Where a while loop's results were concatenated to a single string What I would like to do is output the results in individual containers with controls such as dragging for repositioning / an x for deletion That's not what I'm here for in this post I want to embed youtube videos, so they are not just stored as links, rather a clickable video so if you have something like string.string2.string3.string4.string5.<iframe src="youtube"...>.string7.string8 how would that video be isolated and parsed / understood as a front end youtube video ? To provide a brief background in case you are wondering why in my right mind, I would want to do this... First it is the primary solution that comes to mind going off what already works Secondly, the purpose or point of the concatenated string comes from the "application" design which is a store and recall interface. Vague, I know. The website has multiple users and they all have access to a single database. They save random strings, whether they are paragraphs or links, possibly videos that are uploaded, etc... these are saved by a keyphrase, later recalled by searching that keyphrase. Currently the output is nothing more than a concatenated string, that was fine initially but some of my friends have been testing the website and they made suggestions which are good such as repositioning and deleting entries. Now I want to automatically parse youtube links into embedded videos... I'll probably use that explode "function" to disect the link and place the url within the src=" " Anyway, I have to look into this but if anyone has any thoughts I'd appreciate it. Edited by moose-en-a-gant, 11 January 2015 - 02:05 AM. Anyone have access to a youtube video/audio downloader script? I'm sure there are one of these laying around somewhere... Looking for 1. Hello everyone I am working on a blog system. and I am having problems with the youtube video embed I have found some script online that kinda works If I post more then one youtube link the player shows up.. but it says movie not loaded. if I post just one video it just shows the url to the video on youtube. here is my youtube_function.php <?PHP //convert youtube links into embede function show_youtube($text) { $VID_WID = 320; $VID_HEI = 240; for ($k=0; $k<9; $k++) { $text .= ""; $find = 'youtube.com/watch?v='; $pos = strpos($text, $find); if ($pos == false) { break; } $len = strlen($text); for ($i=$pos; $i>=0; $i--) { if (substr($text, $i, 6) == 'http://') { $pos1 = $i; break; } } for ($i=$pos; $i<$len; $i++) { if (in_array($text[$i], array('&', ' ', "\r", "\n", ',', "\t"))) { $pos2 = $i; break; } } $link1 = substr($text, $pos1, $pos2 - $pos1); $link2 = str_replace('/watch?v=', '/v/', $link1); $embed = '<object width="' . $VID_WID . '" height="' . $VID_HEI . '">'. '<param name="movie" value="' . $link2 . '"></param>'. '<param name="allowFullScreen" value="true"></param>'. '<param name="allowscriptaccess" value="always"></param>'. '<embed src="' . $link2 . '" type="application/x-shockwave-flash" '. 'allowscriptaccess="always" allowfullscreen="true" '. 'width="' . $VID_WID . '" height="' . $VID_HEI . '"></embed></object>'; $text = str_replace($link1, $embed, $text); } return $text; } ?> and I have index.php <?php session_start(); include ("includes/includes.php"); include ("includes/youtube_function.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <link rel="stylesheet" href="includes/style.css" type="text/css" media="screen" title="no title" charset="utf-8"> <title>Simple Blogging System</title> </head> <body> <div id="wrap"> <div id="header"><h1>Simple Blogging System<br /><font size="6">*Keep it simple*</font></h1></div> <div id="nav"> <center> Link Link Link </center> </div> <div id="main"> <div id="blogPosts"> <?php $blogPosts = GetBlogPosts(); foreach ($blogPosts as $post) { echo "<div class='post'>"; echo "<h2>" . $post->title . "</h2>"; echo show_youtube($post->post, $text); echo "<span class='footer'>Posted By: " . $post->author . " Posted On: " . $post->datePosted . " Tags: " . $post->tags . "</span>"; echo "</div>"; ?> <br /> <?php } ?> </div> </div> <div id="sidebar"> <h2>Archive</h2> <p> old </p> <p> old </p> <p> old </p> </div> <div id="footer"> <p>Simple Blogging System</p> </div> </div> </body> </html> so as you can see I have show_youtube($post->post, $text); I have tried this just out of curiosity to see if I could fix this myself. but It seems like the video does not want to run at all... I am confused with this and some help would be greatly appreciated. Thank you in advance Hi guys, In an application I'm working on, I'm looking to embed a youtube video with [YOUTUBE][/YOUTUBE]. Code: [Select] echo preg_replace('#(?:<\>]+href=\")?(?:http://)?((?:[a-zA-Z]{1,4}\.)?youtube.com/(?:watch)?\?v=(.{11}?))[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#', '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$matches[2].'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.$matches[2].'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>', $ENTIREPAGE?); The problem is that the video appears with a slider control at the bottom. How do I get rid of the Youtube slider control at the bottom? Thanks. I have a video system on my website that allows users to post videos and it embeds youtube videos into the site, I would like to create an interface where you can comment on the actual video itself and it go to youtube's commenting stream. Is that possible? difficult? I am looking for a code where I can get a video URL from Youtube, Vimeo, Facebook and convert it to an embedded video to be shown on my site. I found a script that does that. It works fine. The only errors I get are in the inspect element window in the browser. Errors such as this. Failed to load resource: net::ERR_BLOCKED_BY_CLIENT googleads.g.doubleclick.net/pagead/id:1 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT static.doubleclick.net/instream/ad_status.js:1
This is the function to generate the embedded videos. Do the above errors matter if the videos show up and play fine? function generateVideoEmbedUrl($url){ //This is a general function for generating an embed link of an FB/Vimeo/Youtube Video. $finalUrl = ''; if(strpos($url, 'facebook.com/') !== false) { //it is FB video $finalUrl.='https://www.facebook.com/plugins/video.php?href='.rawurlencode($url).'&show_text=1&width=200'; }else if(strpos($url, 'vimeo.com/') !== false) { //it is Vimeo video $videoId = explode("vimeo.com/",$url)[1]; if(strpos($videoId, '&') !== false){ $videoId = explode("&",$videoId)[0]; } $finalUrl.='https://player.vimeo.com/video/'.$videoId; }else if(strpos($url, 'youtube.com/') !== false) { //it is Youtube video $videoId = explode("v=",$url)[1]; if(strpos($videoId, '&') !== false){ $videoId = explode("&",$videoId)[0]; } $finalUrl.='https://www.youtube.com/embed/'.$videoId; }else if(strpos($url, 'youtu.be/') !== false){ //it is Youtube video $videoId = explode("youtu.be/",$url)[1]; if(strpos($videoId, '&') !== false){ $videoId = explode("&",$videoId)[0]; } $finalUrl.='https://www.youtube.com/embed/'.$videoId; }else{ //Enter valid video URL } return $finalUrl; }
How could I from the varying URLs parse only the YouTube video ID? http://www.youtube.com/watch?v=SwrawcORlp0&feature=player_embedded http://www.youtube.com/watch?v=SwrawcORlp0&feature=popular How can I from the URLs above only extract the id into a variable $url SwrawcORlp0 Thanks, df Youtube has an advanced api to deliver xml; but when I try to parse its xml, it is not well-defined. I want to get "average rating" for a given video, but simple xml load disregard this section: $xml = simplexml_load_file('http://gdata.youtube.com/feeds/mobile/videos/wZ252E282go'); print_r($xml); How can I put the value of "average rating" into an string to echo? Code: [Select] $txt = preg_replace( "#\[yt\]http://www.youtube.com/watch?v=(.+?)\[/yt\]#is", '<embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" wmode="transparent" width="512" height="313" allowfullscreen="true" />', $txt ); Okay this is my code just for inserting it into HTML, the problem is whenever I try to use: Code: [Select] [yt]http://www.youtube.com/watch?v=l1G7TJD6Xu0[/yt] On my form to enter it does not work? But if I use Code: [Select] $txt = preg_replace( "#\[yt\](.+?)\[/yt\]#is", '<embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" wmode="transparent" width="512" height="313" allowfullscreen="true" />', $txt ); Code: [Select] [yt]l1G7TJD6Xu0[/yt] It works. But I want to use the full URL of the youtube, so I don't want my users to copy/paste just the "l1G7TJD6Xu0" Code , any help? Thank you Before you say about trying to use curl and fsockopen...I have tried those already but my host does not allow it due to their settings on their php.ini file. I am wondering if there is a way (other than those above) to grab the latest videos from a specific user on youtube, and be able to display them on a website, such as grabbing information about the video, as well as displaying it. If this is at all possible, and you can help...thanks in advance. Has anyone had any success doing this? I'm not sure if I should try to write this myself or use some kind of framework. I found the Zend Gdata framework (http://framework.zend.com/manual/en/zend.gdata.html) and tried it out but I kept getting error: Warning: include_once() [function.include]: Failed opening '1' for inclusion (include_path='.:/usr/share/pear') I'm assuming it needs to find PEAR which I don't have installed but no where in the Zend docs does it say that it requires PEAR so I'm a little confused. I've never used any of the Zend frameworks so I have no idea if it needs PEAR or not. Anyone have any other methods for doing this? thanks. Hi, I'm working with the YouTube API to echo a feed based on a user's query. My current code is below. With this code, a whole list of videos is retrieved. However, in order to present the feed as I wish to... I need to return each video in the feed individually. I am unsure how to do this and any advice would be really appreciated. Code: [Select] $feedURL = "http://gdata.youtube.com/feeds/api/videos/-/$youtubeQuery?orderby=viewCount&max-results=10"; // read feed into SimpleXML object $sxml = simplexml_load_file($feedURL); // iterate over entries in resultset // print each entry's details foreach ($sxml->entry as $entry) { // get nodes in media: namespace for media information $media = $entry->children('http://search.yahoo.com/mrss/'); // get video player URL $attrs = $media->group->player->attributes(); $watch = $attrs['url']; // get video thumbnail $attrs = $media->group->thumbnail[0]->attributes(); $thumbnail = $attrs['url']; // get <yt:duration> node for video length $yt = $media->children('http://gdata.youtube.com/schemas/2007'); $attrs = $yt->duration->attributes(); $length = $attrs['seconds']; // get video title $title = $media->group->title; // get <gd:rating> node for video ratings $gd = $entry->children('http://schemas.google.com/g/2005'); if ($gd->rating) { $attrs = $gd->rating->attributes(); $rating = $attrs['average']; } else { $rating = 0; } } ?> The application that I want to build is quite simple. Here is a bit of the background of the work flow: In my company, we create video for our client profile. After the video is done, we upload the video to our website and to youtube. It is done automatically. After a period of time, the client can delete the video. Of course, it will delete the video in our system as well as the video in youtube. For now, the video in our system is deleted automatically. However, youtube video is deleted manually. Our company has grown to have quite a lot of clients. It's hard for us to keep track clients that requested to delete their videos. We want to be able to have an application that will delete youtube video automatically. I already tried to play around with youtube authentication in http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Authentication but I have no luck with the authentication. I want the application to be able to delete the video under my youtube account without having me to login to youtube. In my case right now, every time the application wants to delete the video, I have to send the request to youtube and ask for verification (i.e. I have to do application verification every time). Here is what I have done so far: ini_set('display_errors', 1); ini_set('log_errors', 1); ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); error_reporting(E_ALL); require_once('db_class.php'); require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata_YouTube'); Zend_Loader::loadClass('Zend_Gdata_AuthSub'); Zend_Loader::loadClass('Zend_Gdata_App_Exception'); session_start(); setLogging('on'); $_SESSION['developerKey'] = 'AI39si5H3hL9tcKOMl80IqzoC6nb87ka1QLgHxLp9nFi1l44dLa987_Gi0rbofLePQdFEWf1lrSB8KGs4lXIrcF8TR6PhUcO3Q'; function getAuthSubRequestUrl() { $next = 'http://example.com/youtube_delete_video.php'; $scope = 'http://gdata.youtube.com'; $secure = false; $session = true; return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session); } function updateAuthSubToken($singleUseToken) { try { $sessionToken = Zend_Gdata_AuthSub::getAuthSubSessionToken($singleUseToken); } catch (Zend_Gdata_App_Exception $e) { print 'ERROR - Token upgrade for ' . $singleUseToken . ' failed : ' . $e->getMessage(); return; } $_SESSION['sessionToken'] = $sessionToken; generateUrlInformation(); header('Location: ' . $_SESSION['homeUrl']); } function getAuthSubHttpClient() { try { $httpClient = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']); } catch (Zend_Gdata_App_Exception $e) { print 'ERROR - Could not obtain authenticated Http client object. ' . $e->getMessage(); return; } $httpClient->setHeaders('X-GData-Key', 'key='. $_SESSION['developerKey']); return $httpClient; } function generateUrlInformation() { if (!isset($_SESSION['operationsUrl']) || !isset($_SESSION['homeUrl'])) { $_SESSION['operationsUrl'] = 'http://'. $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $path = explode('/', $_SERVER['PHP_SELF']); $path[count($path)-1] = 'index.php'; $_SESSION['homeUrl'] = 'http://'. $_SERVER['HTTP_HOST'] . implode('/', $path); } } function loggingEnabled() { if ($_SESSION['logging'] == 'on') { return true; } } function setLogging($loggingOption, $maxLogItems = 10) { switch ($loggingOption) { case 'on' : $_SESSION['logging'] = 'on'; $_SESSION['log_currentCounter'] = 0; $_SESSION['log_maxLogEntries'] = $maxLogItems; break; case 'off': $_SESSION['logging'] = 'off'; break; } } function logMessage($message, $messageType) { if (!isset($_SESSION['log_maxLogEntries'])) { $_SESSION['log_maxLogEntries'] = 20; } if (!isset($_SESSION['log_currentCounter'])) { $_SESSION['log_currentCounter'] = 0; } $currentCounter = $_SESSION['log_currentCounter']; $currentCounter++; if ($currentCounter > $_SESSION['log_maxLogEntries']) { $_SESSION['log_currentCounter'] = 0; } $logLocation = 'log_entry_'. $currentCounter . '_' . $messageType; $_SESSION[$logLocation] = $message; $_SESSION['log_currentCounter'] = $currentCounter; } function printCacheWarning() { return '<p class="note">' . 'Please note that the change may not be reflected in the API ' . 'immediately due to caching.<br/>' . 'Please refer to the API documentation for more details.</p>'; } function editVideoData($videoId) { $httpClient = getAuthSubHttpClient(); $youTubeService = new Zend_Gdata_YouTube($httpClient); $videoEntryToUpdate = $youTubeService->getFullVideoEntry($videoId); if (!$videoEntryToUpdate instanceof Zend_Gdata_YouTube_VideoEntry) { print 'ERROR - Could not find a video entry with id ' . $videoId . '<br />' . printCacheWarning(); return; } try { $putUrl = $videoEntryToUpdate->getEditLink()->getHref(); } catch (Zend_Gdata_App_Exception $e) { print 'ERROR - Could not obtain video entry\'s edit link: ' . $e->getMessage() . '<br />'; return; } $videoEntryToUpdate->setVideoTitle("My Test Movie - Private 10000012"); $videoEntryToUpdate->setVideoDescription("My Test Movie - Private 10000012"); $videoEntryToUpdate->setVideoPrivate(); try { $updatedEntry = $youTubeService->updateEntry($videoEntryToUpdate, $putUrl); if (loggingEnabled()) { logMessage($httpClient->getLastRequest(), 'request'); logMessage($httpClient->getLastResponse()->getBody(), 'response'); } } catch (Zend_Gdata_App_HttpException $httpException) { print 'ERROR ' . $httpException->getMessage() . ' HTTP details<br /><textarea cols="100" rows="20">' . $httpException->getRawResponseBody() . '</textarea><br />' . '<a href="session_details.php">' . 'click here to view details of last request</a><br />'; return; } catch (Zend_Gdata_App_Exception $e) { print 'ERROR - Could not post video meta-data: ' . $e->getMessage(); return; } print 'Entry updated successfully.<br /><a href="#" onclick="' . 'ytVideoApp.presentFeed(\'search_owner\', 5, 0, \'none\'); ' . 'ytVideoApp.refreshSearchResults();" >' . '(refresh your video listing)</a><br />' . printCacheWarning(); } if (!isset($_GET['token'])) { $returnURL = getAuthSubRequestUrl(); echo "<a href=".$returnURL.">Link To Google</a>"; } else { $singleUseToken = $_GET['token']; updateAuthSubToken($singleUseToken); /* editVideoData('mJDRXXaFVGw'); */ } This is how I call the function: http://example.com/youtube_delete_video.php So, what I need basically is to know 1. how can I store the authentication after I verify it from youtube? 2. What function to populate after I store the authentication? <- I couldn't figure where this part is in the documentation. PS: example.com is not a real url. It's just for the sake of writing the post he ) I have this function: function bbcode($input){ $input = strip_tags($input); $input = htmlentities($input); $search = array( '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url=http://(.*?)\](.*?)\[\/url\]/is', '/\[color=(.*?)\](.*?)\[\/color\]/is', '/\[yt\](.*?)\[\/yt\]/is', ); $replace = array( '<b>$1</b>', '<i>$1</i>', '<u>$1</u>', '<img src="$1" style="border:0">', '<a href="$1">$2</a>', '<font style="color:$1">$2</font>', '<object width="660" height="405"> <param name="movie" value="'.str_replace("watch?v=", "v/", $1).'" /> <param name="allowFullScreen" value="true" /> <param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="660" height="405" src="'.str_replace("watch?v=", "v/", $1).'" allowscriptaccess="always" allowfullscreen="true"></embed> </object>', ); return nl2br(preg_replace($search,$replace,$input)); } There is an error on code: <param name="movie" value="'.str_replace("watch?v=", "v/", $1).'" /> and on: <param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="660" height="405" src="'.str_replace("watch?v=", "v/", $1).'" allowscriptaccess="always" allowfullscreen="true"> How can i use str_replace in this situation ? :S hello, I am trying to figure out how I can take only the v= in the youtube urls http://www.youtube.com/watch?v=nGawAhRjtoA&feature=topvideos i just want php to take v=nGawAhRjtoA and ignore everything else any ideas guys/gals? thanks Does anyone know of a json or php method of authenticating a youtube user without using zend? Code: [Select] <?php $id = NULL; $username = 'myYouTubeAccount'; $url = 'http://gdata.youtube.com/feeds/api/users/%s/uploads?orderby=updated&max-results=8'; $xml = simplexml_load_file(sprintf($url, $username)); foreach ($xml->entry as $entry) : $kids = $entry->children('http://search.yahoo.com/mrss/'); $attributes = $kids->group->content[0]->attributes(); $flv = $attributes['url']; $attributes = $kids->group->player->attributes(); $link = $attributes['url']; $querystring = parse_url($link,PHP_URL_QUERY); parse_str($querystring, $id_temp); $id = $id_temp['v']; ?> <a href="<?=$link?>"> <img src="http://i4.ytimg.com/vi/<?=$id?>/default.jpg" /> </a> <?php endforeach; ?> |