 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
Posted: Mon Jan 16, 2012 12:43 pm Post subject: Read and display Youtube Video Feeds with 3.17 |
|
|
So as the other two tricks it is very simple code - only change ARD to the youtube screenname you want.
| Code: |
{$yt=simplexml_load_file('http://gdata.youtube.com/feeds/api/users/ARD/uploads')}
{foreach $yt->entry as $e}
{foreach $e->link->attributes() as $k=> $a}
{if $k=='href'}
{$e->title|default:'No Title'}<br/>{$e->content|default:'No Description'}<br/>
<p><a href="{$a[0]}">Zum Video</a></p><hr/>
{/if}
{/foreach}
{/foreach}
|
|
|
| Back to top |
|
rodneyrehm Administrator

Joined: 30 Mar 2007 Posts: 698 Location: Germany, border to Switzerland
|
Posted: Mon Jan 16, 2012 1:04 pm Post subject: |
|
|
Seeing this and the previous five hundred posts about simple_xml_loadfile()…
Maybe you just want to write a plugin for embed.ly - using the oEmbed "standard". You can still pipe their results through a smarty template, but it shouldn't be necessary.
after all, {embed src="http://www.youtube.com/watch?v=U35O2Zd63AE" width="400" height="300"} seems a bit more straight forward (and might be made compatible with any bbcode/markdown/whatever markup you allow your users to input).
Yes, I'm using oEmbed. No, I don't have a smarty plugin for that since I've never had a reason to embed something on a template level. But… you obviously have that need, so knock yourself out… _________________ Twitter |
|
| Back to top |
|
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
Posted: Mon Jan 16, 2012 1:26 pm Post subject: |
|
|
This is only a linear raw list without an extension to display a video in the own website.
Demo is here http://powercms.org/?366 at the end of the page.
You see very long descriptions of the owner in this example and you can decide to view it or not.
If someone wishes to show the videos onpage the best method is to use ajax and not to display all videos to start it onclick directly via embed or so, because this makes a page very slow - we have max 25 videos in the list. |
|
| Back to top |
|
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|