[ Video Sharing CMS v4 ] How to implement a pop up

Started by RumbaGumba,

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

RumbaGumbaTopic starter

Hi guys,
Can I put a pop up showing to all pages and where do I have to insert the code? ex. Facebook Like pop up.
  •  

PHPVibe A.

Hi!

tpl/main/tpl.globals.php holds the footer and header.

RumbaGumbaTopic starter

Can you be more specific where exactly in tpl.globals.php have to insert the code because I tried a couple of places and all fu*ked up the site
  •  

PHPVibe A.

#3
This depends how the code looks like.

If you have ' in the code, it will need escaping like \'  if you place it in a echo/return/variable with ' content ' assignment.

I guess this is why you get errors.

If you are specific on where you need to place it footer/header and what's the code, I can help you.

RumbaGumbaTopic starter

  •  

RumbaGumbaTopic starter

In other words users will have to like my facebook page in order to watch the videos. That is why I need to show it to all pages and not only to home page
  •  

PHPVibe A.

#6
I would not see why that would not work, it uses same jquery version as phpvibe.

Try
$footer =  '
<!-- Facebook POPUP LikeBox With Timer Code Start -->
<style type=\'text/css\'>
#exepopup{background-color:#fff;position: fixed;top:50%;z-index:9999;display:none;padding:0px;left:50%;border:10px solid rgba(82, 82, 82, 0.7);-webkit-background-clip: padding-box; /* for Safari */background-clip: padding-box; /* for IE9+, Firefox 4+, Opera, Chrome */-webkit-border-radius:8px 8px 8px 8px;-moz-border-radius:8px 8px 8px 8px;border-radius:8px 8px 8px 8px;width:400px;height:360px;margin-left:-200px;margin-top:0px;overflow:hidden;}#exepopup span{font-size:20px !important;font-weight:bold !important;}#exepopup h1{background:#6d84b4 url(http://4.bp.blogspot.com/-wbOyGFuANTQ/UVF1F4ouC4I/AAAAAAAABiA/RX4jNlICbjM/s1600/aktechz-fb-lock.png) 98% no-repeat;border:1px solid #3b5998 !important;color:#FFFFFF !important;font-size:20px !important;font-weight:700 !important;padding:5px !important;margin:0 !important;font-family:\'"lucida grande",tahoma,verdana,arial,sans-serif !important;overflow:hidden !important;}.exepopupdata{font-size:12px !important;font-weight:normal !important;height:265px !important;padding:1px !important;background:#fff !important;border-bottom:2px solid #ddd;overflow:hidden !important;}#exepopupfooter{text-align:left;background:#F2F2F2 !important;height:56px !important;padding:10px 10px 10px 10px !important;overflow:hidden !important;}#exepopupclose{float:right;background-color:#eee !important;border:1px solid #ccc !important;color:#111 !important;font-weight:bold !important;padding:5px 8px 5px 8px !important;text-decoration:none !important;display:inline-block !important;font-family:\'"lucida grande",tahoma,verdana,arial,sans-serif !important;outline:none !important;position:relative !important;font-size:18px !important;margin:1px !important;}#exepopupclose:active{top:1px;left:1px;}</style>
<script type=\'text/javascript\'>
jQuery(document).ready(function() {
function exepopupfunc() {
var sec = 10
var timer = setInterval(function() {
$("#exepopupfooter span").text(sec--);
if (sec == 0) {
$("#exepopup").fadeOut("slow");
clearInterval(timer);
}
},1000);
var exepopupwindow = jQuery(window).height();
var exepopupdiv = jQuery("#exepopup").height();
var exepopuptop = jQuery(window).scrollTop()+50;
jQuery("#exepopup").css({"top":exepopuptop});}
jQuery(window).fadeIn(exepopupfunc).resize(exepopupfunc)
//alert(jQuery.cookie(\'sreqshown\'));
//var exepopupww = jQuery(window).width();
//var exepopupwww = jQuery("#exepopup").width();
//var exepopupleft = (exepopupww-exepopupwww)/2;
var exepopupleft = 500;
//var exepopupwindow = jQuery(window).height();
//var exepopupdiv = jQuery("#exepopup").height();
//var exepopuptop = (jQuery(window).scrollTop()+exepopupwindow-exepopupdiv) / 2;
jQuery("#exepopup").animate({opacity: "1", left: "0" , left: exepopupleft}, 0).show();
jQuery("#exepopupclose").click(function() {
jQuery("#exepopup").animate({opacity: "0", left: "-5000000"}, 1000).show();});});
</script>
<div id="exepopup">
<h1>Join Us On Facebook</h1>
<div class="exepopupdata"><iframe src="http://facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FEXEIdeas2010&amp;width=400&amp;colorscheme=light&amp;show_faces=true&amp;border_color=%23fff&amp;stream=false&amp;header=false&amp;height=250" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:250px;" allowtransparency="true"></iframe></div>
<div id="exepopupfooter">Please Wait <span>10</span> Seconds...!!!<a href="#" id="exepopupclose" onclick="return false;">Skip</a></div></div>
<!-- Facebook POPUP LikeBox With Timer Code End -->';


After:

$next .= 'var nv_lang = \''._lang("Next video starting soon").'\';';


And replace under:

$footer =  '


with
$footer .=  '

Note: i've removed jquery cause it's already in phpvibe and will give errors.
This popup code is kinda trashy.

marius20foc

since what was stated here is obsolete for 3.5 could we get an update?

changing
$footer =  '
with
$footer .=  '

gives a error like this one:

[13-Mar-2014 17:58:46 America/Chicago] PHP Notice:  Undefined variable: footer in /home4/xxxxxx/public_html/tpl/main/tpl.globals.php on line 291


also, I see that there is no jquery.js in 3.5, is it safe to add the file, thus is required for that popup?

PS:is it ok just to delete the error log, or should I empty its content? In my case it's a hefty 600Mb :o
  •  

PHPVibe A.

Depends where you've put it, a first instance of $footer cannot have $footer .= since it will trow that error.
But you can also do $footer = ''; before to simply init it.

If you have error related to 3.5, I'm interest in his contents, if they are old, you can just delete it.

major48

I am trying to add a popunder in the <head> Tags. I read this but whenever I add the code my page won't load.
  •  

PHPVibe A.


major48

#11
Quote from: Alexander on
How does it look like?
Post it.
<!-- Begin JuicyAds PopUnder Code -->
<script type="text/javascript">juicy_code='34b42333x256z2v2r2a4y2';</script>
<script type="text/javascript" src="http://ads.juicyads.com/jsclients/jac.js" charset="utf-8"></script>
<!-- End JuicyAds PopUnder Code -->
  •  

PHPVibe A.

Show me the code put in the header :) This will cause errors if just pasted since ' needs to become \'

major48

Quote from: Alexander on
Show me the code put in the header :) This will cause errors if just pasted since ' needs to become \'
That's what I am saying. I am not sure which file to edit and where to edit it. It just needs to go in before </head> and I tried that but it didn't work.
  •  

Marius P.

tpl/main/tpl.globals.php

$head .= '</head>



to


$head .= '

<script type="text/javascript">juicy_code=\'34b42333x256z2v2r2a4y2\';</script>
<script type="text/javascript" src="http://ads.juicyads.com/jsclients/jac.js" charset="utf-8"></script>
</head>



Not sure what was so complicated  :P
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

major48

Quote from: @Mario on
tpl/main/tpl.globals.php

$head .= '</head>



to


$head .= '

<script type="text/javascript">juicy_code=\'34b42333x256z2v2r2a4y2\';</script>
<script type="text/javascript" src="http://ads.juicyads.com/jsclients/jac.js" charset="utf-8"></script>
</head>



Not sure what was so complicated  :P

That's what I tried before I messaged you guys and the page comes up blank when I do it
  •  

major48

  •  

PHPVibe A.


xda

Quote from: @Mario on
tpl/main/tpl.globals.php

$head .= '</head>



to


$head .= '

<script type="text/javascript">juicy_code=\'34b42333x256z2v2r2a4y2\';</script>
<script type="text/javascript" src="http://ads.juicyads.com/jsclients/jac.js" charset="utf-8"></script>
</head>



Not sure what was so complicated  :P

Hi. i already test this. but still same. my website blank.
  •  

xda

  •  

PHPVibe A.


conghandang

#21
Can you show me the way add popup code in tag <head>   </head>..Thanks you
I try it in file tpl.global.php but this site error!
This popup code follow:
<!-- PopAds.net Popunder Code for coitube.net -->
<script type="text/javascript">
  var _pop = _pop || [];
  _pop.push(['siteId', 372436]);
  _pop.push(['minBid', 0]);
  _pop.push(['popundersPerIP', 0]);
  _pop.push(['delayBetween', 0]);
  _pop.push(['default', false]);
  _pop.push(['defaultPerDay', 0]);
  _pop.push(['topmostLayer', false]);
  (function() {
    var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true;
    var s = document.getElementsByTagName('script')[0]; 
    pa.src = '//c1.popads.net/pop.js';
    pa.onerror = function() {
      var sa = document.createElement('script'); sa.type = 'text/javascript'; sa.async = true;
      sa.src = '//c2.popads.net/pop.js';
      s.parentNode.insertBefore(sa, s);
    };
    s.parentNode.insertBefore(pa, s);
  })();
</script>
<!-- PopAds.net Popunder Code End -->
  •  

PHPVibe A.

The code needs editing as i've explained up:
<!-- PopAds.net Popunder Code for coitube.net -->
<script type="text/javascript">
  var _pop = _pop || [];
  _pop.push([\'siteId\', 372436]);
  _pop.push([\'minBid\', 0]);
  _pop.push([\'popundersPerIP\', 0]);
  _pop.push([\'delayBetween\', 0]);
  _pop.push([\'default\', false]);
  _pop.push([\'defaultPerDay\', 0]);
  _pop.push([\'topmostLayer\', false]);
  (function() {
    var pa = document.createElement(\'script\'); pa.type = \'text/javascript\'; pa.async = true;
    var s = document.getElementsByTagName(\'script\')[0]; 
    pa.src = \'//c1.popads.net/pop.js\';
    pa.onerror = function() {
      var sa = document.createElement(\'script\'); sa.type = \'text/javascript\'; sa.async = true;
      sa.src = \'//c2.popads.net/pop.js\';
      s.parentNode.insertBefore(sa, s);
    };
    s.parentNode.insertBefore(pa, s);
  })();
</script>
<!-- PopAds.net Popunder Code End -->

conghandang

  •  

maldboy

@conghandang how you added man?am trying the same code including \  but i get error... tell me the correct code or image from your code plz.ty
  •  

Similar topics (7)