009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

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!
User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Wed Dec 12, 2007 7:23 pm

Hey guys, it's Yavor again  ;D

I'll be working on this task:
Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.
Describe the task.

Using Dougal Campbell’s Wordpress Plugin, create a Joomla! v 1.5 Plugin to
converts Joomla! v 1.5 articles to Pirate Speak for use on September 19th
Talk Like a Pirate Day.

Resources:

    * What is Talk like a Pirate Day?
    * Dougal Campbell's WordPress Plugin
    * Start with Loadmodule plugin to get the basic plugin structure required.

Skills Needed

    * Ability to install XAMPP, download and install Joomla! on a localhost
using default data.
    * Familiarity with Joomla!
    * Knowledge of PHP
    * Knowledge of MySQL

Difficulty

Advanced.
Work Product

A functioning Joomla! v 1.5 module packaged for installation.
Licensing

All code must be created using the GNU General Public License version 2.
http://www.gnu.org/licenses/old-license ... .html#SEC4

Documentation written for this task must be made available under the
Joomla! Electronic Documentation License.
Extra Credit (Optional)

Register as a developer at joomlacode.org and create a project for your module.
Time Limit

4 weeks.
It was really easy to implement this as a plugin and because all of Dougal Campbell's text filter suite plugins are identical in architecture, I decided to implement the whole Text Filter Suite for Wordpress system in the J! Framework (basically I'm reusing 95% of his code and slapping some J! love on top)

Currently I'm working on a custom JParameter so that users can configure all the plugin's aspects from within the plugin settings (it also makes adding a new TFS plugin really easy - just put it with the others). So when I'm done with that and when my Joomlacode project is approved, I'll post the complete package there, post a link here and see what the wonderful Joomla people think.
Last edited by AmyStephen on Sun Jan 06, 2008 7:07 pm, edited 1 time in total.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Wed Dec 12, 2007 9:33 pm

Salutations :D

I just wanna give you an update on how things are going, in the form of a screenshot, with the pirate and acronymit filters turned on.
Image

All there is to do now is to code the new param element.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Wed Dec 12, 2007 11:26 pm

Um, I've hit a snag. Again.

How do I add some JavaScript from the backend? Specifically from within a direct descendant of JElement? ;D
I tried JDocument->addScript and it doesn't really do it.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Thu Dec 13, 2007 12:18 am

I am not at my normal computer, so I can't dig into the code, but I would suggest looking at the source code used in the Article Manager to  loads Images. It uses Squeezebox; maybe that would be helpful?

Also - WAY TO GO on simply adding all of the important languages: Acronymns, Chef, Fudd, Jive, and Kraut, in addition to Pirate Talk. I wanted to offer my L33t plugin, in case you want to add in that language. It belongs with the group, I think. There are three levels of implementation - 100% L33t is pretty tough to read.

It's yours if you want it. It was just something for me to play with. I never even added it to JED. Of course, you do not need to do so. Certainly anything other than Pirate is above the Call and very much appreciated!

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

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Thu Dec 13, 2007 12:50 am

Thanks, Amy! I'll be sure to throw it in with the rest - the more the merrier, you know  ;D

I'll take a look at that component. I've done all I have to for the Jelement, now all I need is to make it insert my custom JS. Once I am done with this implementation I can go back to the Categories module and implement it there for choosing sections.

P.S. My particular implementation involves a set of normal form elements (checkboxes in this case) and a hidden field, which is the official element, as far as JParameter is concerned. I've written a simple function to modify the contents of the hidden field and I've attached it to the checkboxes' onClick event, but I have no way of getting it declared as I've hit a wall with the backend custom javascript thing.
P.P.S. I can put the function definition in the onClick property and it works for saving, but it's cumbersome and doesn't allow me to access the function that is supposed to read the hidden field and check the checkboxes as necessary.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Thu Dec 13, 2007 1:50 am

Success! I managed to solve my Javascript woes :) I'm attaching a working version of the plugin.

I haven't done any code cleaning/commenting yet, my first concert was to get it working. Later on I'll add Amy's leet plugin, implement internationalization for the total of three strings in the plugin, clean up the code a bit and I'll call it done.
You do not have the required permissions to view the files attached to this post.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Thu Dec 13, 2007 2:14 am

You rock!  8)

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Thu Dec 13, 2007 9:31 pm

Amy, I have a question.

What encoding should I use when editing leet.php as it somehow gets mixed up, especially the leet characters array. Can you somehow provide me with an unicode-friendly version of sorts? :D The plugin does its work as it should when activated, but editing is a pain as some of the leet characters get corrupted or something.

Thanks.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Thu Dec 13, 2007 10:55 pm

Well, I have an almost-final version at joomlacode

I don't know why, but the system won't install my language files. I checked out the other plugins and it turned out neither has a languages tag in its manifest. So I omitted that for now.

The filters are working ok, save for leet, which has the habit of eating a letter once in a while, but then again I understand nothing of the output so it may be how it should be. My custom element is also living up to my expectations, although I'm really awkward with JavaScript.

Making custom filters is really easy and any filters developed for the original WP TFS should be compatible - I only had to remove the add_filter() reference in acronymit.

So, what do you think? final review
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Sun Dec 16, 2007 10:10 pm

I was internet-less for a couple of days and, while anxiously waiting for universities to say whether or not I'm in, I worked on the plugin and I'm really satisfied with the result.

Firstly, I implemented an option to filter all articles, only articles in certain categories or articles containing the {tfsjoomla} tag.
Secondly, the plugin can filter article titles now, too.
And finally, based on the filter selector parameter, I built a category selector parameter that allows users to select multiple categories in a friendly way.

As usual, the package is on joomlacode. Let's see what you people think.

Bye!
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

ibnhafsun
Joomla! Hero
Joomla! Hero
Posts: 2318
Joined: Fri Aug 19, 2005 9:41 pm
Contact:

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by ibnhafsun » Sun Dec 16, 2007 10:19 pm

And what happened with the Universities?
...nam qui dabat olim imperium, fasces, legiones, omnia, nunc se continet atque duas tantum res anxius optat, panem et circenses...
http://www.todosjuntos.org
http://inmo-e.com

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Sun Dec 16, 2007 10:22 pm

Still no response. Bulgarian mail truly is snail-mail. It's really quite awful to be a student-candidate.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

ibnhafsun
Joomla! Hero
Joomla! Hero
Posts: 2318
Joined: Fri Aug 19, 2005 9:41 pm
Contact:

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by ibnhafsun » Sun Dec 16, 2007 10:30 pm

I have downloaded and installed your plugin. Damn, we have now a Bork plugin!

I'll make some testing. And, what can I say about your postal service? I am Spaniard and we have some "issues" with that kind of services too.
...nam qui dabat olim imperium, fasces, legiones, omnia, nunc se continet atque duas tantum res anxius optat, panem et circenses...
http://www.todosjuntos.org
http://inmo-e.com

ibnhafsun
Joomla! Hero
Joomla! Hero
Posts: 2318
Joined: Fri Aug 19, 2005 9:41 pm
Contact:

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by ibnhafsun » Sun Dec 16, 2007 10:49 pm

It works like a charm on a first quick test, both, the category and the whole site options, with Bork, of course. I am going to update my installation (yes, I got the plugin.php error, I am lazy and had a non updated Joomla! install).

Thanks a lot, Yavor, for your time and efforts.
...nam qui dabat olim imperium, fasces, legiones, omnia, nunc se continet atque duas tantum res anxius optat, panem et circenses...
http://www.todosjuntos.org
http://inmo-e.com

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Sun Dec 16, 2007 11:18 pm

Thanks for your feedback, ibnhafsun :)

By the way, what's with you and the Bork filter? :D
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

ibnhafsun
Joomla! Hero
Joomla! Hero
Posts: 2318
Joined: Fri Aug 19, 2005 9:41 pm
Contact:

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by ibnhafsun » Sun Dec 16, 2007 11:36 pm

Well, I guess it's a question of "how old I am". I am older than you. The Muppets were... uhmmm... errr... my idols? But there are a couple of them very special: Grover (Coco in Spanish) and The Swedish Chef.

From time to time I use the Börk example to illustrate my Translation Teams rant, lol. Now it will be easier: I have your plugin, a powerful weapon, they should be scared, hehehehe.
Last edited by ibnhafsun on Sun Dec 16, 2007 11:44 pm, edited 1 time in total.
...nam qui dabat olim imperium, fasces, legiones, omnia, nunc se continet atque duas tantum res anxius optat, panem et circenses...
http://www.todosjuntos.org
http://inmo-e.com

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Sun Dec 16, 2007 11:48 pm

fealebenpae wrote: Amy, I have a question.

What encoding should I use when editing leet.php as it somehow gets mixed up, especially the leet characters array. Can you somehow provide me with an unicode-friendly version of sorts? :D The plugin does its work as it should when activated, but editing is a pain as some of the leet characters get corrupted or something.

Thanks.
Oops! Sorry about that! I tried changing the characters to something not so particular. If you want, you can try these characters. Otherwise, move around it. My intention was certainly not to slow you down and I am afraid I have!

I'll take a look at the new one.

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

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Sun Dec 16, 2007 11:52 pm

@ibnhafsun

I see. Sadly, the Muppets are only a historical fact for me.

@AmyStephen

It's all right, I figured it out rather quickly - I viewed the file through Firefox and played with the encodings a bit and then edited it in TextEdit. with characters as funky as those it's hard to tell if everything's all right :-D
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Sun Dec 16, 2007 11:55 pm

They were pretty! I didn't think about encoding! :-[

Looking at your extension...  ;)

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Mon Dec 17, 2007 12:36 am

Really, really well done!

LOVE the way you handle multiple selections on categories.

Turning title updates on, or off, is good.

The code, itself, is well written and nicely organized.

I think the reason characters are missing from leet, from time to time, is that many of the "Uppercase To Values" are missing. If you look at the txt file in my previous post, you can copy that section back into your program.

Looks great! I'll pay attention for your response,
Amy :)

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Mon Dec 17, 2007 1:14 am

You were right, half of that part from the array was missing. It's ok now. I also fixed a bug with html entities (actually had to remove a htmlentities() from your code to make leet behave like the other filters)

I updated the package on joomlacode. As for the categories, I retrofitted that to GHOP Categories as soon as the parameter was working :D
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Mon Dec 17, 2007 5:48 am

Looks like the array is still missing [10] thru [23].

Also - the headings seem to update when off - and not when on.

+++

Just noticed. The SVN was changed, but the zip file was not updated. I'll check it again when you have a new zip!

Thanks,
Amy :)

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Mon Dec 17, 2007 4:00 pm

It turned out I had misplaced tfs-leet.php - I placed in the root folder of the archive, instead of the tfsjoomla folder. My bad :D I uploded a fixed zip file.
As for the titles, I think they should works as advertised - I'm at school right now, typing away on a friend's laptop, but from what tests I conducted at home last night, I think the titles opton worked correcty. I'm looking at the code right now and it realy ought to work. I mean, in the xml, 1 is for Yes and 0 is for No and in the php code i have if($this->params->get('titles')) $article->title so I'm positive it should filter the titles, although I can get easily confused with the escaping and the encoding the html entities. Please have a look at it again. Thanks!
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Mon Dec 17, 2007 5:29 pm

Yeah, I was to blame for the titles thing :-D I had done a $this->params->get('filtering') instead of ('titles'). Silly me, and I couldn't see it until now :-D I updated the fixed package to joomlacode.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Tue Dec 18, 2007 2:12 pm

I am sorry to say this, but the title on/off toggle still does not work for me. It's always on.

I've tried global, or one section (About Joomla!)

These two variables $matches, $regex are not initialized.

These are still not correct.
// Uppercase To Values
$leetTo [0] = "4";
$leetTo [1] = "ß";
$leetTo [2] = "<";
$leetTo [3] = "[";
$leetTo [4] = "€";
$leetTo [5] = "|=";
$leetTo [6] = "(γ,";
$leetTo [7] = "']~[";
$leetTo [8] = "!";
$leetTo [9] = "<";
$leetTo [24] = "`/";
$leetTo [25] = "~/_";
So, I went and looked at the zip file from the download - and it's that way in the package. For some reason, I don't think you are packaging your new code. Check out the zip and see what you think.

Thanks!
Amy :)

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Sat Dec 22, 2007 1:43 am

Hey fealebenpae -

What's going on? Hope you are okay? Let's get this amazing extension of your finished up! You've done such great work.

If you get a minute, check in and let us know how you are doing!

Much thanks!
Amy :)

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by fealebenpae » Thu Dec 27, 2007 1:09 am

Hey, guys, really sorry I haven't been here this past week, but you know how it is with holidays and relatives, and stuffing yourself with food till you collapse on the table, and I'm on the verge of running late on my University applications and so on and so forth.

Amy, to be frank, I'm all done with the filters and the structure of the plugin, but it's leet that giving me problems, which I haven't really had the time to fix, but I'll get to it the day after tomorrow, if not tomorrow.

Happy holidays, everyone!  ;D
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Thu Dec 27, 2007 1:38 am

No problem - we are all a bit busy over the holidays, which is GREAT!

Now, when you get a chance to get back to it, there are two problems - both of which you have corrected - neither of which is in your zip file. The title fix and the leet fix are both in the SVN, just not in your download.

I wish very much I had never raised the issue of Leet, though, since it has slowed you down due to the encoding issues. I'd rather see you pull it out then spend one more moment on it, truth told.

But, again, the current status of your project is very simple - the code appears to be in your JoomlaCode repository, just not your extension zip file. That's true for the title issue as well as the leet issue. Get that resolved and you can hopefully move on!

You have been super to work with; thanks for participating in this contest.
Amy :)

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Sat Dec 29, 2007 3:56 pm

fealebenpae  -

Do whatever you want with Leet - but - let's get the title fixes into the zip at minimum and sign off on this. It's done! All that needs to happen is to get the code out of the SVN into the distribution file.

Let's get it done today, if possible, so that you can move forward into bold developer directions, like you were born to do! ;)

Ok, maybe I had too much coffee this morning. Hope to hear from you today, or soon!
Amy :)

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

Re: 009 - Create a Joomla! v 1.5 plugin to convert articles to Pirate Speak.

Post by AmyStephen » Thu Jan 03, 2008 4:55 pm

fealebenpae  -

Let's get this signed off! It's ready - let's roll with it!

Thanks,
Amy :)


Locked

Return to “Google's Highly Open Participation Contest”