DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • March 21, 2019, 04:34:47 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: PopUp Size  (Read 1531 times)
0 Members and 1 Guest are viewing this topic.
Spy.Dr
Militia
**
Offline Offline

Posts: 15


View Profile
« 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
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1750


View Profile
« Reply #1 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. Smiley
Logged

Check My Modules for the latest versions.
Spy.Dr
Militia
**
Offline Offline

Posts: 15


View Profile
« Reply #2 on: January 09, 2011, 12:11:21 PM »

Thank you very much. Its IT. Work it.
Logged
TGTarheel
Mod God
*****
Offline Offline

Posts: 516


View Profile
« Reply #3 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. Smiley

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?

Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1923


You're welcome.


View Profile WWW
« Reply #4 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.
« Last Edit: December 18, 2018, 03:37:27 AM by Aeolus » Logged

TGTarheel
Mod God
*****
Offline Offline

Posts: 516


View Profile
« Reply #5 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
« Last Edit: December 18, 2018, 04:14:16 AM by TGTarheel » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
36 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search