A partial archive of meta.discourse.org as of Tuesday July 18, 2017.

Image Gallery Plugin

crob611

I took a stab at creating a plugin that can organize a bunch of images into somewhat of a gallery. See a screenshot of it in action here: Screenshot here:

Imgur

This doesn't handle displaying images in lightboxes, instead it wraps the existing Discourse lightboxing that occurs on images.

You can customize the size the images get scaled down to.

Usage is like this:

[image-gallery]
 <img src="whatever" />
 <img src="whatever" />
[/image-gallery]

Repo is here: https://github.com/crob611/discourse-image-gallery

michaeld

Nice! Added to the list!

Mahamsamatan

@crob611, cool plugin, can you provide a link where I could see it in action?

crob611

@Mahamsamatan Unfortunately, I don't have it running anywhere. Sorry.

stealthii

There is a minor detail that I would like to see fixed - on any forum you cannot quote the tags to give rise to a description, for example:

On my forum, a line containing code quoted [image-gallery] ... [/image-gallery] will process these words/tags wherever they are written, unlike the [spoiler] plugin.

codexia

Does this work on the latest version of Discourse? I tried to install it on my development version of Discourse, I can't get it to work. When the tags are used on a new post, I can't save it as it gives me "Internal Server Error 500". I will include the production.log error message as soon as possible as I can get to my devbox.

EDIT: added error message from production.log:

Started POST "/posts" for "IP-ADDRESS" at 2015-01-13 21:06:42 +0000
Processing by PostsController#create as */*
  Parameters: {"raw"=>"[image-gallery]\n<img src=\"/uploads/default/17/02c9eeb0ca7f57e9.png\">\n<img src=\"/uploads/default/10/d2d06cb573f66f29.jpg\">\n<img src=\"/uploads/default/18/6033609447a3dc8c.jpg\">\n[/image-gallery]", "title"=>"testiaaanaskffgbkvb", "is_warning"=>"false", "archetype"=>"regular"}
Completed 500 Internal Server Error in 81ms

PrettyText::JavaScriptError (Object [/image-gallery] has no method 'exec'):
  lib/pretty_text.rb:165:in `block in markdown'
  lib/pretty_text.rb:330:in `block in protect'
  lib/pretty_text.rb:328:in `synchronize'
  lib/pretty_text.rb:328:in `protect'
  lib/pretty_text.rb:146:in `markdown'
  lib/pretty_text.rb:198:in `cook'
  app/models/post_analyzer.rb:12:in `cook'
  app/models/post_analyzer.rb:104:in `cooked_document'
  app/models/post_analyzer.rb:49:in `raw_mentions'
  app/models/post.rb:154:in `block (2 levels) in <class:Post>'
  lib/validators/post_validator.rb:40:in `max_mention_validator'
  lib/validators/post_validator.rb:10:in `validate'
  lib/post_creator.rb:258:in `save_post'
  lib/post_creator.rb:81:in `block in create'
  lib/post_creator.rb:140:in `call'
  lib/post_creator.rb:140:in `block in transaction'
  lib/post_creator.rb:138:in `transaction'
  lib/post_creator.rb:76:in `create'
  app/controllers/posts_controller.rb:80:in `create_post'
  app/controllers/posts_controller.rb:65:in `create'
  lib/middleware/anonymous_cache.rb:119:in `call'
  config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
  config/initializers/silence_logger.rb:26:in `call'
  lib/middleware/unicorn_oobgc.rb:95:in `process_client'
OvermindDL1

Same thing, dead I guess?

Are old no-longer-working plugins going to be trimmed from this section to a 'old' section or so?

Mittineague

I'd too would be interested in this.
Got a github link you can post or M me? wink

sam

Reply on any broken plugins, if author has abandoned we will close or move out of plugin category

Fabio_Machado_de_Oli

It's broken for me too, and last commit was feb, 2014

sam

np, moved to broken plugins for now. @crob611 let me know if you fix it.

crob611

Sorry all for not keeping this updated. I'll be glad to get it updated when I get a chance, or merge any pull requests if someone else wants to fix it. Would love to get back into making some other Discourse plugins.

chasovoy85

i fix
https://github.com/chasovoy85/discourse-image-gallery/tree/chasovoy85-patch-1

erlend_sh

Nice. You should make a pull request to @crob611's original repo.

chasovoy85

I'm a novice in GitHub... but I'll try

erlend_sh

Just click here :wink:

chasovoy85

Thanks. Done :slight_smile:

erlend_sh

Great. If you don't hear from @crob611 in a week or so we can point to your fork instead of the defunct repo and move this out of #plugin:broken-plugin, provided someone else confirm that it's working!

chasovoy85

Cool. Thanks! :grinning:

crob611

I can merge it in, but I'm not setup to test to make sure it's working or anything. I'd also be glad to transfer the repo if someone else would like to maintain it going forward. @chasovoy85?