x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
image.pl - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\LITTLELEV\ImageFolioLite\if_lib\image.pl
旋转
特效
属性
历史版本
############################################################################### # 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. ############################################################################### ############################################################################### # VIEW IMAGE # Generates a page showing one image. Results from the click on a linked # thumbnail image. The header and footer files used here are different than # the ones for thumbnail pages generated by gen_image_table. ############################################################################### sub view_image { require "$libpath/iptc.pl"; $this_alt = "$FORM{'image'}"; if ($watermark && !$antileech) { $imageurl = $imagefolio_url . "?main=imageLeech&source=IF&ct=$current_time&file="; } ($newimage) = $FORM{'image'} =~ m,^(.*)\.\w+$,; if ($record_counts) { &record_counts; } $fullsize_name = qq|$mypattern_fullsize$newimage.$myextension_fullsize|; $fullsize_file = qq|$image_directory/$FORM{'link'}/$fullsize_name|; $ratelink = qq|
Rate It!
|; $newlink = $FORM{'link'}; $newlink =~ s/\//\./g; if (!$hits) { $hits = "0"; } if (!$votes) { $votes = "0"; } if (!$rating) { $rating = "0.00"; } if (-e "$image_directory/$FORM{'link'}/$mypattern$newimage.jpg") {$timage = qq|$mypattern$newimage.jpg|;} elsif (-e "$image_directory/$FORM{'link'}/$mypattern$newimage.JPG") {$timage = qq|$mypattern$newimage.JPG|;} elsif (-e "$image_directory/$FORM{'link'}/$mypattern$newimage.gif") {$timage = qq|$mypattern$newimage.gif|;} elsif (-e "$image_directory/$FORM{'link'}/$mypattern$newimage.GIF") {$timage = qq|$mypattern$newimage.GIF|;} $mediapath = "$image_directory/$FORM{'link'}/$FORM{'image'}"; if (($FORM{'image'} =~/(\.jpg|\.gif|\.png)/i) && $imageprotect) { my ($width, $height) = imgsize("$mediapath"); # my $media_info = image_info("$mediapath"); # my $width = $media_info->{width}; # my $height = $media_info->{height}; if ($width && $height) { $wh_info = qq| width="$width" height="$height"|; } } if ($wh_info) { $mediaurl = "$if_images_directory/pixel.gif"; $mediaurl_bg = "$imageurl/$FORM{'link'}/$FORM{'image'}"; $mediaurl_bg =~ s/([^a-zA-Z0-9$ignore_chars])/"%" . sprintf("%2x", ord($1))/ge; if ($FORM{'url'}) { # print "Content-type: text/html\n"; print "Location:$mediaurl_bg\n\n"; exit; } } else { $mediaurl = "$imageurl/$FORM{'link'}/$FORM{'image'}"; $non_jpg_file_url = "$new_imageurl/$FORM{'link'}/$FORM{'image'}"; if (!-e $mediapath) { $mediaurl = "$icons_dir/404.jpg"; $mediaurl_404 = 1; $this_alt = "File not Found"; } else { $mediaurl =~ s/([^a-zA-Z0-9$ignore_chars])/"%" . sprintf("%2x", ord($1))/ge; $non_jpg_file_url =~ s/([^a-zA-Z0-9$ignore_chars])/"%" . sprintf("%2x", ord($1))/ge; } if ($FORM{'url'}) { # print "Content-type: text/html\n"; print "Location:$mediaurl\n\n"; exit; } } if ($FORM{'search'}) { $query = $FORM{'search'}; $query =~ s/([^a-zA-Z0-9\~])/"%" . sprintf("%2x", ord($1))/ge; if ($FORM{'search'} eq "NEW") { $searchphrase = "Newly Added"; $sortfiles = 1; $display_sort = 1;} elsif ($FORM{'search'} eq "HITS") { $searchphrase = "Top Hits"; $sortfiles = 1; $display_sort = 3;} elsif ($FORM{'search'} eq "RATES") { $searchphrase = "Top Rates"; $sortfiles = 1; $display_sort = 4;} elsif ($FORM{'search'} eq "RANDOM") { $searchphrase = "Random"; $sortfiles = 5; $display_sort = 5;} elsif ($FORM{'search'} =~ /^USER~/) { ($blah, $search_user) = split(/~/, $FORM{'search'}); $searchphrase = "Uploads from $search_user"; } elsif ($FORM{'search'} eq "APPROVE") { $searchphrase = "Pending Approval"; $sortfiles = 1; $display_sort = 1;} else { $searchphrase = "Search Results"; } &get_nextprev_search_links; $newthisdirectory = "$searchphrase Display"; if ($FORM{'tt'}) { $mediasrc = get_object($FORM{'tt'}, $mediaurl); } else { $mediasrc = qq|
|; $mediasrc .= qq|
|; } if ($FORM{'search'} eq "NEW" && $show_new_cats && $FORM{'cat'}) { if ($FORM{'cat'} =~ /\//) { my ($currcat, $lastcat) = $FORM{'cat'} =~ m#^(.*)\/(.*)#; $thisdir = get_clean_name($lastcat); } else { $thisdir = get_clean_name($FORM{'cat'}); } $pagelinks = qq| <$font>
Top
>
$searchphrase
>
$thisdir
> $newimage|; } else { $pagelinks = qq| <$font>
Top
>
$searchphrase
> $newimage|; } } elsif ($FORM{'lbview'}) { &get_nextprev_lightbox_links; $newthisdirectory = "$lb_display"; if ($FORM{'tt'}) { $mediasrc = get_object($FORM{'tt'}, $mediaurl); } else { $mediasrc = qq|
|; $mediasrc .= qq|
|; } $pagelinks = qq| <$font>
Top
>
$lightbox_name
> $newimage|; } else { &get_nextprev_image_links; $pagelinks = build_title_linked($FORM{'link'}); if ($FORM{'tt'}) { $mediasrc = get_object($FORM{'tt'}, $mediaurl); } else { $mediasrc = qq|
|; } } if ($wh_info) { $mediasrc = qq|
$mediasrc
|; } $mediasrc = qq|
$mediasrc
|; &find_size_date($FORM{'link'}, $FORM{'image'}, $timage); $filedate = unix_to_date($filedate); if (!$filesize_done) { if ($filesize < 1500) { $filesize = commify($filesize) . " bytes"; } else { $filesize = int($filesize/1024); if ($filesize < 1500) { $filesize = commify($filesize) . " Kb"; } else { $filesize = int($filesize/10.24); $filesize = ($filesize/100) . " Mb"; } } } $admin_image1 = $FORM{'image'} if !$mediaurl_404; $admin_image2 = $timage; &build_pull_down_menu; &build_nav; if ($if2_caption) { if (-e "$data_directory/$newlink.captions.txt"){ open (CAPTIONS,"$data_directory/$newlink.captions.txt"); while (
) { my($filename, $description) = split(/\t/,$_); chomp $_; next if !$description; ($newfile) = $filename =~ m,^(.*)\.\w+$,; if ($newfile eq $newimage) { $image_caption = $description; last; } } close(CAPTIONS); } } $iptc_category = $FORM{'link'}; if ($timage) { $iptc_image = $timage; } else { $iptc_image = $FORM{'image'}; } &iptc_create_table; if ($custom18_user && -e "$sessions_dir/$custom18_user/_watermark.png") { print "Set-Cookie: IFPro_userwm=$custom18_user; path=/;\n"; } else { print "Set-Cookie: IFPro_userwm=; path=/;\n"; } if ($is_admin) { my $plugunder = &create_image_tools; $mediasrc .= qq|
$plugunder
|; } elsif ($is_user && $custom18_user) { $plugunder = qq||; $mediasrc .= qq|
$plugunder
|; $plugunder = (); } if ($using_lightbox_mod){ my ($base) = $FORM{'image'} =~ m,^(.*)\.\w+$,; my ($ext) = ($FORM{'image'} =~ /\.([^.]+)$/); my $inout = 1 if defined $LIGHTBOX{"$FORM{'link'}|$base|$ext"}; my $plugunder= qq||; $mediasrc .= qq|
$plugunder
|; } if ($show_similar && $show_similar_link) { $thumblinks .= qq|
Show similar $mystuff_plural
|; } if ($imageprotect) { if (!$wh_info) { $if_javascript .= qq|\n|; } $if_javascript = qq|
$if_javascript|; # Not supported by "Safari": # $if_javascript .= qq||; } if ($one_time_access or $is_admin) { $if_javascript .= qq| |; $current = "&admin_directory=$FORM{'link'}"; $current .= "&admin_image1=$admin_image1"; #preview image $current .= "&admin_image2=$admin_image2"; #thumbnail image $current .= "&user_owner=$custom18_user"; #user if ($custom18_email && $custom18_user) { $current .= "&user_email=$custom18_email"; #user email } $current .= "&ota=$FORM{'ota'}"; $current .= "&tt=$FORM{'tt'}"; if ($custom18_approval) { $del_appr_button = qq|
|; $del_appr_button .= qq|
|; if ($is_admin or $config_cache_page_age) { $del_appr_button .= qq|
<$font>Make sure you rebuild the index after you are done approving files.
|; } } elsif ($one_time_access) { $del_appr_button = qq|
|; } if ($del_appr_button) { $mediasrc = qq|
$del_appr_button
$mediasrc|; } } elsif ($custom18_approval) { &Error('This file has not been approved for viewing yet!'); } ############################################################################### # REMOVE OLD FILES # Searches the temp directory for old files, and removes them from your web space ############################################################################### #sub remove_old_files { # opendir (DL, "$tempdir"); # @old_files= grep { /\d+/ } readdir(DL); # closedir (DL); # $OLDFILESSIZE = @old_files; # # use File::Path; # # if ($OLDFILESSIZE > 1) { # foreach $old_file (@old_files) { # if (-M "$tempdir/$old_file" > "0.25") { # if (-d "$tempdir/$old_file") { # rmtree("$tempdir/$old_file"); # } # else { # unlink("$tempdir/$old_file"); # } # } # } # } #} #$download_from_temp = 1; #$tempdirurl = $base_if_url . "/temp"; if ($FORM{'download'}) { if ($download_from_temp) { eval "use Archive::Zip qw(:CONSTANTS :ERROR_CODES);1;" or $donnotzip = 1; use File::Copy; &remove_old_files; my $temp_id = int(rand(1234567890)) + time; mkdir ("$tempdir/$temp_id", "0777") or $failed_download = qq|
<$font>
Failed to download: $!
|; chmod(0777,"$tempdir/$temp_id") or $failed_download = qq|
<$font>
Failed to download: $!
|; # &File::Copy::copy ("$fullsize_file", "$tempdir/$temp_id/$newimage.$myextension_fullsize") or $failed_download = qq|
<$font>
Failed to download: $!
|; # chmod(0777,"$tempdir/$temp_id/$newimage.$myextension_fullsize") or $failed_download = qq|
<$font>
Failed to download: $!
|; if (lc($myextension_fullsize) eq 'zip' or $donnotzip) { &File::Copy::copy ("$fullsize_file", "$tempdir/$temp_id/$newimage.$myextension_fullsize") or $failed_download = qq|
<$font>
Failed to download: $!
|; chmod(0777,"$tempdir/$temp_id/$newimage.$myextension_fullsize") or $failed_download = qq|
<$font>
Failed to download: $!
|; } else { my $zip = Archive::Zip->new(); $zip->addFile( $fullsize_file, "$newimage.$myextension_fullsize" ); my $member = $zip->memberNamed( "$newimage.$myextension_fullsize" ); $member->desiredCompressionMethod( 0 ); die 'write error' if $zip->writeToFileNamed( "$tempdir/$temp_id/$newimage.zip" ) != AZ_OK; chmod(0777,"$tempdir/$temp_id/$newimage.zip") or $failed_download = qq|
<$font>
Failed to download: $!
|; $myextension_fullsize = 'zip'; } if (!$failed_download) { if (!$is_admin && $download_log) { &create_download_log; } print "Location:$tempdirurl/$temp_id/$newimage.$myextension_fullsize\n\n"; exit; } } else { if(open(SENDFILE, $fullsize_file)) { if($image_directory =~ /\:/) { binmode(SENDFILE); binmode(STDOUT); } $FileSize = (stat($fullsize_file))[7]; ($Filename = $fullsize_file) =~ m!([^/^\\]*)$!; if (lc($myextension_fullsize) eq 'zip'){ print "Content-Type: application/x-zip\n"; } else { print "Content-Type: application/x-unknown\n"; # print "Content-Type: application/octet-stream\n"; } print "Content-Length: $FileSize\n"; print "Content-Disposition: attachment; filename=$newimage.$myextension_fullsize\n\n"; print while(
); close(SENDFILE); if (!$is_admin && $download_log) { &create_download_log; } exit; } else { $failed_download = qq|
<$font>
Failed to download: $!
|; } } } if (-e $fullsize_file && $use_fullsize) { if (lc($myextension_fullsize) eq 'zip' && $custom18_file_type){ $display_name = "$newimage.$custom18_file_type"; } else { $display_name = "$newimage.$myextension_fullsize"; } if ($download_link_under_preview) { my $plugunder = ""; if ($use_textlinks) { if (lc($myextension_fullsize) ne 'zip' && !$download_from_temp) { $plugunder = qq|
<$font_dl_link>Download
$failed_download|; } else { $plugunder = qq|
<$font_dl_link>Download
$failed_download|; } } else { if (lc($myextension_fullsize) ne 'zip' && !$download_from_temp) { $plugunder = qq|
$failed_download|; } else { $plugunder = qq|
$failed_download|; } } $mediasrc .= qq|
$plugunder
|; } } else { $display_name = $FORM{'image'}; } $mediasrc .= "
"; if ($commerce_skin) { require "$commercepath/ifc_lib/image.pl"; &calc_price_options; } if (-e "$image_directory/$FORM{'link'}/image.html") { open (TEMPLATE,"$image_directory/$FORM{'link'}/image.html") or &Error("Could not open template. Reason $!"); } else { open (TEMPLATE,"$image_template") or &Error("Could not open template. Reason $!"); } while (
) { if (//i) { $template .= &ssi_include($2); } elsif (//i) { $template .= &ssi_exec_include($2); } else { $template .= $_; } } close(TEMPLATE); require "$libpath/headerfooter.pl"; if (-e "$image_directory/$FORM{'link'}/$newimage.data") { open (METADATA,"$image_directory/$FORM{'link'}/$newimage.data") or &Error("Could not open database. Reason $!"); LINE: while (defined ($line =
)) { next LINE if ($line =~ /^\s*$/); # skip blank lines next LINE if ($line =~ /^#/); # skip comment lines my ($fieldname, $fieldvalue) = split(/\t/, $line); $template =~ s/$fieldname/$fieldvalue/ig; } close(METADATA); } $site_title =~ s/\*\*\*Admin Mode\*\*\*// if $quickdisplay; $template =~ s/%%%TEXTNAV%%%/$textnav/ig; if ($use_textlinks) { $template =~ s/%%%NAV%%%/<$font>$textnav<\/font>/ig; } else { $template =~ s/%%%NAV%%%/$nav/ig; } $template =~ s/%%%TEXT_NEXT_PREVIOUS%%%/$text_next_previous/ig; $template =~ s/%%%IPTCTABLE%%%/$iptc_table/ig; $template =~ s/%%%FILENAME%%%/$display_name/ig; $template =~ s/%%%FILESIZE%%%/$filesize/ig; $template =~ s/%%%FILEDATE%%%/$filedate/ig; $template =~ s/%%%CAPTION%%%/$image_caption/ig; $template =~ s/%%%DIRECTORY%%%/$FORM{'link'}/ig; $template =~ s/%%%HITS%%%/$hits/ig; $template =~ s/%%%RATING%%%/$rating/ig; $template =~ s/%%%VOTES%%%/$votes/ig; $template =~ s/%%%SITE_TITLE%%%/$site_title/ig; $template =~ s/%%%IMAGE%%%/$mediasrc/ig; $template =~ s/%%%NAV%%%/$nav/ig; $template =~ s/%%%IMAGE_NAME%%%/$newimage/ig; $template =~ s/%%%SLIDESHOW%%%/$slideshow_tag/ig; $template =~ s/%%%CATEGORY%%%/$newthisdirectory/ig; $template =~ s/%%%SEARCH_INFO%%%/$searchinfo/ig; $template =~ s/%%%PAGELINKS%%%/$pagelinks/ig; $template =~ s/%%%TEXTPULLDOWN_MENU%%%/$textpulldown_menu/ig; $template =~ s/%%%MAIN_TABLE_BORDER_COLOR%%%/$main_table_border_color/ig; $template =~ s/%%%MAIN_HEADER_BGCOLOR%%%/$main_header_bgcolor/ig; $template =~ s/%%%MAIN_NAV_BGCOLOR%%%/$main_nav_bgcolor/ig; $template =~ s/%%%MAIN_HEADER_FONT%%%/$main_header_font/ig; if ($use_printbutton) { $template =~ s/%%%PRINTBUTTON_ADD_IMAGE%%%/
Comments
Total ratings:
0
Average rating:
无评论
of 10