The Joomla! Forum ™






Post new topic Reply to topic  [ 17 posts ] 
Author Message
PostPosted: Tue Dec 18, 2007 4:04 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

I'm the one who did task number 127

Sander Kromwijk

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Last edited by AmyStephen on Thu Jan 03, 2008 1:34 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Dec 18, 2007 5:54 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Aug 19, 2005 12:37 am
Posts: 963
Location: Washington, DC / NoVA
Excellent! Looking forward to more of your code  ;D

_________________
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php


Top
 Profile  
 
PostPosted: Thu Dec 20, 2007 7:25 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

Here is my first version.

To use it, you have to put {images} at the beginning. Then put an image on each line (with the image button). At the end, put a {/images}

Sander Kromwijk


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

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Sat Dec 22, 2007 8:57 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

Here is my final version (unless there are big problems)

Sander Kromwijk


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

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Sun Dec 23, 2007 2:43 am 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
Sander,

Could you put the instructions for use of the plugin into the description? I love the detailed instructions, maybe there is a way to install that on the site somehow?

When I first used the plugin I got some warning messages. However, I figured out what the problem was.

Th plugin was expecting the images to be includes n

  ... once i did that it worked. However this wasn't clear from the documentation. I think you should try to modify the program to allow for additonal delimiters, specifically
and
since both are commonly inserted by wysiwyg editors.

Install and uninstall went great, and the reults are great to look at.  :)

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Sun Dec 23, 2007 2:43 am 
Joomla! Champion
Joomla! Champion

Joined: Wed Nov 22, 2006 3:35 pm
Posts: 7056
Location: Nebraska
Sander -

Image

Very, very nice! :)

Pull those style tags out and place them into a file - then include the file within your php file.
Code:
   // Add CSS
   $document =& JFactory::getDocument();
   $document->addStyleSheet( JURI::base() . 'plugins/content/slimbox.css', 'text/css', null, array( ' id' => 'StyleSheet' ) );


These two files can be copied into a folder named magazinelayout:
Code:
      <filename plugin="magazinelayout">magazinelayout.image.php</filename>
      <filename plugin="magazinelayout">magazinelayout.class.php</filename>


Usually, if it's just the php, xml, css and 1 js file, they can all stay in the root of the content plugins - but if there is more than that, creating a folder can be helpful. You could add your css to that folder, if you choose.

This is a beauty - there is no doubt. What a great way to take a set of up to eight images and turn it into a perfectly arranged gallery. This has the potential of dressing up many J! sites.

I love how you allow the image manager to be used. You need to consider, though, that a lot of HTML is going to slip in there between the images. When that happens, the site bombs hard.

When we used a NoWYSIWYG editor - it only recognized the first image - experimenting more, it appeared that paragraph tags around the images created a perfect feed to your program.

Give it some thought how you can handle the inexperienced user with the editor - and the noWYSIWYG editor. At bare minimum, make it perfectly obvious in the instructions what that HTML should look like inside of the plugin.

This is a wonderful, wonderful, wonderful plugin. People are going to love it. Thanks for taking the task. We'll look for your next post!

Amy :)

_________________
http://Twitter.com/AmyStephen
http://www.alltogetherasawhole.org/


Top
 Profile  
 
PostPosted: Mon Dec 24, 2007 11:13 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

Here is the plugin. I saw that I had made a mistake with the pargraph thing. It is not necessery to put any delimiters anymore, only the two {images} tags. I can't test the plugin because I'm not on my own computer (I'm on vacation), so I hope I did not make any coding errors. I've also written a part in the documentation for the people who don't use wysiwyg editors. The two php files and the css file are in another directory.

Sander Kromwijk

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Mon Dec 24, 2007 11:14 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

I forgot to attach the file, here it is:

Sander Kromwijk


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

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Mon Dec 24, 2007 12:06 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
Sander,

I uninstalled and tried to reinstall ... I got this error:



        * JInstaller::install: File '/home/xxxx/public_html/rc4/tmp/install_476f9ffeb932b/plg_magazinelayout/magazinelayout.image.php' does not exist

Message

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Wed Dec 26, 2007 5:52 am 
Joomla! Champion
Joomla! Champion

Joined: Wed Nov 22, 2006 3:35 pm
Posts: 7056
Location: Nebraska
I had the same problem as mcsmom.

Try this for your xml file:
Quote:


Content - Magazine Layout
Sander Kromwijk
December 2007
Sander Kromwijk. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
s.kromwijk@gmail.com

1.0
Plugin which implements a Magazine Layout

magazinelayout.php
MagazineLayout





en-GB.plg_content_magazinelayout.ini


_________________
http://Twitter.com/AmyStephen
http://www.alltogetherasawhole.org/


Top
 Profile  
 
PostPosted: Fri Dec 28, 2007 1:48 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

I tried to correct the problem, but since the new version RC4 it doesn't work anymore. Did the event names change?

Sander Kromwijk

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Fri Dec 28, 2007 2:05 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Sorry,

I forgot the / in the ending tag  :-[

Sander Kromwijk

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Fri Dec 28, 2007 2:37 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

Here is the corrected version. I have been able to test it this time, so now I'm sure it works. Unless something is missing, this is the final version.

Sander Kromwijk


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

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Fri Dec 28, 2007 9:59 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Aug 19, 2005 12:37 am
Posts: 963
Location: Washington, DC / NoVA
Looks good over all, here are a few comments:

You can get rid of the second loop by using this regex to find all single and double quotes:

Code:
$regex = '/src=["\'](.*)["\']/iU';


Note that the \ inside of the character class is escaping the single quote for the string and not for the regex.

I'm looking for a way around hand editing the images to get the paths right. Here's my solution so far. Before you get to the loop, build the path to strip:

Code:
$uri =& JFactory::getURI();
$path = '../..' . str_replace('~', '%7E', $uri->getPath());


Inside the loop right before you add the match to the array, strip out this path if it exists:

Code:
if (stristr($matches[1][$i], $path)) {
   $matches[1][$i] = str_replace($path, '', $matches[1][$i]);
}


This solution isn't ideal, but it works on my end. The whole str_replace('~', '%7E', $uri->getPath()); bit is my way of escaping the ~ character (which is a part of the URL I'm testing this from). A more robust solution would be to split the result of $uri->getPath() on /, urlencode() the pieces, then join them up again. This will at least fix it for the editor that ships with Joomla! (TinyMCE). It would also be better if I didn't prepend the '../..' bit to the beginning; you can probably write a preg_replace() regex to ignore everything before the urlencoded version of $uri->getPath();


I would definitely implement the first of these two so you don't have to do two separate loops for both kinds of quotes. The second part is trickier, but would definitely improve the usability of the plugin.

_________________
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php


Top
 Profile  
 
PostPosted: Tue Jan 01, 2008 9:26 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Thu Dec 13, 2007 2:59 pm
Posts: 68
Hi,

I corrected the things you said. Is it OK now?

Sander Kromwijk


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

_________________
Simple and elegant messaging. Download the Messaging extension for Joomla! See http://extensions.joomla.org/extensions/4026/details


Top
 Profile  
 
PostPosted: Wed Jan 02, 2008 3:03 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Aug 19, 2005 12:37 am
Posts: 963
Location: Washington, DC / NoVA
Yes, it looks great! I'm going to say this is done, but I'll let one of the other judges take a look and give feedback.

_________________
Joseph L. LeBlanc: http://www.jlleblanc.com
Frontend components start here: /components/com_[name]/[name].php
Backend components start here: /administrator/components/com_[name]/admin.[name].php


Top
 Profile  
 
PostPosted: Thu Jan 03, 2008 1:27 am 
Joomla! Champion
Joomla! Champion

Joined: Wed Nov 22, 2006 3:35 pm
Posts: 7056
Location: Nebraska
I love this, very, very much and can't wait to start seeing it on some sites. I mean, how easy can things get? WOW!

I also accept this as complete. Please upload to the Google Task Page. When you have done so, we will mark it complete there, as well, and you will be free to choose another task, if you wish.

Thank you for your contributions to the Joomla! community,
Amy :)

_________________
http://Twitter.com/AmyStephen
http://www.alltogetherasawhole.org/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group