Limit publishing

front page Forums Community Limit publishing

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #40075

    We’re using MyCred to sell services like jobs opportunities, publishing articles, publishing ads, etc.

    We saw that your plugin blocks content for custom post types. But what we need is to sell the ‘publish’ or ‘upload’ a new post, job, etc. Not the content itself.

    So, we made a specific page for the ‘new ad’ form, and set it a credit price. But the problem we see with this, is that once the user ‘buy’ with the credits, he can upload as many ads as he/she wants. And the only way to filter this is to set an ‘expiration date’ on the purchase. Is there a hook or something to only allow one post to the user to publish, and then when he does, ask for the payment again?


    Hi there,

    There is a hook in myCRED that allows you to deduct points for post publishing.

    Cordially, M.

    AvatarRafael MotorsPlace

    I have exactly the same problem. I need purchased content to be displayed only once per purchase. How to solve it?



    Hi Rafael,

    This is not the same problem, they were trying to make their users pay for each publication (publish once per payment). While you are trying to make your users pay for each view (view content once per payment).

    In your case there could be some issues with your users if they have a bad or spotty internet connection. In your case, it’s better to set a time limit (expiration period) for viewing the content after payment, which is what they intially did but wasn’t very adapted to their situation.

    Cordially, M.

    AvatarRafael MotorsPlace

    Hello M.
    Thanks for answering!
    I followed the suggestion and changed the expiration time. However, I managed to change it to just 1 minute. I would like to switch to 1 second, but I can’t.

    I followed the guidelines of this link:

    However, when I replace “MINUTE_IN_SECONDS” with “MONTH_IN_SECONDS”, an error occurs when loading the page. In addition, I believe this would be to change it to a month, not a second, as it is in the instruction on that link.

    I figured if I replaced it with “SECOND_IN_SECONDS”, it would work, but there is also an error in loading.

    One minute to expire is still a lot for me. How should I do?



    Hello Rafael,

    Those all caps strings are just shortcuts (constants) to avoid calculating the number of seconds in a given period of time. For example, HOUR_IN_SECONDS is equal to 3600 and MINUTE_IN_SECONDS is equal to 60.

    I didn’t read through the linked solution but from the top of my head, I would suggest trying to replace that string with the number 1 for one second or maybe 3 for three seconds…

    Let me know how that works out.

    Cordially, M.

    AvatarRafael MotorsPlace

    It worked!
    Thank you. Your plugin solved a big problem with my site. Soon I will buy adds.



    You are welcome. 🙂

    But for your information, I am not part of the myCRED team, I am just a third-party developer and a fellow user just like you.

    Anyway, if you need something else, you can let me know.

    Have a nice day and good luck with your project. 😉

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

You must be logged in to reply to this topic.