<?php // no direct access defined('_JEXEC') or die('Restricted access'); /*layout for img ads only (ie. images only) */ $ht = ''; if ($addata->ignore != '') { $ht .= '<span class="ad_ignore_button_span" style="display:none;"><img title="' . JText::_('CLK_ING') . '" class="ad_ignore_button layout5_ad_ignore_button" src="' . JUri::Root() . 'components/com_socialads/images/fbcross.gif" alt="" onClick="' . $addata->ignore . '" /></span>'; } $ht .= '<div class="ad_prev_wrap layout5_ad_prev_wrap well well-small">'; /*Ad image starts here...*/ $ht .= '<!--div for preview ad-image--> <div class="layout5_ad_prev_second">'; $ht .= '<a ' . $upload_area . ' href="' . $addata->link . ' " target="_blank">'; //$ht.= '<img class="layout5_ad_prev_img" alt="" src="'.JUri::Root().$addata->ad_image.'" border="0" />'; //changed in 2.7.5 beta 2 $ht .= $adHtmlTyped; $ht .= '</a>'; $ht .= '</div>'; /*Ad image ends here*/ $ht .= '</div>'; echo $ht;
* @package Kunena.Framework * * @copyright (C) 2008 - 2013 Kunena Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @link http://www.kunena.org **/ defined('_JEXEC') or die; if (defined('KUNENA_LOADED')) { return; } // Manually enable code profiling by setting value to 1 define('KUNENA_PROFILER', 0); // Component name amd database prefix define('KUNENA_COMPONENT_NAME', 'com_kunena'); define('KUNENA_COMPONENT_LOCATION', 'components'); define('KUNENA_NAME', substr(KUNENA_COMPONENT_NAME, 4)); // Component paths define('KPATH_COMPONENT_RELATIVE', KUNENA_COMPONENT_LOCATION . '/' . KUNENA_COMPONENT_NAME); define('KPATH_SITE', JPATH_ROOT . '/' . KPATH_COMPONENT_RELATIVE); define('KPATH_ADMIN', JPATH_ADMINISTRATOR . '/' . KPATH_COMPONENT_RELATIVE); define('KPATH_MEDIA', JPATH_ROOT . '/media/' . KUNENA_NAME); // URLs define('KURL_COMPONENT', 'index.php?option=' . KUNENA_COMPONENT_NAME); define('KURL_SITE', JUri::Root() . KPATH_COMPONENT_RELATIVE . '/'); define('KURL_MEDIA', JUri::Root() . 'media/' . KUNENA_NAME . '/'); $libraryFile = JPATH_PLATFORM . '/kunena/bootstrap.php'; if (file_exists($libraryFile)) { require_once $libraryFile; } // Kunena has been initialized define('KUNENA_LOADED', 1);
function getList() { $input = JFactory::getApplication()->input; $addtype = $input->get('addtype'); //echo "1-----". $zonlay = $input->get('zonelayout', ''); //echo "2-----". $selected_layout1 = array(); if ($zonlay) { JRequest::setVar('layout', $zonlay); $selected_layout_arr = explode('|', $zonlay); $i = 0; foreach ($selected_layout_arr as $selected_layout) { $selected_layout1[$i] = $selected_layout; $i++; } } if ($addtype == 'text') { $layout_type = "Text"; } else { if ($addtype == 'img') { $layout_type = "Image"; } else { if ($addtype == 'text_img') { $layout_type = "Text And Image"; } else { $layout_type = ""; $add_type[] = JHtml::_('select.option', '0', 'select'); JHtml::_('select.genericlist', $add_type, 'layout_select', 'class="inputbox" size=1', 'value', ''); exit; } } } $add_type = ''; //'<table><tbody><tr>'; $newvar = JPluginHelper::getPlugin('socialadslayout'); $sel_layout1 = array_values($selected_layout1); foreach ($newvar as $k => $v) { $params = explode("\n", $v->params); foreach ($params as $pa => $p) { if (JVERSION >= '1.6') { $lay = json_decode($p); if (isset($lay->layout_type)) { if ($layout_type == $lay->layout_type) { $chk = ''; $nam = substr($v->name, 5); if (in_array($nam, $sel_layout1)) { $chk = 'checked="yes"'; } else { if ($layout_type == 'Image') { $chk = 'checked="yes"'; } } $add_type .= '<span style = "vertical-align:text-top;"> <input type="checkbox" ' . $chk . ' name="layout_select" class="inputbox" value="' . $nam . '" /> <img src="' . JUri::root() . 'plugins/socialadslayout/plug_' . $nam . '/plug_' . $nam . '/layout.png" > </span> '; //JHtml::_('select.option', $nam , '<div class ="optimg" >'.$nam.'</div>' ); } } } else { $lay = explode("=", $p); if ($lay[0] == 'layout_type') { if ($layout_type == $lay[1]) { $chk = ''; $nam = substr($v->name, 5); if (in_array($nam, $sel_layout1)) { $chk = 'checked="yes"'; } else { if ($layout_type == 'Image') { $chk = 'checked="yes"'; } } $add_type .= '<span style = "vertical-align:text-top;"> <input type="checkbox" ' . $chk . ' name="layout_select" class="inputbox" value="' . $nam . '" /> <img src="' . JUri::Root() . 'plugins/socialadslayout/plug_' . $nam . '/layout.png" ></span> '; //JHtml::_('select.option', $nam , '<div class ="optimg" >'.$nam.'</div>' ); } } } } } //$add_type .='</tr></tbody></table>' ; if ($add_type == '') { echo JText::_('NO_LAY'); } else { echo $add_type; } exit; }
function getAdPreview($adid, $showlink = 0) { require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php"; $document = JFactory::getDocument(); $document->addStyleSheet(JUri::base() . 'components/com_socialads/css/helper.css'); $document->addScript(JUri::base() . 'components/com_socialads/js/helper.js'); $user = JFactory::getUser(); if ($adid == 0) { //Still unable to get the title and body. Check if it is stored in the following variables or not. $buildadsession = JFactory::getSession(); $addata = $buildadsession->get('ad_data'); $pluginlist = $buildadsession->get('addatapluginlist'); $upimg = $buildadsession->get('upimg'); //by madhura /*if($pluginlist != ''){ $img = $buildadsession->get('pluginimg'); } else { $img = $buildadsession->get('upimg'); } else { $img = $buildadsession->get('upimgcopy'); }*/ if ($buildadsession->get('upimg') != '') { $img = $buildadsession->get('upimg'); } else { if ($buildadsession->get('ad_image') != '') { $img = $buildadsession->get('ad_image'); } else { $img = $buildadsession->get('upimgcopy'); } } $title = $addata[2]['ad_title']; $body = $addata[3]['ad_body']; $link = "#"; } else { $db = JFactory::getDBO(); $query = "SELECT * FROM #__ad_data WHERE ad_id =" . $adid; $db->setQuery($query); $addata = $db->loadObject(); $link = JUri::base() . "index.php?option=com_socialads&view=redirector&adid=" . $addata->ad_id; $title = $addata->ad_title; $img = $addata->ad_image; $body = $addata->ad_body; } if ($socialads_config['ignore'] == 0 || $user->id == 0) { $showlink = 2; } $html = '<div class="ad_prev_main"> <div class="ad_prev_wrap">'; if ($showlink == 0) { $html .= '<img class="ad_ignore_button" src="' . JUri::Root() . 'components/com_socialads/images/fbcross.gif" onClick="ignore_ads(this,' . $adid . ',' . $socialads_config["feedback"] . ');" /> <div class="ad_prev_first">'; if ($link == '#') { $html .= '<a class="ad_prev_anchor" href="' . $link . '">' . $title . '</a>'; } else { $html .= '<a class="ad_prev_anchor" href="' . $link . '" target="_blank">' . $title . '</a>'; } $html .= '</div>'; if ($img != '') { $html .= ' <div class="ad_prev_second"> <a href="' . $link . ' " target="_blank"> <img class="ad_prev_img" width="' . $socialads_config['image_dimensions'] . '" "src="' . JUri::Root() . $img . '" border="0" /> </a> </div>'; } } else { if ($showlink == 2) { $html .= '<div class="ad_prev_first">'; if ($link == '#') { $html .= '<a class="ad_prev_anchor" href="' . $link . '">' . $title . '</a>'; } else { $html .= '<a class="ad_prev_anchor" href="' . $link . '" target="_blank">' . $title . '</a>'; } $str = JUri::base(); $img = str_replace($str, '', $img); $html .= '</div>'; if ($img != '') { $html .= ' <div class="ad_prev_second"> <a href="' . $link . ' " target="_blank"> <img class="ad_prev_img" width="' . $socialads_config['image_dimensions'] . '" src="' . JUri::Root() . $img . '" border="0" /> </a> </div>'; } } else { $html .= '<div class="ad_prev_first">'; $html .= $title; $html .= '</div>'; if ($img != '') { $html .= ' <div class="ad_prev_second">'; $str = JUri::base(); $img = str_replace($str, '', $img); $html .= '<img class="ad_prev_img" width="' . $socialads_config['image_dimensions'] . '" src="' . JUri::Root() . $img . '" border="0" /> </div>'; } } } $html .= '<div class="ad_prev_third">'; $html .= $body; $html .= '</div> </div> </div>'; return $html; }
function getAdHTML($addata, $adseen = 0, $adrotation = 0, $widget = '') { jimport('joomla.application.module.helper'); require JPATH_SITE . DS . "components" . DS . "com_socialads" . DS . "defines.php"; require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php"; global $mainframe; $mainframe = JFactory::getApplication(); $db = JFactory::getDBO(); $document = JFactory::getDocument(); $mod_sfx = ""; // $adRetriever = new adRetriever(); // $addata = $adRetriever->getAdDetails($ad_id); $module = JModuleHelper::getModule('socialads'); if ($mainframe->isSite() && $adseen == 1 && $addata != 0) { if (JVERSION >= '1.6.0') { $moduleParams = json_decode($module->params); $mod_sfx = $moduleParams->moduleclass_sfx; } else { $moduleParams = new JParameter($module->params); $mod_sfx = $moduleParams->get('moduleclass_sfx'); } } $zone_data = ''; if ($adseen == 1) { if ($addata == 0) { $buildadsession = JFactory::getSession(); $adses = $buildadsession->get('ad_data'); $addata = new stdClass(); $pluginlist = $buildadsession->get('addatapluginlist'); ///Extra code for zone pricing $addata->layout = $buildadsession->get('layout'); $addata->ad_image = str_replace(JUri::base(), '', $buildadsession->get('upimg')); if (!$buildadsession->get('adzone')) { $adzone = 1; } else { $adzone = $buildadsession->get('adzone'); } $addata->ad_title = $adses[2]['ad_title']; $addata->ad_body = $adses[3]['ad_body']; $query = "SELECT zone_type,max_title,max_des,img_width,img_height FROM #__ad_zone WHERE id =" . $adzone; $db->setQuery($query); $zone_data = $db->loadObjectList(); } else { //ad preview for the lightbox, showad , adsummary view $query = "SELECT * FROM #__ad_data WHERE ad_id =" . $addata; $db->setQuery($query); $addata = $db->loadObject(); } $addata->link = '#'; } if ($zone_data == '') { $query = "SELECT az.id AS zone_id,az.zone_type,az.max_title,az.max_des,az.img_width,az.img_height FROM #__ad_data as ad LEFT JOIN #__ad_zone as az ON ad.ad_zone=az.id WHERE ad_id =" . $addata->ad_id; $db->setQuery($query); $zone_data = $db->loadObjectList(); $adzone = $zone_data[0]->zone_id; //added in 2.7.5 stable } $tit = $addata->ad_title; $addata->ad_title = mb_substr($tit, 0, $zone_data[0]->max_title, 'UTF-8'); if ($addata->layout != 'layout6') { $bod = $addata->ad_body; $addata->ad_body = mb_substr($bod, 0, $zone_data[0]->max_des, 'UTF-8'); } $addata->ignore = ""; $upload_area = ''; $left_class = ' row-fluid '; if ($zone_data[0]->zone_type == 1 && $adseen == 0) { $left_class = " pull-left "; } //For the orientation of the Ad ie Horizontal or Vertical //$style = 'style="'.$float_style.'"'; $saad_entry_number = 0; if ($adrotation == 1) { $saad_entry_number = self::$ad_entry_number; ++self::$ad_entry_number; } @($html = '<div class = " ad_prev_main' . $mod_sfx . $left_class . ' " preview_for= "' . $addata->ad_id . '" ad_entry_number="' . $saad_entry_number . '" >'); if ($adseen == 0) { if ($this->_my->id == 1) { //$widget=''; if (!empty($_SERVER['HTTP_REFERER'])) { $parse = parse_url($_SERVER['HTTP_REFERER']); if ($widget != "") { $widget = '&widget=' . $parse['host'] . '|' . $widget; } } } else { $widget = '&widget=' . $widget; } $addata->link = JUri::root() . substr(JRoute::_("index.php?option=com_socialads&task=adredirector&adid=" . $addata->ad_id . "&caltype=1" . $widget), strlen(JUri::base(true)) + 1); if ($socialads_config['ignore'] != 0 && $this->_my->id != 0 && $this->_fromemail == 0) { if ($this->_my->id != 1) { $addata->ignore = "ignore_ads(this," . $addata->ad_id . "," . $socialads_config['feedback'] . ");"; } //$html .= '<img class="ad_ignore_button" src="'.JUri::Root().'components/com_socialads/images/fbcross.gif" onClick="ignore_ads(this,'.$addata->ad_id.','.$socialads_config["feedback"].');" />'; } } $plugin = 'plug_' . $addata->layout; $document->addStyleSheet(JUri::root() . 'components/com_socialads/css/helper.css'); $document->addScript(JUri::root() . 'components/com_socialads/js/helper.js'); $adRetriever = new adRetriever(); //START changed by manoj 2.7.5b2 //no passing zone id all time changed in 2.7.5 stable if (!$adseen) { $adHtmlTyped = $adRetriever->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $addata->layout, $track = 1, $adzone, $addata->ad_id); } else { if (!$addata) { $adHtmlTyped = $adRetriever->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $addata->layout, $track = 0, $adzone); } else { $adHtmlTyped = $adRetriever->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $addata->layout, $track = 0, $adzone); } } //END changed by manoj 2.7.5b2 if (JVERSION >= '1.6.0') { $layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . $plugin . DS . 'layout.php'; } else { $layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . 'layout.php'; } if (JFile::exists($layout)) { if (JVERSION >= '1.6.0') { $document->addStyleSheet(JUri::root() . 'plugins/socialadslayout/' . $plugin . '/' . $plugin . '/layout.css', 'text/css', '', array("id" => $addata->layout . 'css')); } else { $document->addStyleSheet(JUri::root() . 'plugins/socialadslayout/' . $plugin . '/layout.css', 'text/css', '', array("id" => $addata->layout . 'css')); } ob_start(); include $layout; $html .= ob_get_contents(); ob_end_clean(); } else { /*Ad title starts here...*/ $html .= '<!--div for preview ad-title--> <div class="ad_prev_first">'; if ($adseen == 0) { $html .= '<a class="ad_prev_anchor" href="' . $addata->link . '" target="_blank">' . $addata->ad_title . '</a>'; } else { $html .= $addata->ad_title; } $html .= '</div>'; /*Ad title ends here*/ /*Ad image starts here...*/ if ($addata->ad_image != '') { //check it image exists $html .= '<!--div for preview ad-image--> <div class="ad_prev_second">'; if ($adseen == 0) { $html .= '<a href="' . $addata->link . ' " target="_blank">'; } $html .= '<img class="ad_prev_img" src="' . JUri::Root() . $addata->ad_image . '" border="0" />'; if ($adseen == 0) { $html .= '</a>'; } $html .= '</div>'; } /*Ad image ends here*/ /*Ad description starts here...*/ $html .= '<!--div for preview ad-descrip--> <div class="ad_prev_third">' . $addata->ad_body . '</div>'; /*Ad description ends here*/ } $html .= '</div>'; return $html; }
function changelayout() { require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php"; $adseen = 2; $document = JFactory::getDocument(); $input = JFactory::getApplication()->input; //$post=$input->post; //$input->get $layout = $input->get('layout'); $addata = new stdClass(); $addata->ad_title = $input->get('title', '', 'STRING'); if ($addata->ad_title == '') { $addata->ad_title = JText::_("EXAMPLEAD"); } $addata->ad_body = $input->get('body', '', 'STRING'); if ($addata->ad_body == '') { $addata->ad_body = JText::_('SAMPLEAD'); } //START changed by manoj 2.7.5b2 $addata->link = '#'; $addata->ignore = ""; $upload_area = 'id="upload_area"'; $plugin = 'plug_' . $layout; $addata->ad_adtype_selected = $input->get('adtype'); $addata->adzone = $input->get('adzone'); /*added by manoj 2.7.5 stable*/ $addata->ad_image = ''; $adHtmlTyped = ''; if ($addata->ad_adtype_selected == 'text') { //$adHtmlTyped='<div class="preview-bodytext '.$layout.'_ad_prev_third">'; $adHtmlTyped .= $addata->ad_body; //$adHtmlTyped.='</div>'; } else { $addata->ad_image = $input->get('img', '', 'STRING'); $addata->ad_image = str_replace(JUri::base(), '', $addata->ad_image); if ($addata->ad_image == '') { $addata->ad_image = 'components/com_socialads/images/adimage.jpg'; } } require_once JPATH_SITE . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php'; $adshelper = new adRetriever(); $adHtmlTyped = $adshelper->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $layout, $track = 0, $addata->adzone); //END changed by manoj 2.7.5b2 //$document->addStyleSheet(JUri::base().'components/com_socialads/css/helper.css'); //added by sagar if (JVERSION >= '1.6.0') { $layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . $plugin . DS . 'layout.php'; $document->addStyleSheet(JUri::base() . 'plugins/socialadslayout/' . $plugin . '/' . $plugin . '/layout.css'); $css = JUri::base() . 'plugins/socialadslayout/' . $plugin . '/' . $plugin . '/layout.css'; } else { $layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . 'layout.php'; $document->addStyleSheet(JUri::base() . 'plugins/socialadslayout/' . $plugin . '/layout.css'); $css = JUri::base() . 'plugins/socialadslayout/' . $plugin . '/layout.css'; } //added by sagar $document->addScript(JUri::base() . 'components/com_socialads/js/helper.js'); if (JFile::exists($layout)) { ob_start(); include $layout; $html = ob_get_contents(); ob_end_clean(); } else { $html = '<!--div for preview ad-image--> <div><a id="preview-title" class="preview-title-lnk" href="#">'; if ($addata->ad_title != '') { $html .= '' . $addata->ad_title; } else { $html .= '' . JText::_("EXAMPLEAD"); } $html .= '</a> </div> <!--div for preview ad-image--> <div id="upload_area" >'; if ($addata->ad_image != '') { $html .= '<img src="' . $addata->ad_image . '">'; } else { $html .= '<img src="' . JUri::Root() . 'components/com_socialads/images/adimage.jpg">'; } $html .= ' </div> <!--div for preview ad-bodytext--> <div id="preview-bodytext">'; if ($addata->ad_body != '') { $html .= '' . $addata->ad_body; } else { $html .= '' . JText::_('SAMPLEAD'); } $html .= '</div>'; } //@TODO //$js should be sent out only for video ads and flash ads $js = ' flowplayer("div.vid_ad_preview", { src:"' . JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer-3.2.10.swf", wmode:"opaque" }, { canvas: { backgroundColor:"#000000", width:300, height:300 }, //default settings for the play button play: { opacity: 0.0, label: null, replayLabel: null, fadeSpeed: 500, rotateSpeed: 50 }, plugins:{ controls: { url:"' . JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer.controls-3.2.10.swf", height:25, timeColor: "#980118", all: false, play: true, scrubber: true, volume: true, time: false, mute: true, progressColor: "#FF0000", bufferColor: "#669900", volumeColor: "#FF0000" } } }); '; $z = array("html" => $html, "css" => $css, "js" => $js); echo json_encode($z); jexit(); }