MOD Steps:
- replace '--YOURSITE--' with your site info
- is very much hacked into code and I did not really use the built in path constructs in the code.
/oc-content/plugins/osclass_pay/functions.php
added function at the bottom, name: "osp_credits_flash" (Line 2817-2855)
// CREDITS REMINDER
// ZeroThree Media LLC
// Sudo - v.1.0 - 10/28/17
function osp_credits_flash(){
if(osc_logged_user_id() != NULL){
if(osp_param('wallet_enabled') == 1) {
$wallet = osp_get_wallet(osc_logged_user_id());
$credit = $wallet['formatted_amount'];
$credit_display = '$'.number_format($credit,2);
if($credit <> '' && $credit > 0) {
//osc_add_flash_error_message(sprintf(__('You have %s in free credit, upgrade your listings...<a href="http://--YOURSITE--/osclasspay/item" target="_blank">Click here to Upgrade your listing</a>', 'osclass_pay'), osp_format_price($credit)));
if($credit < 4){
//$html = '<div id="flashmessage" class="flashmessage flashmessage-error"><a class="btn ico btn-mini ico-close">x</a>Credit balance low. <a href="http://--YOURSITE--/osclasspay/pack">Click to buy more</a></div>';
osc_add_flash_error_message(sprintf(__('You have %s in credits, upgrade your listings...<a href="http://onebackpage.com/osclasspay/item">Click here to create or upgrade your listing</a>', 'osclass_pay'), osp_format_price($credit)));
}else{
//$html = '<div id="flashmessage" class="flashmessage flashmessage-error"><a class="btn ico btn-mini ico-close">x</a>You have '.$credit_display.' in credits, upgrade your listings...<a href="http://--YOURSITE--/osclasspay/item">Click here to create or upgrade your listing</a></div>';
osc_add_flash_error_message(sprintf(__('You have %s in credits, upgrade your listings...<a href="http://--YOURSITE--/osclasspay/item">Click here to create or upgrade your listing</a>', 'osclass_pay'), osp_format_price($credit)));
}
//echo $html;
}
}
}
}
osc_add_hook("after_login", "osp_credits_flash");
/*
if(osc_logged_user_id() != NULL){
osc_run_hook("after_login", 'osp_credits_flash');
}
*/
// CREDITS REMINDER
// ZeroThree Media LLC
// Sudo - v.1.0 - 10/28/17
If using HybridAuth -
Oct25, 2017 - Display Credits Flash on Login
/oc-content/plugins/HybridAuth/HybridAuthClass.php
Line 55-75
// *****************************************
// ZeroThree Media LLC
// Sudo - v.1.0 - 10/25/17
// *****************************************
if(osp_param('wallet_enabled') == 1) {
$wallet = osp_get_wallet(osc_logged_user_id());
$credit = $wallet['formatted_amount'];
$credit_display = '$'.number_format($credit,2);
if($credit <> '' && $credit > 0) {
if($credit < 4){
osc_add_flash_error_message(sprintf(__('You have %s in credits, upgrade your listings...<a href="http://--YOURSITE--/osclasspay/item">Click here to create or upgrade your listing</a>', 'osclass_pay'), osp_format_price($credit)));
}else{
osc_add_flash_error_message(sprintf(__('You have %s in credits, upgrade your listings...<a href="http://--YOURSITE--/osclasspay/item">Click here to create or upgrade your listing</a>', 'osclass_pay'), osp_format_price($credit)));
}
}
}
// *****************************************