036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

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!
AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7056
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by AmyStephen » Fri Dec 28, 2007 4:54 am

Josh -

What I am able to test and see, looks good to me.

I left a message with the Vemod News Mailer website asking that he come and review your work. Hopefully, we will get feedback from him soon.

Please do not worry about the due date, you have been steadily working and communicating and are in very good shape.

Thanks for your contributions to Joomla!,
Amy :)

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Fri Dec 28, 2007 9:29 am

Hi!

I'm the developer of Vemod News Mailer (for Joomla 1.0.x)

Josh:
I would like to see what you have done. Which version of the component did you work on?
I've tried contacting the developers of Vemod a couple of times so far, and after a couple of weeks I still haven't received a reply from them.  I'll keep on trying though, it would definitely be great if they could give me a review.
Is that really true? I answer all email that isn't about viagra...

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

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by AmyStephen » Fri Dec 28, 2007 3:33 pm

Yea! Thanks so very, very much for joining us!  :-*

The last version that Josh provided is two posts back, but the link is here.

Your involvement is so helpful. Josh selected an extremely rich extension and knowing that all of the functions worked properly was a bit overwhelming.

Thank you, again and again! We look forward to your feedback, as I am certain does Josh. He's been great!

Amy :)
tha wrote: Is that really true? I answer all email that isn't about viagra...
Note to self: never drink coffee while reading.

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Sat Dec 29, 2007 1:55 am

Hi!

I have been looking at the component now, testing and debugging. I have also written down my comments. Where should I mail them?

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

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by AmyStephen » Sat Dec 29, 2007 2:15 am

Thank you so very much! If you don't mind, we would appreciate you sharing your feedback in the forums. If you look at the GHOP entries, there is lots of great feedback - corrections - encouragements - going on.

Your feedback is so important and I know it takes time to do, so thank you for that.

What a great extension, too, I can see why Josh selected it!

Thanks, again,
Amy :)

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Sat Dec 29, 2007 2:24 am

Allright but don't hate me...

Hi!

My name is Thomas Allin and I am the developer of a component for Joomla 1.0.x called Vemod News Mailer.

The main function of the component is to allow registered users to email-subscribe to news categories. The component will send news items to subcribers when published.

I am honored that my component has been selected for this contest. I am aware that it is a very difficult task to convert practically uncommented code and that this component is difficult to test because testing involves sending emails.

I have not been developing for Joomla 1.5 so I might be missing some important issues.

Installation:

The component installs without problems. I assume that notices about language files that was not installed are just right.

Backend:

The tabs are rewritten to 1.5-tabs and the backend looks right. There seems to be a problem with the preview buttons and after a little debugging it appears that not all instances of $mosconfig_live_site and $mosconfig_sitename has been replaced with the new function calls required. What is also a problem is that $mosconfig_live_site should not be replaced with JPATH_BASE but with JURI::root().

Another issue at the backend is that when the config is saved warnings about missing modules are displayed. This could have been a simple issue but unfortunately module files are not placed directly in the 'modules' directory in Joomla 1.5. The code that handles modules has to be rewritten to find the right path for each module. Since it seems that the name of the module directory is the same as the name of the module it could be done with $modulename . '/' . $modulename . '.php', which might (or might not) work with future modules?

Frontend:

The frontend looks good at first glance and here the mail format preview does work as expected. However at a closer look at the code even here $mosconfig_live_site was replaced with JPATH_BASE or JPATH_SITE where it should be JURI::root(). Subcribing to news categories works just fine when verification email is off. Managing subscribers also seems to work.

Functionality:     

Now it was time to create a news item and mail it away. The first small problem was that when a news item is created the publish_up time seems (by default in Joomla 1.5) to be set to the following whole hour (i.e. 12:00:00 when the news item was created 11:05:00). That might not be a problem but the news item won't show up on the preview page before 12:00:00.
Pressing the 'send' button at the preview page gives the following Fatal error: Call to undefined function mosMail() in I:\xampplite\htdocs\joomla15RC4\components\com_vemod_news_mailer\vemod_news_mailer.html.php on line 336

Conclusion:

The contestant has put a lot of work into the conversion and seems to have a good understanding of the main parts of the component. It is easy to mix up url and path and that can be fixed rather easily. The biggest problem for me is that the contestant did not test the main functionality of the component at all, namely sending a mail. I also think that it is a good idea to turn notices on in php.ini while developing and testing to get rid of undefined variables and the like.

jbelani1
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Nov 29, 2007 7:19 pm

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by jbelani1 » Sat Dec 29, 2007 5:33 am

Hi Thomas

Let me start off by saying thank you very much for taking your time to review the component.  I really appreciate it.  I worked on Vemod some more and fixed most of the problems you found.
The component installs without problems. I assume that notices about language files that was not installed are just right.
I am pretty sure that the language notices are normal.  I tried to install other Joomla! 1.5 native components and I get the same notices.
The tabs are rewritten to 1.5-tabs and the backend looks right. There seems to be a problem with the preview buttons and after a little debugging it appears that not all instances of $mosconfig_live_site and $mosconfig_sitename has been replaced with the new function calls required. What is also a problem is that $mosconfig_live_site should not be replaced with JPATH_BASE but with JURI::root().
I was a little confused about paths and urls and I now have fixed the $mosconfig_live_site problem.
Another issue at the backend is that when the config is saved warnings about missing modules are displayed. This could have been a simple issue but unfortunately module files are not placed directly in the 'modules' directory in Joomla 1.5. The code that handles modules has to be rewritten to find the right path for each module. Since it seems that the name of the module directory is the same as the name of the module it could be done with $modulename . '/' . $modulename . '.php', which might (or might not) work with future modules?
It seems that I misunderstood the situation with the modules.  For some odd reason I thought that the modules that weren't found were Vemod modules.  But obviously I was very wrong  :-[.  I fixed this as well.
Now it was time to create a news item and mail it away. The first small problem was that when a news item is created the publish_up time seems (by default in Joomla 1.5) to be set to the following whole hour (i.e. 12:00:00 when the news item was created 11:05:00). That might not be a problem but the news item won't show up on the preview page before 12:00:00.
Pressing the 'send' button at the preview page gives the following Fatal error: Call to undefined function mosMail() in I:\xampplite\htdocs\joomla15RC4\components\com_vemod_news_mailer\vemod_news_mailer.html.php on line 336
I haven't fixed the publish_up time yet, I will when I have time to take a closer look.  For the Fatal Error, it seems that I converted every call to mosMail() but this one slipped through  :-[.  Well I fixed this up so it should work now.
I also think that it is a good idea to turn notices on in php.ini while developing and testing to get rid of undefined variables and the like.
When going through tests for undefined variables I only encountered one so far: Notice: Undefined variable: fromtemplate in /opt/lampp/htdocs/joomlanight/components/com_vemod_news_mailer/vemod_news_mailer.php on line 21.  This variable is used a few times throughout vemod_news_mailer.php, however it is never defined.  I wanted to check if it was a change I made that made it undefined, so I tried running the original Vemod component in Joomla! 1.0.  However, I still got the same notice.  I'm not quite sure how to handle this, nor the purpose of this variable.

Once again I thank you very much for reviewing the component.  It seems that many of the mistakes I made were misunderstandings on my part on how everything worked.  However I guess this is how I'll learn  :).  I attached the revised component.

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

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Sat Dec 29, 2007 8:47 am

:-[ I'm glad you appreciate it...
I was a little confused about paths and urls and I now have fixed the $mosconfig_live_site problem.
Take have a look at line 1108-1114 in admin.vemod_news_mailer.php in the zip you attached. $mosconfig_live_site and $mosconfig_sitename are still there. If you switch on notices you will discover since "view source" in your browser will show notices instead of the expected strings.
I haven't fixed the publish_up time yet, I will when I have time to take a closer look.
Well, I guess you can't without bribing the joomla developers  ;)
For the Fatal Error, it seems that I converted every call to mosMail() but this one slipped through  .  Well I fixed this up so it should work now.
There are still two calls to mosmail in vemod_news_mailer.html.php. If sending a newsletter works for you I suspect you are testing a component that is supposed to be native in legacy mode???
When going through tests for undefined variables I only encountered one so far: Notice: Undefined variable: fromtemplate in /opt/lampp/htdocs/joomlanight/components/com_vemod_news_mailer/vemod_news_mailer.php on line 21.  This variable is used a few times throughout vemod_news_mailer.php, however it is never defined.  I wanted to check if it was a change I made that made it undefined, so I tried running the original Vemod component in Joomla! 1.0.  However, I still got the same notice.  I'm not quite sure how to handle this, nor the purpose of this variable.
$fromtemplate is defined in the template file if you switch on scheduled mailings. And you are right! this notice comes up in version 1.2.3 of the 1.0.x component  :-[ which is why

Code: Select all

if(!isset($fromtemplate))    $fromtemplate = 0;
was added in version 1.2.4 . Not all notices are shown on the page, they can appear in calls to javascript functions like mentioned above.

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

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

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

tha wrote: I also think that it is a good idea to turn notices on in php.ini while developing and testing to get rid of undefined variables and the like.
It is a good idea for each of our contestants to do this: set error_reporting  =  E_ALL in the php.ini file during development.

Thomas -

Thanks, again, for efforts here.  It's a very large component and having your involvement is absolutely required to get the work done correctly.

As you can see, your comments are well received by the contestant, not at all considered negative. IMO, the biggest benefit these contestants get is close contact with those with real life experience in open source and this type of feedback. They can find out, through experience, is this is an area they want to pursue.

It's iterative work, back and forth, providing feedback, and allowing the contestant to work, reviewing again with feedback, and so on. Doing this result in your component being ready for v 1.5, which, by the way, I sense is nearing.

Josh - As long as the two of you are working, I don't want you to worry about dates. You have made excellent progress on your own but it is honestly impossible, within the short span of this contest, to do so, alone. It takes a community, it takes feedback and changes, to create working code. You are doing good work and are to be encouraged.

Keep up the great partnership!
Amy :)

jbelani1
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Nov 29, 2007 7:19 pm

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by jbelani1 » Sun Dec 30, 2007 7:30 pm

Hi all

Thomas -

Ah I didn't notice that a new version of Vemod came out  :-[.  It looks like a lot of important changes were made in this version.  Because of this, it would probably be much better if I focused all of the component changes on 1.2.4 instead of 1.2.3.  This should take me only several days because I have a much better understanding of how this component works now, and the changes that need to be made between Joomla! 1.0 and Joomla! 1.5.

Amy -

Thank you very much Amy.  This is indeed pretty hard to complete by one's self.  It is a great experience working with a community, and the developer of Vemod  :).

I'll post my Vemod 1.2.4 changes as soon as I can.

-Josh

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Sun Dec 30, 2007 8:19 pm

Josh:

It sounds like a great idea to use version 1.2.4. In fact you will be able to use the installation you made for version 1.2.3 and just copy in the new files. The only files with changes are: vemod_news_mailer.php, vemod_news_mailer.html.php, admin.vemod_news_mailer.php and js.vemod_news_mailer.php and you don't have to do make any changes to the js file.

Actually I created a working version of 1.2.4 for joomla 1.5 today with the help of your code and a text compare program. It is going to be fun to compare our versions when you are ready  :)

There is a small bug in admin.vemod_news_mailer.php (1.2.4) that you might want to fix at the same time. It is line 1331 which should be:

Code: Select all

'<?php echo $sidebarmodule2." title"; ?>','<?php echo $sidebarmodule3." title"; ?>','<?php echo $sidebarmodule4." title"; ?>','<?php echo @$sidebarmodule5." title"; ?>','<?php echo @$sidebarmodule6." title"; ?>','Close','User Name',this.form.unsubscribealltext.value,this.form.compilednewsmailHTML.value,1)" value=" view ">
I noticed you asked about the germani language file earlier. That is "german informal". They still have two ways of addressing each other in Germany: Sie or Du  8)

I wish you good luck and a happy new year!
Last edited by tha on Sun Dec 30, 2007 8:32 pm, edited 1 time in total.

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

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by AmyStephen » Tue Jan 01, 2008 4:58 am

tha wrote: Actually I created a working version of 1.2.4 for joomla 1.5 today with the help of your code and a text compare program. It is going to be fun to compare our versions when you are ready  :)
8)

jbelani1
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Nov 29, 2007 7:19 pm

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by jbelani1 » Thu Jan 03, 2008 3:46 am

Hello and Happy New Year  ;D

Its great to hear that my code helped you build a Joomla 1.5 version of Vemod, and it will definitely be interesting when comparing our versions  :P.  I'll take a look at the bug.

Thanks for clarifying the germani language file, that was stumping me for a while!

I'm just popping in to say that I am working, and will have the component up by Friday.

-Josh

jbelani1
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Nov 29, 2007 7:19 pm

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by jbelani1 » Sat Jan 05, 2008 6:17 am

Hi all

Alright finally I got a Joomla! 1.5 version of Vemod 1.2.4 up.  I'm sorry it took a little longer than I anticipated because of readjusting to school and such  :-[.  Anyway this version appears to work, and doesn't have nearly as many silly mistakes as my Vemod 1.2.3 versions.

Thomas -

I fixed the bug you told me about.  I also fixed a bug where in the back-end it wouldn't tell you if modules 5 or 6 didn't exist.  The fix starts on line 791 if you want to take a look.  I also fixed a grammar error in the english language file where it should have said your subscriptions have been updated.

Let me know if you find any bugs, errors, etc.  Thanks!

-Josh
You do not have the required permissions to view the files attached to this post.
Last edited by jbelani1 on Sat Jan 05, 2008 4:42 pm, edited 1 time in total.

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Sun Jan 06, 2008 1:01 am

Hi Josh!

It really was fun to compare our files especially since they were extremely similar.

I only found 2 differences. The first one in admin.vemod_news_mailer.php line 779 is just a copy and paste error. Line 779 should be:

Code: Select all

if (!file_exists(JPATH_SITE."/modules/" . $sidebarmodule3 . "/" . $sidebarmodule3 . ".php"))
Our little trick with the modules should also be implemented in vemod_news_mailer.html.php. Line 1373 should then be

Code: Select all

if (file_exists(JPATH_SITE."/modules/" . $modulename . "/" . $modulename . ".php"))
and line 1392 should be

Code: Select all

include(JPATH_SITE."/modules/" . $modulename . "/" . $modulename . ".php");
Congratulations to a great work! Be proud!

I have one more thing that could be worth a little thought:

In Joomla 1.5 there is only one text area to write or edit news items. Introtext and bodytext are separated with a red line entered with the "Read more" button. My guess is that many publishers won't use that button and all text will often be in introtext.

Vemod News Mailer has an option to truncate bodytext and replace it with a link to the article ("Read more..." link). I think it would be a good idea to change that in some way. Here are some ideas:
  • Change the character truncation to an option to replace the bodytext with a "Read more..." link (all introtext will be included)
  • Change it to an option to truncate concatenated introtext and bodytext
  • Change it to an option to truncate the introtext only and leaving bodytext out of the newsletter when selected
What do you think?

Best wishes...

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

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by AmyStephen » Tue Jan 08, 2008 4:02 am

Josh -

I'll bet next time you'd pick a much less complex component!  ;)

It appears to me that you have accomplished more than we could have hoped for. First of all, you brought Thomas into the Joomla! forums for the first time, ever, and he already served this community for a long time with this magneficent extension. Secondly, you helped to get the extension ready for Joomla! v 1.5 and this is a good one to have available!

Most importantly, though, you did a fantastic job and learned a lot, I am certain, about developing in Joomla!. If you want to upload your work to the Google Task, I will accept it as complete. Thomas's comments were very positive about your progress and I am completely satisfied with your efforts. Thank you for your contributions to the Joomla! community.

I hope the two of you stay in touch. Thomas - much respect and appreciation for helping Josh, and helping us, with this contest. You rock!

Amy :)

jbelani1
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Nov 29, 2007 7:19 pm

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by jbelani1 » Wed Jan 09, 2008 5:07 am

Hi all!

Amy - Haha yeah maybe  ;).  Although this component was difficult and complex, I am very happy I chose it.  I couldn't have asked for a better experience  :D.  Much like you said Amy, I learned a lot during this task, and you can be sure that I will continue to contribute to the Joomla! community.  I am going to upload this to google tomorrow after I make the changes Thomas noted in his previous post.

Thomas - Ah it is good to hear you only found a couple of differences  :).  I'm going to make those changes and upload the component to google tomorrow.  I really like your ideas about the read more link.  However, I feel I really should post this component to google as soon as possible.  I'm completely willing to work with you on Vemod outside of this competition of course  :).  I hope we keep in touch.  Finally, thank you very much for giving me guidance in this competition!  You've helped a great deal.

-Josh

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Wed Jan 09, 2008 1:11 pm

I really like your ideas about the read more link.  However, I feel I really should post this component to google as soon as possible.
Sure, I wasn't asking you to implement it, I just wanted to hear your thoughts. There are many changes in Joomla 1.5 and some of them calls for a little extra creativity.

Good luck with the contest!  8)

jbelani1
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Nov 29, 2007 7:19 pm

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by jbelani1 » Fri Jan 11, 2008 3:00 am

Hey it seems that google hasn't updated the quota for uploads yet.  Is there anyway to work around this?  I have attached the finished zip with the component and documentation.  Thanks!

-Josh
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: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by AmyStephen » Fri Jan 11, 2008 3:51 am

Happening to lots of people.

I uploaded it to http://JoomlaPlace.org/ghop/GHOP_Task_036.zip

Go ahead and paste that URL into your Google Task and I'll close it when you are done.

Thanks, again!
Amy :)

jbelani1
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Thu Nov 29, 2007 7:19 pm

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by jbelani1 » Fri Jan 11, 2008 8:32 pm

Thanks Amy!

I posted the comment.

-Josh

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by tha » Sat Jan 19, 2008 12:34 pm

Is it ok to make your version available for download at the Vemod News Mailer website or should I wait until the contest is over?

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

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by AmyStephen » Sun Jan 20, 2008 8:17 am

Certainly - all of this good work is being put to immediate service. Certainly please share these additions to your own amazing work! Google is not asking we hold it back.

Thomas - thank you for your work with this. I hope we see you around the forums!

Take care,
Amy ;)

User avatar
MiCCAS
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 188
Joined: Mon Jan 01, 2007 6:59 am
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by MiCCAS » Sun Jan 20, 2008 2:36 pm

Congratulations, this was a wonderful job and it was amazing to see the original developer here to help you out too!
MiCCAS.net Free PC Services

Cosmin
Joomla! Explorer
Joomla! Explorer
Posts: 288
Joined: Thu Aug 18, 2005 1:50 pm
Location: Romania
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.5 natively

Post by Cosmin » Wed Jan 30, 2008 1:00 pm

Hello, I tested this component, great work on porting it to J! 1.5. Everything is working fine, except one thing. I'm using the SEF URL's and the "Read more" link doesn't point to article's URL.
Member of the Romanian Joomla! Translation Team
Joomla! Romania: http://www.joomla.ro

tha
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 28, 2007 9:22 am
Location: Sweden
Contact:

Re: 036 - Upgrade a Joomla! 1.0 component to work in Joomla! 1.

Post by tha » Tue Feb 26, 2008 1:05 pm

Hi!

The url for content items seems to be different in Joomla 1.5. To fix this, find the function vmn_getContentUrl in vemod_news_mailer.html.php and replace it with this:

Code: Select all

function vmn_getContentURL($newsitem)
{
    global $mainframe;
	$database = &JFactory::getDBO();
	$Itemid = $mainframe->getItemid( $newsitem->id, 0, 0);
    return vmn_sefRelToAbs("index.php?view=article&id=". $newsitem->id . "&option=com_content&Itemid=" . $Itemid); 
}
Another issue that has come up is that Joomla 1.5 uses GMT in the content table. This will cause news items to be considered "old" if you live in the wrong timezone ;)
To compensate for this edit vemod_news_mailer.php like this:

Find the line:

Code: Select all

$now = date( 'Y-m-d H:i:s' );
Change it to:

Code: Select all

$now = gmdate( 'Y-m-d H:i:s' );
It may look a little strange at the frontend preview since "previous news scan" will now be shown as GMT.


Locked

Return to “Google's Highly Open Participation Contest”