Jump to content


Photo

Trade Proposal Popup


This topic has been archived. This means that you cannot reply to this topic.
79 replies to this topic

#1 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 22 September 2008 - 06:51 AM

MFL now has a "League Reminder" that should make this popup unnecessary. Check out this thread: http://forums.myfant...showtopic=28747


================================================================================


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")
<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.myfanta...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
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
Posted Image

Thanks go out to "thehohiostate" for creating the image.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#2 commishkeg

commishkeg

    Veteran

  • Members
  • PipPipPip
  • 280 posts

Posted 22 September 2008 - 11:20 AM

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



#3 commishkeg

commishkeg

    Veteran

  • Members
  • PipPipPip
  • 280 posts

Posted 22 September 2008 - 11:31 AM

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



#4 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 22 September 2008 - 01:35 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/

#5 FFTL

FFTL

    Veteran

  • Members
  • PipPipPip
  • 205 posts

Posted 22 September 2008 - 02:51 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..

@lilbitmawhney


#6 dmgold77

dmgold77

    Veteran

  • Members
  • PipPipPip
  • 186 posts

Posted 22 September 2008 - 06: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.

#7 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 22 September 2008 - 06:31 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/

#8 Ogre

Ogre

    Veteran

  • Members
  • PipPipPip
  • 179 posts

Posted 22 September 2008 - 07:41 PM

Habman, thanks a lot it looks great. Is there a way you could do that with Unread Private Messages?

#9 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 22 September 2008 - 07:44 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/

#10 Ogre

Ogre

    Veteran

  • Members
  • PipPipPip
  • 179 posts

Posted 22 September 2008 - 08:09 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!

#11 Ironhedz

Ironhedz

    Veteran

  • Members
  • PipPipPip
  • 100 posts

Posted 23 September 2008 - 05: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

#12 Ironhedz

Ironhedz

    Veteran

  • Members
  • PipPipPip
  • 100 posts

Posted 23 September 2008 - 05:40 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.

#13 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,605 posts

Posted 24 September 2008 - 01:19 AM

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.sidelinel...showtopic=23212
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#14 krishansel

krishansel

    Veteran

  • Members
  • PipPipPip
  • 43 posts

Posted 26 September 2008 - 08: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.

#15 Lasernuke_Commish

Lasernuke_Commish

    Veteran

  • Members
  • PipPipPip
  • 220 posts

Posted 26 September 2008 - 11:10 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.