serendipity_event_imageselectorplus

Creating and modifying plugins.
Post Reply
nogad
Regular
Posts: 14
Joined: Wed Aug 20, 2014 10:48 am

serendipity_event_imageselectorplus

Post by nogad » Wed Aug 20, 2014 10:58 am

Hello.

I just modified the plugin serendipity_event_imageselectorplus, and mybe i wnt to modify it more in the future. Now my question is: are you (the team) willing to use it for SPARTACUS, so all of the users are be able to profit from changes?

Feel free to download it (last modified on 2014-08-22): serendipity_event_imageselectorplus_mod_hideafter.zip




(This file is automatically deleted after 1 year, beginning at 2014-08-20, 10:00.)

The changes are in those 3 files:

Code: Select all

documentation_en.html
plugin_mediainsert.tpl
serendipity_event_imageselectorplus.php
I also added a german documentation (still not translated at all): documentation_de.html


Thank you for your cms. Its hard at beginning, but really cool!


Update: its possible to arrange the previews in rows.

Code: Select all

<media type="picperrow" pr="5">
will break the preview line after every fith picture.

Download updated.
Last edited by nogad on Sun Aug 24, 2014 12:38 am, edited 3 times in total.

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: serendipity_event_imageselectorplus

Post by onli » Wed Aug 20, 2014 1:12 pm

Hi
Thanks a lot!
Normally, patches are always welcome. We'll have a look at it (Garvin is not here right now, and I'm not familiar with the plugin, so it could take a bit) and either include it or give feedback.

To make this a bit easier, could you paste a diff between the original and your version?

nogad
Regular
Posts: 14
Joined: Wed Aug 20, 2014 10:48 am

Re: serendipity_event_imageselectorplus

Post by nogad » Wed Aug 20, 2014 10:41 pm

Diff für plungin_mediainsert.tpl:
https://www.diffchecker.com/kadx1pz5


Diff für serendipity_event_imageselectorplus.php:
https://www.diffchecker.com/spblhq0g

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_event_imageselectorplus

Post by Timbalu » Thu Aug 21, 2014 9:52 am

Hi

Could you give us a test page to see what this is doing exactly?
I say this, since it was possible to arrange the previews in rows before. Which btw was the main idea of these mediainsert galleries. Its CSS and markup behaviour is depending on the theme/template and the contents article width. Maybe your template Sagittarius-A just doesn't allow this?
You might select a better one like 2k11, to compare.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

nogad
Regular
Posts: 14
Joined: Wed Aug 20, 2014 10:48 am

Re: serendipity_event_imageselectorplus

Post by nogad » Fri Aug 22, 2014 2:20 am

I set up a testpage here:

http://test.nogad.de/serendipity/

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_event_imageselectorplus

Post by Timbalu » Fri Aug 22, 2014 9:15 am

OK - now I know I missed that new type="picperrow" pr="5" thing.
Looks good to me. Good idea! - Thanks.
Maybe this needs some better smarty iteration, but I will play around with it and commit it with the next imageselectorplus update. Alright? Have you finished with the docu?
I can't load that zip. Are you able to use GitGub Gist or even better do a Pull request?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

bernd_d
Regular
Posts: 466
Joined: Thu Jun 03, 2010 9:28 am
Contact:

Re: serendipity_event_imageselectorplus

Post by bernd_d » Fri Aug 22, 2014 5:53 pm

Timbalu wrote:...I will play around with it and commit it with the next imageselectorplus update.
...
Are you able to use GitGub Gist or even better do a Pull request?
Before this, the german variables should be renamed somehow. ;)

nogad
Regular
Posts: 14
Joined: Wed Aug 20, 2014 10:48 am

Re: serendipity_event_imageselectorplus

Post by nogad » Fri Aug 22, 2014 11:29 pm

Huhu.

I just updated the plugin again, fixed in a dirty mode a bug and translated the german Dokumentation. I also added the missing german strings to the lang_de.inc.php

Downloadlink is in the first post. And no, i dont want to make a new diff. I also dont use github - im to lazy. I got my code in my head. The changes too ;)

Would be nice to see a futher update of this plugin, its a good one!

With all my bests regards

Mathias :)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_event_imageselectorplus

Post by Timbalu » Sat Aug 23, 2014 10:11 am

Does your Bug Fix fix the "Division by zero" modulo error?

I had a little spare time with it yesterday, thinking the pic per row being a good addition, but did not really like this new hideafter, since that is something you can use more easily with the "range type" and works even better, since only placing images you really want to show up to the source.
Now I have read your docu for this and it says:
<mediainsert>
<gallery name="MyHolidays/" />
<media type="gallery" />
<media type="hideafter" nr="2" />
</mediainsert>

This example inserts from the directory "MyHolidays" all pictures but stop visiblity from picture number 3.

Why its useful?
If you are using a lightbox plugin, which inserts in all article images, there may be a lot of preview images.
With hideafter you can stop the visibility of a hughe list of preview pictures. But the lightbox is still working!
which is a case I did not expect and do not fully understand. Why do you want image set hidden in entries for lightbox plugins. What is the main goal about it, if you can use the range type?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

nogad
Regular
Posts: 14
Joined: Wed Aug 20, 2014 10:48 am

Re: serendipity_event_imageselectorplus

Post by nogad » Sat Aug 23, 2014 3:42 pm

Yup, the zero modulo has been fixed :)

The hideafter Tag is useful, if there is plugin for lightbox. The lightbox is catching up all images in the html code. If you use the range tag for imageselectorplus, not ALL pics are cating by the lightbox, because not ALL pictures are in the code. So you can set up a "teaser" for the lightbox and can watch all images in the lightbox, but if there are 50 or 70 or 100 pics in a gallery, i dont want to show them in the article.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_event_imageselectorplus

Post by Timbalu » Sat Aug 23, 2014 5:23 pm

Ok - so you don't want to view them in the entry, except of some as a teasered gallery, but want the lightbox to show them all. Now, how do you tell lightbox to show them, since set display: none, without tweaking the plugin or your template to allow them in that case? At least we'd need to think of other users too. Or does lightbox doesn't care about this at all?

And you are talking about galleries containing 50 or 100 images. This is an enormous amount which still has to be catched, pushed, set as markup and disabled to view by your browser. I am not sure this is feasible and should be done. (btw, I still have that "Division by zero" modulo error.)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_event_imageselectorplus

Post by Timbalu » Sat Aug 23, 2014 6:46 pm

I reworked the tpl a little bit for using iteration and index checks, being Smarty2 compatible and avoiding Division by zero errors. There is no need for the fix in plugin itself. Could you check this in your environment, please?!

Code: Select all

<div class="serendipity_mediainsert_gallery">

{foreach from=$plugin_mediainsert_media item="medium" name="pmd"}

 {if isset($plugin_mediainsert_hideafter) && $smarty.foreach.pmd.iteration <= $plugin_mediainsert_hideafter}
  {if !$smarty.foreach.pmd.first && $plugin_mediainsert_picperrow > 0 && $smarty.foreach.pmd.index % $plugin_mediainsert_picperrow == 0}
  <div style="clear:both">&nbsp;</div>
  {/if}
 {/if}
 {if isset($plugin_mediainsert_hideafter) && $smarty.foreach.pmd.iteration > $plugin_mediainsert_hideafter}
  <div class="serendipity_imageComment_left" style="width: 0px; height: 0px; display: none">
 {else} 
  <div class="serendipity_imageComment_left" style="width: {$medium.thumbwidth}px">
 {/if}
      <div class="serendipity_imageComment_img">
      <a class="serendipity_image_link" href="{$serendipityHTTPPath}uploads/{$medium.path}{$medium.realname}">
       <!-- s9ymdb:{$medium.id} -->
        <img width="{$medium.thumbwidth}" height="{$medium.thumbheight}" src="{$serendipityHTTPPath}uploads/{$medium.path}{$medium.name}.{$medium.thumbnail_name}.{$medium.extension}" />
      </a>
      </div>
      <div class="serendipity_imageComment_txt">{$medium.comment1}</div>
  </div>
{/foreach}

</div>
<div style="clear:both">&nbsp;</div>
Is there a real need for the last clear both div in your template?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

nogad
Regular
Posts: 14
Joined: Wed Aug 20, 2014 10:48 am

Re: serendipity_event_imageselectorplus

Post by nogad » Sun Aug 24, 2014 12:34 am

Hi Timbalu,

the new template is working well. Thanks for fixing the code.

The last div for clear was needed, because the floating will not clear up and without the div it continues floating on right. But now - miracly, it doesnt floating right. It seems, there was a bug, i didnt seen.

I updated the first post, new download for this plugin - it includes your template changes.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: serendipity_event_imageselectorplus

Post by Timbalu » Wed Oct 22, 2014 1:38 pm

Timbalu wrote:Ok - so you don't want to view them in the entry, except of some as a teasered gallery, but want the lightbox to show them all. Now, how do you tell lightbox to show them, since set display: none, without tweaking the plugin or your template to allow them in that case? At least we'd need to think of other users too. Or does lightbox doesn't care about this at all?

And you are talking about galleries containing 50 or 100 images. This is an enormous amount which still has to be catched, pushed, set as markup and disabled to view by your browser. I am not sure this is feasible and should be done.
Hi Nogad, I hope you will find this entry mentioning you in time.

I am currently in work to modernize the lightbox plugin and came into conflicts with these hidden set 'display: none' gallery parts. My testpages had also entries/galleries with your hideafter tweaks.

Now, before I began to remember you wanted to have this to use lightboxes showing also the hidden images, I felt this to be somehow confusing, while shown entry images were not alike lightbox ranges. Therefore I removed showing the hidden ones in the modernized lightboxes. This is possible for some, but not all lightboxes.

I would like to discuss that further in this german thread, since that is about modernizing lightboxes.
http://board.s9y.org/viewtopic.php?f=10&t=19341

All english speakers - in need to drop a line about this issue for upcoming lightboxes - just use the german thread too or open a new one.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Post Reply