public static function add(GatheringDataSourceConfiguration $configuration, $tweet) { $gathering = $configuration->getGatheringObject(); try { // we wrap this in a try because it MIGHT fail if it's a duplicate $item = parent::create($gathering, $configuration->getGatheringDataSourceObject(), date('Y-m-d H:i:s', strtotime($tweet->created_at)), $tweet->text, $tweet->id); } catch (Exception $e) { } if (is_object($item)) { $item->assignFeatureAssignments($tweet); if (count($tweet->entities->media) > 0 && $tweet->entities->media[0]->type == 'photo') { $item->setAutomaticGatheringItemTemplate(); } else { $type = GatheringItemTemplateType::getByHandle('tile'); $template = GatheringItemTemplate::getByHandle('tweet'); $item->setGatheringItemTemplate($type, $template); } return $item; } }
<?php defined('C5_EXECUTE') or die("Access Denied."); $ap = new Permissions($item->getGatheringObject()); $type = GatheringItemTemplateType::getByHandle('tile'); $types = GatheringItemTemplateType::getList(); if ($item->canViewGatheringItem()) { ?> <div data-block-type-handle="<?php echo BLOCK_HANDLE_GATHERING_ITEM_PROXY; ?> " data-gathering-item-batch-timestamp="<?php echo $item->getGatheringItemBatchTimestamp(); ?> " data-gathering-item-id="<?php echo $item->getGatheringItemID(); ?> " class="ccm-gathering-item h<?php echo $item->getGatheringItemSlotHeight(); ?> w<?php echo $item->getGatheringItemSlotWidth(); ?> "> <div class="ccm-gathering-item-inner"> <?php if ($showTileControls && $ap->canEditGatheringItems()) { ?> <div class="ccm-ui"> <ul class="ccm-gathering-item-inline-commands ccm-ui">
<?php defined('C5_EXECUTE') or die("Access Denied."); $nh = Loader::helper('validation/numbers'); $form = Loader::helper('form'); $gaiID = intval($_REQUEST['gaiID']); $nh = Loader::helper('validation/numbers'); $item = GatheringItem::getByID($gaiID); $type = GatheringItemTemplateType::getByHandle('detail'); if (is_object($item) && Loader::helper('validation/token')->validate('get_gathering_items', $_REQUEST['token'])) { $item->render($type); }