<?php if (!defined('PmWiki')) exit ();

/*  copyright 2007 Dipankar Sarkar.
    This file is distributed under the terms of the GNU General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This module enables embedding of Slideshare slideshows into
    wiki pages. simply use (:slideshare whatever:) where "whatever" is
    replaced with the code of numbers and alphabets, that is attached to the end
    of slideshow URLs after the http://www.slideshare.net/.
    So for example if the URL  a slideshow is:
    
    http://www.slideshare.net/nmenap/machu-picchu-77777
	
    then you'd write (:slideshare nmenap/machu-picchu-77777:).
   this is all that you need
   
   
   
   
   UPDATE
   
   Insertion of "object" element in $res variable, by Alexandre Magno, 2008.
   
   For http://www.slideshare.net/adunne/what-is-web-20-157107 put the 
   doc value for the movie. It found in embed code for Wordpress. 
   
     [slideshare id=157107&doc=what-is-web-20-1194363300579044-4&w=425]
        
   Something like (:slideshare what-is-web-20-1194363300579044-4:)

	UPDATE

	SlideShare has changed a lot since 2008. The recipe was no longer working.
	Now you have only to provide the number that follows ".../embeded_code"
	at the script used to embed the presentation into a blog. Currently, you can
	find the embedding code above the presentation.
	Example:
	<div ...> ... <iframe src="http://www.slideshare.net/slideshow/embed_code/5582333" ... </div>
	(:slideshare 5582333:)

*/

// Version date: 10/04/2011, by Iuri Fernandes


$RecipeInfo['SlideShare']['Version'] = '2011-10-04';

Markup('slideshare', '<img', "/\\(:slideshare (.*?)\\s*:\\)/e", "ShowSlideShare('$1')");

function ShowSlideShare($id) {
	$res.="
<div style=\"width:425px\" id=\"__ss_$id\">
<iframe src=\"http://www.slideshare.net/slideshow/embed_code/$id\" width=\"425\" height=\"355\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\">
</iframe>
</div>
";

	return Keep("$res");
}