PDA

View Full Version : PHP Photo Album tweek the autodesc?



rmott78
08-12-2014, 02:01 AM
1) Script Title: PHP Photo Album Script v2.11

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/php-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?

vwphillips
08-13-2014, 11:49 AM
140813A.txt



Image 1bc
Image2bc
Image3bc





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');

prince_85
05-27-2015, 02:55 PM
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.

Beverleyh
05-27-2015, 03:55 PM
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.

vwphillips
05-28-2015, 09:19 AM
<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>