------------------------------- I am trying to run the ThickBox Window only the first time they enter the page as a login and nag page. I have been at this for literally days used different methods such as trying to jerry rig drupal to use both jquery and prototype etc... I think this is the closet I have gotten. My problem it tells me my url is not an image?? my url is going to a login page that was custom made .tpl.php login (I altered the Template.php to look for /login for only one case not for all other logins etc.. for drupal just need to be able to load it in the iframe........ any ideas I am starting to go blind.. The above javascript does work and understands not to run the code if they have already been to the page... Your help will be greatly appreciated thanks and may the force be with you.......................
<script>
window.onload = checkVisit;
function setCookie(name, value, expires, path, domain, secure) {
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else {
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) {
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}
function checkVisit() {
// Check last viewed version
var cookie = getCookie("javawin");
if (cookie == null || parseFloat(cookie) < 1.2) {
ShowThickbox();
date=new Date;
date.setMonth(date.getMonth()+3);
setCookie("javawin", "1.2", date);
}
}
function ShowThickbox()
{
TB_show('Thickbox Title', '/xampp/I-Create/?q=user/login?KeepThis=true&TB_iframe=true&height=400&width=600', null);
}
</script>
Comments
Possible solution? I wanted
Possible solution?
I wanted something like what you want.
If user not loged on ==> display Nag/Login
If user loged on ==> display page
I made this little addition to the page.tpl.php in the header below where the scripts are included I added
And in the Body I added the following:
Hope that it might help you
//
Daniel
Daniel you rock!
I have been breaking my head for hours on this and I was able to create a pop up box on the first time visit based on the code above. Here's what I did in case someone needs it.
Code for displaying a first time visitor window in thickbox
I put this in the head tag
Then, in the body I have the div to display:
Hope this helps someone else! Pay it forward!
Sol
Code for displaying a first time visitor window in thickbox
Hi Sol.
You are a genius! Thanks for the code above. I have one issue i.e it works great on my PC (localhost) but when i do same on my http server it shows up the popup each time.
Here's my code:
function showThickbox() { $(document).ready(function() { tb_show('','register.html'+'?KeepThis=true&TB_iframe=true&height=304&width=300&','modal=true',false); }); }-----------------------------
Thanks a lot if you know a solution to my problem
ThickBox for Browser Detection
Here's the same code to detect the browser version and display a link to upgrade.
I added this code in the body tag:
Hope it helps!
Sol
THANK YOU
Thanks so much for this I have been going crazy! Ahhhh. One question, is there any way to theme this so it matches the TB (standard TB CSS) on my site? I tried to add the div id of TB_window but it does not work
Cheers!
venusrising