Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-19 18:22:12

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

[plugin] [ORPHAN] ako_youtube

ako_youtube
Easily embed YouTube videos into your TXP site.

Well, here’s another quick and easy one from me, myself and I. It does pretty much what it states – embeds a YouTube video based on the attributes. Those attributes are:

  • v – The YouTube video ID (in the url, after either “v=” or “/v/”).
  • height – The height of the embeded video. Defaults to 425px.
  • width – The width of the embeded video. Defaults to 350px.
  • vmode – The vmode attribute in the embeded code. This defaults to transparent.
  • xhtml – Either 0 or 1, 1 produces XHTML valid output (as per suggestion by cbeyls). By default, it produces XHTML invalid code (that is, just the plain old code that YouTube gives out.
  • urlonly – This attribute, if set to 1, will only output the URL of the page with the video on YouTube, and nothing more.
  • link – This attribute, if set to 1, will allow you to use this as a wrapping tag, creating a link with to the YouTube page, with the text that you’ve wrapped with this plugin.
  • linkclass – This attribute will add a class to the link made if you’re using the “link” attribute.

Download v.2.1
(no help file yet)

Enjoy.

Last edited by akokskis (2006-10-04 01:09:41)


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#2 2006-09-19 22:46:41

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [plugin] [ORPHAN] ako_youtube

Sweet Adrian! Thanks a million. Simple yet very perfect timing. :)

~Jamie

Offline

#3 2006-09-22 01:14:10

Danw
Member
From: Perth, Australia
Registered: 2005-06-20
Posts: 10
Website

Re: [plugin] [ORPHAN] ako_youtube

This is great, and very useful. Cheers.

Just a heads up, in the reference file:

The simplest form is this:
<txp:ako_random_comment v="KOmIGUqLka0" />

Should be ako_youtube.

Offline

#4 2006-09-22 01:34:52

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: [plugin] [ORPHAN] ako_youtube

Whoa… The silly mistakes that we make when copying from one file to another. Oops.

Fixed with version 0.1.1


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#5 2006-09-23 02:03:58

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] ako_youtube

It could have been a good plugin if it did not make my pages fail XHTML validation. Could you make the markup valid regarding XHTML 1.0 Strict specifications?


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#6 2006-09-23 02:31:22

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] ako_youtube

Let me help you:

<code>$out = ‘<object type=“application/x-shockwave-flash” width=”’.$width.’” height=”’.$height.’” data=“http://www.youtube.com/v/’.$v.’”>’;</code>
<code>$out .= ‘<param name=“movie” value=“http://www.youtube.com/v/’.$v.’” /><param name=“quality” value=“best” />’;</code>
<code>$out .= ‘<param name=“wmode” value=”’.$wmode.’” /></object>’;</code>


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#7 2006-09-23 08:27:55

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: [plugin] [ORPHAN] ako_youtube

…There’s no need to be unpleasant about this all.

If you follow any of my plugins, you’d know that I’m always more than willing to take feature requests from anyone on the forums. There’s no need to simply bash my plugin and call it bad (saying it “could have been good” is effectively saying it’s bad) because it happens not to produce valid xhtml code. As it happens, the code that it outputs is in the same exact format as the code that you’d get to embed a video from any YouTube page.

…New version tomorrow with xhtml output, as well as a few other little things I thought might be useful.


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#8 2006-09-23 14:08:04

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: [plugin] [ORPHAN] ako_youtube

cbeyls wrote:

It could have been a good plugin…

I wasn’t going to react to your post until I saw your similar, negative remarks on Adrian’s other plug-in.

There are many ways to phrase your feedback, but it’s poor style to publicly criticise others’ work by knocking it. It certainly won’t inspire the author to address the issues raised.

Keep it friendly and if you can offer your help, even better!

Offline

#9 2006-09-23 16:46:50

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] ako_youtube

Okay, no more critics… I’ll give you a good article to read. Hope this helps.


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#10 2006-09-24 02:06:52

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: [plugin] [ORPHAN] ako_youtube

Honestly, cbeylys, I’m not here to debate the merits of XHTML validity or the lack thereof. I’m all for making valid XHTML code, and I try to do so as much as possible. The code that the plugin returns by default, may not be XHTML valid, but that’s simply the code that you can get off the YouTube website. If you’re such a web standards evangelist, maybe you should start a petition against YouTube for giving out XHTML invalid code.
And quite frankly, I don’t believe this (the TXP forums) to be the proper place for such discussion anyways – at least not the plugins forum.

In any event, here’s me coming out with version 0.2. New in this version are the following attributes:
  • xhtml – Either 0 or 1, 1 produces XHTML valid output (as per your suggestion cbeyls). By default, it produces XHTML invalid code (that is, just the plain old code that YouTube gives out.
  • urlonly – This attribute, if set to 1, will only output the URL of the page with the video on YouTube, and nothing more.
  • link – This attribute, if set to 1, will allow you to use this as a wrapping tag, creating a link with to the YouTube page, with the text that you’ve wrapped with this plugin.
  • linkclass – This attribute will add a class to the link made if you’re using the “link” attribute.

Download v.2
(No help page, yet)

As always, constructive criticism, feature requests, etc etc are more than welcome.

Last edited by akokskis (2006-09-24 03:21:11)


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#11 2006-09-24 16:36:09

cbeyls
Archived Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

Re: [plugin] [ORPHAN] ako_youtube

Yep, I just noticed the embed code you’re talking about on the Youtube website, so I can’t blame you for using that code in your plugin. The reason why it is not compliant with XHTML 1.0 strict is because it uses the “embed” tag which is deprecated.

Youtube is still using old HTML 4.0, as are most websites.

However, most people like myself choose Textpattern because it is one of the only CMS that allows to produce pages that are fully compliant with the XHTML 1.0 strict standard. I see that your website is also using this declaration. So I think that most people using Textpattern feel concerned about respecting the latest web standards. The valid markup I suggested is absolutely equivalent to the youtube one, and it works in all browsers too, so you can safely drop the Youtube one if you want.


My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)

Offline

#12 2006-09-25 17:47:00

rayben
Member
From: Cologne, Germany
Registered: 2004-10-20
Posts: 31

Re: [plugin] [ORPHAN] ako_youtube

First of all: Thx for this great plugin!

But I had to tweak the source code to get the xhtml feature working:

I changed:
<code>
$out = ‘<object type=“application/x-shockwave-flash” width=”’.$width.’” height=”’.$height.’” data=“http://www.youtube.com/v/’;’‘.$v.’”>’.n.t;
</code>

to
<code>
$out = ‘<object type=“application/x-shockwave-flash” width=”’.$width.’” height=”’.$height.’” data=“http://www.youtube.com/v/’.$v.’”>’.n.t;
</code>

I don’t know if this is a general problem or just an error which occurred only on my site

I hope that helps in some sort of way.

Cheers, Ben

Offline

Board footer

Powered by FluxBB