Page 1 of 1

Portfolio Question

Posted: Tue Mar 08, 2005 8:25 pm
by us3rX
[url=\"http://us3rX.killagraphix.com/portfolio/\"]Click Me <img src=\'http://www.killanet.net/forum3/public/s ... iggrin.gif\' class=\'bbc_emoticon\' alt=\':D\' />[/url]

On my portfiolio i have it listing all my banners/bgs/sigs and etc... when they click a link to the picture it opens the picture in the iframe... what i was thinking about is when they click the image link it opens a popup or a new page to the [b][i][u]excact[/u][/i][/b] size of the image o.0 dont know if this is possible so...

1) Can this be done easily?
2) Would popup blockers block the popup?

us3rX <img src=\'http://www.killanet.net/forum3/public/s ... /ph34r.gif\' class=\'bbc_emoticon\' alt=\':ph34r:\' />

Portfolio Question

Posted: Tue Mar 08, 2005 8:53 pm
by ner0
popup blockers will be able to block the popup... but most will allow it if the user initiates it (through clicking)

to determine the dimensions you should use something like...

[code]<?php
$dimensions = getimagesize("filename");
$width = $dimensions[0];
$height = $dimensions[1];
?>[/code]

put something like the following in your <head> (don\'t know if it\'s possible to have it anywhere else.)

[code]function pop(thewidth.theheight,thefilename)
{
  mywindow = window.open (thefilename,
 "Viewing Image [Portfolio]",
 "width=" + thewidth + ",height=" + theheight);
}[/code]

then in your php, all you\'ll need is something like this...

[code]<?php
$file = "filename";
$link = "javascript:pop({$width},{$height},{$file})";
$link = "<a href=\"{$link}\">View This Image</a>";
echo $link;[/code]

probably buggier than anything you\'ve ever seen, but it\'s a basis on which you can build I guess... the $height/width should work no probs... it\'s just the js which i\'m not too good at.

hope it helps <img src=\'http://www.killanet.net/forum3/public/s ... >/good.gif\' class=\'bbc_emoticon\' alt=\'(Y)\' /> and sexy portfolio

- <img src=\'http://www.killanet.net/forum3/public/s ... enguin.gif\' class=\'bbc_emoticon\' alt=\':penguin:\' />

Portfolio Question

Posted: Tue Mar 08, 2005 10:29 pm
by Sp3culuM
You could just use something like;

[code]<a href="image.php?src=test.jpg" target="_blank">Test.jpg!</a>[/code]

And then in image.php, where you want the image to display;

[code]<?php echo '<img src="'.$_GET['src'].'" />'; ?>[/code]

I'm sure someone could find a fault with that but it's probably the easiest way.

Portfolio Question

Posted: Tue Mar 08, 2005 11:06 pm
by ner0
yeah that\'d work fine sp3c, mine was just tryin to get the \"exact window size\" thing in there too... would work out much easier to do ^^ above