Is this like a contest or game or something.. "Here's the actions you haven't done yet"? Specifically, I'm assuming you want to know which actions haven't been used by the current user, not anyone, right?Secondly.... I have a view (in a 3rd party component) that simply lists my open graph objects in a grid.... I am trying to figure out a way to do some sort of check before the page loads (with php) to get all the open graph objects that have already been used and remove them from the grid before they load.... Does that make sense?
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_jfbconnect/models');
$jfbcOgActionModel = JModelLegacy::getInstance('OpenGraphAction', 'JFBConnectModel');
$urlKey = $jfbcOgActionModel->getUniqueKey('http://yoursite.com/link-to-coupon'); // The URL of the object page
$action = $jfbcOgActionModel->getAction('12345); // ID of the action you want to check
// Check to see if the user has disabled the action (if the action is configured to be disable-able) and check if it hasn't been triggered within the timeframe settings
if ($action->actionReady($urlKey) && $action->enabledForUser())
$isReady = true;
else
$isReady = false;//JFB Connect Action Check Code
$couponUrl = $this->item->link; // I define the path to the object as it's already used in the view ?!?!
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_jfbconnect/models');
$jfbcOgActionModel = JModelLegacy::getInstance('OpenGraphAction', 'JFBConnectModel');
$urlKey = $jfbcOgActionModel->getUniqueKey($couponUrl); // The URL of the object page
$action = $jfbcOgActionModel->getAction('1'); // ID of the action you want to check
// Check if action hasn't been triggered within the timeframe settings
if ($action->enabledForUser()) { // I changed the if statement to just one of the two checks
$isReady = true;
} else {
$isReady = false;
}
if($isReady == false){ // then I make another if statement based off the isReady variable ?>
alert("Item Already Used");
// ITEM USED DIV THAT RED ALSO GOES HERE SO I CAN SEE VISUALLY IF IT'S WORKING
if($isReady == true){
//my normal code to make coupons goes hereJoin our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.
