About this topic

  • Posted by Help 1 year ago. There are 3 posts. The latest reply is from byron.
  • This topic is not resolved

No tags yet.

  1. how would i go about limiting the number of photos uploaded to a gallery?

  2. To add to this, I'd like to do this on a user basis, so each user can upload a maximum of 5 photos to a particular gallery?

  3. Hi Help,
    PhotoSmash doesn't provide this ability. If you're comfortable with PHP, you should be able to make some modifications to the code. It would probably take a few hours to get it all thought through and coded. A general outline would be:

    1) You'd need to hook into the filter that is called when the upload link is generated (bwb-photosmash.php). Here, you'd check to see if the user has already loaded too many times and then return nothing if they're at the limit or return the link if they're ok
    2) You'd need to modify ajax-wp-upload.php to have a hook that where you could check if they're over the limit or not...if they're over the limit, you'd want to exit the upload routine and return a JSON message that tells them they're over the limit. The reason for this is that once they've got the upload form, they can keep uploading as much as they want, so you need to see at the upload time if they're over the limit.

    Hope that helps,
    Byron

RSS feed for this topic