138 - Create a Joomla! v 1.5 Slideshare Module

Google's Highly Open Participation Program tries to get young students into Open Source and Joomla! specifically. Everyone is welcome, there are not limits. You can be a coder, documenter, tester, translator to help out. Jump in and start helping!
jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Sat Dec 08, 2007 8:34 pm

Hello, my name is John and I've just claimed this task:

http://code.google.com/p/google-highly- ... ail?id=138

I've been working with PHP for a little over a year (I think), and I've been working with JavaScript for around 2 1/2 years.  I haven't started working on this yet, so any suggestions or comments about how I should go about this are greatly appreciated.

I look forward to working with everyone here on many tasks.

Thanks! :)


Create a Joomla! v 1.5 Slideshare Module
Describe the task.

SlideShare is a very popular social networking environment for sharing
presentations on the web.

Create a Joomla! module to:

  # Retrieve slideshows by User, Tag or Group;
  # Display a list of matching slideshows;
  # Display a slideshow selected from the list.

Resources:

    * Slideshare

  # Home - http://www.slideshare.net/
  # API - http://www.slideshare.net/developers
  # Developer Documentation -
http://www.slideshare.net/developers/documentation

    * Examples

  # Chris Heilmann -
http://www.wait-till-i.com/2007/10/31/s ... avascript/
  # Demo - http://icant.co.uk/sandbox/slidesharesh ... reshow.php


Google Task

Claimed: Dec 8 Due: Dec 24
[me=AmyStephen]added project information.[/me]
Last edited by AmyStephen on Tue Jan 22, 2008 3:46 am, edited 1 time in total.

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Mon Dec 10, 2007 2:00 am

I have a quick question.  I'm trying to add parameters for my module, but it doesn't seem to be working.  I added the tag to the install.xml file like in the example ( http://forum.joomla.org/index.php?topic=233628 ), but it's not adding the parameter options when I go to my module from the Module Manager page.  Is there something else that I have to do?

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Mon Dec 10, 2007 2:10 pm

John -

Sorry for the late response.  Briefly - so that you are not held back - check the xml files for core modules - ex. mod_latestnews - to see how to set the parameters.

Hope that helps you get started,
Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Mon Dec 10, 2007 8:12 pm

That's exactly what I need :)

Thanks!

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Mon Dec 10, 2007 8:28 pm

Thought that might do the trick. The beauty of the GPL - learn from the core devs!  :pop

Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Mon Dec 10, 2007 10:43 pm

Ok, I think I have all the PHP done.  I'm just working on the layout and stuff now, which is where I have a small problem.  The SlideShare viewer is about 420 px wide, which is much wider than anything else on the page.  Is it alright if I use the Scriptaculous JavaScript library (Open Source under the MIT License) to kind of make a pop-up viewer?  It's easier to just show you what it does... Here it is in action.  When you click on an image, it does it's thing.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Mon Dec 10, 2007 10:50 pm

Couple points:

1. 420 px is not bad. I always make certain my images, etc., are 450px. So, I don't think that is unreasonable. However, you should have control over that as you write out the script. Maybe you can make width and height a parameter in your module.

2. If you want a popup, it would make more sense to use Squeezebox, which is a Mootools Slimbox equivalent and is native in Joomla!. I would recommend the popup be optional though. (I believe Scriptaculous has conflicts with Mootools, as does JQuery).

Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Mon Dec 10, 2007 11:10 pm

Uh... I think I may be a bit confused.  Where did you want this module to go?  I thought this was going to go on the left around the "Main Menu" module.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Mon Dec 10, 2007 11:17 pm

You could - although that would be very cramped - and now I understand your concerns.

There is a plugin in Joomla! called Load Module.

It allows you to insert the modules for a specific module position into your article.

Code: Select all

{loadposition userx}


That's one way I could see this used.

HTH,
Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Tue Dec 11, 2007 12:07 am

When I first skimmed through the task on the GHOP page, that's how I thought it was going to be done, put in articles.  But after reading into it, I thought you wanted it on the left, and I thought that was odd.  This makes more sense.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Tue Dec 11, 2007 12:13 am

John -

do you think this should be a plugin, rather than module?

I wonder. I don't want you to have to do a lot of rework, but hopefully the code cany be reused IF you think it's better as a plugin.

Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Tue Dec 11, 2007 12:25 am

I'd like to try and use the Load Module plug-in, but I'm not sure how to go about doing that. 

However, if you think that it would be better suited as a plug-in, then I'll do that.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Tue Dec 11, 2007 12:35 am

It's truly up to you.

If you create a module, it can be used within an article if you include the Load Module plugin.

To do so:

1. Make certain the Load Module plugin is enabled in the Plugin Manager.

2. Specify a unique "location" for your module by opening the module in the Module Editor. In the upper left corner, you will find a listbox called "position." You can type into that listbox, as well. So, let's say for example, you type in GHOP as the position name.

In a template, you specify where positions go - then Joomla! places output for all modules with that name positon at that exact location in a template.

3. You can also put module output into article using this syntax:

Code: Select all

{loadposition GHOP}


Then, Joomla! places all of the output for modules with the position GHOP into that spot in your article.

Try it with any module. See what it looks like in your article.

I guess the more I think about this, the more I wonder why should it be a module? Will it ever be useful in the "normal" sense of a model - by surrounding a component. I don't think so because of it's size. It would be nice to have the thoughts of some developers on this - if someone wants to share their perspective, it would be helpful.

Give it some thought.

HTH,
Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Tue Dec 11, 2007 12:45 am

Oh, ok, I see now.

I'm going to finish this as a module, since I'm almost done with it this way.  If this doesn't work out, then I can always go back and redo it as a plug-in.

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Tue Dec 11, 2007 11:16 pm

I have a rough first release done.  There are a few things that I intend on changing, but I just wanted to first get this out, to get some feedback about the layout, etc.

The things I'm going to change:

  • I'm going to take out the PHP from the top of tmpl/default.php, and put it in the helper.php file, allowing me to,
  • take all the files out of tmpl/ except index.html and default.php.
  • Change it so that the user can specify the username, type of filter, and limit in the article, instead of as paramters.
  • Actually enable filtering by something other than username (the others don't work yet).
  • There's probably something that I'm forgetting, but I have to run, so I'll post more tonight.

Thanks!
You do not have the required permissions to view the files attached to this post.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Wed Dec 12, 2007 12:28 am

John -

It's not done, yet, but, still it's FABULOUS! and it's showing a slideshow I posted yesterday. I am very excited to have this available for the Joomla! community! It's an amazing social networking app. Thank you for taking this challenge!

Image

This isn't an easy one, is it? It's impressive what you have accomplished in short order.

Some ideas:
Pull the CSS out of default.php. Create a file, and then load it. Here's an example of that for a JS and CSS file.

// Add Javascript
$document =& JFactory::getDocument();
$document->addScript( JURI::base() . 'plugins/content/mootoolsaccordion.js' );

// Load Accordion CSS
$document->addStyleSheet( JURI::base() . 'plugins/content/mootoolsaccordion.css', 'text/css', null, array( ' id' => 'StyleSheet' ) );

             

The JS you are building can be loaded like this example:

$js = "window.onload = function () { ";
$js .= "    dp.SyntaxHighlighter.ClipboardSwf = '";
$js .= baseurl;
$js .= "plugins/content/clipboard.swf'; ";
$js .= "    dp.SyntaxHighlighter.HighlightAll('code'); } ";

$document->addScriptDeclaration($js);


It would be nice to get rid of that table if at all possible.

For certain, pull the style tags out of the table and get those into the CSS file.


LOVE IT!  :-*

Looking forward to the next view. You have a future in code!
Amy :)


+++

Also - Internationalization - http://forum.joomla.org/index.php/topic ... msg1102267
Last edited by AmyStephen on Wed Dec 12, 2007 12:32 am, edited 1 time in total.

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Wed Dec 12, 2007 2:00 am

AmyStephen wrote:Also - Internationalization - http://forum.joomla.org/index.php/topic ... msg1102267


Ah yes, that was the other thing I had on my to-do list.

I'm cleaning up the default.php file now, then I'm going to add to the helper class to not just show blank boxes when a user only has one slide.

A quick question... That image that you posted, what browser was that?

Edit:  When I tried adding the external CSS style sheet, it works in IE7, but in Firefox I'm getting an error that says

Error: The stylesheet http://localhost/joomla/modules/mod_sli ... olor=black was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://localhost/joomla/index.php?optio ... icle&id=44
Line: 0
Last edited by jgirata on Wed Dec 12, 2007 2:59 am, edited 1 time in total.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Wed Dec 12, 2007 3:49 am

I use FF.

I'll bet the problem is that relative path. Including "JURI::base()" when you load the CSS, it might clear up the problem.

Good work, so far! Hope you are having fun!
Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Thu Dec 13, 2007 2:08 am

I've decided that I'm going to turn this into a plug-in.  The way that I get the info from the user will be modeled off of the Odeo plug-in (Issue 131), since it's going to be generally the same thing: the user will type {SlideShare variables}.

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Thu Dec 13, 2007 2:14 am

Cool! That makes sense to me. Thanks for taking a step backward from work already accomplished in the module, in order to build a better result. That is admirable.

This is going to be a great plugin!
Amy :)

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Thu Dec 13, 2007 2:35 am

The only thing (well, the first thing :P) that I'm having trouble with is having my plug-in load when the page is created.  It seems that in the Odeo plug-in, the main function that does the work is onPrepareContent().  I tried changing the name of my main function to that (as well as adding jimport('joomla.event.plugin') above my class and extends JPlugin to the class declaration (if that's what it's called), but it's still not running.  Is there something else that I need to do?

Nevermind, I figured it out. :)
Last edited by jgirata on Thu Dec 13, 2007 8:39 pm, edited 1 time in total.

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Thu Dec 13, 2007 11:25 pm

I'm working on the Internationalization now, and I added the tag to the XML file, and I created the language file, but when I add JTEXT::_('USER') to my file that displays the content, it should display "User" but it displays "USER."  Is there something else that I need to do?

Attached is the latest version of my code.
You do not have the required permissions to view the files attached to this post.

User avatar
depresz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Nov 29, 2007 4:14 pm
Location: Piotrków Trybunalski, Poland
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby depresz » Sat Dec 15, 2007 7:09 am

Use:
$lang = & JFactory::getLanguage();
$lang->load('plg_frontend_myplugin', JPATH_ADMINISTRATOR);


I had this same problem ;)
Last edited by depresz on Sat Dec 15, 2007 10:41 am, edited 1 time in total.
Great Hacking Opportunity Project
numbers? sure! 3d 22h on forum, about 500h of work <- this is real GHOP

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Sat Dec 15, 2007 1:55 pm

depresz wrote:Use:
$lang = & JFactory::getLanguage();
$lang->load('plg_frontend_myplugin', JPATH_ADMINISTRATOR);


I had this same problem ;)


Thank you SO much.  I've been trying to get this to work for 2 days now :)

I'm still not able to get the parameter labels and descriptions to change to their translated strings.  It still just has the capital letter.  Any idea why?
Last edited by jgirata on Sat Dec 15, 2007 2:55 pm, edited 1 time in total.

User avatar
depresz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Nov 29, 2007 4:14 pm
Location: Piotrków Trybunalski, Poland
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby depresz » Sat Dec 15, 2007 3:20 pm

If you have configuration file (file.xml), you can see for example:
I love Open Source so much


You can just enter there a text to translate:
I LOVE OPEN SOURCE


...and add following line to file (for example en-GB.plg_pluginname.ini); file where you were putting normal text to translating ;)
I LOVE OPEN SOURCE=I love Open Source so much


This same case is with other text in .xml file.
Maybe you have disabled plugin if you can't see translated text. <= that was in my case.
Great Hacking Opportunity Project
numbers? sure! 3d 22h on forum, about 500h of work <- this is real GHOP

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Sat Dec 15, 2007 3:32 pm

I think I've done all that...

Here's slideshare.xml



Content - SlideShare
John Girata
1.5.0
December 2007
(C) 2007 John Girata
http://www.gnu.org/copyleft/gpl.html GNU/GPL
A module to view SlideShare presentations.

slideshare.php
slideshare/class.rss.php
slideshare/default.php
slideshare/index.html
slideshare/css.php
slideshare/javascript.js
slideshare/SSUtil.php


language/en-GB/en-GB.slideshare.ini








And here's en-GB.slideshare.ini:

USER=User
TAG=Tag
GROUP=Group
TOTAL SLIDES=Total Slides
CURRENT SLIDE=Current Slide
FIRST BACKGROUND COLOR=First Background Color
FIRST BACKGROUND COLOR DESC=The first background color to be used behind the presentation titles in the list.  This one will be used behind the first, third, fifth, etc., presentations.
SECOND BACKGROUND COLOR=Second Background Color
SECOND BACKGROUND COLOR DESC=The second background color to be used behind the presentation titles in the list.  This one will be used behind the second, fourth, sixth, etc., presentations.
BORDER COLOR=Border Color
BORDER COLOR DESC=The border color for the presentation viewer.


The thing is, the text in the actual plug-in is translated, it's only the text used by the parameters  :-\

User avatar
depresz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Nov 29, 2007 4:14 pm
Location: Piotrków Trybunalski, Poland
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby depresz » Sat Dec 15, 2007 4:01 pm

Will you share your plugin? I'll check what's wrong  ;)
Great Hacking Opportunity Project
numbers? sure! 3d 22h on forum, about 500h of work <- this is real GHOP

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby AmyStephen » Sat Dec 15, 2007 4:06 pm

On install, I don't think this works quite right.

The language string, as in this example, will show on install.
I LOVE OPEN SOURCE


Inside of the plugin, it is translated correctly.

If that's the problem you are having, it's a known issue.

Thanks!
Amy :)

User avatar
depresz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Nov 29, 2007 4:14 pm
Location: Piotrków Trybunalski, Poland
Contact:

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby depresz » Sat Dec 15, 2007 4:22 pm

When plugin is disabled and when you enter to the configuration, you won't see translated string. How to create plugin with multi-language parameters?

jgirata, sorry for interpolation  :-[
Last edited by depresz on Sat Dec 15, 2007 5:19 pm, edited 1 time in total.
Great Hacking Opportunity Project
numbers? sure! 3d 22h on forum, about 500h of work <- this is real GHOP

jgirata
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Sat Dec 08, 2007 8:11 pm

Re: 138 - Create a Joomla! v 1.5 Slideshare Module

Postby jgirata » Sat Dec 15, 2007 5:11 pm

AmyStephen wrote:On install, I don't think this works quite right.

The language string, as in this example, will show on install.
I LOVE OPEN SOURCE


Inside of the plugin, it is translated correctly.

If that's the problem you are having, it's a known issue.

Thanks!
Amy :)


Yes, if I understand correctly, that is my problem :P

If it's a known issue, and there's nothing I can do, then I'll just take the English text and put it in.

Edit:  After looking through it, I don't think there's anything else I need to do.  When I was adding the comment to the top of every file, like I saw in most plug-ins, I noticed, in the @version, there was a four-digit number in the middle, and a word at the end (in pagenavigation.php it was jinx).  I was wondering what those were :-/

Since that's relatively minor, and I can add that before I upload to Joomla! Code, I'd like to submit for Final Review.
You do not have the required permissions to view the files attached to this post.
Last edited by jgirata on Sat Dec 15, 2007 6:07 pm, edited 1 time in total.


Return to “Google's Highly Open Participation Contest”

Who is online

Users browsing this forum: No registered users and 1 guest