function getAds($adid = '') { require_once JPATH_ROOT . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php'; if (empty($adid)) { $adid = 0; } $adRetriever = new adRetriever(); $preview = $adRetriever->getAdHTML($adid, 1); return $preview; }
function onEmail_jma_socialads($id, $date, $userparam, $fetch_only_latest) { $areturn = array(); $areturn[0] = $this->_name; $check = $this->_chkextension(); if (!$check) { $areturn[1] = ''; $areturn[2] = ''; return $areturn; } $userparam['alt_ad'] = 1; $userparam['ad_rotation'] = 0; //$id = 54; $input = JFactory::getApplication()->input; require_once JPATH_ROOT . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php'; require_once JPATH_ROOT . DS . 'components' . DS . 'com_socialads' . DS . 'helper.php'; $html = '<span>'; $cssdata = ''; $simulate = ''; $sim_flag = $input->get('flag', 0, 'INT'); if ($sim_flag == 1) { // to check if called from simulate in admin $simulate = '&simulate=1'; } if ($id == '' || !$id || !isset($id)) { $adRetriever = new adRetriever(-1, 1); } else { $adRetriever = new adRetriever($id, 1); } $socialadshelper = new socialadshelper(); $adsdata = array(); $adsdata = $adRetriever->fillslots($userparam, $adRetriever); //echo '<br>data';//print_r($adsdata); if (!empty($adsdata)) { //$random_ads = $adRetriever->getRandomId($adsdata,$userparam); $itemid = $socialadshelper->getSocialadsItemid('buildad'); foreach ($adsdata as $key => $random_ad) { if ($random_ad->ad_id != -999) { $addata = $adRetriever->getAdDetails($random_ad); } else { $addata = null; } if ($addata) { $html .= '<div>'; $html .= $adRetriever->getAdHTML($addata); $html .= '<img alt="" src="' . JUri::root() . 'index.php?option=com_socialads&task=getimprimage&adid=' . $random_ad->ad_id . $simulate . '" border="0" width="1" height="1"/>'; $html .= '</div>'; if (JVERSION >= '1.6.0') { $cssfile = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . 'plug_' . $addata->layout . DS . 'plug_' . $addata->layout . DS . 'layout.css'; } else { $cssfile = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . 'plug_' . $addata->layout . DS . 'layout.css'; } $cssdata .= file_get_contents($cssfile); } } if ($userparam['create'] == 1) { $html .= '<div style="clear:both;"></div><a class ="create" target="_blank" href="' . JRoute::_(JUri::root() . 'index.php?option=com_socialads&view=buildad&Itemid=' . $itemid) . '">' . $userparam['create_text'] . '</a>'; } } $html .= '</span>'; if (empty($adsdata)) { $areturn[1] = ''; $areturn[2] = ''; } else { $areturn[1] = $html; $areturn[2] = $cssdata; } // print_r($areturn); return $areturn; }
} if($flg==0) $doc->addScript($namespace_js); * * */ //require_once(JPATH_SITE . DS .'components'. DS .'com_community'. DS .'libraries'. DS .'core.php'); // Include the syndicate functions only once require_once dirname(__FILE__) . DS . 'helper.php'; $helperPath = JPATH_SITE . DS . 'components' . DS . 'com_socialads' . DS . 'helper.php'; if (!class_exists('socialadshelper')) { JLoader::register('socialadshelper', $helperPath); JLoader::load('socialadshelper'); } require_once JPATH_ROOT . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php'; $lang = JFactory::getLanguage(); $lang->load('mod_socialads', JPATH_SITE); $moduleid = $module->id; $zone_id = $params->get('zone', 0); $modSocialadsHelper = new modSocialadsHelper(); $ad_type = $modSocialadsHelper->getAdtypebyZone($zone_id); if ($params->get('create', 1)) { $socialadshelper = new socialadshelper(); $Itemid = $socialadshelper->getSocialadsItemid('buildad'); } $adRetriever = new adRetriever(); $ads = $adRetriever->getAdsforZone($params, $moduleid); require JModuleHelper::getLayoutPath('mod_socialads'); } ?>
function calculatereach() { $plgdata = array(); $aa = array(); $aa = json_encode($_POST['mapdata']); if (isset($_POST['plgdata'])) { $plgdata = json_encode($_POST['plgdata']); } $plg_target_field = array(); $target_field = array(); $plgmapdata_array = array(); if (empty($aa) and empty($plgdata)) { jexit(); } if (!empty($aa)) { $mapdata_array = json_decode($aa); if (empty($mapdata_array)) { jexit(); } $target_field = socialadsControllerBuildad::calculatereach_parseArray($mapdata_array); } if (!empty($plgdata)) { $plgmapdata_array = json_decode($plgdata); $plg_target_field = socialadsControllerBuildad::calculatereach_parseArray($plgmapdata_array); } require_once JPATH_COMPONENT . DS . 'adshelper.php'; $reach = 0; $adRetriever = new adRetriever(); $reach = $adRetriever->getEstimatedReach($target_field, $plg_target_field); header('Content-type: application/json'); echo json_encode(array("reach" => $reach)); jexit(); }
/** * @version SVN: <svn_id> * @package Com_SocialAds * @copyright Copyright (C) 2005 - 2014. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access defined('_JEXEC') or die(';)'); $doc = JFactory::getDocument(); $input = JFactory::getApplication()->input; $user = JFactory::getUser(); if (!$user->id) { ?> <div class="techjoomla-bootstrap"> <div class="alert alert-block"> <?php echo JText::_('BUILD_LOGIN'); ?> </div> </div><!--techjoomla bootstrap ends if not logged in--> <?php return false; } require_once JPATH_SITE . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php'; $doc->addStyleSheet(JUri::base() . 'components/com_socialads/css/helper.css'); $doc->addScript(JUri::root() . 'components/com_socialads/js/flowplayer-3.2.9.min.js'); // Added by manoj stable 2.7.5 $adid = $input->get('id', 0, 'INT'); $adRetriever = new adRetriever(); echo $adRetriever->getAdHTML($adid, 1);
function buildAdLayout($ad_id) { $adRetriever = new adRetriever(); $adRetriever->getAdHTML($addata); }
function getad_status($adid) { if ($adid) { require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php"; $adRetriever = new adRetriever(); $db = JFactory::getDBO(); /* not needed... code done for Moses $query = "SELECT bid_value FROM #__ad_data WHERE ad_id =".$adid; $db->setQuery($query); $bid = $db->loadresult(); */ $query = "SELECT ad_noexpiry,ad_alternative,ad_affiliate FROM #__ad_data WHERE ad_id =" . $adid; $db->setQuery($query); $ad_alt_exp = $db->loadObject(); if ($ad_alt_exp->ad_noexpiry == 1 || $ad_alt_exp->ad_alternative == 1 || $ad_alt_exp->ad_affiliate == 1) { $statue_adcharge = array(); $statue_adcharge['ad_charge'] = 0.0; $statue_adcharge['status_ads'] = 1; return $statue_adcharge; } $query = "SELECT ad_payment_type FROM #__ad_data WHERE ad_id =" . $adid; $db->setQuery($query); $caltype = $db->loadresult(); $ad_charge = $adRetriever->getad_charges($adid, $caltype); if ($socialads_config['select_campaign'] == 1 && $ad_alt_exp->ad_noexpiry == 0 && $ad_alt_exp->ad_alternative == 0 && $ad_alt_exp->ad_affiliate == 0) { $status_ads = $adRetriever->check_balance($adid, $ad_charge); } else { $status_ads = 1; } $statue_adcharge = array(); $statue_adcharge['ad_charge'] = $ad_charge; $statue_adcharge['status_ads'] = $status_ads; return $statue_adcharge; } return false; }
function checkifadsavailable() { $input = JFactory::getApplication()->input; if ($input->get('zone_id')) { require_once JPATH_ROOT . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php'; $adRetriever = new adRetriever(); $check = $adRetriever->CheckifAdsavailable($input->get('ad_id', '', 'INT'), $input->get('module_id', '', 'STRING'), $input->get('zone_id', '', 'INT')); header('Content-type: application/json'); echo json_encode($check); jexit(); } }
function getAds() { require_once JPATH_ROOT . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php'; $input = JFactory::getApplication()->input; $adid = $input->get('adid', 0, 'INT'); $adRetriever = new adRetriever(); $preview = $adRetriever->getAdHTML($adid, 1); return $preview; }