125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

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
depresz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Nov 29, 2007 4:14 pm
Location: Piotrków Trybunalski, Poland
Contact:

125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby depresz » Sun Dec 30, 2007 12:09 pm

Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5
Describe the task.

    * Create a Joomla! v 1.5 plugin that will extract the published date
from an article and insert a Calender Icon containing the date the article
was published next to the title. This might require template overrides if
the date is to print to the left of the title on the blog and article views.

Resources:

    * CSS Articles

  # Creating a Blog Entry Date Calendar Icon Look with CSS, Mostly
http://brainstormsandraves.com/archives ... scalendar/
  # Almost Bullet-Proof CSS Calendar
http://stuffthathappens.com/blog/2007/0 ... -calendar/


OK, after one day break I come back. Yesterday wasn't so free because i studied documentation (but it was day without code)  :pop. It's time to start another brand new task. I have only one problem...


PROBLEM
I don't know how to implepment this Date Calendar Icon to the Plugin level... I made up my mind that I'll do this task the best I can, I'm going to use following method:
This might require template overrides if the date is to print to the left of the title on the blog and article views.


WAY OF RESOLVING
Plugin has to integrate into com_content component; I have to override system component because there are main elements which control position of text (and calendar icon also) in frontpage, article, etc...

MANUAL INSTALLATION
I have manually edited /components/com_content/views/frontpage/tmpl/default_item.php and calendar icon looks beautiful! Take a look on attachment (with and without icon)

AUTOMATIC INSTALLATION
But when I append to xml of plugin following line:

Code: Select all

<filename>components/com_content/views/frontpage/tmpl/default_item.php</filename>

source file is still this same. It seems that plugins can not overwrite system files (at least components).

CONCLUSION
This method (overwriiting system files) is very very dangerous (what if in RC5 xD someone change something on view of com_component?). I believe that there is other way to resolve this problem or else this code has to be build into the core of Joomla :laugh:. This task can't be plugin? (or have to be build in default installation of Joomla?)


PROGRESS: 85% ? (5 Jan 2008)
STATUS: WORKING



In attachment is also manually edited file which include code to images below [components/com_content/views/frontpage/tmpl/default_item.php]

EDIT:
30/12 - 4:37a.m. Update of source file (Files.zip)
31/12 - 2:59a.m. Another verion of view CSS modification - added image (calendar2)
You do not have the required permissions to view the files attached to this post.
Last edited by AmyStephen on Sun Jan 06, 2008 6:39 am, edited 1 time in total.
Great Hacking Opportunity Project
numbers? sure! 3d 22h on forum, about 500h of work <- this is real GHOP

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

Re: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby depresz » Mon Dec 31, 2007 8:08 pm

I would be REALLY happy if someone response to my topic. I have nothing to do and I am sitting idly.
2nd January school starts  :'( so i wanna do something in my last hours.

OIC, New Year, but work is work  :laugh:
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: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby AmyStephen » Tue Jan 01, 2008 4:42 am

Template overrides!!!!

Look at the templates/BEEZ/html folder. Start drilling down into the com_content folder and see all those views? Article? Category? Frontpage? Section? Then, into the Frontpage, notice your default_item.php file? :)

So, copy this file:
\templates\beez\html\com_content\frontpage\default_item.php


To here:
\templates\yourtemplate\html\com_content\frontpage\default_item.php


And change to your heart's content without hacking core (or just place your file at that location.)

I think this will be a "snippet"  (See what Kevin did) on the JoomlaCode - rather than a standard installation.

Hopefully, that will help you move out of stall mode. I'll be back in a bit.  :P
Amy

PS - LOVING THIS!  :-*
Last edited by AmyStephen on Tue Jan 01, 2008 4:43 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: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby AmyStephen » Tue Jan 01, 2008 5:39 am

I just now noticed this one on JED. Looks like it works for v 1.5, too. Might want to see how that was done.

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

Re: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby depresz » Thu Jan 03, 2008 2:28 pm

Hello,
I completly forgot about OnPrepareContent event. I used this method few hours ago in my plugin. It's very smart and elegant function, because everything thanks that is in one file. In other way I would have to create template (it would be very uncomfortable to install template for one small thing what is Calendar Icon).

Thanks Amy.
I have problems with Internet now but I think that first version will available today, about 15:00 (UTC-5h).
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: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby AmyStephen » Thu Jan 03, 2008 3:15 pm

Good for you. I cannot wait to see this - it will be very cool on a J! site! One project I would like to add is Gravatars which I think will end up being a similar type implementation. Will have to wait and see how this progresses, first.

You do good work. I am so pleased you chose to work with Joomla!.

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: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby depresz » Fri Jan 04, 2008 2:36 pm

Sorry Amy that I didn't respond yesterday, but my ISP had some problems with routers. Nevermind ;) Most important is that I have done pre-alpha-RC-something release.
User (admin in back-end) has opportunity to select whether parameters will show in com_content content. I decided that I'll give users so many options to change as possible.

IMPROVEMENTS
edit 4/01/08:I have also opened, code. I think that would be great if user would add own css into calendar_icon directory, and create parameter in config that allow write file name of created text. Is it good idea?
edit 5/01/08: I implement this feature. It's so much better now. Also: *translation bug fixed, *added vertical-align in black_day.css, *added translation to description of plugin

PLUGIN STYLES
standard.css:
Image
black_day.css:
Image

DUB DUB DUB BROWSERS
I didn't test plugin by other browser than based on Mozilla engine. I don't have access to IE, because I'm on Linux - It seems that everything looks brilliant even on Internet Explorer (Linux emulation of IEv6 by wine with msttcorefonts). Both built-in styles are O.K.
Mozilla Firefox (2.0.0.3) - Windows: O.K.
Mozilla Fiefox (2.0.0.11) - Linux: O.K
Opera (9.25 & 9.5 beta) - Linux: O.K
Konqeuror (Linux): 50/50 (problem with size of font), but this is not popular browser

PLUGIN
version with select box for styles: http://www.depresz.piotrkow.net.pl/cale ... 4Jan08.zip
version with text box for styles: http://www.depresz.piotrkow.net.pl/cale ... 5Jan08.zip (LATEST)

DOCUMENTATION
[4/01/08] version with select box for styles: http://www.depresz.piotrkow.net.pl/Cale ... oc_1.0.pdf
[5/01/08] version with text box for styles: http://www.depresz.piotrkow.net.pl/cale ... 5Jan08.pdf (LATEST)


GRAVATAR (FUTURE?)
Yeah, you have right, implementation of gravatar would be similiar to calendar icon. What can I do with this? I've noticed that code will very, very, very simple. One thing that you have to pass, is e-mail address. MD5 sum do everything.

Code: Select all

    [email protected]';
    echo "<img src=\"".$address='http://www.gravatar.com/avatar.php?gravatar_id='.md5($email)."\">";

Gravatar is very cool for people without self server where they can put avatar. I think that we can implement Gravatar as separated plugin (but based on calendar_icon) code. I educated that param of email address plugin can be read from JUser or something like that. This plugin can be so small that even plugin parameter box will empty. So better integrate this with calendar_icon? LOL

I am and I will very open for every comment and suggestion.

Cheeeerz,
Tomasz Dobrzyñski, aka depresz (or vice versa xD)
Last edited by depresz on Sat Jan 05, 2008 2:17 pm, edited 1 time in total.
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: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby AmyStephen » Sun Jan 06, 2008 6:38 am

Rocks!!!!  8)

Works perfectly and looks great, too! I love it and I'll be using it!

I hope you have this in JoomlaCode and on the JED? It's going to be popular.

Upload to Google and I'll accept this as complete. Maybe I'll add another task for Gravatars. If I do I hope you take it.

Thanks, again, for your great contributions to our community (and your wonderful documentation skill, as well!)

Amy :)

PS - love the CSS options!

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

Re: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby depresz » Sun Jan 06, 2008 8:21 am

JoomlaCode: http://joomlacode.org/gf/project/calendar_icon/frs
JED: http://extensions.joomla.org/index.php? ... &Itemid=35

I knew that CSS will rock  ;)

Would be really cool if you would upload task with Gravatar. This is very interesting technology. I thnik that I can create not only show image, but everything what offer Gravatar. (now I'm gonna carry out unit test, I think. This task has better important range for Joomla! community).

Google updated,
Thanks so much Amy!
Last edited by depresz on Sun Jan 06, 2008 11:56 am, edited 1 time in total.
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: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joomla! v 1.5

Postby AmyStephen » Sun Jan 06, 2008 6:15 pm

depresz wrote:Would be really cool if you would upload task with Gravatar. This is very interesting technology. I thnik that I can create not only show image, but everything what offer Gravatar. (now I'm gonna carry out unit test, I think. This task has better important range for Joomla! community).


Thank you so much! You are right - we need help testing, first. Maybe when that is done, we can look at the Gravatar.

Thanks so much for all you have done.
Amy :)

Attache
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu Jul 10, 2008 2:53 pm

Re: 125 - Create a Blog Entry Date Calendar Icon Plugin for Joom

Postby Attache » Tue Aug 26, 2008 8:09 pm

is there a way to get this to work for event calender apps like gcalender, jevents, jcal?


Return to “Google's Highly Open Participation Contest”

Who is online

Users browsing this forum: No registered users and 0 guests