Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hi guys!

I have a clonable template (news.php), and databound to edit the news from frontend (edit-news.php). User can register and submit a news on my website.

I want to implement a system that user can submit news, but to edit the news he need to pay a package, lets say $10 for 100x edit. Lets say he submit 15 news, so he can 100x edit all that news he submit. After he reach 100x edit, he cant access the edit news page, and he need to pay again to get 100 credit for editing a news.

is it possible with couch? Lemme know.


Thx!
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
Hi :)

You asked -
is it possible with couch?
I'd say, sure. But you'll have to put on your programmers hat for that :) You'll need to keep track of the count of pages submitted by a user, the total number of edits (not to mention, the amount of money paid by her).

Can of course be done but the solution will squarely belong to programmer territory instead of designer.
KK wrote: Hi :)

You asked -
is it possible with couch?
I'd say, sure. But you'll have to put on your programmers hat for that :) You'll need to keep track of the count of pages submitted by a user, the total number of edits (not to mention, the amount of money paid by her).

Can of course be done but the solution will squarely belong to programmer territory instead of designer.


Thx KK!

Lookin back on the old thread, i found thread that discus about page hit counter, and i found this :
Code: Select all
<cms:if k_is_page>

    <cms:no_cache />

    <cms:php>
        // identify bots
        global $CTX;
        if( isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/bot|crawl|slurp|spider/i', $_SERVER['HTTP_USER_AGENT']) ){
            $CTX->set( 'is_bot', '1', 'global' );
        }       
    </cms:php>
   
    <cms:if "<cms:not is_bot />">
        <cms:db_persist
            _masterpage=k_template_name
            _page_id=k_page_id
            _mode='edit'
           
            page_hits="<cms:add page_hits '1' />"
        />
    </cms:if>
</cms:if>


What i understand is, that code identify if the visitor bot or not, if not, the rest of the code will add 1 count every time the page accessed. So, can i use cms:decr to decrease value by 1 on editable region lets say "edit_counter", and filter user like this :
Code: Select all
<cms:if edit_counter = '0'>
<h1>you need to top up your edit credit to editing</h1>
<cms:else />
..Edit content..
</cms:if>


Am i on the right track KK?

Any advise needed, THX!
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
@GoingMarryAsap,
That basic idea makes sense to me. But you don't want to count it against the user's edit_count just because they visit the page. I would make the code part of the editing DBF so that when they submit an edit, the changes persist and the counter decreases by 1.

Since the user has to log in to edit their own forms, you don't have to worry about bots. Only a logged in user can access the form.

Also you need to keep track of payments and credit the account when it is paid. I would make edit_counter an editable region in the user account. When a user makes a payment, add credits to the counter. When they make edits, decrease the count.

Hope that helps,
Tim
tim wrote: @GoingMarryAsap,
That basic idea makes sense to me. But you don't want to count it against the user's edit_count just because they visit the page. I would make the code part of the editing DBF so that when they submit an edit, the changes persist and the counter decreases by 1.

Since the user has to log in to edit their own forms, you don't have to worry about bots. Only a logged in user can access the form.

Also you need to keep track of payments and credit the account when it is paid. I would make edit_counter an editable region in the user account. When a user makes a payment, add credits to the counter. When they make edits, decrease the count.

Hope that helps,
Tim


Thx tim to stepin by ;)

Yes, i will add the edit_counter region on user template. For the the payments, i will add simple bank transfer, with transfer reporting after the user transfer. So user need to report to admin, and will provide the screenshot. And admin will confirm the transfer via internet banking report, and add the credit manually to user account.

Im still workin on it, and i will update here whats goin on.

Thx!
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
Let us know how you do get on.

I'm looking for something like this. Rather than limit the user i want them to display the amount they have in stock so, 10, but once user pays by paypal and redirects back to my website that count then goes down to 9. And once the count is 0 changes the buy now button to ended to stop buyers from buying when no products are left. So if a single product is sold ie, 1 product in stock and this is brought through paypal the count will be 0 and it'll be ended.
Hi SimonRLM!

I still workin on this web, but i still skip this section and work for the other parts. I will post the result asap after i try.



SimonRLM wrote: Let us know how you do get on.

I'm looking for something like this. Rather than limit the user i want them to display the amount they have in stock so, 10, but once user pays by paypal and redirects back to my website that count then goes down to 9. And once the count is 0 changes the buy now button to ended to stop buyers from buying when no products are left. So if a single product is sold ie, 1 product in stock and this is brought through paypal the count will be 0 and it'll be ended.


Maybe you can use db_persist to manipulate the stock after the "paypal pay" button clicked. Maybe add "submit" button with type="hidden" on a form that contain db_persist. And decr the stock by 1. So after the paypal button clicked, the submit hidden submit button triggered, and decr the stock by 1.
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
I'll have to look into the db_persist as I've not yet used this code.
But that would work. Will deffo have to investigate more into this
8 posts Page 1 of 1