Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Image Popup

  1. #1
    Join Date
    May 2005
    Posts
    34

    Default Image Popup

    I've seen threads about this on the 1.xx forum, but not for 2.X

    I've been asked to have the ability to make the images appear in full size inside a popup window opened from the listing_detail_mainjavarows.html.

    I've added the following code to the renderListingsImagesJavaRows in the images.inc.php:

    Code:
    if ($config['url_style'] == '1')
    {
    $display .=  '<a href="index.php?action=view_listing_image&amp;image_id='.$imageID.'" target="_blank">';
    }
    else
    {
    						
    $display .=  '<a href="listing_image_'.$imageID.'.html" target="_blank">';
    }
    $display .= "HOLA</a></td>";
    This gives me a nice link with the HOLA text underneath the javarows images. But when I click on this I get the image in full size, but wraped with my template around.
    I would prefer to have the image on it's own on a blank page, but even adding the target="_blank" it opened a new window with my template around the image.

    Can I open a new window with just the image inside? What function do I have to call to achieve this?

  2. #2
    Join Date
    May 2005
    Location
    Bogor - Indonesia
    Posts
    134

    Default

    Quote Originally Posted by Jerome
    I've seen threads about this on the 1.xx forum, but not for 2.X

    I've been asked to have the ability to make the images appear in full size inside a popup window opened from the listing_detail_mainjavarows.html.

    I've added the following code to the renderListingsImagesJavaRows in the images.inc.php:

    Code:
    if ($config['url_style'] == '1')
    {
    $display .=  '<a href="index.php?action=view_listing_image&amp;image_id='.$imageID.'" target="_blank">';
    }
    else
    {
    						
    $display .=  '<a href="listing_image_'.$imageID.'.html" target="_blank">';
    }
    $display .= "HOLA</a></td>";
    This gives me a nice link with the HOLA text underneath the javarows images. But when I click on this I get the image in full size, but wraped with my template around.
    I would prefer to have the image on it's own on a blank page, but even adding the target="_blank" it opened a new window with my template around the image.

    Can I open a new window with just the image inside? What function do I have to call to achieve this?

    You need something like
    Code:
    <a href=\"$field_value\" onclick=\"window.open(this.href,'_blank','location=0,status=0,scrollbars=1,toolbar=0,menubar=0,width=500,height=520' );return false\">$field_value</a>"
    With the "clik" you open the popup with functions escribed in the script. You only have to ad the IMG statement inside to show the image as well

    luck
    ______________
    Mamboindo::

  3. #3
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    42
    Posts
    9,796

    Default

    You could also add &popup=yes to the link linke this:

    <a href="index.php?action=view_listing_image&amp;imag e_id='.$imageID.'&amp;popup=yes" >

  4. #4
    Join Date
    May 2005
    Location
    Bogor - Indonesia
    Posts
    134

    Default

    Quote Originally Posted by pbflash
    You could also add &popup=yes to the link linke this:

    <a href="index.php?action=view_listing_image&amp;imag e_id='.$imageID.'&amp;popup=yes" >
    absolutely right but with that you have not detailed on size, resize yes/no, etc
    ______________
    Mamboindo::

  5. #5
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    42
    Posts
    9,796

    Default

    I forgot to add that you still need the onclick command in the link.

  6. #6
    Join Date
    May 2005
    Posts
    34

    Default

    Ok this is what've done

    Code:
    $display .= '<script type="text/javascript">'."\r\n";
    $display .= '<!--'."\r\n"; 
    $display .='function MM_openBrWindow(theURL,winName,features) { //v2.0'."\r\n";
    $display .='window.open(theURL,winName,features);'."\r\n";
    $display .='}'."\r\n";
    $display .='//-->'."\r\n";
    $display .='</script>'."\r\n";
    if ($config['url_style'] == '1')
    {
    $display .=  "<a href='javascript:;'";
    $display .= "onClick=\"MM_openBrWindow('index.php?action=view_listing_image&amp;image_id='.$imageID.'','','width=500','height=400')\">";
    }
    else
    {
    						
    $display .=  '<a href="listing_image_'.$imageID.'.html">';
    }
    $display .= "HOLA</a></td>";
    And it does not work, BUT I know that it opens a popup window ok, because if I put and html document's name in the javascript it opens that document.
    The only think I don't know is the syntax or the function I need to call to see my image on it's onw.
    Maybe someone could show me, because I'm really lost know, this is as far as my limited "knowledge" of php and scripting goes.

  7. #7
    Join Date
    May 2005
    Posts
    34

    Default

    I'm really stuck here, I get my code to be parsed correctly by PHP, because I don't know the syntax I have to use.

    Anybody could help me on this, I would greatly appreciate it.

  8. #8
    Join Date
    May 2005
    Posts
    34

    Default

    I did it!! At least part of it

    This is the code I used
    Code:
    $display .=  "<a href=\"javascript:MM_openBrWindow('index.php?action=view_listing_image&amp;image_id=$imageID','','width=500','height=400')\">";
    But it still opens the whole page with the image situated where the {content} tag is.

    I need the be able to link directly to the image itself on the database. How can I do that???

    Help please. This goes beyond my knowledge

  9. #9
    Join Date
    May 2005
    Posts
    34

    Default

    Any one knows how to do this?? how to open an image on it own inside this popup window I created??

  10. #10
    Join Date
    Jun 2004
    Posts
    1,067

    Default

    Use Pbflas's advice, it will remove all the sourounding content from the page and show only the image.
    Quote Originally Posted by pbflash
    You could also add &popup=yes to the link linke this:

    <a href="index.php?action=view_listing_image&amp;imag e_id='.$imageID.'&amp;popup=yes" >

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts