Results 1 to 5 of 5

Thread: PHP Photo Album tweek the autodesc?

  1. #1
    Join Date
    Aug 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Photo Album tweek the autodesc?

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

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

    3) Describe problem: No problem with the script. It work perfectly and I'd like to thank the author for his/her time and effort in writing a wonderful script. I have implemented it into a site that I admin, letting users upload photos via a simple form to a folder on the server, that this script then displays on a photo gallery page. I would like to add the ability for users to include short descriptions/captions with the pictures (via a text box within the form), and have the gallery display them, instead of the standard autodesc for position or date. Is this possible, maybe in the manual description array? I can handle the form part, and uploading the caption as a .txt file to the server with the same rootname as the photo. Can the script be tweeked to pull the corresponding file?

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    140813A.txt

    Code:
    Image 1bc
    Image2bc
    Image3bc

    Code:
    function ajax(o,url){
      var oop=this,html=false;
      if (window.ActiveXObject){
       try {
        html=new ActiveXObject("Msxml2.XMLHTTP");
       }
       catch (e){
        try {
         html=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e){
        }
       }
      }
      else if (window.XMLHttpRequest){
       html=new XMLHttpRequest();
      }
      else {
       return false;
      }
      html.onreadystatechange=function(){ ajaxpopulate(o,html); }
      html.open('GET',url+'?'+new Date().getTime(),true);
      try {
       html.send(null);
      }
      catch (e){
      }
     }
    
     function ajaxpopulate(o,html){
      if (html.readyState==4&&(html.status==200||window.location.href.indexOf("http")==-1)){
       o.desc=html.responseText.split('\n');
       new phpimagealbum({
    	albumvar: myvacation, //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")
    	}
       })
      }
     }
    
    ajax(myvacation,'140813A.txt');
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    May 2015
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question PHP Photo Album script v2.11 - Need autodesc as image file name

    Hi,

    I want the script to display the image file names (without extension) to be displayed as auto description. Can you please let me know what are the changes I've to make inthe script to accomplish that. Your quick help will be appreciated.
    Last edited by Beverleyh; 05-27-2015 at 03:39 PM. Reason: formatting

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Which script are you referring to prince_85? If this is about an alteration to the script posted for rmott78's original question, then hopefully Vic will be able to help you. However, if you are asking a NEW question about the PHP Photo Album script, please start a NEW thread.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  5. #5
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <script type="text/javascript" src="http://www.mysite.com/myimages/getalbumpics.php?id=myvacation"></script>
    <script type="text/javascript">
    
     for (var z0=0;z0<myvacation.images.length-1;z0++){
      myvacation.desc[z0]=myvacation.images[z0][1].substring(0,myvacation.images[z0][1].lastIndexOf('.'));
     }
    
    </script>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Similar Threads

  1. Replies: 2
    Last Post: 07-18-2011, 01:17 PM
  2. PHP Photo Album v2.11
    By hvirdi in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 04-01-2011, 03:38 PM
  3. Add Photo Title to PHP Photo Album Script
    By EdgeAgain in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 09-27-2009, 11:31 PM
  4. DD PHP Photo Album script - photo descrip
    By aavaughan in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 09-13-2007, 12:44 AM
  5. PHP Photo Album v2
    By calumogg in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 06-03-2007, 09:50 AM

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
  •