EnlargeIt! AJAX GUI for CPG 1.5.x - Page 7 EnlargeIt! AJAX GUI for CPG 1.5.x - Page 7
 

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

EnlargeIt! AJAX GUI for CPG 1.5.x

Started by Timos-Welt, January 05, 2009, 01:19:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Darkness

I found a couple of problems with the popup feature. Firstly, the enlarge button doesn't show no matter what you do because the $USER_DATA['access_level'] variable is empty. By changing it to USER_ACCESS_LEVEL, it works.


        } elseif ($CONFIG['plugin_enlargeit_maximizemethod'] == '0') {
    if ((USER_ID && $USER_DATA['access_level'] == '3') || (!USER_ID && $CONFIG['allow_unlogged_access'] == '3')) {
$meta  .= <<< EOT
        enl_buttonurl[{$loopCounter}] = 'maxpop';
        enl_buttontxt[{$loopCounter}] = '{$lang_plugin_enlargeit['full_size']}';
        enl_buttonoff[{$loopCounter}] = -144;
EOT;
$loopCounter++;
}
        }


The next issue is that the image in the popup is scaled down for some reason so it looks like it's smaller than the intermediate picture. Not sure if this is intended or not but I preferred the popup with scrollbars.

mrdee

Noticed that the Lasthits function was not working if images were being viewed using Enlargeit.  The hits were being recorded under the meta data for each image, but when displaying the "lasthits" page it didn't show the latest "enlargeit" hits.  I fixed it by doing this:

In counter.php find the following line:

$enlcnt_query="UPDATE `".$CONFIG['TABLE_PREFIX']."pictures` SET hits=hits+1 WHERE (pid = '".$enlcnt_pid."')"

...and edit it to look like this:

$enlcnt_query="UPDATE `".$CONFIG['TABLE_PREFIX']."pictures` SET hits=hits+1, lasthit_ip='$raw_ip', mtime=CURRENT_TIMESTAMP WHERE (pid = '".$enlcnt_pid."')";

mrdee

I have edited my install of this plugin to use Flowplayer http://flowplayer.org/ instead of the included players (along with the provided YouTube looking control bar).  This player allows me far more flexibility and plugin options.  I have tested it on FF and IE without problems.  I was considering posting details of the code changes here, but I'd like to know first if others are interested in doing it and also whether Timos is interested in adding it into future releases due to the problem if this doesn't happen.  e.g. if anyone changes their plugin code (like I have done) and it is then not included in future development of the plugin it adds complexity and maintenance burden for future upgrades (I have to document all that I do each time so I can repeat it when a new version comes out).  Also, it means editing the enlargeit_source.js file, compressing it (just an online tool) and then putting the compressed text into the corresponding enlargeit.js file.

Also, I upload all my files (some old flv files and also now higher res MP4 H.264 files) but give them all a .flv extension just to simplify the changes I need to make to this plugin.  If I were doing it properly I would spend more time creating a 3rd player option in the plugin config menu and coding it to recognise the different file types that flash can play.  I've found that the flash plug-in will play files irrespective of whether they are given the corresponding file extension or not (though for H.264 a fairly recent flash plugin is needed, v9 from memory...).

I can't post a link to the site as it is not connected to the public Net.  However, there are many demos at the Flowplayer site.

I'll put another post elsewhere explaining how to do it using just Coppermine (not Enlargeit), but not sure exactly where to put that post yet as it is mostly a mod to just my theme, plus the upload of 3 swf files to the root dir.  Also, their is the issue of crediting the Flowplayer product to consider.

Timos-Welt

It's no problem to include a third player option. Please post what you have, I'll have a look into it.

mrdee

Quote from: Timos-Welt on June 09, 2010, 12:08:48 PM
It's no problem to include a third player option. Please post what you have, I'll have a look into it.

OK, here is what I did, step by step:

* Note:  Doing this uses the section of the plugin dedicated to the RphMedia player rather than adding a 3rd option, and effectively removes the RphMedia player.

1.  Download the player from http://flowplayer.org/.  As a minimum you need to upload the player file plus the controls file, but I also use the provided "Tube" controls file.  I attach the latest version of that one here as the recent update of flowplayer left it a bit tricky to find on their site.  Those files need to be uploaded to enlargeit/images/flash/.

2.  In enlargeit_source.js find this text:

else
  {
    var enl_swfsrc = (enl_isie)? ' id="' + enl_img.id+'swfinner" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" data="'+enl_swfpath+'player.swf?movie='+enl_getlongdesc.split('::')[1]+'&autoload=on&fgcolor=0xFF0000&bgcolor=0x000000&volume=70&autorewind=0"' : '';
    enl_swfsrc += ' width="' + enl_getlongdesc.split('::')[2] + '" height="' + enl_getlongdesc.split('::')[3] + '"><param name="movie" value="'+enl_swfpath+'player.swf?movie='+enl_getlongdesc.split('::')[1]+'&autoload=on&fgcolor=0xFF0000&bgcolor=0x000000&volume=70&autorewind=0"></param><param name="allowFullScreen" value="true"></param>';
    enl_swfsrc += '<embed id="' + enl_img.id+'swfinneremb' + '" src="'+enl_swfpath+'player.swf?movie='+enl_getlongdesc.split('::')[1]+'&autoload=on&fgcolor=0xFF0000&bgcolor=0x000000&volume=70&autorewind=0" type="application/x-shockwave-flash" width="' + enl_getlongdesc.split('::')[2] + '" allowfullscreen="true" height="' + enl_getlongdesc.split('::')[3] + '"></embed></object>';
  }


and replace it with:

else
  {
    var enl_swfsrc = (enl_isie)? 'classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' width=\'' + enl_getlongdesc.split('::')[2] + '\' height=\'' + enl_getlongdesc.split('::')[3] + '\' id=\'single2\' name=\'single2\'' : '';
    enl_swfsrc += ' ><param name=\'movie\' value=\''+enl_swfpath+'flowplayer-3.2.2.swf\'><param name=\'allowFullScreen\' value=\'true\'><param name=\'allowscriptaccess\' value=\'always\'><param name=\'flashvars\' value=\'config={\"clip\":{\"url\":\"'+enl_getlongdesc.split('::')[1]+'\",\"autoPlay\":false,\"autoBuffering\":true,\"scaling\":\"fit\"},\"plugins\":{\"controls\":{\"url\": \"'+enl_swfpath+'flowplayer.controls-tube-3.2.1.swf\",\"height\":\"20\",\"timeColor\":\"#D00000\",\"durationColor\":\"#FFFFFF\",\"timeBgColor\":\"#000000\"}},\"canvas\":{\"backgroundColor\":\"#000000\",\"backgroundGradient\":\"[0.1, 0]\"}}\'>';
    enl_swfsrc += '<embed type="application/x-shockwave-flash" id="single2" name="single2" src="'+enl_swfpath+'flowplayer-3.2.2.swf" width="' + enl_getlongdesc.split('::')[2] + '" height="' + enl_getlongdesc.split('::')[3] + '" allowscriptaccess="always" allowfullscreen="true" flashvars=\'config={\"clip\":{\"url\":\"'+enl_getlongdesc.split('::')[1]+'\",\"autoPlay\":false,\"autoBuffering\":true,\"scaling\":\"fit\"},\"plugins\":{\"controls\":{\"url\": \"'+enl_swfpath+'flowplayer.controls-tube-3.2.1.swf\",\"height\":\"20\",\"timeColor\":\"#D00000\",\"durationColor\":\"#FFFFFF\",\"timeBgColor\":\"#000000\"}},\"canvas\":{\"backgroundColor\":\"#000000\",\"backgroundGradient\":\"[0.1, 0]\"}}\'/></object>';
  }


This leaves some of the many options "hard coded" and a gold plated solution would be to have them all configurable via the plugin interface (but I didn't need that so didn't do it).

3. Grab the newly saved js text in the source file (all of the file except the very top part, as indicated in the comments), paste it into a js compress tool and then paste the output text from that tool into the enlargeit.js file.

4. Edit the CASE 2 section of codebase.php to this:

    // CASE 2: flash or movie
    elseif (in_array($enl_filetyplower, $movie_array) == TRUE) {
      $pid = $thumb['pid'];
     
      // For flash or movie files we need some more data from the database
      $result = cpg_db_query("SELECT aid from {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' LIMIT 1");
      $row = mysql_fetch_array($result);
      $album = $row['aid'];
      $pic_data = get_pic_data($album, $pic_count, $album_name, -1, -1, false);
      for($pos = 0; $pic_data[$pos]['pid'] != $pid && $pos < $pic_count; $pos++); {
          $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false);
      }
      $CURRENT_PIC_DATA = $pic_data[0];
      if ($CURRENT_PIC_DATA['pwidth'] == 0) {
          $CURRENT_PIC_DATA['pwidth'] = 500;
      }
      if ($CURRENT_PIC_DATA['pheight'] == 0) {
          $CURRENT_PIC_DATA['pheight'] = 410;
      }

//the next single line corrects the viewer size in Flowplayer allowing for use of a player control panel set at 20px high
      $CURRENT_PIC_DATA['pheight'] = $CURRENT_PIC_DATA['pheight'] + 20;

      if ($enl_filetyplower == 'swf') {
      $enl_newthumb  = '<img src="images/thumbs/thumb_swf.png" class="enlargeimg" width="'.$thumb['pwidth'].'" height="'.$thumb['pheight'].'" ';
      } else {
      // $enl_newthumb  = '<img src="images/thumbs/thumb_movie.png" class="enlargeimg" width="'.$thumb['pwidth'].'" height="'.$thumb['pheight'].'" ';
      $mrdeefilename = $thumb['filename'];
      $mrdeethumext = ".jpg";
      $mrdeefilename = substr($mrdeefilename, 0, (strlen ($mrdeefilename)) - (strlen (strrchr($mrdeefilename,'.'))));
      $enl_newthumb  = '<img src="' . $CONFIG['fullpath'] . $thumb['filepath'] . $CONFIG['thumb_pfx'] . $mrdeefilename . $mrdeethumext . '" ';
      $enl_newthumb .= 'class="enlargeimg" ';
      if (($CONFIG['thumb_use'] == 'any' && $thumb['pwidth'] >= $thumb['pheight']) || $CONFIG['thumb_use'] == 'wd') {
        $enl_thumbheight = round($thumb['pheight'] / $thumb['pwidth'] * $CONFIG['thumb_width']);
        $enl_newthumb  .= 'width="' . $CONFIG['thumb_width'] . '" height="' . $enl_thumbheight . '" ';
       } elseif (($CONFIG['thumb_use'] == 'any' && $thumb['pwidth'] < $thumb['pheight']) || $CONFIG['thumb_use'] == 'ht') {
        $enl_thumbwidth = round($thumb['pwidth'] / $thumb['pheight'] * $CONFIG['thumb_width']);
        $enl_newthumb  .= 'width="' . $enl_thumbwidth . '" height="' . $CONFIG['thumb_width'] . '" ';
      }
      $enl_newthumb .= 'border="0" onclick="enlarge(this);" ';
      if ($enl_filetyplower == 'swf') {
      $enl_newthumb .= 'longdesc="swf::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
      } elseif ($enl_filetyplower == 'flv') {
      if ($CONFIG['plugin_enlargeit_flvplayer'] == '0') {
          $enl_newthumb .= 'longdesc="fl2::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
      } else {
          $enl_newthumb .= 'longdesc="flv::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
      }
      } elseif ($enl_filetyplower == 'dvx') {
      $enl_newthumb .= 'longdesc="dvx::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
      }
      $enl_newthumb .= 'name="'.$thumb['pid'].'" alt="" title="'.$thumb['title'].'" />';
      $more_params = array(
       '{LINK_ONCLICK}'  => 'onclick="return false;"',
       '{THUMB}'  => $enl_newthumb,
      );
    }
    }


5.  When I upload a movie I do it via the batch add tool.  I use the thumb file which comes from my camera, after renaming it giving it the thum prefix as per the setup of the coppermine config.  The name after the prefix needs to match the name given to the uploaded movie file.  The batch add process then links the thum to the movie automatically.

6.  The final step is to edit the movie file dimensions (width/height) in the properties of the uploaded image.  I tend to compress my movies in H.264 but leave them at full 1080P in terms of physical pixel dimensions.  This makes them look very good when you play them back in the player at full screen.  However, I set the properties in the image to initially play them at 881x496, which makes for a popup box in enlargeit which suits the majority of screen resolutions.

The last two steps are needed irrespective of using Enlargeit.

commonplace

I'm having an issue with this plugin. On my main/front page, when I click on "User Galleries", it shows the two users that have uploaded pictures (myself and my sister), but the image shows up as... I'm not sure what to call it. :)  But it looks like maybe a symbol for a movie/video? When I hover over it, the mouse turns into the "EnlargeIt" plus icon, almost like I could enlarge the picture, but of course I can't. And I'm not able to click the image to go into the user's gallery; I have to click their name. It's not a big deal but my end users are not that computer savvy and I'm sure this will confuse them.

My gallery is here:  http://photos.envail.com/

User name: test
Password: test123

You should be able to see what I mean without even logging in, though -- it behaves the same for guests as it does for registered users and admins. Let me know if you need any more information, or if anyone knows how to fix it. Disabling EnlargeIt! "fixes" it but I'm hoping to keep it enabled AND have this work. :)  Anything else I can do to help, please let me know! I've attached an image of the picture I'm seeing when I go to the User Galleries. When EnlargeIt! is disabled, it shows a random image from that user's albums and I'm able to click on the image in order to enter that user.

/Kevin

mrdee

If you are running a development thread for this plugin then please move these to a "bugs list" type of thread

In v1.15 for CPG1.5 I have found a small bug in info.php

if ($CURRENT_PIC_DATA['keywords'] != "") {
        $info[$lang_picinfo['Keywords']] = '<span class="alblink">' . preg_replace("/(\S+)/", "<a href=\"thumbnails.php?album=search&amp;search=\\1\">\\1</a>" , $CURRENT_PIC_DATA['keywords']) . '</span>';
    }


probably should be:

if ($CURRENT_PIC_DATA['keywords'] != "") {
        $info[$lang_common['keywords']] = '<span class="alblink">' . preg_replace("/(\S+)/", "<a href=\"thumbnails.php?album=search&amp;search=\\1\">\\1</a>" , $CURRENT_PIC_DATA['keywords']) . '</span>';
    }


------------
Clickable Keywords in the Info Page

When using keywords which have spaces in them, with the keywords separated by ";" the Info Page displays them as individual clickable words rather than allowing keywords to include a space (and be one single clickable link).  Make sense?  I didn't find out how to fix this yet.

mrdee

Quote from: mrdee on August 10, 2010, 02:44:05 PM
Clickable Keywords in the Info Page

When using keywords which have spaces in them, with the keywords separated by ";" the Info Page displays them as individual clickable words rather than allowing keywords to include a space (and be one single clickable link).  Make sense?  I didn't find out how to fix this yet.

Here is the fix for the one above:

In info.php replace:

if ($CURRENT_PIC_DATA['keywords'] != "") {
        $info[$lang_common['keywords']] = '<span class="alblink">' . preg_replace("/(\S+)/", "<a href=\"thumbnails.php?album=search&amp;search=\\1\">\\1</a>" , $CURRENT_PIC_DATA['keywords']) . '</span>';
    }


with:

if ($CURRENT_PIC_DATA['keywords'] != '') {
        if ($CONFIG['keyword_separator'] == ' ') {
            $info[$lang_common['keywords']] = '<span class="alblink">'
                . preg_replace("/([^{$CONFIG['keyword_separator']}]+)/"
                        , '<a href="thumbnails.php?album=search&amp;keywords=on&amp;search=$1">$1</a>'
                        , $CURRENT_PIC_DATA['keywords'])
                . '</span>';
        } else {
            $keyword_links = '';
            foreach (explode($CONFIG['keyword_separator'], $CURRENT_PIC_DATA['keywords']) as $keyword) {
                $keyword_links .= ($keyword_links ? ' '.$CONFIG['keyword_separator'].' ' : '')
                        . '<a href="thumbnails.php?album=search&amp;keywords=on&amp;search='
                        . str_replace(' ', '+', $keyword)
                        . '">' . $keyword . '</a>';
            }
            $info[$lang_common['keywords']] = '<span class="alblink">'
                . $keyword_links
                . '</span>';
        }
        }


this then takes into account different keyword separators (copied from displayimage.php in CPG1.5.8)

mrdee

Hi Timos

Please do you know if there is there a way that I can either:

A.  Retain the plus/minus mouse cursor and still get the "alt" tooltip popup box to appear on thumbnails?

or

B.  Switch off the plus/minus mouse cursor and still benefit from the "alt" tooltip popup on thumbnails?

This functionality is standard for the thumbnails pages when Enlargeit is not installed and I'd would like the best of both worlds.  I notice that from source pages that the "alt" data is still being loaded, but the tooltip function is not working.

Thanks in advance.

toxichotspot

Is there a way to add a facebook share button in a way similar to the download button?

www.ToxicHotspot.com

Shane

Is there any way to include the photo description below the image in the same way that the photo title is included above?

site:  http://shaneandpamela.com/cpg

Ivo007

First of all great plugin!

I recently upgraded the existing 1.4.22 galley to a test 1.5.8 in order to get familiar with the new CPG version and check out the plugins in the new version. When I installed EnlargeIt! I noticed a few things:

1. In the Configuration screen, the display of the buttons Vote, Comments, E-Card cannot be configured. Is there a plan to add that functionality again?
2. When I click on the Last updated albums the behaviour is not the same. Where in the 1.4.x version clicking on a last updated album would open the album thumbnails, the 1.5.x pluging displays the thumbnail picture of the last updated album. Is that a bug or wanted behaviour? A lot of my users want to see the whole album and not just the thumbnail picture of the last updated album, therefore if its wanted behaviour can you make it configurable?

1.4.22 gallery
http://www.vikyandivo.com/gallery

1.5.8 test gallery
http://www.vikyandivo.com/cpg15x

Keep the good work going!
Tnx
Ivo

vibe7

Hi
Currently I am using Enlargeit 1.15 plugin , and my hosting provider complain that i am using 100% of the CPU and ask to remove the plugin,, does any one have newer version that fix the high CPU issue.
thanks

TeknoSounds

Luckily haven't had the CPU issue...mines sitting at 0% (able to watch it directly since I have a dedicated server) but maybe I don't get as many hits as you...?

I second the issue with the comments button, where did it go??
Also would be awesome if could get the comments to show to the side of the picture when blowing it up? I feel the comments function is mostly overlooked by my users that visit since they currently have to click the info button to get to the intermediate picture.

Also I installed a plugin for sharing a picture on facebook, could you set an option to detect this and put a image link up top to do the same?

holyworld

Thanks a lot for this great plug-in, works great & love it!

Question:

Currently it works only with youtube files, where the thumbnail pic starts with "youtube_" (if I am not mistaken).

There is a plug-in called "remote videos" which works with "xxx.youtube" text files and normal labeled "thumb_" thumbnail pics.

After several attempts to change the code myself and failed... I was wondering if its planed to add support for youtube videos as well.

Thanks a lot!

phill104

Timo,

Any idea why the copy to clipboard buttons do not appear in the latest FF and IE9 on the Bb page - http://www.windsurf.me.uk/cpg133/thumbnails.php?album=47
It is a mistake to think you can solve any major problems just with potatoes.

FBleu

Hello  :)

There are big differences between the file lang english and german,
I would do the update file French,
My translation must be done from the English or German file ?
or a mix of the two files ?

Cordially Franck

phill104

Please always base translations on the English file.
It is a mistake to think you can solve any major problems just with potatoes.

shortmort37

Hi Timos!

Quote from: Timos-Welt on June 09, 2010, 12:08:48 PM
It's no problem to include a third player option. Please post what you have, I'll have a look into it.

Have you had a chance to review FlowPlayer?  Also, any comments on this?

Quote from: Shane on September 12, 2010, 01:16:14 AM
Is there any way to include the photo description below the image in the same way that the photo title is included above?

site:  http://shaneandpamela.com/cpg

I, too, would like to include descriptions.  NFLightbox provides descriptions, but skips over video in albums; EnlargeIt! does not skip, but lacks descriptions.  I would love to have the best of both worlds!

adTHANKSvance,
Dan

fmk

Hi Timos,

I found a small conflict between EnlargeIT's settings and MiniCMS.

"MiniCMS plugin for cpg1.5.x : http://forum.coppermine-gallery.net/index.php/topic,68455.msg341717.html#msg341717
FMK

Love doesn't stop by my door, I am always infatuated with new things.