{{vtIf: {vtCurrentAccessRights} .ncn. update}}{{vtRedirect}}{{vtEndIf}}{{vtScript}} ### sucht das x-te (URL-Parameter "-pos") zu aktualisierende Bild und aktualisiert es ### {{vtInclude: includes/initialize.html}} {{vtIf: {vtSession:update_recursive} .neq. 1}} {{vtSet: depth="1"}} {{vtEndIf}} {{vtIf: {vtSession:update_ignore} .eq. 1 .and. {vtSession:update_timestamp} .gt. 0 .and. {vtSession:update_ignore_minutes} .gt. 0 }} {{vtCalc: {vtSession:update_timestamp} - 60*{vtSession:update_ignore_minutes} }} {{vtSelect: -type="image", -depth="{vtGet:depth}", -skip="{vtGetValue:-pos}", -max="2", -sortfield[]="Verzeichnis", -sortfield[]="Dateiname", -filter="{LastCheck} .lt. {vtResult}"}} {{vtElse}} {{vtSelect: -type="image", -depth="{vtGet:depth}", -skip="{vtGetValue:-pos}", -max="2", -sortfield[]="Verzeichnis", -sortfield[]="Dateiname"}} {{vtEndIf}} {{vtIf: {vtCountSelection} .gt. 1}} {{vtSet: Result[last_image]="0"}} {{vtElse}} {{vtSet: Result[last_image]="1"}} {{vtEndIf}} {{vtLoop}} {{vtSet: Result[link]="{vtLink}", Result[id]="{vtID}", Result[path]="{Verzeichnis}/{Dateiname}"}} {{vtSet: LoresPath="{vtGlobal:pxtcPathLores}/{Verzeichnis}/{Dateiname}" }} {{vtSet: HiresPath="{vtGlobal:pxtcPathHires}/{Verzeichnis}/{Dateiname}" }} {{vtIf: {vtSession:update_lores} .gt. 0}} {{vtSet: Result[status_lores]=""}} {{vtIf: {vtSession:update_lores} .eq. 1}} {{vtCalc: update_lores_image( utf8_encode('{Verzeichnis}/{Dateiname}'), FALSE ) }} {{vtElse}} {{vtCalc: update_lores_image( utf8_encode('{Verzeichnis}/{Dateiname}'), TRUE ) }} {{vtEndIf}} {{vtSet: Result[status_lores]="{vtResult}"}} {{vtIf: {vtResult} .gt. 0 }} {{vtDo: -act="update", -obj="{vtID}", lores_timestamp="{vtEcho:time()}", LastCheck="{vtSession:update_timestamp}" }} {{vtElse}} {{vtSet: Result[error]="2"}} {{vtEndIf}} {{vtEndIf}} {{vtCalc: file_exists('{vtGet:LoresPath,raw|utf8_encode}') ? '1' : '0' }} {{vtIf: {vtResult} .eq. 0 .and. {vtGet:Result[error]} .eq. }} {{vtSet: Result[error]="1"}} {{vtExit}} {{vtEndIf}} {{vtCalc: filemtime( '{vtGet:LoresPath,raw}' ) }} {{vtSet: Timestamp}} {{vtIf: {Format} .eq. }} {{vtCalc: getImageOrientation( '{vtGet:LoresPath,raw}', 0.01 ) }} {{vtDo: -act="update", -obj="{vtID}", Format="{vtResult}" }} {{vtSet: Result[status_format]="1"}} {{vtEndIf}} {{vtIf: {vtSession:update_iptc} .gt. 0}} {{vtSet: DoUpdate="1"}} {{vtIf: {vtSession:update_iptc} .eq. 1}} {{vtIf: {vtGet:Timestamp} .eq. {Timestamp} }} {{vtSet: DoUpdate="0"}} {{vtSet: Result[status_iptc]="0"}} {{vtEndIf}} {{vtEndIf}} {{vtIf: {vtGet:DoUpdate} .eq. 1}} {{vtSet: charset="{vtGlobal:pxtcIPTCCharset}" }} {{vtIf: {vtGet:charset} .eq. latin1 }} {{vtSet:charset=""}} {{vtEndIf}} {{vtSet: ImagePath = "{vtGet:LoresPath,raw}" }} {{vtIf: {vtSession:update_iptc_source} .eq. hires }} {{vtCalc: file_exists( '{vtGet:HiresPath}' ) ? 1 : 0 }} {{vtIf: {vtResult} .eq. 1 }} {{vtSet: ImagePath = "{vtGet:HiresPath,raw}" }} {{vtEndIf}} {{vtEndIf}} {{vtRepeat: Category, Keywords, ReferenceNumber, CreationDate, CreationTime, Photographer, City, State, CountryCode, Country, Title, Credit, Copyright, Description, Instructions }} {{vtCalc: getIPTCHeader('{vtGet:ImagePath,escaped}', '{vtItem}', '{vtGet:charset}' ) }} {{vtSet: {vtItem}="{vtResult}"}} {{vtEndRepeat}} {{vtDo: -act="update", -obj="{vtID}", Timestamp="{vtGet:Timestamp}", LastCheck="{vtSession:update_timestamp}", Name="{vtGet:Title}", Remarks="{vtGet:Description}", Keywords="{vtGet:Keywords}", Category="{vtGet:Category}", ReferenceNumber="{vtGet:ReferenceNumber}", CreationDate="{vtGet:CreationDate}", CreationTime="{vtGet:CreationTime}", Photographer="{vtGet:Photographer}", City="{vtGet:City}", State="{vtGet:State}", CountryCode="{vtGet:CountryCode}", Country="{vtGet:Country}", Credit="{vtGet:Credit}", Copyright="{vtGet:Copyright}", Instructions="{vtGet:Instructions}" }} {{vtSet: Result[status_iptc]="1"}} {{vtEndIf}} {{vtEndIf}} {{vtIf: {vtSession:update_thumbs} .gt. 0}} {{vtSet: Result[status_thumbs]=""}} {{vtIf: {vtSession:update_thumbs} .eq. 1}} {{vtCalc: makeThumbnail( utf8_encode('{Verzeichnis:escaped}/{Dateiname:escaped}') ) }} {{vtElse}} {{vtCalc: makeThumbnail( utf8_encode('{Verzeichnis:escaped}/{Dateiname:escaped}'), TRUE ) }} {{vtEndIf}} {{vtSet: Result[status_thumbs]="{vtResult}"}} {{vtIf: {vtResult} .gt. 0 }} {{vtDo: -act="update", -obj="{vtID}", thumb_timestamp="{vtDate}", LastCheck="{vtSession:update_timestamp}" }} {{vtEndIf}} {{vtEndIf}} {{vtIf: {vtGet:DoUpdate} .eq. 0 }} {{vtDo: -act="update", -obj="{vtID}", LastCheck="{vtSession:update_timestamp}" }} {{vtEndIf}} {{vtExit}} {{vtEndLoop}} {{vtEndSelect}} {{vtEndScript}}{{vtGet:Result,raw}}