disabling comments on gallery and folder but not photos

HomeForumsInstallationdisabling comments on gallery and folder but not photos

This topic has 1 voice, contains 10 replies, and was last updated by  Developer 121 days ago.

Viewing 11 posts - 1 through 11 (of 11 total)
Author Posts
Author Posts
10 January 2012 at 21:24 #4894

Brian

I would like to only allow comments on the individual photos themselves, not the gallery or folders. Is there a way to do this?

Thank you,
brian

10 January 2012 at 23:54 #4897

Marcel

Yes that is possible.
Add this to the top of the comment-template just above <div id="comments">

global $lg_gallery;
if ( $lg_gallery->is_gallery() ) {
  if ( ! $lg_gallery->is_image( $lg_gallery->file ) ) return;
}

and don’t forget to put the code between <?php ?> tags

11 January 2012 at 17:15 #4947

Brian

Thanks, I will give this a try! While I have you here, the last thing I’ve been banging my head over is a frontend uploader. I know you are working on one, but I need to launch this private blog soon. Basically, I would like my users to be able to upload a photo into a folder and passing their username and description into a field. Can you give me any advice on where I might start?

Thanks!

11 January 2012 at 20:18 #4954

Marcel

Have you searched in the WordPress plugin repository for frontend uploaders?
Maybe you could tweak a plugin to work for LG

13 January 2012 at 16:35 #5008

Brian

Man, I’m really becoming a pest! ;) I finally got around to trying to hide the comments with your suggestion above, but there is no <div id="comments"> in the /wp-includes/comment-template.php I tried putting your code in anyway and it broke stuff. Any other suggestions?

Sorry man… I really appreciate all of your help!

Thanks,
-Brian

13 January 2012 at 21:17 #5014

Marcel

try hacking the comments_template.php in lazyest-gallery/inc/

14 January 2012 at 0:47 #5018

Brian

MAN! You’re awesome, that did it, but I’m getting an error message at the bottom of the page.

Parse error: syntax error, unexpected T_IF, expecting ‘,’ or ‘;’

It says it’s on line 20, which is the bit about

if ( $lg_gallery->is_gallery() ) {

Any thoughts?

Thanks again for ALL of your help! Do you have a donation page? I’ll chip in!
-Brian

14 January 2012 at 0:51 #5019

Brian

Also, that code has turned off comments on the photos themselves too! Can I get those back or is it an all or nothing thing?

Thanks man,
Brian

14 January 2012 at 12:23 #5026

Marcel

No it is not an all or nothing thing. I will try to find out why it doesn’t work.

17 January 2012 at 8:42 #5041

Marcel

There was a missing semicolon in the code example. I have corrected it. Please copy the code from above. This code will hide the comments form altogether.

17 January 2012 at 10:34 #5044

Developer

please read also: http://brimosoft.nl/2012/01/17/how-to-show-comments-on-slides-only/

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘disabling comments on gallery and folder but not photos’ is closed to new replies.

RSS RSS feed for this Topic