Esempio n. 1
0
        $add_this_share = '
		<!-- AddThis Button BEGIN -->
		<div class="addthis_toolbox addthis_default_style ">
		<a href="https://www.addthis.com/bookmark.php"
		class="addthis_button"
		addthis:url="' . $ad_url . '"
		></a>
		</div>
		<!-- AddThis Button END -->
		';
        $pid = '';
        if ($socialads_config['sa_addthis_pub'] != '') {
            $pid = '#pubid=' . $socialads_config['sa_addthis_pub'];
        }
        $add_this_js = 'https://s7.addthis.com/js/250/addthis_widget.js' . $pid;
        $socialadshelper->loadScriptOnce($add_this_js);
        //output all social sharing buttons
        echo '<div class="social_share_container">
			<div class="social_share_container_inner">' . $add_this_share . '</div>
		</div>';
    }
    //for jomsocial like
    //if($socialads_config['se_jomsocial'])
    //{
    /*$jspath=JPATH_ROOT.DS.'components'.DS.'com_community';
    		if(JFolder::exists($jspath)){
    			include_once($jspath.DS.'libraries'.DS.'core.php');
    		}
    		CFactory::load( 'libraries' , 'like' );
    		$likes	    = new CLike();
    		//$likesHTML  = ($isMember && !$isBanned) ? $likes->getHTML( 'groups', $group->id, $my->id ) : $likes->getHtmlPublic( 'groups', $group->id );
Esempio n. 2
0
    return;
}
$doc = JFactory::getDocument();
$ads = $this->ads;
$moduleid = $this->moduleid;
$zone_id = $this->zone;
$params = $this->adRetriever;
$adRetriever = $this->adRetriever;
$lang = JFactory::getLanguage();
$lang->load('mod_socialads', JPATH_ROOT);
require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php";
$socialadshelper = new socialadshelper();
$doc = JFactory::getDocument();
$doc->addStyleSheet(JUri::base() . 'modules/mod_socialads/css/style.css');
if ($params->get('ad_rotation', 0) == 1) {
    $socialadshelper->loadScriptOnce(JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer-3.2.9.min.js');
    $socialadshelper->loadScriptOnce(JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'adrotation.js');
    $ad_rotationdelay = $params->get('ad_rotation_delay', 10);
    ?>
	<script>
		var site_link="";
		var user_id="";

		techjoomla.jQuery(document).ready(function()
		{
			var countdown;
			var module_id =	'<?php 
    echo $moduleid;
    ?>
';
			var ad_rotationdelay	=	<?php 
Esempio n. 3
0
    function getAdHTMLByMedia($upload_area, $ad_image, $ad_body, $ad_link, $ad_layout, $track = 0, $adzone, $ad_id = '')
    {
        $adHtmlTyped = '';
        if ($ad_layout == 'layout2' || $ad_layout == 'layout4' || $ad_layout == 'layout6') {
            $ad_type = 'text';
            $adHtmlTyped .= $ad_body;
        } else {
            require_once JPATH_SITE . DS . 'components' . DS . 'com_socialads' . DS . 'helpers' . DS . 'media.php';
            require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php";
            $media = new sa_mediaHelper();
            $fpath = JUri::root() . $ad_image;
            $fextension = JFile::getExt($fpath);
            $ad_type = $media->get_ad_type($fextension);
            $socialadshelper = new socialadshelper();
            /*
            //@TODO use image/zone dimensions here?
            $media_d=$media->check_media_resizing_needed($zone_d,$fpath);
            $opti_d=$media->get_new_dimensions($zone_d->img_width, $zone_d->img_height, 'auto');
            */
            switch ($ad_type) {
                case "image":
                    //@TODO use resized image dimensions here
                    $adHtmlTyped = '<img class="' . $ad_layout . '_ad_prev_img" alt="" src="' . JUri::root() . $ad_image . '" style="border:0px;" />';
                    break;
                case "flash":
                    if ($track) {
                        $zone_d = $media->get_adzone_media_dimensions($adzone);
                        //include flowplayer javascript
                        $socialadshelper->loadScriptOnce(JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer-3.2.9.min.js');
                        $adHtmlTyped = '';
                        //@TODO use image?zone dimensions here?
                        //$ht_wd='width:'.$media_d['width_img'].'px;height:'.$media_d['height_img'].'px';
                        //$ht_wd='width:'.$opti_d['new_calculated_width'].'px;height:'.$opti_d['new_calculated_height'].'px';
                        $ht_wd = 'width:' . $zone_d->img_width . 'px;height:' . $zone_d->img_height . 'px';
                        //create uniquq tag for each ad for video ads
                        $adHtmlTyped .= '<div
							href="' . JUri::root() . $ad_image . '"
							style="display:block;' . $ht_wd . '"
							id="vid_player_' . $ad_id . '">
							</div>';
                        //flow player js, configured as required
                        $adHtmlTyped .= '
						<script>
							flowplayer("vid_player_' . $ad_id . '",
							{
								src:"' . JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer-3.2.10.swf",
								wmode:"opaque"
							},
							{
								/*
								canvas: {
									backgroundColor:"#000000",
									width:' . $zone_d->img_width . ',
									height:' . $zone_d->img_height . '
								},
								*/

								clip : {
									scaling: "scale",
									autoPlay: true
								},

								//default settings for the play button
								play: {
									opacity: 0.0,
									label: null,
									replayLabel: null,
									fadeSpeed: 500,
									rotateSpeed: 50
								},

								plugins:{
									controls: null,

									content: {
										url:"' . JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer.content-3.2.8.swf",
										width:' . $zone_d->img_width . ',
										height:' . $zone_d->img_height . ',
										backgroundColor: "#112233",
										opacity: 0.0,
										onClick: function() {
										window.open("' . $ad_link . '","_blank");/*opens in new tab*/
										}
									}
								}
							});
						</script>';
                    } else {
                        //FLOWPLAYER
                        $zone_d = $media->get_adzone_media_dimensions($adzone);
                        $adHtmlTyped = '';
                        $adHtmlTyped .= '
						<div class="vid_ad_preview"
						href="' . JUri::root() . $ad_image . '"
						style="background:url(' . JUri::root() . '/components/com_socialads/images/black.png);width:' . $zone_d->img_width . 'px;height:' . $zone_d->img_height . 'px;
						">
						</div>
						';
                        //this is needed for ad preview from backend
                        $adHtmlTyped .= '<script type="text/javascript">
						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:' . $zone_d->img_width . ',
								height:' . $zone_d->img_height . '
							},

							//default settings for the play button
							play: {
								opacity: 0.0,
							 	label: null,
							 	replayLabel: null,
							 	fadeSpeed: 500,
							 	rotateSpeed: 50
							},

							plugins:{
								controls: null
							}
						});
						</script>';
                    }
                    break;
                case "video":
                    if ($track) {
                        $zone_d = $media->get_adzone_media_dimensions($adzone);
                        //include flowplayer javascript
                        $socialadshelper->loadScriptOnce(JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer-3.2.9.min.js');
                        $adHtmlTyped = '';
                        /*
                        //@TODO use image?zone dimensions here?
                        $ht_wd='width:'.$media_d['width_img'].'px;height:'.$media_d['height_img'].'px';
                        $ht_wd='width:'.$opti_d['new_calculated_width'].'px;height:'.$opti_d['new_calculated_height'].'px';
                        */
                        $ht_wd = 'width:' . $zone_d->img_width . 'px;height:' . $zone_d->img_height . 'px';
                        //calculate top margin for play button icon
                        $top_margin = $zone_d->img_height / 2 - 48;
                        //calculate overlay div height
                        $div_height = $zone_d->img_height - 25;
                        //create uniquq tag for each ad for video ads
                        $adHtmlTyped .= '<div
							href="' . JUri::root() . $ad_image . '"
							style="display:block;' . $ht_wd . '"
							id="vid_player_' . $ad_id . '">
							</div>';
                        //flow player js, configured as required
                        $adHtmlTyped .= '
						<script>
							flowplayer("vid_player_' . $ad_id . '",
							{
								src:"' . JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer-3.2.10.swf",
								wmode:"opaque"
							},
							{
								canvas: {
									backgroundColor:"#000000",
									width:' . $zone_d->img_width . ',
									height:' . $zone_d->img_height . '
								},

								//default settings for the play button
								play: {
									opacity: 0.0,
								 	label: null,
								 	replayLabel: null,
								 	fadeSpeed: 500,
								 	rotateSpeed: 50
								},
							';
                        if ($socialads_config["allow_vid_ads_autoplay"] == 0) {
                            //added by aniket for stop auto play
                            $adHtmlTyped .= '	clip: {
									// these two settings will make the first frame visible
									autoPlay: false,
									autoBuffering: true,
									duration: 0,
									// locate a good looking first frame with the start parameter
									start: 62,
									},
							';
                        }
                        $adHtmlTyped .= '	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"
									},

									content: {
										url:"' . JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer.content-3.2.8.swf",
										width:' . $zone_d->img_width . ',
										height:' . $div_height . ',
										backgroundColor: "#112233",
										opacity: 0.0,
										onClick: function() {
										window.open("' . $ad_link . '","_blank");/*opens in new tab*/
										}
									}
								}
							});
						</script>';
                    } else {
                        //FLOWPLAYER
                        $zone_d = $media->get_adzone_media_dimensions($adzone);
                        $adHtmlTyped = '';
                        $adHtmlTyped .= '
						<div class="vid_ad_preview"
						href="' . JUri::root() . $ad_image . '"
						style="background:url(' . JUri::root() . '/components/com_socialads/images/black.png);width:' . $zone_d->img_width . 'px;height:' . $zone_d->img_height . 'px;
						">
						</div>
						';
                        //this is needed for ad preview from backend
                        $adHtmlTyped .= '<script type="text/javascript">
						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:' . $zone_d->img_width . ',
								height:' . $zone_d->img_height . '
							},

							//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"
									}
							}
						});
						</script>';
                    }
                    break;
            }
            //end switch case
        }
        //end else (media ads)
        $adHtmlTypedwithad_type = "<div class='adtype' adtype='" . $ad_type . "'>" . $adHtmlTyped . "</div>";
        return $adHtmlTypedwithad_type;
    }