SF.net SVN: phpwiki:[10771] trunk/lib/plugin/PhotoAlbum.php

vargenau--- via phpwiki-checkins <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 10771
          http://sourceforge.net/p/phpwiki/code/10771
Author:   vargenau
Date:     2021-12-10 10:02:15 +0000 (Fri, 10 Dec 2021)
Log Message:
-----------
PhotoAlbum plugin: fix width with px

Modified Paths:
--------------
    trunk/lib/plugin/PhotoAlbum.php

Modified: trunk/lib/plugin/PhotoAlbum.php
===================================================================
--- trunk/lib/plugin/PhotoAlbum.php	2021-12-10 09:59:39 UTC (rev 10770)
+++ trunk/lib/plugin/PhotoAlbum.php	2021-12-10 10:02:15 UTC (rev 10771)
@@ -256,9 +256,11 @@
             $newwidth = $this->newSize($size[0], $width);
             if ($width != 'auto' && $newwidth > 0) {
                 if (is_numeric($newwidth)) {
-                    $newwidth = $newwidth.'px';
+                    $newwidthpx = $newwidth.'px';
+                } else {
+                    $newwidthpx = $newwidth;
                 }
-                $params = array_merge($params, array("style" => 'width: '.$newwidth));
+                $params = array_merge($params, array("style" => 'width: '.$newwidthpx));
             }
             if (($mode == 'thumbs' || $mode == 'tiles' || $mode == 'list')) {
                 if (!empty($size[0])) {
@@ -642,9 +644,13 @@
         } else {
             $src = '/'.$params['src'];
         }
+        $width = $params['width'];
+        if (is_numeric($width)) {
+            $width = $width.'px';
+        }
         if (array_key_exists('width', $params)) {
             return HTML::img(array('src' => $src,
-                                   'style' => 'width: '.$params['width'],
+                                   'style' => 'width: '.$width,
                                    'alt' => $params['alt']));
         } else {
             return HTML::img(array('src' => $src,

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.