fanningert / kirbycms-extension-image

KirbyCMS Extension - Image Extended
http://www.fanninger.at/thomas/works/kirbycms-extension-image
GNU General Public License v3.0
28 stars 2 forks source link

Can't get this working #7

Closed xypaul closed 9 years ago

xypaul commented 9 years ago

How do I install this plugin? Can't get it working :/

fanningert commented 9 years ago

Simple copy the site directory into the installation directory of getkirby. After that it should work. But the current version0.7 has some problem with php lower then version 5.5.

bovisp commented 9 years ago

Yeah, I'm running PHP 5.4 and this isn't working for me either. A huge shame as it's such a lovely plugin!

xypaul commented 9 years ago

@fanningert yeah that's what I did. I am running PHP 5.6.7

fanningert commented 9 years ago

@bovisp Ok, I will post a new version. In some hours, you will have a working version. (0.7.1). The main problem on PHP 5.4 is that the empty method don't support method output as variable. Example:

if(!empty($tag->target()))

need to write

$file_alt = $file->alt();
if(!empty($file_alt))

@xypaul When I am at home (Sunday afternoon), I will test it with my Test webserver and ArchLinux. The current php version on ArchLinux is 5.6.8. At the mean time, can you post a error log or other information for analysis!?

fanningert commented 9 years ago

@bovisp Please test the new master repository version. I pushed some correction for PHP 5.4.

xypaul commented 9 years ago

@fanningert thanks for investigating this so quickly :)

I will push an error log once I have access to my computer.

xypaul commented 9 years ago

@fanningert okay so I have investigated this problem a little further.

I don't get any errors, and my image tag remains having the same functionality as the default kirby image tag. I am hundred percent sure though, that I have added all the files just as you specified. I have also tried (_image:) with no success.

Any ideas?

fanningert commented 9 years ago

@xypaul Have switched on the debug flag of kirby in the config.php (http://getkirby.com/blog/quicktip-debug). The (_image:) is not a supported tag for this extension. It is only a workaround to display the tag logic.

bovisp commented 9 years ago

@fanningert I will give this a try sometime today. currently I am in bed sick as a dog!

bovisp commented 9 years ago

OK. I uploaded the 0.71 update for php5.4 and this is what I got:

Fatal error: Can't use method return value in write context in /path-to-kirby/site/tags/image.php on line 43

Any idea what could be causing this?

fanningert commented 9 years ago

Replace the line 43 of the file /path-to-kirby/site/tags/image.php

if(!empty($tag->target()))

need to write

$file_alt = $file->alt();
if(!empty($file_alt))

I forgot to check the tag file. I will update it.

bovisp commented 9 years ago

OK. No more fatal error, but now I get this:

Parse error: syntax error, unexpected '=', expecting ')' in /path-to-kirby/tags/image.php on line 84
fanningert commented 9 years ago

@bovisp sorry for the try and error session. Currently my focus is on the next version (Test landscape is PHP 5.4 and NGINX). Now to your problem. Replace the foreach at the error position with following code.

From

    foreach(kirbytext::$tags['image_gallery']['attr'] as $name) {
      if( !empty($value = $tag->attr($name)) )
        $image_options[$name] = $value;
    }

to

    foreach(kirbytext::$tags['image_gallery']['attr'] as $name) {
      $value = $tag->attr($name);
      if( !empty($value) )
        $image_options[$name] = $value;
    }
bovisp commented 9 years ago

@fanningert problem solved. Thanks again for all of your help and support!

fanningert commented 9 years ago

@bovisp No Problem. @xypaul Have you now any problem with the plugin? OR can I close this issue?

fanningert commented 9 years ago

@xypaul I close it.

xypaul commented 9 years ago

@fanningert yeah just tried with all the new code you updated... but yeah can't get it to work. so this is my folder structure:

screenshot 2015-05-10 18 41 23

fanningert commented 9 years ago

@xypaul It looks like correct. Did you using the image or the imageext kirbytag? When you qould like to use the image tag with this plugin, you need to activate the support with the config parameter kirby.extension.imageext.support.tag.image.

But this lines in you site/config/config.php

c::set('kirby.extension.imageext.support.tag.image', true);
c::set('kirby.extension.imageext.support.tag.image_gallery', true);

The kirby.extension.imageext.support.tag.image_gallery config parameter activate the support for image_gallery tag.

Per default after the installation, only imageext and imageext_gallery are active.

xypaul commented 9 years ago

If I use (imageext:) or change the settings in site/config/config.php as specified above my kirbytext doesn't get converted from markdown into html anymore.

I am thinking this might be because I am using Kirby 2.1 beta. What version of Kirby are you using?

fanningert commented 9 years ago

@xypaul I test it with the current develop branch and my productive site run also (currently) with the develop branch. Later I will switch back to the master branch on my productive site. (I use currently the develop branch, because the master branch has some bugs with the html and bricks classes) Thanks for the information about your used version. I will test it with the 2.1 beta version.

fanningert commented 9 years ago

Ok, I test it with the version 2.1 beta and it is working with the imageext and image tag. Add following line to the config file. (Before this, please update to the current version of webhelper and this plugin)

c::set('kirby.extension.imageext.debug', true);

This will change the output to a debug view and display the image array from my backend. When this not working, then the plugin is not loaded for the image tag.

In this case, you can send me your installation (without your content). So I can debug the code and find the problem. Please don't forget to remove your licence code from the config file.

xypaul commented 9 years ago

@fanningert yeah still no success :/ I've emailed my files to your webmaster email address I found on your website :+1:

fanningert commented 9 years ago

@xypaul Ok, I get it to work.

Rename the plugins directories from kirbycms-extension-image-master to kirbycms-extension-image and kirbycms-extension-webhelper-master to kirbycms-extension-webhelper. But I also found there could be a problem with the other plugins. The parameter width and so on will not supplied to the plugin. I will check it.

fanningert commented 9 years ago

@xypaul Ok I found the second problem. You renamed the thumbs directory to thumb. But kirby use in default configuration the thumbs directory for the thumbs. Just rename it to thumbs and it is working.

But when you would like to use the directory thumb as thumb directory, but the site.php file in the root directory of your kirby installation and add following code in to the site.php file.

<?php 

$kirby = kirby();

//Changing the thumbs folder
$kirby->roots->thumbs = $kirby->roots()->index() . DS . 'thumb';
$kirby->urls->thumbs  = $kirby->urls()->index() . '/thumb';
xypaul commented 9 years ago

@fanningert thanks so much, I've got it working now... If you want a copy of any of my themes as a thank you please email me :)

fanningert commented 9 years ago

@xypaul Thanks, but I really lucky with my current theme. But I saw, you are from Australia? I am in September (the complete month) in Australia (East coast). Can you tell me some points, what I should visit. (You can send it at my e-mail address) I am with a caravan on the road at this vacation. Start is Cairns and the end point is Sydney.

xypaul commented 9 years ago

@fanningert yeah I do live in Australia - Brisbane to be specific. Will send you an email :+1: But yeah we should totally meet up haha :smile:

rmeister commented 8 years ago

@fanningert Hey, I can't get this working as well. Folders and config.php seem correct to me. The behaviour is the same as for xypaul: With activated tags, files do not get converted to HTML. Though, if debug mode is active an array will be displayed.

I'm using Kirby 2.2.3 and PHP 5.5.9 (with the built-in server)

Edit: nvm, forgot to install php5-gd