Hey guys,
I need to know what to add to check Vodes balance and redirect for Vodes purchase. When a user clicks on the link to the page, as of now, if there are credits it will deduct. But if there are "0" credits the link still allows the view to occur. I have tried a few of the "if" examples around the threads but nothing works correctly. I get errors related to the line I tried to code. I am sure it is a simple thing. Any help would be great.
I used the example code from your threads at the top of the target page.:
Code used:
<?php
defined('_JEXEC') or die('Restricted access');
$user = & JFactory::getUser();
$path = JPATH_SITE.DS.'components'.DS.'com_vodes'.DS.'models'.DS.'credits.php';
require_once($path);
$credits =& new VodesModelCredits();
$credits->_user = $user;
$credits->decrease(2);
}
if "WHAT DO I NEED HERE TO CHECK BALANCE and REDIRECT IF 0 BALANCE"
}
else if "WHAT GOES HERE IF BALANCE AVAILABLE TO SHOW CONTENT?"
?>
Thanks so much in advance for your help.
Best wishes,
PM1