Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x

Started by Joe Carver, November 20, 2009, 04:09:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe Carver

iScroll v2.1 for Coppermine 1.5.x
This plugin is based upon the good work of rphMedia and his excellent mod. Image Scroller - based on iTunes [link to Intermediate]. 

Adapted to cpg 1.5xx from my cpg1.4.xx plugin version  It will add a moving slideshow of thumbnails to the main and album list page . The thumbs "flip and turn"  for a 3D effect.

   
Example/Demo Here (Main Site)  
And
Here (My 1st CPG Gallery)  
And
Here (Artists Gallery)  


    Features
    • Fast scroll and reverse direction by mouse click
    • Light weight - low cpu/fast page for visitor
    • Configuration page select - show most viewed, top rated, last comment or random
    • Configuration page - number of thumbnails to show
    • Configuration - adjust size of window and more

            ====================================================

       To install:
       
       1) Download the .zip. Login, and install with Plugin Manager. Check your home page for the new display.
       

       To uninstall:

       1) Use Plugin Manager to uninstall

            ====================================================

    Credits for code snips and inspiration go to: rphMedia for creating the mod. and the .swf files, the Dev. Team for SEF URLS code snips and Timos Welt for Slider code snips. The list continues with Nibbler for Online Stats snips, Joachim Müller and Αndré for directions and suggestions.

            ====================================================

    Please have fun with it. All critiques and suggestions are welcome.

    Joachim Müller

    #1
    Hello Joe,

    good to see the iscroller available for cpg1.5.x as well. Thanks for your continued contributions. I have added your plugin to our download section at sourceforge net: https://sourceforge.net/projects/coppermine/files/cpg1.5x_plugin_iscroll_v1.0.zip/download

    Here are some suggestions for possible future versions:

    • Change the string "CONFIGURATION - RUN ONLY AFTER INSTALLING PLUGIN" to "configuration"; the user won't see the link if he hasn't installed the plugin, so the additional text is only confusing.
    • Add the record "iscroll" to "The content of the mainpage" during plugin install if it doesn't already exist, and remove it again on uninstall. This will make you end up with less frustrated end users. Take a look at the source code of the "Who is online" plugin that comes with cpg1.5.x out of the box to see how this is done code-wise (it's comparatively easy).
    • Take a look at the naming conventions for plugins that are available at http://documentation.coppermine-gallery.net/en/dev_plugins.htm#plugin_writing_naming_conventions_archives (I have renamed your plugin archive accordingly in the download section)
    • On the plugin configuration screen you have the string "Select Meta album for thumbnails. Current setting is: ( 1 ) Selection is REQUIRED" that looks a bit nonsensical to me as well as the message "Refresh Page - Show Changes" after submitting the form: the user expects the form to display the actual settings already. Read them first (code-wise) and select the form elements accordingly.

    The same question we have asked Timo goes to you as well: do you agree to have your plugin added to the SVN repository? Is that OK license-wise as well?

    I'm looking forward to your continued contributions

    Joachim

    P.S. I wasn't able to make the plugin actually work as expected, but that may be as well an individual issue on my side. I can't post a link to my tesbed as it's on localhost, but here is the relevant part of the output:<div id="eye" align="center">
    <script language="javascript">
    if (AC_FL_RunContent == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    AC_FL_RunContent(
    'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
    'width', '800',
    'height', '250',
    'src', 'flow_link',
    'FlashVars', 'xmlPath=http://localhost/~gaugau/cpg15x/flow_link.php',
    'quality', 'high',
    'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', "transparent",
    'devicefont', 'false',
    'id', 'flow_link',
    'bgcolor', '',
    'name', 'flow_link',
    'menu', 'true',
    'allowFullScreen', 'false',
    'allowScriptAccess','sameDomain',
    'movie', 'flow_link',
    'salign', ''
    ); //end AC code
    }
    </script><embed src="flow_link.swf" flashvars="xmlPath=http://localhost/~gaugau/cpg15x/flow_link.php" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="transparent" devicefont="false" bgcolor="" name="flow_link" menu="true" allowfullscreen="false" allowscriptaccess="sameDomain" salign="" type="application/x-shockwave-flash" height="250" width="800" align="middle">
    </div>
    The section where the scroller should show just is blank for me.

    Αndré

    Plugin works on my testbed.

    Quote from: i-imagine on November 20, 2009, 04:09:09 AM
       5) Optional - To change the style/size of the thumbs you must replace file flow_link.swf. Within the
       iscroll folder there are two extra folders named with different thumb settings. To change, upload
       the newer flow_link.swf to your gallery root.
    I suggest to add an option to the config screen.

    Joe Carver

    @ Joachim and Andre,

    Thanks for the information. As a "one man test team" I always worry that I will overlook the obvious flaws in my output.

    To address a few of your very valid points.


    • Member rhpMedia has already replied that he has no issues with his .swf(s)  being repackaged
    • It is fine with me to list/add this to the SVN repository.
    • This work in progress may take a few attempts before it is finished
    • All of the Config. page change suggestions are excellent - work will continue
    • The naming was intentional for the 'pre-beta release' - will rename in the future

    It might not work on a stand-alone (isolated) test bed due to the 'sameDomain' restrictions in codebase.php, function iscroller_main . Possibly it would work with that being changed to 'always', however that value would be unacceptable for a  public/production Gallery.

    Thanks Again.

    Joe Carver

    Release of Version 0.3

    With the suggestions from above, a little bit more and with the sound of one hand clapping.....

      Version 0.3 Changelog:
      • Easy 100% Automatic installation through plugin manager
      • Location of iScroll on Main page added to Config. page
      • Selection of .swf - 17 or 5 thumbs added to Config. page
      • Config. page - change selection of meta album
      • Config. page refreshes w/changes (using function cpgRedirectPage)
      • Cleanup, minor edits - file plugin/iscroll/configuration.php
      • Rename to conventional cpg standard (it's now semi-officially released(!))
      • Credits list lengthened

        To Do:
        • Bug in LIMIT results, db query does not add first selection to xml file in flow_link.php. All meta albums are reduced by 1 from LIMIT value.

        Readme file now accessible through plugin manager, includes instructions for creating crossdomain.xml file.

        Suggestions - directions - corrections are requested and welcomed.

        Enjoy it!

        Timos-Welt

        Good work, I love the optical gimmick!

        A few things:
        1) Combining your plugin with my slider plugin, both only work if iScroll is above slider in the plugin list on plugin manager page. We should together try to fix that.
        2) The script code for the page head should only be inserted on album list page. You could use something like this:
        // only insert stuff if we're on album list page
        if (defined('INDEX_PHP') && !defined('DISPLAYIMAGE_PHP') && !defined('THUMBNAILS_PHP'))
        {
         ...
        }

        3) Config page: Select SWF for thumbnails (Show 5 or Show 17) isn't saved correctly.

        Joe Carver

        Thanks, but I cannot take more than 35% credit because the effects come from the .swf's created by rphMedia I am only the clerk, moving the nice display to the front of the store....

        To address the last point first, you might try a cache clean or refresh of page for the saving/seeing the difference between 17 and 5 thumbs. I was using Home Page then Album list (back and forth) here because even Firefox was "sticky" with the the older settings. That function also does depend on write access to the root, maybe that is why it doesn't work for you.

        I haven't tried Slider with this yet, I would be almost afraid of making myself dizzy.... But yes, some users might want to try it. I am sure that you have a deeper understanding of how things are working, but my guess is that the plugins are:
        1) Competing for the same space on the page
        2) Competing for a place in the page <head>

        It is with 2) that I have seen/experienced more issues with. In this case I am not sure. A few experiments/tests might help, but for the moment I want to take a short break.

        Thanks for the code suggestion - I will try it and if it works I will include it in the next release. It also looks like something that can be used elsewhere.


        papukaija

        Quote from: i-imagine on November 21, 2009, 07:20:12 PM
        That function also does depend on write access to the root, maybe that is why it doesn't work for you.
        Plugins shouldn't need write access to Coppermine's root folder. Use either your plugin's folder or a mysql database.

        Joe Carver

        Write access to the Coppermine root is needed for installation and the (major) config. change, not for operation.

        This plugin also relies on write access for installation: SEF_URLs plugin for cpg1.5.x
        :)

        Joachim Müller

        papukaija is totally right. It's completely unnecessary to write stuff to the root folder. We have lead this discussion already for Timo's excellent enlargeit plugin and he managed to change this around easily. To treat a file as if it was in the root of coppermine's folder, you can access it as index.php?file=plugin_name/file_name_without_extension

        Joe Carver

        The change might not be as trivial as changing merely one or two lines.

        However I will give it a try.

        Joe Carver

        One quick question for the devs. before committing/posting the newer (working) version.

        Is it acceptable for the plugin's configuration to write to the plugin's directory from the plugin's sub-directory?

        (ex. file: plugins/iiscroll/file_xxx.yyy      updated/changed with     file: plugins/iscroll/new_dir/file_xxx.yyy)

        Done by action/selection on plugin config. page.

        Thanks in advance

        Αndré


        Joe Carver

        It isn't a config value - there are two different .swf's that the plugin configuration can choose from.

        There could be different ways around.........but the question still stands/

        Joe Carver

        Issue should be settled with this release - question about writing to a dir. is still open (for future reference only)

        Release of Version 0.5

          Version 0.5 Changelog:
          • Selection of .swf - 17 or 5 thumbs now selected from folder
          • Page <head> .js refererence now only on index pages - Thanks Timos Welt
          • Config. page - change .swf selection to dropdown
          • Cleanup, minor edits - file configuration.php

          New version now attached to first post.

          Joachim Müller

          Not sure why exactly you want to write something on file system level in the first place, but if you must, the folder your plugin resides in or any sub-folder is better than attempting to write to coppermine's root folder. But trust me: you don't have to write a file - let us know why you want to write a file (maybe post the code snippet) and we'll try to come up with a solution that doesn't rely on file writing at all.

          Joe Carver

          Thank you for the reply.

          I will ask for help with the one remaining issue with this plugin that I can't seem to solve. (probably because the obvious is being overlooked.....)

          The image set is generated by file flow_link.php. It makes output of .xml for the .swf player to use.

          The bug/issue is that the query LIMIT value is made short by a value of 1. It will not respect the first selection, no matter what type of META album is used. (random, last up, most viewed, top-rated). Ask for 10, it will return 9 - ask for 22, it will return 21.

          Here is a "lightweight" version of flow_link.php. The plugin variables have been removed. It will run by itself when located in the iscroll plugin folder. [  index.php?file=iscroll/test_flow_link   ]
          <?php

          // test file for iscroll plugin db LIMIT select

          define('IN_COPPERMINE'true);
          require_once(
          'include/init.inc.php');

          $path=$CONFIG['site_url'];

          $xml '<?xml version="1.0"?>
          <content>';

          if ($FORBIDDEN_SET != "") $FORBIDDEN_SET = "AND $FORBIDDEN_SET";

          $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename LIKE '%.jpg' AND filename not like 'youtube_%' $FORBIDDEN_SET  $META_ALBUM_SET ORDER BY pid DESC LIMIT 10");

          $row = mysql_fetch_array($result);

          while ($row = mysql_fetch_array($result))
          {
          $type = max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width'] ? 'thumb' : 'thumb';

          $xml .= "<image>
          <path><![CDATA[" . $path . get_pic_url($row, $type) . "]]></path>
          <description><![CDATA[" . $row['title'] . "]]></description>
          <data><![CDATA[" . $path . "displayimage.php?pos=-" . $row['pid'] . "]]></data>
          </image>";
          }
          $xml .= '</content>';
          echo $xml;
          ?>


          The .xml output from this example is 9, not the LIMIT of 10.

          Thanks in advance for time and replies.



          Joe Carver

          Question answered - thanks anyway. There was a redundant/useless line in the file flow_link.php. Will be included in next release.

          $row = mysql_fetch_array($result);

          Was removed and now the count/LIMIT results are correct.
          I plan to wait a while for the next release - just in case of any more issues reported.

          Joe Carver

          Release of Version 0.7

            Changelog
            • Bug in LIMIT results, db query in flow_link.php
            • page <head> .js refererence now by $CPG_PHP_SELF
            • Config. page - edits to display + error handling
            • Cleanup, format, garbage clean from last release

            Released with note and question for devs - this will conflict and interfere with the meta <head> changes in two plugins I have tested it with - EnlargeIt v1.3 and Slider v0.3. Each seems to "compete" for a final say in the <head> output.

            With EnlargeIt the conflict resolves when iScroll is moved above EnlargeIt on the list in Plugin manager. (note that iScroll does not interact/pop-up the EnlargeIt display). The effect also is seen when EnlargeIt v1.3 and Slider v0.3 are used together, list position relates to function. I hope that I have explained this well enough, this effect is something I have experienced with 1.4xx plugins and is probably not new to the devs either  :) (I am stuck for a solution)

            This version should be closer to 1.5.xx standards, any help and critiques are greatly appreciated.   

            [edit to remove v0.7]

            Nibbler

            You should append to the html instead of replacing it, ie.


            return $html . $meta;