Charging Points to Add Image and Add Video


How to disallow adding images and videos based upon points.
I appreciate any help you may offer.I am trying to charge members points in order to add images or videos. I went into Setup---->Configurations---->Point Options and set "Points Given" to Add Image to -5 (a negative number). 5 Current Points are deducted from the member on image upload. I can see this in a member's Profile that this works fine.
Here's the problem:
I only want the image to be uploaded if the member has enough Current Points for the transaction. If the member does not have enough points, the image should not upload.
After doing what I described above, the member now has "Current Points: -5 to spend". The upload was allowed with a negative result of points.
Setting Security--->Privileges---->Points to not allow negative points only refers to "Gift Points". Images added are deducted from "Current Points".
I know this is usually done within the query to the database, but I can't figure out how to do this.
Hoping that someone has an idea. Thanking you in advance.


Your approach is smart

Unfortunately Composr isn't coded to know what you're doing, so it would need implementing. We've had an issue on the tracker a while for this request:
0000045: Implicit point store - charging to add content - Composr CMS feature tracker
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Since reading your reply, I have been trying to learn about CRUD. I'm pretty much a beginner, so I've got a lot to learn.
I'm not giving up!


What if I made the button to "ADD IMAGE" invisible (Content Management--->Galleries--->ADD IMAGE page) if a query to the database reveals the user does not have enough Current Points (using Operators)?
How should I go about this?


Also just changing the icon isn't going to be a secure solution, as if a user could find the direct URL they'd bypass the check, and if that was also checked, they could simulate a form submission, so you'd need to add a check in the actualiser code.
I'd start by just trying to disable the form if there isn't enough points. That doesn't fix the aforementioned actualiser issue, but I think it's better than just disabling the icon as casual users are not going to be simulating form submissions but they might be bookmarking form URLs.
So find the get_form_fields functions for images and videos in cms_galleries.php and I think you'd need to add some code to them something like:
Code (PHP)
warn_exit('You do not have enough points, you need at least 50');
}
Obviously this is hard-coding it in a not completely secure way for just a couple of content types, while the tracker issue is to do a more comprehensive, secure, solution. But if it does what you need…
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


I will keep reading about CRUD. Unfortunately, I couldn't even find the location of the CRUD module to view it. I did read the tutorial a few times, and searched for additional explanations. It was beyond this beginner's skill set. I thought that having the add button appear or not appear on the page might be a solution I could handle, but I wasn't sure if this was okay to do. Thanks for explaining!
As a side note, your tutorials, documentation, and videos are excellent resources! I've learned a lot already. Thank you!




Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.




What if a hidden field was passed with the value of Available Points, when the user goes to the page to upload an image or upload a video (after clicking on "Add Image" or "Add Video" buttons).
Would the Field Filters (Setup-->Field Filters) be able to stop the upload, based upon that hidden field's value (using operators)?
Again, not sure how to correctly implement this but I can't stop thinking about what might work.
I am looking forward to Chris Graham's lessons!


I'm thinking about how we can do a programming session at the moment. Will you be around for the next hour or two? (It won't take that long, but I've got to work out how to do it)
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.




Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.




Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.







