I tried something nice. But it's not really working out. This is the current code:
What I want here is, set the thumbnail to float left, and then the video title and description will be displayed right of the thumbnail. But when I try to open the page it says:
Fatal error: Class 'Zend_Gdata_YouTube' not found in /home/a6121237/public_html/videos.php on line 94
So I looked up the link you gave in the above post, and found this:
"The PHP client library can be used to retrieve public feeds or to execute authenticated operations. All public feeds are read-only and do not require any authentication. Authenticated operations, on the other hand, include the retrieval of private feeds, such as a user's inbox feed, as well as write, upload, update and delete operations. You will need to sign up for a developer key to be able to execute authenticated operations."
I have a developer key. But I can't find anywhere how I can add the class or let the script recognize the class. Maybe I'm looking wrong. I know that in Java, if you want to use something specific, you need to import it first. Maybe it's the same case here?
And I also think that this line does not have to be in the while loop, but I cannot test that now, because of the above error.
EDIT: now I think I know what it is, I need to include some file. Googling more....
EDIT2: So after some googling, I found out that I had to download this:
http://framework.zend.com/download/gdata/
And then include something. This is the current code of display_videos.php:
Code: Select all
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_YouTube');
$yt = new Zend_Gdata_YouTube();
// Build query to get results of video Title & Link
$result = mysql_query("SELECT * FROM uservideos") // Select all results from table uservideos
or die ('cannot select table:' .msql_error()); // If error then stop and display mysql error code
// Begin to build table for sql results
echo "<table border=\"0\" width=\"60%\" >"; // initial table width 60% of page
echo "<tr><th width=\"10%\"></th>"; // Title width share is 100%
// Display results in your table
while ($row =mysql_fetch_array($result)){ // Fetch your results and place in an array to call each value
$videoEntry = $yt->getVideoEntry($row['Video_Id']);
// Make sure you include your css file for your class="example6" to work with the popup function for each video
echo "<tr><td>";
echo "<a class=\"example6\" href=\"".$row['Link']."\" title=\"".$row['Title']."\"><img class=\"fleft\" src=\"http://img.youtube.com/vi/".$row['Video_Id']."/default.jpg\" alt=\"\"/></a> '<b>Titel:</b> ' .$videoEntry->getVideoTitle(). <br> '<b>Beschrijving:</b> ' .$videoEntry->getVideoDescription()."; // Includes your CSS class
echo "</td></tr>";
}
echo "</table>";
?>
But now I'm getting this error:
Fatal error: Uncaught exception 'Zend_Gdata_App_InvalidArgumentException' with message 'Property getVideoTitle does not exist' in /home/a6121237/public_html/Zend/Gdata/App/Base.php:484 Stack trace: #0 /home/a6121237/public_html/videos.php(104): Zend_Gdata_App_Base->__get('getVideoTitle') #1 {main} thrown in /home/a6121237/public_html/Zend/Gdata/App/Base.php on line 484
EDIT3: Changed the long line into this:
Code: Select all
echo "<a class=\"example6\" href=\"".$row['Link']."\" title=\"".$row['Title']."\"><img class=\"fleft\" src=\"http://img.youtube.com/vi/".$row['Video_Id']."/default.jpg\" alt=\"\"/></a><b>Titel:</b> ".$videoEntry->getVideoTitle()." <br> <b>Beschrijving:</b> ".$videoEntry->getVideoDescription()." "; // Includes your CSS class
And now it's working

It was, of course, an error in the quotes....
It is now fully working. Thanks for your help

Even if I did this one for a big part on my own
Do you want a link to the result?