Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3 4   Go Down

Author Topic: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x  (Read 118215 times)

0 Members and 1 Guest are viewing this topic.

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page

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.
    « Last Edit: September 29, 2012, 02:02:25 pm by Joe Carver »
    Logged

    Joachim Müller

    • Dev Team member
    • Coppermine addict
    • ****
    • Offline Offline
    • Gender: Male
    • Posts: 47843
    • aka "GauGau"
      • gaugau.de
    Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
    « Reply #1 on: November 20, 2009, 09:35:13 am »

    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:
    Code: [Select]
    <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.
    « Last Edit: November 29, 2009, 05:55:06 pm by Joachim Müller »
    Logged

    Αndré

    • Administrator
    • Coppermine addict
    • *****
    • Country: de
    • Offline Offline
    • Gender: Male
    • Posts: 15764
    Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
    « Reply #2 on: November 20, 2009, 09:44:38 am »

    Plugin works on my testbed.

       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.
    Logged

    Joe Carver

    • Dev Team member
    • Coppermine addict
    • ****
    • Country: us
    • Offline Offline
    • Gender: Male
    • Posts: 1545
    • aka 'i-imagine'
      • Home Page
    Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
    « Reply #3 on: November 20, 2009, 02:12:22 pm »

    @ 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.
    « Last Edit: November 20, 2009, 02:38:38 pm by i-imagine »
    Logged

    Joe Carver

    • Dev Team member
    • Coppermine addict
    • ****
    • Country: us
    • Offline Offline
    • Gender: Male
    • Posts: 1545
    • aka 'i-imagine'
      • Home Page
    Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
    « Reply #4 on: November 21, 2009, 06:24:33 pm »

    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!
        « Last Edit: November 23, 2009, 02:43:59 am by i-imagine »
        Logged

        Timos-Welt

        • Dev Team member
        • Coppermine addict
        • ****
        • Offline Offline
        • Gender: Male
        • Posts: 808
          • Timos-Welt
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #5 on: November 21, 2009, 06:39:11 pm »

        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:
        Code: [Select]
        // 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.
        Logged

        Joe Carver

        • Dev Team member
        • Coppermine addict
        • ****
        • Country: us
        • Offline Offline
        • Gender: Male
        • Posts: 1545
        • aka 'i-imagine'
          • Home Page
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #6 on: November 21, 2009, 07:20:12 pm »

        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

        • Contributor
        • Coppermine frequent poster
        • ***
        • Country: 00
        • Offline Offline
        • Posts: 333
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #7 on: November 21, 2009, 10:44:50 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.
        Logged

        Joe Carver

        • Dev Team member
        • Coppermine addict
        • ****
        • Country: us
        • Offline Offline
        • Gender: Male
        • Posts: 1545
        • aka 'i-imagine'
          • Home Page
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #8 on: November 21, 2009, 11:33:58 pm »

        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

        • Dev Team member
        • Coppermine addict
        • ****
        • Offline Offline
        • Gender: Male
        • Posts: 47843
        • aka "GauGau"
          • gaugau.de
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #9 on: November 22, 2009, 11:37:25 am »

        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
        Logged

        Joe Carver

        • Dev Team member
        • Coppermine addict
        • ****
        • Country: us
        • Offline Offline
        • Gender: Male
        • Posts: 1545
        • aka 'i-imagine'
          • Home Page
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #10 on: November 22, 2009, 01:10:19 pm »

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

        However I will give it a try.

        Joe Carver

        • Dev Team member
        • Coppermine addict
        • ****
        • Country: us
        • Offline Offline
        • Gender: Male
        • Posts: 1545
        • aka 'i-imagine'
          • Home Page
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #11 on: November 22, 2009, 06:28:30 pm »

        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é

        • Administrator
        • Coppermine addict
        • *****
        • Country: de
        • Offline Offline
        • Gender: Male
        • Posts: 15764
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #12 on: November 22, 2009, 08:41:17 pm »

        Why don't you save config values in the database?
        Logged

        Joe Carver

        • Dev Team member
        • Coppermine addict
        • ****
        • Country: us
        • Offline Offline
        • Gender: Male
        • Posts: 1545
        • aka 'i-imagine'
          • Home Page
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #13 on: November 22, 2009, 10:29:25 pm »

        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

        • Dev Team member
        • Coppermine addict
        • ****
        • Country: us
        • Offline Offline
        • Gender: Male
        • Posts: 1545
        • aka 'i-imagine'
          • Home Page
        Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
        « Reply #14 on: November 23, 2009, 02:38:47 am »

        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

          • Dev Team member
          • Coppermine addict
          • ****
          • Offline Offline
          • Gender: Male
          • Posts: 47843
          • aka "GauGau"
            • gaugau.de
          Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
          « Reply #15 on: November 23, 2009, 09:18:21 am »

          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.
          Logged

          Joe Carver

          • Dev Team member
          • Coppermine addict
          • ****
          • Country: us
          • Offline Offline
          • Gender: Male
          • Posts: 1545
          • aka 'i-imagine'
            • Home Page
          Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
          « Reply #16 on: November 23, 2009, 04:15:38 pm »

          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   ]
          Code: [Select]
          <?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.


          « Last Edit: November 23, 2009, 04:23:20 pm by Joe Carver »
          Logged

          Joe Carver

          • Dev Team member
          • Coppermine addict
          • ****
          • Country: us
          • Offline Offline
          • Gender: Male
          • Posts: 1545
          • aka 'i-imagine'
            • Home Page
          Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
          « Reply #17 on: November 24, 2009, 01:04:36 am »

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

          Code: [Select]
          $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.
          « Last Edit: November 24, 2009, 01:10:16 am by Joe Carver »
          Logged

          Joe Carver

          • Dev Team member
          • Coppermine addict
          • ****
          • Country: us
          • Offline Offline
          • Gender: Male
          • Posts: 1545
          • aka 'i-imagine'
            • Home Page
          Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
          « Reply #18 on: November 27, 2009, 04:16:28 pm »

          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]
            « Last Edit: November 27, 2009, 08:05:07 pm by Joe Carver »
            Logged

            Nibbler

            • Guest
            Re: Image Scroll - Based on iTunes - Slideshow for Coppermine 1.5.x
            « Reply #19 on: November 27, 2009, 04:22:23 pm »

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

            Code: [Select]
            return $html . $meta;
            Logged
            Pages: [1] 2 3 4   Go Up
             

            Page created in 0.031 seconds with 19 queries.