Results 1 to 4 of 4

Thread: Help to use onphotoclick to copy pictures from Main gallery to other gallery

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help to use onphotoclick to copy pictures from Main gallery to other gallery

    1) Script Title: PHP Photo Album script v2.11

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem:
    First of all I am not too familiar with php but loves it (provise very neat solution to many questions) and I am not too familiar with forums. Please ask more precisions if mu message is not clear.

    I use PHP Photo Album script v2.11 to display png thumbnails and pictures that came from image processing algorithm. I need to clean all pictures for quality purpose: Good, bad and questionnable.
    So for now, I can display all pictures in main gallery called All.
    I would like to copy the selected pictures of All galley to Good gallery or Bad gallery
    By clicking on pictures or selecting them using choosing buttons or boxes.

    Would it be possible to do it using option in onphotocleick? Or is there another option.
    I tried to look through the forum but I did not find. Again I am not too familiar with forums.

    If somebody could help, I would appreciate. I that works. I would be happy to make a link to my page and show the results.

    Chris

  2. #2
    Join Date
    Aug 2004
    Posts
    9,893
    Thanks
    3
    Thanked 966 Times in 954 Posts
    Blog Entries
    15

    Default

    What you're asking is a very specific usage of this script, so I'm not surprised nothing came up on the forums. It depends on what you mean by "copy" the image. The onpanelclick event can be used to accomplish some of what you're looking for, though from the sound of it, not all of it. In other words, your own familiarity with JavaScript would be needed. Just to get you moving in the right direction, one way to add the clicked on image within the gallery to another DIV through onpanelclick would be something like:

    Code:
     onphotoclick:function(thumbref, thumbindex, thumbfilename){
    	var newimage=document.createElement("img")
    	newimage.src=thumbref.src
    	document.getElementById("anotherdiv").appendChild(newimage)
     }
    In the above case, when a gallery image is clicked on, it "clones" that image and adds it to the DIV with id="anotherdiv" on the page.
    DD Admin

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Whoaou!
    This is a very quick reply. I guess I see what you mean. If I undestand correctly I could use anotherdiv=Good and then clicking on each images I interpret as Good will be copied or clones to this new DIV.
    I will let you know if that is what I was looking for.

    Best,

    Chris

  4. #4
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Still need help

    Hello

    I tried the above solution. It does not work as I hoped. Nothing happens when I click the pictures. See the my code below. I have a DIV called test and another called GoodTest where I did put getalbumpics.php in it.
    On the same page I display test gallery and Goodtest Gallery.When there are pictures in both DIV it works like in the demo page http://www.dynamicdrive.com/dynamici...photoalbum.htm

    As you said you gave me some directions so I have probably to find more instruction to colplete the code to get the pictures cloned in GoodTest directory. I tried to look for onpanelclick and document.getElementById but I did not find much help.
    web page of pictures I need to select and move to Good or Bad is http://www.lmd.polytechnique.fr/~pie...LS/Earli/Test/

    Thanks for your support.

    Chris

    ---------------------------ALS_QL_Checks.html-------------------
    <head>
    <title>Quicklook Checks of ALS inversions</title>

    <h1> Essai
    </h1>
    <script type="text/javascript"
    src="http://www.lmd.polytechnique.fr/~pietras/Diagnostics/ALS/Earli/Test/getalbumpics.php?id=test"></script>

    <script type="text/javascript">

    //Optional, manual description for particular pictures inside album
    //Syntax: albumid.desc[index]="Picture description here"
    //eg: myvacation.desc[2]="This is description for the 3rd picture in the album"
    //eg: myvacation.desc[6]="This is description for the 7th picture in the album"

    </script>

    <script type="text/javascript"
    src="http://www.lmd.polytechnique.fr/~pietras/Diagnostics/ALS/Earli/Test/GoodTest/getalbumpics.php?id=GoodTest"></script>

    <script type="text/javascript">

    //Optional, manual description for particular pictures inside album
    //Syntax: albumid.desc[index]="Picture description here"
    //eg: myvacation.desc[2]="This is description for the 3rd picture in the album"
    //eg: myvacation.desc[6]="This is description for the 7th picture in the album"

    </script>

    <script type="text/javascript" src="ddphpalbum.js">

    /***********************************************
    * PHP Photo Album script v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
    ***********************************************/

    </script>

    <link rel="stylesheet" type="text/css" href="ddphpalbum.css" />

    <script type="text/javascript">

    new phpimagealbum({
    albumvar: test, //ID of photo album to display (based on getpics.php?id=xxx)
    dimensions: [3,2],
    sortby: ["date", "asc"], //["file" or "date", "asc" or "desc"]
    autodesc: "Photo %i", //Auto add a description beneath each picture? (use keyword %i for image position, %d for image date)
    showsourceorder: true, //Show source order of each picture? (helpful during set up stage)
    onphotoclick:function(thumbref, thumbindex, thumbfilename){
    var newimage=document.createElement("img")
    newimage.src=thumbref.src
    document.getElementById("./GoodTest").appendChild(newimage)
    }
    })

    </script>

    <script type="text/javascript">

    new phpimagealbum({
    albumvar: GoodTest, //ID of photo album to display (based on getpics.php?id=xxx)
    dimensions: [3,2],
    sortby: ["file", "asc"], //["file" or "date", "asc" or "desc"]
    autodesc: "Photo %i", //Auto add a description beneath each picture? (use keyword %i for image position, %d for image date)
    showsourceorder: true, //Show source order of each picture? (helpful during set up stage)
    onphotoclick:function(thumbref, thumbindex, thumbfilename){
    thumbnailviewer.loadimage(thumbref.src, "fit2screen")
    }
    })

    </script>

    </head>

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
  •