Welcome Guest ( Log In | Register )

5 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> Trade Proposal Popup, A better script
habman
post Sep 22 2008, 06:51 AM
Post #1


Veteran
***

Group: Members
Posts: 1948
Joined: 29-August 05
From: Leamington ON, Canada
Member No.: 3058

2009 MFL: 31589 , 24836


MFL has recently added some new javascript variables to the "Pending Trades" Home Page module that has allowed coders to create a Trade Proposal Popup.


The only criteria to get this to work are that you need to have the "Pending Trades" Home Page module somewhere on your home page and you need to have the following script in your footer.

Here is the code that must be placed in your footer:
(Make sure that your advanced editor is set to "off")
CODE
<script language="Javascript" type="text/javascript">
<!--

//POPUP SETTINGS either set to true or false
var popupTradeProposalsFromMe = true;
var popupTradeProposalsToMe = true;
var popupTradeAwaitingCommissionerApproval = true;
var popupTradeAwaitingCommissionerReview = true;

//PERSONALIZE THE MESSAGES (OPTIONAL)
var popupTradeMessageToMe = "";

//FREQUENCY; 0=always, 1=once per browser session; 2=once per day; 3=once per week
var popupTradeFrequency = 1;

//POPUP COLOUR SETTING; use either color names (black) or code (#000000)
var popupTradeBGColor = 'black';  
var popupTradeBorder  = '2px solid red';

//POPUP POSITIONING;
//1=left/top;     4=center/top;      6=right/top;
//2=left/center;  0=center/center;   7=right/center;
//3=left/bottom;  5=center/bottom;   8=right/bottom;
var popupTradePositioning = 0;

// -->
</script>

<script language="JavaScript" type="text/javascript" src="http://www.habman.com/mfl/apps/js/tradepopup.js"></script>




If you are using my previous trade alert popup (see here) you should remove that one if you are going to use this one.


You can see it working on this test site:

http://www24.myfantasyleague.com/2008/home/60536

Login as the "Dolphins" password "dolphins"

Let me know of any issues.

EDITED TO ADD

March 9, 2009: I added on option to add a custom message to the popup when a trade has been proposed to a team. For example replacing var popupTradeMessageToMe = ""; with
CODE
var popupTradeMessageToMe = "<img src='http://www.habman.com/mfl/apps/js/images/tradesign.png' />";


Will will replace the normal trade offer announcement with this image


Thanks go out to "thehohiostate" for creating the image.


--------------------
My MFL scripts . . . . . . . . http://www.habman.com/mfl/
Go to the top of the page
 
+Quote Post
commishkeg
post Sep 22 2008, 11:20 AM
Post #2


Veteran
***

Group: Members
Posts: 280
Joined: 25-July 07
From: on the road somewhere
Member No.: 5370



SWEEEEEEEEEEEEEEEEEEEEET !!! i'm off to swap it right now ... you RAWK man


--------------------


Go to the top of the page
 
+Quote Post
commishkeg
post Sep 22 2008, 11:31 AM
Post #3


Veteran
***

Group: Members
Posts: 280
Joined: 25-July 07
From: on the road somewhere
Member No.: 5370



that looks GREAT !! ... question , is there a way to move where it pops up ? i'd like to move it down the page , just a lil ... right now it pops up right on the scrolling text and it cuts off the top off the window ... nitpicky i know , but you created somethin really cool , i'd like it to be seen correctly



--------------------


Go to the top of the page
 
+Quote Post
habman
post Sep 22 2008, 01:35 PM
Post #4


Veteran
***

Group: Members
Posts: 1948
Joined: 29-August 05
From: Leamington ON, Canada
Member No.: 3058

2009 MFL: 31589 , 24836


QUOTE (commishkeg @ Sep 22 2008, 01:31 PM) *
that looks GREAT !! ... question , is there a way to move where it pops up ? i'd like to move it down the page , just a lil ... right now it pops up right on the scrolling text and it cuts off the top off the window ... nitpicky i know , but you created somethin really cool , i'd like it to be seen correctly



Okay I have added the ability to position the popup at several different positions on the screen.

see the var popupTradePositioning in the code above.

Once you add the new var you may have to do a CTRL-F5 to clear your cache.


--------------------
My MFL scripts . . . . . . . . http://www.habman.com/mfl/
Go to the top of the page
 
+Quote Post
FFTL
post Sep 22 2008, 02:51 PM
Post #5


Veteran
***

Group: Members
Posts: 170
Joined: 15-August 08
From: Baltimore
Member No.: 6812

2009 MFL: 20271
2010 MFL: 40665 , 23392


QUOTE (habman @ Sep 22 2008, 03:35 PM) *
QUOTE (commishkeg @ Sep 22 2008, 01:31 PM) *
that looks GREAT !! ... question , is there a way to move where it pops up ? i'd like to move it down the page , just a lil ... right now it pops up right on the scrolling text and it cuts off the top off the window ... nitpicky i know , but you created somethin really cool , i'd like it to be seen correctly



Okay I have added the ability to position the popup at several different positions on the screen.

see the var popupTradePositioning in the code above.

Once you add the new var you may have to do a CTRL-F5 to clear your cache.


Thanks Habman.. love this new pop up script.. Already using it..


--------------------
Damien Clark
rosterdoc.com
Go to the top of the page
 
+Quote Post
dmgold77
post Sep 22 2008, 06:14 PM
Post #6


Veteran
***

Group: Members
Posts: 184
Joined: 24-June 08
From: Cincinnati
Member No.: 6502

2009 MFL: 47245


Great code...just out of curiosity, will this pop up every time you visit the site? Or just when there's a new offer?

Thanks.
Go to the top of the page
 
+Quote Post
habman
post Sep 22 2008, 06:31 PM
Post #7


Veteran
***

Group: Members
Posts: 1948
Joined: 29-August 05
From: Leamington ON, Canada
Member No.: 3058

2009 MFL: 31589 , 24836


QUOTE (dmgold77 @ Sep 22 2008, 08:14 PM) *
Great code...just out of curiosity, will this pop up every time you visit the site? Or just when there's a new offer?

Thanks.


The popup will occur based on two conditions:

1) as long as an owner has an outstanding trade proposal and 2) The pop frequency you have chosen.


Use the var popupTradeFrequency to set the frequency.

A setting of 0 will popup the app on each home page visit.
A setting of 1 will popup the app once per browser session.
A setting of 2 will popup the app once per day.
A setting of 3 will popup the app once per week.


--------------------
My MFL scripts . . . . . . . . http://www.habman.com/mfl/
Go to the top of the page
 
+Quote Post
Ogre
post Sep 22 2008, 07:41 PM
Post #8


Veteran
***

Group: Members
Posts: 179
Joined: 27-April 08
From: PA
Member No.: 6387



Habman, thanks a lot it looks great. Is there a way you could do that with Unread Private Messages?
Go to the top of the page
 
+Quote Post
habman
post Sep 22 2008, 07:44 PM
Post #9


Veteran
***

Group: Members
Posts: 1948
Joined: 29-August 05
From: Leamington ON, Canada
Member No.: 3058

2009 MFL: 31589 , 24836


QUOTE (Ogre @ Sep 22 2008, 09:41 PM) *
Habman, thanks a lot it looks great. Is there a way you could do that with Unread Private Messages?


I will e-mail Kevin at MFL and see if a variable can be added to that Home Page Module so something similar can be done.


--------------------
My MFL scripts . . . . . . . . http://www.habman.com/mfl/
Go to the top of the page
 
+Quote Post
Ogre
post Sep 22 2008, 08:09 PM
Post #10


Veteran
***

Group: Members
Posts: 179
Joined: 27-April 08
From: PA
Member No.: 6387



QUOTE (habman @ Sep 22 2008, 09:44 PM) *
QUOTE (Ogre @ Sep 22 2008, 09:41 PM) *
Habman, thanks a lot it looks great. Is there a way you could do that with Unread Private Messages?


I will e-mail Kevin at MFL and see if a variable can be added to that Home Page Module so something similar can be done.

Thanks a lot!
Go to the top of the page
 
+Quote Post
Ironhedz
post Sep 23 2008, 05:27 PM
Post #11


Veteran
***

Group: Members
Posts: 100
Joined: 17-September 04
Member No.: 1805



Habman the pop up is not working on my site. The site is 16956. When I login either as commish or someone I know has a trade - I get no pop up at all. I checked my browser to make sure it was not set to block pop ups. Is there something I am doing wrong. As always thanks for your help and your code, you make myfantasyleague more enjoyable - while I am at it can you write a script to block the ad's - lol
Go to the top of the page
 
+Quote Post
Ironhedz
post Sep 23 2008, 05:40 PM
Post #12


Veteran
***

Group: Members
Posts: 100
Joined: 17-September 04
Member No.: 1805



QUOTE (Ironhedz @ Sep 23 2008, 06:27 PM) *
Habman the pop up is not working on my site. The site is 16956. When I login either as commish or someone I know has a trade - I get no pop up at all. I checked my browser to make sure it was not set to block pop ups. Is there something I am doing wrong. As always thanks for your help and your code, you make myfantasyleague more enjoyable - while I am at it can you write a script to block the ad's - lol

Sorry - It would help if I read the thread completely. Problem solved.thanks again.
Go to the top of the page
 
+Quote Post
habman
post Sep 24 2008, 01:19 AM
Post #13


Veteran
***

Group: Members
Posts: 1948
Joined: 29-August 05
From: Leamington ON, Canada
Member No.: 3058

2009 MFL: 31589 , 24836


QUOTE (Ogre @ Sep 22 2008, 10:09 PM) *
QUOTE (habman @ Sep 22 2008, 09:44 PM) *
QUOTE (Ogre @ Sep 22 2008, 09:41 PM) *
Habman, thanks a lot it looks great. Is there a way you could do that with Unread Private Messages?


I will e-mail Kevin at MFL and see if a variable can be added to that Home Page Module so something similar can be done.

Thanks a lot!


Check out this thread http://www.sidelineleagues.com/forums/inde...showtopic=23212


--------------------
My MFL scripts . . . . . . . . http://www.habman.com/mfl/
Go to the top of the page
 
+Quote Post
krishansel
post Sep 26 2008, 08:30 PM
Post #14


Veteran
***

Group: Members
Posts: 43
Joined: 17-August 08
Member No.: 6829

2009 MFL: 14269
2010 MFL: 45331


This may be a stupid question but how exactly do I add this app. to my page. I have the pending trades module on my home page but don't quite understand how to insert the code and making it a footer. Thanks.
Go to the top of the page
 
+Quote Post
Lasernuke_Commis...
post Sep 26 2008, 11:10 PM
Post #15


Veteran
***

Group: Members
Posts: 220
Joined: 22-February 04
From: North St. Paul, MN
Member No.: 17

2009 MFL: 18033
2010 MFL: 24400


QUOTE (krishansel @ Sep 26 2008, 09:30 PM) *
This may be a stupid question but how exactly do I add this app. to my page. I have the pending trades module on my home page but don't quite understand how to insert the code and making it a footer. Thanks.



log in as Commissioner.
Go to for commissioners > Setup

Under Home Page Message Setup section (near the bottom of the page)

click one of the home page messages numbers, copy and paste the code in the the text box.

Give it a name that "makes sense" in the optional message label (I call mine footer, so I know that one is my footer, but you can use anything)
to set it as a footer
there are 2 check boxes below the text box
check the box for:
Message Should Appear: In Footer Of All League Pages

Click update Message

you'll then want to go back to your Home page, click customize page in the upper right.
you will have to lists, available modules on the left and your installed modules on the right.

Find the module you just saved on the left, click add to list.
click save home page setup.


you should be set

{edited per Habmans comments, Thank you Habman}


--------------------
You are in contravention of the New Paradigm.
Return to your own sector...........or be destroyed.
Go to the top of the page
 
+Quote Post

5 Pages V   1 2 3 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 3rd September 2010 - 11:51 PM