Recent Topics

[Plugin] [4.x.x] A slide show in any post (any blog type)

Started by on Oct 19, 2012 – Contents updated: Feb 15, 2013

Oct 19, 2012 19:00    

[edited 2012 11 18]
I previoulsy presented my adaptation of the photoblog skin to allow the automatic sequencing of the photo posts belonging to an album (a category), see my previous posts http://forums.b2evolution.net/viewtopic.php?t=24905 . I come now with a plugin which allows insertion of a slide show in any post of any blog or photoblog. It installs easily like any other plugin (download, unzip in your_b2evo/plugins/, install from your backoffice Main settings/Plugins).

See a demo and more explanations as well as a download link http://www.le-fataliste.fr/blabla/atelier.php/jl-diarama . This page is partly in french, but the explanations are also given in english (follow the link).

Since I'm not a super expert in b2evolution, I first developped a php script independent from b2evo to perform the slide show and run it in an iframe. I know that some people don't like iframes, and I was kindly pushed (see below) to make a version without the use of an iframe. The main difference between the two versions is that the iframe one allows several instances in the same post while version without iframe does not. Both versions may be downloaded. My php script is under the control of the plugin, so using it is just writing a simple code in your post.

Enjoy.
Jacques

Nov 16, 2012 12:20

iframe is not the best idea but thanks for the effort.
If you have a moderate experience on b2 plugins you can easily make it into an actual plugin without iframe.Just look at "renderer" plugins, which will replace [your_slider_trigger] shortcode with actual slideshow code.

Nov 17, 2012 01:23

tilqicom wrote:

iframe is not the best idea but thanks for the effort.
If you have a moderate experience on b2 plugins you can easily make it into an actual plugin without iframe.Just look at "renderer" plugins, which will replace [your_slider_trigger] shortcode with actual slideshow code.

Thank you for your comment. However I was expecting something a little bit more helpfull when I wrote "tell me". You said that I "just" have to "look at" the plugins... I indeed spent some time looking at the doc (manual) for plugins. I hardly found anything which could really be of any help. And since I don't have any feedback up to now, I'm unsure that it worth the time that I would spent trying to have my code running without the iframe. I developped my code independently from b2evo and managed to have it working with (if not working "in") b2evo to fit my need. To go further, I need some "push". Again, I thank you for having commented my post. Regards. jacques

Nov 17, 2012 04:47

Well, it's pretty straight forward, you give your code and the plugin renders it, triggered by a [short code].

PHP

var $mycode '<div id="slider"><!-- slider content --> </div>';
var $short_code '[my_trigger]';
    function RenderItemAsHtml( & $params )
    {
        $content = & $params['data'];
        $content preg_replace$this->short_code$this->mycode$content );
        return true;
    }

Take a look at any rendering plugin, you'll get the gist of it

Nov 17, 2012 10:52

tilqicom wrote:

Well, it's pretty straight forward, you give your code and the plugin renders it, triggered by a [short code].
[...]Take a look at any rendering plugin, you'll get the gist of it

May be you did not noticed that it is what I did ? I'm using a plugin to change my [short code] into some html. But then comes the (more) difficult part of the job : understand all the subtilties of b2evo to have my code working properly once inserted. Up to now I failed to do it. So I keep my code inside an iframe until I understand a little bit more b2evo behaviour. Thank you for your help. Regards. Jacques

Nov 17, 2012 14:33

leFataliste wrote:

tilqicom wrote:

Well, it's pretty straight forward, you give your code and the plugin renders it, triggered by a [short code].
[...]Take a look at any rendering plugin, you'll get the gist of it

May be you did not noticed that iti is what I did ? I'm using a plugin to change my [short code] into some html. But then comes the (more) difficult part of the job : understand all the subilties of b2evo to have my code working properly once inserted. Up to now I failed to do it. So I keep my code inside an iframe until I understand a little bit more b2evo behaviour. Thank you for your help. Regards. Jacques

ah ok, i see.Sorry bout that, i didnt look into the content of your plugin earlier.Now i get it

Nov 18, 2012 20:00

tilqicom wrote:

leFataliste wrote:

tilqicom wrote:

Well, it's pretty straight forward, you give your code and the plugin renders it, triggered by a [short code].
[...]Take a look at any rendering plugin, you'll get the gist of it

May be you did not noticed that iti is what I did ? I'm using a plugin to change my [short code] into some html. But then comes the (more) difficult part of the job : understand all the subilties of b2evo to have my code working properly once inserted. Up to now I failed to do it. So I keep my code inside an iframe until I understand a little bit more b2evo behaviour. Thank you for your help. Regards. Jacques

ah ok, i see.Sorry bout that, i didnt look into the content of your plugin earlier.Now i get it

I finally spent a few hours (in fact 2 days) to try to run the slideshow without an iframe. And I think that I did it. Not so easy for me however. A few answers would have help. 1/ how to get the path to the different important dirs ? 2/ how to send * from the plugin * some code into the head section of the page (to add some call to javascript or css). 3/ how to manage the character sets conversions when reading a file to insert it into the code ? I succeeded to go around all these problems, but I would have get a better code with the answers ti these questions. Thank you again for your interest :) Regards. jacques

Nov 20, 2012 00:50

leFataliste wrote:

tilqicom wrote:

leFataliste wrote:

tilqicom wrote:

Well, it's pretty straight forward, you give your code and the plugin renders it, triggered by a [short code].
[...]Take a look at any rendering plugin, you'll get the gist of it

May be you did not noticed that iti is what I did ? I'm using a plugin to change my [short code] into some html. But then comes the (more) difficult part of the job : understand all the subilties of b2evo to have my code working properly once inserted. Up to now I failed to do it. So I keep my code inside an iframe until I understand a little bit more b2evo behaviour. Thank you for your help. Regards. Jacques

ah ok, i see.Sorry bout that, i didnt look into the content of your plugin earlier.Now i get it

I finally spent a few hours (in fact 2 days) to try to run the slideshow without an iframe. And I think that I did it. Not so easy for me however. A few answers would have help. 1/ how to get the path to the different important dirs ? 2/ how to send * from the plugin * some code into the head section of the page (to add some call to javascript or css). 3/ how to manage the character sets conversions when reading a file to insert it into the code ? I succeeded to go around all these problems, but I would have get a better code with the answers ti these questions. Thank you again for your interest :) Regards. jacques

1. What 'important dirs' are you looking for ?
i assume you are looking for $plugins_subdir variable.

2. for script loading, you may need :

PHP

$plug_url $this->get_plugin_url();

then you can load your resources (js or css) as such

PHP

require_js$plug_url 'myscript.js'TRUE );
    require_css$plug_url 'extra-style.css' );

3. i dont know what exactly you are getting at , but you can use htmlspecialchars if you are having troubles with accented characters

Nov 20, 2012 01:45

tilqicom wrote:

1. What 'important dirs' are you looking for ?
i assume you are looking for $plugins_subdir variable.
2. for script loading, you may need :

PHP

$plug_url $this->get_plugin_url();

then you can load your resources (js or css) as such

PHP

require_js$plug_url 'myscript.js'TRUE );
    require_css$plug_url 'extra-style.css' );

great ! This is what I was looking for. I'll try it. thanks.

tilqicom wrote:

3. i dont know what exactly you are getting at , but you can use htmlspecialchars if you are having troubles with accented characters

I tried all (or say, a lot of) possible php code and decode, but I always finish with the plugin writing my accents like &# 123; in the final page and these codes are not translated by the browser when in a js alert or in a "title" :( But forget about that, it worked when importing the text from an external js.
BTW there is now a new version without an iframe (see the first post in this topic). Ther is a difference between the two versions : the one with iframe allows several instances in the same post, the other one does not.
Regards. Jacques

Feb 08, 2013 19:04

Good effort - however I must admit it's not really beautiful compared to b2nivo.

Feb 08, 2013 21:14

[quote=@bysteven]Good effort - however I must admit it's not really beautiful compared to b2nivo.[/quote]
Thank you for this half appreciation. You are right, my slideshow looks a simple one, but you obviously overlooked some of its properties. It allows natively to be included in any post in its header (photoblog) or in the body (any blog) and if needed several instances may be used in a single post (v1). The last version, in combination with my modified version of the photoblog alllows to combine a global slide show of all the posts in an album together with local slideshows inside each or every post... The beauty lays in the slides, not the slideshow &#58;&#41; Regards.

Feb 09, 2013 19:07

That's certainly true - the functionality is awesome! Perhaps you can make it more beautiful in the future. After that, it would be perfect!

Keep up the good work!


Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.