This topic is locked

Link open in popup

9/25/2007 7:22:07 AM
PHPRunner General questions
H
hueueli author

Hello
how can i open a Thumbnail-Image in a popup-window

J
Jane 9/26/2007

Hi,
I'm not sure that I understand you correctly.

Large image opens in another window. Please clarify what does "popup-window" mean?

H
hueueli author 9/26/2007

ok, my english isn't so good <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=21643&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />
i mean, that the new windows open without scrollbar, location, directories, status, menubar and toolbar
i hope, you understand me now

best regards

hueueli

J
Jane 9/26/2007

Hi,
you can do it using Custom format on the "View as" settings dialog on the Visual Editor tab.

Here is a sample code:

$value="";

if(CheckImageExtension($data["FileNameField"]))

{

// show thumbnail

$thumbname="th".$data["FileNameField"];

if(substr("files/",0,7)!="http://"; && !file_exists(GetUploadFolder("FileNameField").$thumbname))

$thumbname=$data["FileNameField"];

$value="<a href=# onClick=\"java script: window.open('".htmlspecialchars(AddLinkPrefix("FileNameField",$data["FileNameField"]))."',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');\">";

$value.="<img";

if($thumbname==$data["FileNameField"])

{

$value.=" width=100";

$value.=" height=100";

}

$value.=" border=0";

$value.=" src=\"".htmlspecialchars(AddLinkPrefix("FileNameField",$thumbname))."\"></a>";

}



where FileNameField is your actual field name.

H
hueueli author 9/26/2007

Hi Jane
thank you very much for the Code, but he don't display a popupwindow. only the link are point
my code:

$value="";

if(CheckImageExtension($data["pic_url"]))

{

// show thumbnail

$thumbname="th".$data["pic_url"];

if(substr("files/",0,7)!="http://"; && !file_exists(GetUploadFolder("pic_url").$thumbname))

$thumbname=$data["pic_url"];

$value="<a href=# onClick=\"java script: window.open('".htmlspecialchars(AddLinkPrefix("pic_url",$data["pic_url"]))."',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');\">";

$value.="<img";

if($thumbname==$data["pic_url"])

{

$value.=" width=88";

$value.=" height=113";

}

$value.=" border=0";

$value.=" src=\"".htmlspecialchars(AddLinkPrefix("pic_url",$thumbname))."\"></a>";

}
Thank you for your response

hueueli

J
Jane 9/27/2007

Hi,
sorry for my fault.

Here is the correct code:

$value="";

if(CheckImageExtension($data["pic_url"]))

{

// show thumbnail

$thumbname="th".$data["pic_url"];

if(substr("files/",0,7)!="http://"; && !file_exists(GetUploadFolder("pic_url").$thumbname))

$thumbname=$data["pic_url"];

$value="<a href=# onClick=\"javascript: window.open('".htmlspecialchars(AddLinkPrefix("pic_url",$data["pic_url"]))."',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location
=no,left=150,top=200,scrollbars=yes');\">";

$value.="<img";

if($thumbname==$data["pic_url"])

{

$value.=" width=88";

$value.=" height=113";

}

$value.=" border=0";

$value.=" src=\"".htmlspecialchars(AddLinkPrefix("pic_url",$thumbname))."\"></a>";

}

H
hueueli author 9/27/2007

cool, thank you very much