kamath
Forum Replies Created
-
Forum: Plugins
In reply to: [Add From Server] Import files taking into account local time zoneHere is my tested solution:
A new variable$time_gmtis necessary to differ between local time and UTC.In “class.add-from-server.php” I have made the following changes, especially in function “handle_import_file” (All line items relate to the original script):
- Replace lines 260-670 by:
// Initially, Base it on the -current- time. // $time = current_time( 'mysql', 1 ); $time = current_time( 'mysql' ); $time_gmt = current_time( 'mysql', 1 ); // Next, If it's post to base the upload off: if ( 'post' == $import_date && $post_id > 0 ) { $post = get_post( $post_id ); if ( $post && substr( $post->post_date_gmt, 0, 4 ) > 0 ) { // $time = $post->post_date_gmt; $time = $post->post_date; $time_gmt = $post->post_date_gmt; } } elseif ( 'file' == $import_date ) { // $time = gmdate( 'Y-m-d H:i:s', @filemtime( $file ) ); $time = gmdate( 'Y-m-d H:i:s', @filemtime( $file ) ); $time_gmt = $time; } -
Add
$time_gmt = $time;at the end of lines 315 and 340. -
Replace lines 415-421 by:
$post_date = $time; $post_date_gmt = $time_gmt;
That´s it. I hope that it will work without any errors and perhaps these code snippets are part of one of the future versions.
Forum: Plugins
In reply to: [Add From Server] Import files taking into account local time zoneThat’s my approach:
Replace in “class.add-from-server.php”
- Line 261:
$time = current_time( 'mysql', 1 );through
$time = current_time( 'mysql' ); - Line 265,266:
if ( $post && substr( $post->post_date_gmt, 0, 4 ) > 0 ) { $time = $post->post_date_gmt;}through
if ( $post && substr( $post->post_date, 0, 4 ) > 0 ) { $time = $post->post_date;}
But this leads to:
- post_date_gmt = post_date = local time
- post_modified_gmt = post_modified = local time
So there is no difference between local time and UTC.
- This reply was modified 9 years, 8 months ago by kamath.
Forum: Themes and Templates
In reply to: [Virtue] Saving generated thumbnails in a subdirectoryThanks for your explanation. This sounds really complicated…
Forum: Themes and Templates
In reply to: [Virtue] Saving generated thumbnails in a subdirectoryHi Ben,
thanks for your answer. I assumed that my project is easy to implement.
Background: So far I have used Nextgen Gallery. There, thumbnails are created in a subfolderthumbs. But now I have discovered the beauty of Virtue gallery and I want to take this. What struck me in the FTP-view the folder structure due to the numerous thumbnails is pretty confusing. But maybe I have to live with it…Forum: Themes and Templates
In reply to: [Virtue] Saving generated thumbnails in a subdirectoryHi Kevin,
thanks for your answer.
The “original” imageimage.jpgis stored inwp-content/uploads/2016by default using WordPress´ uploader.
All generated thumbnails –image-150x150.jpg,image-300x300.jpgandimage-1024x1024.jpgshall be stored inwp-content/uploads/2016/thumbs.For example using a ftp-client you can differ between orignal image and thumbnail, just because there are stored in different folders.
- This reply was modified 9 years, 8 months ago by kamath.
- Replace lines 260-670 by: