x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
keywords.pl - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\LITTLELEV\ImageFolioLite\admin\keywords.pl
Girar
Efecto
Propiedad
Historial
############################################################################### # BizDesign ImageFolio Lite Edition 4.2 (Four-dot-Two) ############################################################################### # # ## ### VERSION : 4.2 # #### ## ## RELEASED ON : 02/15/2007 # ## ## ## LAST MODIFIED : 02/15/2007 # ########## ## # ## ### ## # ## ### ######## # ############################################################################### # Released by BizDesign, Inc. # written by Dirk Koppers and Greg Raaum of BizDesign # # Purchasing : http://imagefolio.com/purchase/ # Support : http://imagefolio.com/support/ # Phone : (214) 642-9787 # Email : sales@bizdesign.com ############################################################################### # COPYRIGHT AND LICENSE INFORMATION : # # Copyright (c) 1999-2007 BizDesign, Inc. All rights reserved. # # Selling or distributing the code for this program without prior written # consent is expressly forbidden. # # One licensed copy of the program may reside on a single server, in use by a # single domain. For each installed instance of the program, a separate # license is required. # # Licensed users may alter or modify this software, at their own risk, of # course. They may also hire others to modify their own copy of the code, as # long as the code is not transferred to or retained by the individual who is # hired (unless he/she is also a license holder). Although license-holders # may modify the code for their use, modified code may NOT be resold or # distributed. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BIZDESIGN, # INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # BizDesign, Inc. is not liable for any conduct associated with image gallery # activity, nor for any binary media posted using this program, including but # not imited to images, photographs, movies, and clipart. # # The user must assume the entire risk of using the program. Although this # program has been thoroughly tested on BizDesign's servers, BizDesign does not # warrant that it works on all servers and will not be held liable for anything, # including but not limited to, misusage, error, or loss of data. ANY # LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT # OR REFUND OF PURCHASE PRICE. Use at your own risk! ############################################################################### # Do not modify below this line unless you know what you are doing. ############################################################################### $ADDFILEDESCRIPTIONS = "active"; ############################################################################### # STEP 1 # If we don't receive any information we display the list of categories ############################################################################### sub keywords_step_1 { $pagetitle = "Add Keywords and Captions to Images - Select A Category"; &get_header; &get_catlist; print qq|
<$admin_big_font>
Select A Category
<$admin_big_font>
Step 1 of 3
$catlist
|; &get_footer; } ############################################################################### # STEP 2 # If we don't receive any information we display the list of categories ############################################################################### sub keywords_step_2 { &get_imagelist; $pagetitle = "Select An Image"; &get_header; $newcategory = $category; $newcategory =~ s/_/ /g; $newcategory =~ s/\// \> /g; if ($image) { $imagesource = "$imageurl/$category/$image"; } else { $imagesource = $if_images_directory . "/image_viewer.gif"; } print qq|
|; if ($keywords && $kwstep eq "final") { if (!$imagefound) { print qq|<$admin_font>
Error: Could not save Keywords to
$image ($newcategory)
|; } else { print qq|<$admin_font>
Keywords and Caption saved successfully for
$image ($newcategory)
|; } } print qq|
<$admin_font>
Instructions:
Select an image from the select box. If you would like to view the image, click "View This Image." To add or modify the selected image's Keywords and Caption, click "Add Keywords and Caption"
<$admin_big_font>
Select An Image
<$admin_big_font>
Step 2 of 3
<$admin_small_font>$newcategory
<$admin_small_font>$totalnames found
$imagelist
|; &get_footer; } ############################################################################### # STEP 3 # We display a form for adding/modifying keywords ############################################################################### sub keywords_step_3 { $pagetitle = "Add or Modify Keywords and Caption"; &get_header; &get_keyform; &get_image_info; $newcategory = $category; $newcategory =~ s/_/ /g; $newcategory =~ s/\// \> /g; print qq|
<$admin_font>
Instructions:
Add or modify keywords and image caption in the text area below then click "Save Keywords and Caption" Be sure to separate each keyword with a space only, NOT a comma or separate line.
Add or Modify Keywords and Caption
Step 3 of 3
<$admin_small_font>$newcategory
$keyform
<$font>
$thisimage
$file_type
Size: $filesize
Added: $filedate
|; &get_footer; } ############################################################################### # FINAL # We save the Keywords to the database then display step 2 again ############################################################################### sub keywords_final { $keywords =~ s/,/ /g; # Change commas to spaces $keywords =~ s/^\s+//g; # Trim leading blanks... $keywords =~ s/\s+$//g; # Trim trailing blanks... $keywords =~ s/\n/ /g; # Change newline to a space. $keywords =~ s/\r//g; # Remove Windows linefeed character. $keywords =~ s/\s+\s+/ /g; # Change two spaces to one. $keywords =~ s/\s+\s+/ /g; # Change two spaces to one again. $icaption =~ s/^\s+//g; # Trim leading blanks... $icaption =~ s/\s+$//g; # Trim trailing blanks... $icaption =~ s/\n/ /g; # Change newline to a space. $icaption =~ s/\r//g; # Remove Windows linefeed character. $icaption =~ s/\s+\s+/ /g; # Change two spaces to one. $icaption =~ s/\s+\s+/ /g; # Change two spaces to one again. $tcaption =~ s/^\s+//g; # Trim leading blanks... $tcaption =~ s/\s+$//g; # Trim trailing blanks... $tcaption =~ s/\n/ /g; # Change newline to a space. $tcaption =~ s/\r//g; # Remove Windows linefeed character. $tcaption =~ s/\s+\s+/ /g; # Change two spaces to one. $tcaption =~ s/\s+\s+/ /g; # Change two spaces to one again. $newcategory = $category; $newcategory =~ s/\//\./g; # Generate filename for our captions file $newimage = $image; $newimage =~ s/$mypattern//g; # Get full-size image name for use in captions # FIRST, WE WRITE THE KEYWORDS TO THE INDEX FILE open (FILE,"$indexfile") or &Error ("Could not open $indexfile, is it created. Reason: $!"); my(@LINES)=
; close(FILE); $SIZE=@LINES; # Open Link File to Output open (INDEX,">$indexfile") or &Error ("Could not open $indexfile, is it created. Reason: $!"); if ($useflock) { flock(INDEX, 2); } for ($i=0;$i<=$SIZE;$i++) { $_=$LINES[$i]; my ($filename, $path, $blah, $blah, $blah) = split(/\|/, $_); if ($filename eq $image && $path eq $category) { $imagefound = 1; print INDEX "$filename\|$path\|\|\|$keywords\n"; } else { print INDEX $_; } } if ($useflock) { flock(INDEX, 8); } close(INDEX); # SECOND, WE WRITE THE FULL-SIZE IMAGE CAPTION TO A FILE open (FILE,"$data_directory/$newcategory.captions.txt") or &Error ("Could not read captions file, $newcategory.captions.txt. Reason: $!"); my(@LINES)=
; close(FILE); $SIZE=@LINES; # Open Link File to Output open (INDEX,">$data_directory/$newcategory.captions.txt") or &Error ("Could not read captions file, $newcategory.captions.txt. Reason: $!"); if ($useflock) { flock(INDEX, 2); } for ($i=0;$i<=$SIZE;$i++) { $_=$LINES[$i]; my ($filename, $caption) = split(/\t/, $_); if ($filename eq $newimage) { $keyfound = 1; print INDEX $filename . "\t" . $icaption . "\n"; } else { print INDEX $_; } } if (!$keyfound) { print INDEX $newimage . "\t" . $icaption . "\n"; } if ($useflock) { flock(INDEX, 8); } close(INDEX); $keyfound = 0; # THIRD, WE WRITE THE THUMBNAIL IMAGE CAPTION TO A FILE open (FILE,"$data_directory/$newcategory.tcaptions.txt") or &Error ("Could not read captions file, $newcategory.tcaptions.txt. Reason: $!"); my(@LINES)=
; close(FILE); $SIZE=@LINES; # Open Link File to Output open (INDEX,">$data_directory/$newcategory.tcaptions.txt") or &Error ("Could not read captions file, $newcategory.tcaptions.txt. Reason: $!"); if ($useflock) { flock(INDEX, 2); } for ($i=0;$i<=$SIZE;$i++) { $_=$LINES[$i]; my ($filename, $caption) = split(/\t/, $_); if ($filename eq $newimage) { $keyfound = 1; print INDEX $filename . "\t" . $tcaption . "\n"; } else { print INDEX $_; } } if (!$keyfound) { print INDEX $newimage . "\t" . $tcaption . "\n"; } if ($useflock) { flock(INDEX, 8); } close(INDEX); &keywords_step_2; } ############################################################################### # GET KEYFORM # We read through the image index, find a matching file then build a form # from which to add/modify keywords ############################################################################### sub get_keyform { open (FILE,"$indexfile") or &Error ("Could not read index, $indexfile. Reason: $!"); my(@LINES)=
; close(FILE); $SIZE=@LINES; $keyform .= qq|
<$admin_small_font>
K E Y W O R D S
(This is the old ImageFolio keywords system. Please use IPTC instead)
|; foreach $LINE (@LINES) { ($filename, $path, $blah, $blah, $words) = split(/\|/, $LINE); if ($filename eq $image && $path eq $category) { $keyform .= qq|
$words
|; $keyfilefound = 1; last; } } if (!$keyfilefound) { $keyform = qq|
<$admin_font color=red>
Error:
The entry for $image was not found in the Image Index (index.txt). Please rebuild the Image Index using build.cgi
|; } $keyform .=qq|
<$admin_small_font>
C A P T I O N
(This is the old ImageFolio caption system. Please use IPTC instead)
|; $newcategory = $category; $newcategory =~ s/\//\./g; $newimage = $image; $newimage =~ s/$mypattern//g; # remove the pattern if (-e "$data_directory/$newcategory.captions.txt"){ open (CAPTIONS,"$data_directory/$newcategory.captions.txt"); my(@LINES)=
; close(CAPTIONS); foreach $line (@LINES) { my($filename, $caption) = split(/\t/,$line); if ($filename eq $newimage) { $keyform .= $caption; last; } } } else { # if we didn't find a captions.txt file above, we make one here opendir(IMAGEDIR,"$image_directory/$category") or &Error ("Could not read directory, $image_directory/$category. Reason: $!"); @files = readdir(IMAGEDIR); @files = sort { lc($a) cmp lc($b) } @files; # sort the file names alphabetically foreach $file (@files) { if ( -d "$image_directory/$category/$file" ) { # if this is a directory we aren't doing anything # do nothing } else{ if ( -B "$image_directory/$category/$file" && $file =~ /$mypattern/i ) { # if this is a thumbnail and binary file $newfile = $file; $newfile =~ s/$mypattern//g; # remove the pattern $captionslist .= $newfile . "\t" . "\n"; # create captions list so we can print it below } } } closedir(IMAGEDIR); open (INDEX,">$data_directory/$newcategory.captions.txt") or &Error ("Unable to create captions.txt file. Reason: $!"); print INDEX $captionslist; close(INDEX); chmod(0777,"$data_directory/$newcategory.captions.txt"); } $keyform .= qq|
|; # THIS IS THE NEW SECTION FOR ADDING THUMBNAIL CAPTIONS $keyform .=qq|
<$admin_small_font>
T H U M B C A P T I O N
(This is the old ImageFolio keywords system. Please use IPTC instead)
|; if (-e "$data_directory/$newcategory.tcaptions.txt"){ open (CAPTIONS,"$data_directory/$newcategory.tcaptions.txt"); my(@LINES)=
; close(CAPTIONS); foreach $line (@LINES) { my($filename, $caption) = split(/\t/,$line); if ($filename eq $newimage) { $keyform .= $caption; last; } } } else { # if we didn't find a captions.txt file above, we make one here open (INDEX,">$data_directory/$newcategory.tcaptions.txt") or &Error ("Unable to create tcaptions.txt file. Reason: $!"); print INDEX $captionslist; close(INDEX); chmod(0777,"$data_directory/$newcategory.tcaptions.txt"); } $keyform .= qq|
|; # END OF NEW SECTION $keyform .= qq|
|; } ############################################################################### # GET IMAGELIST # We read the directory selected in step one and pull out all of the images # in the directory and create a selection form ############################################################################### sub get_imagelist { $totalnames = 0; if ($image eq $file) { $selected = " selected"; } else { $selected = ""; } opendir(IMAGEDIR,"$image_directory/$category") or &Error ("Could not read directory, $image_directory/$category. Reason: $!"); $imagelist .= qq|
|; @files = readdir(IMAGEDIR); @files = sort { lc($a) cmp lc($b) } @files; # sort the file names alphabetically @names = (); # declare the thumbnails array foreach $file (@files) { if ( -d "$image_directory/$category/$file" ) { # if this is a directory we aren't doing anything # do nothing } else{ if ( -B "$image_directory/$category/$file" && $file =~ /$mypattern/i ) { # if this is a thumbnail and binary file $newfile = $file; $newfile =~ s/$mypattern//g; # remove the pattern if ($image eq $file) { $selected = " selected"; } else { $selected = ""; } $imagelist .= qq|
$newfile|; # create our options for the select form $totalnames++; # count all of the thumnails found } } } closedir(IMAGEDIR); $imagelist .= qq|
|; unless ($totalnames >= 1) { &Error ("The category '$category' does not contain any images."); } } 1;
keywords.pl
Dirección de la página
Dirección del archivo
Anterior
20/27
Siguiente
Descargar
( 19 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10