Extension talk:AdaptiveThumb/Archive 1

wrong directory name in the zip
> extensions# unzip master.zip

> A new folder $IP/extensions/adaptivethumb will be added. Make sure its owner:group is www-data:www-data or whatever you apache is running as:

Unfortunately the extracted directory is "$IP/extensions/adaptivethumb-master" and this forces "require_once("$IP/extensions/adaptivethumb/adaptivethumb.php");" to break my wiki.

So either change the require_once command or the packaged directory.


 * I think I fixed it, could you try again following the documentation? Thanks! --ThorstenStaerk (talk) 16:41, 28 January 2015 (UTC)
 * Only partially. Your fix only works once. If you would try to reinstall the extension using your method it would result in a subdirectory adaptivethumb-master inside adaptivethumb (Fabian Herschel)

example does not work
key/value-pair size=30% does not work. This has the following reason


 * Your paramer in the extension is called "width" and not "size" ;-)


 * OMG so good to have you. Fixed. --ThorstenStaerk (talk) 16:35, 28 January 2015 (UTC)

patch to support adaptive images in tables and outside
The following patch intruces a parameter "mode" which could be left empty or set to "table". This parameter controls whether the image is embedded in a table or not. --- adaptivethumb.php.orig	2015-01-28 19:19:52.068826899 +0100 +++ adaptivethumb.php	2015-01-28 19:59:18.457788756 +0100 @@ -1,4 +1,4 @@ -?php + @@ -16,23 +16,20 @@   $width=htmlentities($argv['width']); // needn't be numeric, could be "50%" $src=htmlentities($argv['src']); $caption=htmlentities($argv['caption']); + $mode=htmlentities($argv['mode']); if (empty($align)) {$align="right";}; if (empty($width)) {$width="100%";}; - $result=" - -  -"; +  if ($mode == "table") { +    $mytable1=" "; +    $myimage=""; +  } else { +    $mytable1=""; $mytable2=""; +    $myimage=""; +  } +  $result=" $mytable1 $myimage $mytable2 "; $result=preg_replace("/\n/","",$result); return $result; } --FabianHerschel (talk)