Hi,
Anyone here using WordPress to blog in conjunction with storing photos in Piwigo? I am, and one thing I have liked about Flickr in the past is the ease with which one can add photos to WordPress posts: you just paste a URL on it's own line, and it's rendered as a medium-sized image with title and link. For a while I've been wanting to be able to do this with my photos on Piwigo, and so I've made this WordPress plugin:
https://github.com/samwilson/embed-piwigo
I know there is PiwigoPress (and the older PiwigoMedia), but I never need their complexity (to browse the photos I want to include in a blog post, I just use Piwigo directly). My plugin isn't at all a replacement for PiwigoPress, though — it's just a much simpler and smaller thing that does one thing.
Anyway, I thought I'd post it here in case anyone's interested. I've not created a page for it on wordpress.org yet (am intending to add caching for the API calls first), so for now it has to be installed manually (which I reckon people should be doing anyway, so the web server user doesn't have to have access to write PHP files).
Thanks,
Sam.
Last edited by samwilson (2018-08-15 11:20:55)
Offline
Cool. I've got a Wordpress site so I may have a use for this in the future.
Do you have a demo or screenshots?
Offline
Yup! It's now available for download from the WordPress plugin directory:
https://wordpress.org/plugins/embed-piwigo/
And it looks like this in the admin area:
And this when an image is being viewed (although of course it is completely up to the theme as to how it gets displayed):
I'm totally keen for any feedback about how it works, especially about what info should be put in the caption text (at the moment it's just the image title, and the description is the tooltip text, but perhaps the date(s), tags, etc. could be added there, or number of comments, or anything really).
Last edited by samwilson (2018-08-15 11:19:57)
Offline
It looks here nice. I try to test the Plugin the next Days. I write my Travelblog and need my Images from the Gallery.
Offline
Hi,
i installed the Plugin and it looks good. It is possible to change the Preview Size to Thumbnail or so?
Offline
Any news from the last year?
Offline
michaelh99 wrote:
Any news from the last year?
Not much has changed with the plugin. It continues to work. Now that WordPress has moved to a new editor (the block-editor, or Gutenberg), a different system might be in order, but I don't plan on changing this plugin to be anything more fancy than a basic old-fashioned embed. Pull requests are always welcome though!
Offline
It would appear the plugin no longer works? I'm completely unable to embed images from
https://www.dragonseye.com/photos/pictu … /1132-barn
into wordpress 6.2.2
Offline
michaelh99 wrote:
It would appear the plugin no longer works? ...
Are you on PHP 8.x? If so, I have a quick and dirty solution:
In "yourwordpress/wp-content/plugins/piwigopress/piwigopress_utils.php" at line 7 replace:
function PWGP_secure($data) { if ( get_magic_quotes_gpc() ) return urldecode ( trim ( htmlentities ( stripslashes( trim($data) ) , ENT_NOQUOTES ) ) ); else return urldecode ( trim ( htmlentities ( trim($data) , ENT_NOQUOTES ) ) ); }
with:
function PWGP_secure($data) { // if ( get_magic_quotes_gpc() ) return urldecode ( trim ( htmlentities ( stripslashes( trim($data) ) , ENT_NOQUOTES ) ) ); // else return urldecode ( trim ( htmlentities ( trim($data) , ENT_NOQUOTES ) ) ); return urldecode ( trim ( htmlentities ( stripslashes( trim($data) ) , ENT_NOQUOTES ) ) ); // return urldecode ( trim ( htmlentities ( trim($data) , ENT_NOQUOTES ) ) ); }
Hint: the function "get_magic_quotes_gpc() " no longer exists in PHP8. This causes a Fatal Error.
I could insert pictures from "https://www.dragonseye.com/photos/" in a Wordpress 6.2.2 running on PHP 8.1
hth
Offline
I'm actually on 7.4 but will try updating and also try the code changes you posted.
Thank you!
Offline
The code affects only php8 (should work in 7 though).
You should describe in detail, where the problem appears.
You must use the 'old' clasic editor.
If you set 'https://www.dragonseye.com/photos/' as your gallery url, can you see and chose your albums?
Can you load and see the first five pics - you may not be able to draw a picture from here to your dropping zone.
If you can 'get more pics' (10) click it should work.
good luck
Offline
I think I'll probably wait on this. If I have to use the old editor, that's kind of a deal breaker since I have since figured out that while "embedding" doesn't work natively, I can add an image from a URL which does most of what I need.
Offline