DragonPrime - LoGD Resource Community

Coding Support => Coding Support Desk => Topic started by: Spy.Dr on January 08, 2011, 06:10:49 AM



Title: PopUp Size
Post by: Spy.Dr on January 08, 2011, 06:10:49 AM
Hi guys,
 please, I finding and finding and finding...but I cant find reply for my question.

How can I change size of all PopUp windows in LoGD (Motd, Mail,...)?
Thx for any reply

Spy.Dr


Title: Re: PopUp Size
Post by: MarcTheSlayer on January 09, 2011, 09:20:08 AM
File: /lib/pageparts.php
Line: 70-73
Code:
<?php
function popup($page,$size="550x300"){
$s split("x",$size);
  return 
"window.open('$page','".preg_replace("([^[:alnum:]])","",$page)."','scrollbars=yes,resizable=yes,width={$s[0]},height={$s[1]}').focus()";
}

Change the 550x300 to the size you want. Of course this will only be used if a size has not been specified by what ever created the link. :)


Title: Re: PopUp Size
Post by: Spy.Dr on January 09, 2011, 12:11:21 PM
Thank you very much. Its IT. Work it.


Title: Re: PopUp Size
Post by: TGTarheel on December 18, 2018, 03:06:38 AM
File: /lib/pageparts.php
Line: 70-73
Code:
<?php
function popup($page,$size="550x300"){
$s split("x",$size);
  return 
"window.open('$page','".preg_replace("([^[:alnum:]])","",$page)."','scrollbars=yes,resizable=yes,width={$s[0]},height={$s[1]}').focus()";
}

Change the 550x300 to the size you want. Of course this will only be used if a size has not been specified by what ever created the link. :)

OK, I hate to gravedig here, BUT...this post best illustrates my question.

I made this change in pageparts.php and it does work....BUT...you imply that a size can be set by whatever creates the link.  But DAMNED if I can get a popup window to size different.

Here is what I am doing...moving "Preferences" to the top of the page near YOM and so on...but I can't size the popup box different.

Code:
return sprintf("<a href='prefs.php' target='_blank' onClick=\"".popup("prefs.php").";return false;\" class='motd'><b>".translate_inline("Preferences")."</b></a> | <a href='prefs.php' target='_blank' onClick=\"".popup("prefs.php").";return false;\" class='motd'><b>".translate_inline("Preferences")."</b></a> | <a href='mail.php' target='_blank' onClick=\"".popup("mail.php").";return false;\" class='hotmotd'>".translate_inline("Mail: %s new, %s old", 'common')."</a>",$row['notseen'],$row['seencount']);


Now, what I WANT...is for this part, just the Preferences....to specify a size.

How do I do that using .popup("prefs.php" - etc.?

I know that a module notepad.php does it using window.open

But I can't figure how to code it in this context

Like i said, you have implied it is possible to set a size for one specific popup.  So how is it done?



Title: Re: PopUp Size
Post by: Aeolus on December 18, 2018, 03:34:41 AM
Pass the custom size as the second argument. So, instead of popup("prefs.php"), use popup("prefs.php","1000x500"). "550x300" is the default value of the argument when it isn't provided through the function call.


Title: Re: PopUp Size
Post by: TGTarheel on December 18, 2018, 03:40:33 AM
Pass the custom size as the second argument. So, instead of popup("prefs.php"), use popup("prefs.php","1000x500"). "550x300" is the default value of the argument when it isn't provided through the function call.

let me try that!!

Son of a bee, it works!!

Thank you!

As an aside, I tried to do this same thing to motd.php and mail.php and petition.php but t did not fly, LOL

Thinking on setting default popup bov like above and then going into individual modules to set them this way instead.

But it ought to work

thanks again

© 2019 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines