This topic is locked

Display image in new window on click

5/13/2008 7:28:16 AM
PHPRunner General questions
V
viper01 author

Can anyone advise me on how I can display an image from my database on a new window when I click on the field image icon in the standard list view display.

The image is normally displayed in the web window at my predefined size so that I have an idea of what it is but I need to show the full size view when I click on that image so I can see more detail.

Thanks

J
Jane 5/13/2008

Hi,
I recommend you to have a look at the thumbnails and iBox feature (on the "View as" settings dialog on the Visual Editor tab) in the PHPRunner.

V
viper01 author 5/14/2008

Jane,
I don't have a thumbnail or ibox in the "view as" section of the visual editor and I don't realy want to add thumbnails to the database if possible.
The Image file is a full jpg image and on the main form I display it at 64x48 pixels to allow end user to get an idea of the product.
I think if I change the HTML code so that I open a new window and display the jpg in that window at full size it should work. But I don't know how to do this.
Can you help ???
Regards

J
Jane 5/14/2008

Hi,
you can use custom format on the "View as" settings dialog on the Visual Editor tab. To open this dialog double click on the field.

Here is a sample code:

$value = "<a target=_blank href=\"".AddLinkPrefix("FieldName",$data["FieldName"])."\"><img border=0 width=50 src=\"".AddLinkPrefix("FieldName",$data["FieldName"])."\"></a>";

V
viper01 author 5/14/2008

Hi Jane,
Found the place to insert this code but do I replace all the "Fieldname" references with my actual field name which is "Photo" as shown below ???
$value = "<a target=_blank href=\"".AddLinkPrefix("Photo",$data["Photo"])."\"><img border=0 width=50 src=\"".AddLinkPrefix("Photo",$data["Photo"])."\"></a>";

V
viper01 author 5/14/2008

Jane,
Tried both methods :

$value = "<a target=_blank href=\"".AddLinkPrefix("Photo",$data["Photo"])."\"><img border=0 width=50 src=\"".AddLinkPrefix("Photo",$data["Photo"])."\"></a>";
and
$value = "<a target=_blank href=\"".AddLinkPrefix("Photo",$data["Fieldname"])."\"><img border=0 width=50 src=\"".AddLinkPrefix("Photo",$data["Fieldname"])."\"></a>";
The first line hangs the machine the second line displays the list view page with no image. When you click on the image icon the new blank page opens but with no picture.

J
Jane 5/14/2008

Sorry for my fault.

Here is the correct code:

$value = "<a target=_blank href=\"".AddLinkPrefix("Photo",$value)."\"><img border=0 width=50 src=\"".AddLinkPrefix("Photo",$value)."\"></a>";

V
viper01 author 5/14/2008

Hi Jane,
$value = "<a target=_blank href=\"".AddLinkPrefix("Photo",$value)."\"><img border=0 width=50 src=\"".AddLinkPrefix("Photo",$value)."\"></a>";
That didn't work, the window frame opens then the machine hangs and I have to close the window after a short time trying to load.

J
Jane 5/14/2008

Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

V
viper01 author 5/14/2008

Jane,
Tried twice to connect to the demo site but each time it gets to step 4 and sits there for ages saying processing uploaded files. I left it trying to load for about a half hour each time

but have had no success.
I will attempt it again tomorrow.
If you have any other thoughts in the mean time they would be appreciated.