This is the code:
<li class="sub"><a class="sub" href="<?php echo
$TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
Friend');?>
What do I need to input to get a height of 15 and width of 200?
> What do I need to input to get a height of 15 and width of 200?
>
>
My bad, can't even type it out.. LOL!
Question is: what do I need to add and/or remove to the line of code so it
will open in a pop-up or new window of height=200 and width of 150
You can't do it in PHP. PHP is server side only, and you need something
client side. Try alt.html and/or comp.lang.javascript.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================
>Dave wrote:
>> <li class="sub"><a class="sub" href="<?php echo
>> $TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
>> Friend');?>
>>
>>> What do I need to input to get a height of 15 and width of 200?
>>>
>>>
>>
>> My bad, can't even type it out.. LOL!
>>
>> Question is: what do I need to add and/or remove to the line of code so
>> it will open in a pop-up or new window of height=200 and width of 150
>>
>>
>
>You can't do it in PHP. PHP is server side only, and you need something
>client side. Try alt.html and/or comp.lang.javascript.
Correct - but PHP can write javascript coding in the web page PHP
creates ...
He can look at
http://www.yourhtmlsource.com/javascript/popupwindows.html
to find infos on how to do it using javascript.
Which is just strings to PHP - and has absolutely nothing to do with PHP.
You guys are both good help. looks like a combo of php and html.
Thanks!
And you didn't pay attention.
Your question has absolutely nothing to do with PHP. It may just happen that
PHP is spitting out the code. It could equally have been Perl or C++ or any
other server side script. Doesn't mean your question would be on-topic in a
C++ group.
Your issue is purely a javascript one. Ask in comp.lang.javascript
sorry, meant to say javascript and html. but, I gotz da idea
And encourage more off-topic posts?
Plus there may be other, better solutions which are more appropriate in
his case. We don't know, because this is a PHP newsgroup and his
question is unrelated to PHP.
No, you just didn't do some basic problem determination and as a result,
posted in the wrong newsgroup.
comp.lang.javascript would be a much better place for this type of
question, as indicated above.
>Raymond Schmit wrote:
>> On Tue, 10 Aug 2010 11:06:04 +1000, "rf" <r...@z.invalid> wrote:
>>
>>> "Dave" <davenl...@hotNOmailSPAM.com> wrote in message
>>> news:ZZ08o.2136$yr6....@newsfe05.iad...
>>>> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
>>>> news:i3prln$75a$1...@news.eternal-september.org...
>>>>> Raymond Schmit wrote:
>>>>>> On Sun, 08 Aug 2010 18:51:15 -0400, Jerry Stuckle
>>>>>> <jstu...@attglobal.net> wrote:
>>>>>>
>>>>>>> Dave wrote:
>>>>>>>> <li class="sub"><a class="sub" href="<?php echo
>>>>>>>> $TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
>>>>>>>> Friend');?>
>>>>
>>>> You guys are both good help. looks like a combo of php and html.
>>> And you didn't pay attention.
>>>
>>> Your question has absolutely nothing to do with PHP. It may just happen that
>>> PHP is spitting out the code. It could equally have been Perl or C++ or any
>>> other server side script. Doesn't mean your question would be on-topic in a
>>> C++ group.
>>>
>>> Your issue is purely a javascript one. Ask in comp.lang.javascript
>>>
>>
>> I think that i give him the solution ->
>> http://www.yourhtmlsource.com/javascript/popupwindows.html
>
>And encourage more off-topic posts?
>
This is NOT a reason for "no help"
The CORRECT help is to send him to the right newsgroup. Then he will
get GOOD answers to his questions!
My answer was not good ?
Nope. Insufficient information to determine whether that will suit his
needs or not. And this would not be the place to ask the appropriate
questions to get the necessary information. And if your answer isn't
correct for him, you just sent him off to waste possibly several hours
on a wild goose chase.
c.l.j has javascript experts who can ask the right questions and provide
the correct response.
> oh gosh.. I created a monster...
Don't give yourself so much credit!
There's been monsters on usenet for over 2 decades now.
"Dave" <davenl...@hotNOmailSPAM.com> wrote in message
news:4X%8o.49017$F%7.3...@newsfe10.iad...
> yup. created a monster...
Luckily, I'm a monster killer!
Try this...
<?php
$popleft = 200; // popup position
$popdown =100; // popup position
$popname = "Invite"; // popup ref name
$popwidth = 200; // subject to browser min
$popheight = 15; // subject to browser min
$popscroll = "no"; // yes/no
?>
<html>
<head>
<?php
$popupscript = "<script type=\"text/JavaScript\"
language=\"javascript\">\n";
$popupscript .= "<!-- POPUP\n";
$popupscript .= "function winBRopen(theURL, Name, popW, popH, scroll){\n";
$popupscript .= "var winleft = " . $popleft . ";\n";
$popupscript .= "var windown = " . $popdown . "\n";
$popupscript .= "winProp =
'width='+popW+',height='+popH+',left='+winleft+',top='+windown+',scrollbars='+scroll+','\n";
$popupscript .= "Win = window.open(theURL, Name, winProp)\n";
$popupscript .= "if (parseInt(navigator.appVersion) >= 4){\n";
$popupscript .= "Win.window.focus();\n";
$popupscript .= "}\n";
$popupscript .= "}\n";
$popupscript .= "// - End of JavaScript - -->\n";
$popupscript .= "</script>\n";
echo $popupscript;
?>
</head>
<body>
<li class="sub"><a class="sub" href="<?php echo
$TMPL['path'].'invite.php';?>" target="_blank" onClick="winBRopen('<?php
echo $TMPL['path'].'invite.php';?>','<?php echo $poptitle;?>','<?php echo
$popwidth;?>','<?php echo $popheight;?>','<?php echo $popscroll;?>');return
false;"><?php echo T_('Invite a Friend');?></a></li>
</body>
</html>
... should be phpy enough to keep the moaners away ;)
Andy
Hi Andy,
The above JavaScript suggestions are poor.
I thought I let you know. ;-)
To name a few:
* It includes ancient <!-- comment blocks. Name me a browser that needs
that.
* It uses browsersniffing where none is needed. (All experts advise you
to never use browsersniffing).
* It uses target (invalid for HTML4 STRICT validation, OK for
Transitional, but you don't know what the OP is serving).
* It is very poorly readable. (In my humble opinion)
You say you are a monster killer. :-)
I say you created a bigger monster. ;-)
I am 100% with Jerry on this one. (You just proved him right with the
above code.)
Please go to a JavaScript group to get decent advice.
Regards,
Erwin Moller
PS: Andy, I appreciate it you try to help. But your suggestion is poor.
No hard feelings I hope. :-)
--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
"Erwin Moller"
<Since_humans_read_this...@spamyourself.com> wrote in
message news:4c65286b$0$22939$e4fe...@news.xs4all.nl...
No hard feelings whatsoever, in fact it's nice to receive constructive
criticism without the usual snide remarks ;)
Andy
Has the OP posted this in a javascript newsgroup yet?
OP?
If referring to me, not yet.. I'm just sitting back and watching then "fun"
"Dave" <davenl...@hotNOmailSPAM.com> wrote in message
news:5sj9o.63338$YX3....@newsfe18.iad...
'ere, don't tell the others, but did you try my solution yet?
Andy
He'd be much better off going to c.l.j to get GOOD advice.
You code is not very good - as Erwin noted. If you want to post
javascript, please do so in the appropriate place.
And BTW - attempting to make it on topic here by wrapping some
javascript values in PHP variables makes your code even worse.
"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:i44o3o$j75$1...@news.eternal-september.org...
You got me! I wanted to help the OP and not incur the wrath of the seasoned
pros ;)
The best way to help him would be to get him to ask in the appropriate
place.
The OP was asking:
What do I need to input to get a height of 15 and width of 200?
And in the first example given at my given url
> http://www.yourhtmlsource.com/javascript/popupwindows.html
We can read:
newwindow=window.open(url,'name','height=400,width=200');
I agree he asked for 14 and 200 instead of 400 and 200 :-)
Anyway, i had furnished THE GOOD answer !
No, you did not.
You did not explain why ? Have you a better solution ?
i have just given the answer of his question how to have height and
width - that on only one sentence - more concise and precise is not
possible.
If you had read the thread, you would have noticed that Jerry advocates for
not give answers for off topic subjects like this one, which should from the
beginning been posted in a javascript newsgroup as this has nothing to do with
PHP, no matter if you generate the javascript with PHP or hard code the
javascript.
I have to agree with Jerry this time and his reply from the 9th of August,
00:51 CEST was the best reply that OP could get here, but for some reason a
long rant for/against posting a javascript reply here has been keeping on for
a long time, too long time.
I think everyone would agree on that you rather see PHP related posts here
than chit chats about cars, medicine, viagra and so on... so pleace try to
keep off topic threads as short as possible and point those who ask to a
possible place where to find the answer they are looking for.
--
//Aho
Yes, I did. You do not know if that is the best solution - or even a
solution which will work for this user. It is only ONE solution - one
which might not even work in his situation.
The correct answer is to get the user to the proper newsgroup where they
can investigate his needs properly and give him the best solution.
That's why there are so many different newsgroups - so that one can get
good answers from the experts. Not half-assed answers from someone who
thinks they know what they're doing.
hehehe.. these guys are funny!
Anyways, I tried Andy's suggestion, did work. errored out on the
','200','15','no');return false;">Invite a Friend
line.
I tried including it in a .js file, <php include=file> but still same
results.
The file is a Template file being called from another part of the program.
Not to worry, we'll keep at it.
... which is EXACTLY why I referred you to an appropriate newsgroup -
where you will get GOOD answers to your questions - not garbage like
you've gotten here.
"Dave" <davenl...@hotNOmailSPAM.com> wrote in message
news:7BZ9o.66931$4B7....@newsfe16.iad...
It only errored out because you didn't reconstruct the lines after pasting
from the newsreader wordwrap ;)
Andy