We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Not enough credits information bar | Forum

Alican
Alican Mar 2 '14
I'm using 'User Credits' plugin and when a user doesn't have credits and tries to make an action, an information bar with a link to payment page appears telling he-she doesn't have enough credits to do the action.


My problem is this information bar appears shortly like 3-5 seconds and disappears.  How can we make the duration longer, or even make it sticky? 


Also if someone has an idea about how to redirect to -> ../user-credits/buy-credits page when the user doesn't have enough credits to do the action.


Here is the information bar I'm mentioning;





Alican
Alican Mar 11 '14
Any solution?
Daisy Team
Daisy Mar 19 '14
Alican,  let's take the Blogs plugin as an example. Open the /ow_plugins/blogs/controllers/save.php file and find the index function. You will see that the plugin checks if a user has credits on their balance and if not - it shows this message:

$credits = OW::getEventManager()->call('usercredits.check_balance', $eventParams);

        if ( $credits === false )
        {
            $this->assign('authMsg', OW::getEventManager()->call('usercredits.error_message', $eventParams));
            return;
        }

If you want to to redirect users to the Buy more credits page instead of showing this message you should modify this clause. If you want to make the redirect for all plugins, you will need to modify each plugin separately.

As for the time to show the message -  you can change the time in /ow_static/plugins/base/js/ow.js file. Search for the var messageTime = 3000; string.
But, if you make changes in this file, these changes will be applied to all site messages.
tammy harris
tammy harris Mar 19 '14
I have been working on this for long time trying to redirect the user to a custom page  showing them how to earn credits and buy credits 

I have tryed everything but no luck any help on this please