Recent Topics

[2.x] B2evo 4.1.0-Beta Comment Attachments

Started by on Sep 10, 2011 – Contents updated: Sep 10, 2011

Sep 10, 2011 09:31    

My b2evolution Version: 2.x

Hi, great work on 4.1 guys.

I have a question, where can we set/restrict what file extensions are allowed for comment attachments?

Then for images, can we set a maximum dimension for images attached in the comments?

Sep 10, 2011 09:36

Ok, answering my own questions,

Dashboard > Blog > Files > Settings > File types

Now can we restrict which file types are allowed on per user groups?

Sep 10, 2011 09:41

Ok, same place:

Allow upload:
Allow anyone (including anonymous users) to upload/rename files of this type
Allow only registered users to upload/rename files of this type
Allow only admins to upload/rename files of this type

guess we can't limit it yet according to groups and user levels? uhmm...

Sep 10, 2011 09:49

It would be nice if we could allow attachment uploads on a per post basis, like with allowing comments on per post basis.

Sep 10, 2011 14:35

There should be an option to allow attachments to blog members according to their FM perms, then you can select members and what file perms they have in particular blog.

Moved to feature requests

Sep 10, 2011 17:13

and resizing images for comments? I noticed the image size specifications are defined in _comment.class.php, can I override it in _item.comment.inc.php somehow?

Another thing, once you a user attached a file and preview it, there is no way for the user to edit/remove the attachement.

Then I also experience some issues on a regular interval where when I attach a file and preview it I get the message:

Incorrect crumb received! [comment]

Your request was stopped for security reasons.

Have you waited more than 120 minutes before submitting your request?

Sep 10, 2011 21:55

It's on the todo list to allow removing images before submitting a comment. will be added soon.

Maximum size should be handled by automatically resizing anything too large.

Display size can be controlled in the skin code.

Sep 11, 2011 04:30

Could you give me some sample code how to control comment image size via the skin?

I am trying to update my skin to allow it, but get the error: "Output format [array] is not supported"

						
$params = array_merge( array(
					'before_image'        => '<div class="image_block">',
					'before_image_legend' => '<div class="image_legend">',
					'after_image_legend'  => '</div>',
					'after_image'         => '</div>',
					//'image_size'          => 'fit-400x320',
					'image_size'          => 'crop-80x80',

				), $params );

$Comment->content(); // <-- Display the comment content and images if any

Sep 11, 2011 04:39

Try this

$Comment->content( 'htmlbody', false, true, $params );

Sep 11, 2011 05:01

Thanks Sam, it worked!! Great Thanks!!! :D

Are you planning to allow to limit the amount attachments for comments so if I want to allow only 1 image attachment per comment, I can do so through a setting? If so, it would be cool if this can be done on a per post basis.

Know you guys are working hard already. I am recommending B2evo to all my clients and the feedback I'm getting is great, they like it allot more than Wordpress. Thanks again.

Sep 11, 2011 05:35

No problem

It's actually a good idea to limit attachments. Say one comment may have up to X files attached and the total number of files per post should not exceed Y

Sep 11, 2011 06:20

...also, you wouldn't want a user to to attach say 10 files and then other users can't attach anything because 1 user used up the quota.

You see, I am using B2evo for photography, so I am thinking of using this feature (comment attachments) to allow users to upload their own pictures in posts that permits it, but I would like to limit the amount of Images they can add in a comment so that other users can add also without a specific user hogging the space.

I like that images contains an <a> link, this way when I specify the image size in the skin it will display a smaller size image(thumb), when the user click the image it can be opened in Lightbox/colorbox frame in a bigger size. The only thing is that the core code doesn't cater to add a class to the <a> link through some params as with specifying the image size. I can hack the file, but it would be better if it wasn't necessary and could be done through the skin.class.

I have included Javascript to look for image extensions and this opens <a> link images in the lightbox regardless if it has a class or not (think you included this also in 4.1 via Colorbox), but assigning a class to the a link doesn't just call for it to be opened in the lightbox it also also restrict rightclicking for that class.

is this making any sense?

Sep 11, 2011 07:49

but assigning a class to the a link doesn't just call for it to be opened in the lightbox it also also restrict rightclicking for that class.

If that's the only reason to have a class, you can do this with proper selectors instead. Add this to display_init() in _skin.class.php

add_js_headline('jQuery(document).ready(function() {
	jQuery(".bComment div.image_block > a").bind("contextmenu", function(e) {
		e.preventDefault();
		alert("Go ahead and view page source if you want to steal this picture ;)");
	});
})');

Sep 12, 2011 21:54

We'll add a lightbox class to comment images in the next release.

I do agree with limiting the number of attachments, at least in the blog settings.

I am not sure why you'd want that on a per post basis. Can you give me a real life example?

PS: I'm always interested in this: what's the one most important thing you/your clients like better in b2evo than in other blog platforms?

Sep 17, 2011 14:16

Okay, say I have a category where visitors can upload their own images for critique, competitions or something likewise, then I would like to limit it to one image per comment so that the comments aren't over run with images in a single comment from one user.

I guess it permits control. If I can control it on a per post basis then I will be able to allow visitors to add more in another post comment if its inline with the post or what I intend to achieve.

It has plenty of applications that it can be used for if it can be permitted per post basis. I know enebling this makes your work allot more challenging, perhaps you can look into it as you develop B2evo.

@fplanque wow, there are plenty of things, but to start with it allows multiple blogs and each can have a different theme. Sounds simple, but once you start thinking out of the box, this is very powerful, something wordpress don't get close to.

Sep 29, 2011 01:26

We will have a setting for max # of images per comment in a future release.

Oct 16, 2011 16:42

Cool, my clients like that B2evolution supports multiple blogs (which can be linked) and that each blog can have a different skin. This in its own right makes B2evolution the most powerful blog software (that I know off), Having the ability for each blog to have its own skin is very useful.

Why I would like to control attachments on a per post basis... well, I use B2evolution for photography and it would be really cool if I could allow users to add images for critique, but I could restrict them from adding more than 1 per comment (and per post), but if I were to publish a post were users can upload two images (used for photographic comparisons such as camera models, ISO settings, lighting variations showing the difference between two images), then it would be cool, but if this is controlled on a per blog basis, this will not be possible.

Hope this helps and makes sense? Anyway, you guys rock, great work.

Oct 16, 2011 16:46

I see I double posted sorry, didn't see that post and thought it never went through. My bad.

Sep 13, 2012 14:34

There should be an option to allow attachments to blog members according to their FM perms, then you can select members and what file perms they have in particular blog.

Sep 13, 2012 14:44

- Any user (Including anonymous users)
- Registered users only
- Members only (Users have to be members of this blog)
- Not allowed

The following options are available for
- Comment viewing
- Comment posting
- Comment attachments
- Comment ratings

Those are in b2evo v5


Form is loading...

b2evolution CMS – This forum is powered by b2evolution CMS, a complete engine for your website.