vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 01-29-2005, 04:39 PM
Crazy Serb Crazy Serb is offline
Member
 
Join Date: Sep 2004
Posts: 36
Default REQUEST: Custom Popup Window?

Would it be possible to code a custom popup window module that would display a custom image/link inside it with the ability to turn it on/off by admins & mods?

I've always had to hard code the popup code/cookie code (that keeps the popup from appearing more than once every X minutes) and it's really hard for my mods to edit that code themselves (not being familiar with html/javascript, etc). So I'm wondering if it would be possible to create a module accessible by admins and mods that will define the following:

- popup dimensions (width/height)
- popup window title
- image dimensions (width/height) (popup dimensions could be the same as this)
- image alt/title
- image source (maybe even ability to add the image/banner via attachments)
- image link (pointing to a thread on the board or whatever other link it may be)
- popup turned on/off

I already have the javascript code that sets a cookie once the popup has been displayed and prevents it from showing up for another hour (time interval is customizable). Actually, here, I'll post all the files involved in this "manual process" here...


flyer.php
Code:
function flyer(){
	window.open('http://www.mydomain.com/popup.html','MyDomain','width=400,height=499','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no');
}

flyer();
popup.html
Code:
<HTML>
<HEAD>
<TITLE>This Friday!</TITLE>
</HEAD>
<CENTER>
<BODY BGCOLOR=black leftMargin=0 topMargin=0>
<IMG width="400" height="499" src="http://www.mydomain.com/images/popup_72.jpg" border="0">
</BODY>
</HTML>
the code added to the HEAD in forum pages:
Code:
var expMinutes = 60; // number of minutes the cookie should last

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expMinutes*60*1000));
function amt(){
var popup = GetCookie('popup')
if(popup == null) {
SetCookie('popup','1')
return 1
}
else {
var newpopup = parseInt(popup) + 1;
DeleteCookie('popup')
SetCookie('popup',newpopup,exp)
return popup
}
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function checkpopup() {
var popup = GetCookie('popup');
if (popup == null) {
popup=1;
SetCookie('popup', popup, exp);
document.write("<SCRIPT LANGUAGE=\"JavaScript\" src=\"http://www.mydomain.com/flyer.php\"></script>");
}
else {
popup++;
SetCookie('popup', popup, exp);
}
}
checkpopup();
  #2  
Old 02-15-2005, 11:32 PM
Crazy Serb Crazy Serb is offline
Member
 
Join Date: Sep 2004
Posts: 36
Default Re: REQUEST: Custom Popup Window?

what, nobody found this valuable or interesting at least?
  #3  
Old 02-22-2005, 11:31 PM
Magical1's Avatar
Magical1 Magical1 is offline
Junior Member
 
Join Date: Oct 2004
Posts: 13
Default Re: REQUEST: Custom Popup Window?

DO YOU HAVE A DEMO WE COULD LOOK AT?
  #4  
Old 05-25-2005, 07:30 AM
fLoW fLoW is offline
Member
 
Join Date: Apr 2005
Location: Brooklyn,NY
Posts: 75
Default Re: REQUEST: Custom Popup Window?

I thinks this is a very good idea... would like to have that on!!
  #5  
Old 05-25-2005, 12:25 PM
Albus Albus is offline
Senior Member
 
Join Date: Apr 2005
Posts: 137
Default Re: REQUEST: Custom Popup Window?

I dislike popups of any sort honestly. Even those built in to vB I'd rather see migrated to another method.
  #6  
Old 05-25-2005, 08:55 PM
Crazy Serb Crazy Serb is offline
Member
 
Join Date: Sep 2004
Posts: 36
Default Re: REQUEST: Custom Popup Window?

Quote:
Originally Posted by Albus
I dislike popups of any sort honestly. Even those built in to vB I'd rather see migrated to another method.
well, that's your personal opinion...
  #7  
Old 05-26-2005, 08:37 AM
LEAD_WEIGHT's Avatar
LEAD_WEIGHT LEAD_WEIGHT is offline
Senior Member
 
Join Date: Mar 2005
Posts: 307
Default Re: REQUEST: Custom Popup Window?

Quote:
Originally Posted by Crazy Serb
what, nobody found this valuable or interesting at least?
If u need help in this u should ask www.vbulletin.org for help.

I would like it if it can be used for my AMF Flashchat Rooms so u do not need to get another url page setup again. Mine always goes to AMF FlashChat but I want it to have the forum display so I can go back & forth.
__________________
User Name : test
Password : test
www.theundergroundsource.com

Last edited by LEAD_WEIGHT; 05-26-2005 at 08:40 AM.
  #8  
Old 05-08-2006, 08:18 PM
NemoTech NemoTech is offline
Member
 
Join Date: Oct 2005
Posts: 35
Default Re: REQUEST: Custom Popup Window?

Exactly what I was looking for, didnt' want to do this myself. I'll test it out now. :thumbs:
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[REQUEST] Will pay $$$ For Custom Skin kderentz Chit Chat 1 01-13-2005 02:34 PM
[Request] How can I add a custom block that can pull posts from my forum? Sal Collaziano Add-On Modules & Modifications 2 12-30-2004 10:03 AM
Custom Skin request. 03GTFL Troubleshooting / "How do I..." Questions 3 06-28-2004 02:55 PM


All times are GMT -4. The time now is 09:38 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.