Changeset 3352306
- Timestamp:
- 08/28/2025 09:37:52 PM (6 months ago)
- Location:
- tradejournal
- Files:
-
- 5 edited
- 9 copied
-
tags/1.2.1 (copied) (copied from tradejournal/trunk)
-
tags/1.2.1/assets/css/style.css (copied) (copied from tradejournal/trunk/assets/css/style.css)
-
tags/1.2.1/assets/js/admin.js (copied) (copied from tradejournal/trunk/assets/js/admin.js)
-
tags/1.2.1/includes/admin.php (modified) (1 diff)
-
tags/1.2.1/includes/csv-import.php (copied) (copied from tradejournal/trunk/includes/csv-import.php) (3 diffs)
-
tags/1.2.1/includes/logs (copied) (copied from tradejournal/trunk/includes/logs)
-
tags/1.2.1/includes/meta-box.php (copied) (copied from tradejournal/trunk/includes/meta-box.php)
-
tags/1.2.1/includes/template-functions.php (copied) (copied from tradejournal/trunk/includes/template-functions.php)
-
tags/1.2.1/readme.txt (copied) (copied from tradejournal/trunk/readme.txt) (2 diffs)
-
tags/1.2.1/tradejournal.php (copied) (copied from tradejournal/trunk/tradejournal.php) (1 diff)
-
trunk/includes/admin.php (modified) (1 diff)
-
trunk/includes/csv-import.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/tradejournal.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tradejournal/tags/1.2.1/includes/admin.php
r3185259 r3352306 66 66 $file_ext = pathinfo($csv_name, PATHINFO_EXTENSION); 67 67 if ($file_ext === 'csv' && realpath($csv_tmp_name) && file_exists($csv_tmp_name)) { 68 // Proceed to import trades 69 tjwp_import_trades_from_csv($csv_tmp_name);68 // Proceed to import trades and capture the created post ID 69 $post_id = tjwp_import_trades_from_csv($csv_tmp_name); 70 70 71 // Output success message 72 echo '<p class="success-message">Trades Imported Successfully!</p>'; 71 // Output success notice with quick links if we have a post ID 72 if ($post_id) { 73 $edit_link = get_edit_post_link($post_id); 74 $view_link = get_permalink($post_id); 75 echo '<div class="notice notice-success is-dismissible"><p>' 76 . esc_html__('Trades imported successfully!', 'tradejournal') . ' ' 77 . '<a href="' . esc_url($edit_link) . '">' . esc_html__('Edit post', 'tradejournal') . '</a>' 78 . ' | ' 79 . '<a href="' . esc_url($view_link) . '" target="_blank" rel="noopener noreferrer">' . esc_html__('View post', 'tradejournal') . '</a>' 80 . '</p></div>'; 81 } else { 82 echo '<div class="notice notice-success is-dismissible"><p>' 83 . esc_html__('Trades imported successfully!', 'tradejournal') 84 . '</p></div>'; 85 } 73 86 } else { 74 87 // Handle invalid file type or path -
tradejournal/tags/1.2.1/includes/csv-import.php
r3346660 r3352306 5 5 function tjwp_import_trades_from_csv($csv_file) 6 6 { 7 $post_id = 0; // default in case import fails 7 8 $csv_data = array_map('str_getcsv', file($csv_file)); 8 9 … … 49 50 ); 50 51 $post_id = wp_insert_post($post_data); 52 if (is_wp_error($post_id)) { 53 $post_id = 0; 54 } 51 55 52 56 if ($post_id) { … … 385 389 update_post_meta($post_id, 'trade_repeater', $trade_data); 386 390 } 391 return $post_id; 387 392 } -
tradejournal/tags/1.2.1/readme.txt
r3346660 r3352306 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8.2 6 Stable tag: 1.2. 06 Stable tag: 1.2.1 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 86 86 87 87 == Changelog == 88 89 = 1.2.1 = 90 * Admin: After CSV import, show success notice with quick links to Edit post and View post. 91 * Importer: Return created post ID to support admin notice links. 88 92 89 93 = 1.2.0 = -
tradejournal/tags/1.2.1/tradejournal.php
r3346660 r3352306 3 3 Plugin Name: TradeJournal WP 4 4 Description: TradeJournal WP imports trades from NinjaTrader CSV files, creating detailed journal entries for each trading day. Includes trade management, P&L calculation, responsive tables, lightbox for screenshots, and compatibility with custom post types and block-based themes. Track performance, analyze setups, and organize screenshots easily within WordPress. 5 Version: 1.2. 05 Version: 1.2.1 6 6 Author: Laith Sinawi 7 7 Author URI: https://sinawiwebdesign.com -
tradejournal/trunk/includes/admin.php
r3185259 r3352306 66 66 $file_ext = pathinfo($csv_name, PATHINFO_EXTENSION); 67 67 if ($file_ext === 'csv' && realpath($csv_tmp_name) && file_exists($csv_tmp_name)) { 68 // Proceed to import trades 69 tjwp_import_trades_from_csv($csv_tmp_name);68 // Proceed to import trades and capture the created post ID 69 $post_id = tjwp_import_trades_from_csv($csv_tmp_name); 70 70 71 // Output success message 72 echo '<p class="success-message">Trades Imported Successfully!</p>'; 71 // Output success notice with quick links if we have a post ID 72 if ($post_id) { 73 $edit_link = get_edit_post_link($post_id); 74 $view_link = get_permalink($post_id); 75 echo '<div class="notice notice-success is-dismissible"><p>' 76 . esc_html__('Trades imported successfully!', 'tradejournal') . ' ' 77 . '<a href="' . esc_url($edit_link) . '">' . esc_html__('Edit post', 'tradejournal') . '</a>' 78 . ' | ' 79 . '<a href="' . esc_url($view_link) . '" target="_blank" rel="noopener noreferrer">' . esc_html__('View post', 'tradejournal') . '</a>' 80 . '</p></div>'; 81 } else { 82 echo '<div class="notice notice-success is-dismissible"><p>' 83 . esc_html__('Trades imported successfully!', 'tradejournal') 84 . '</p></div>'; 85 } 73 86 } else { 74 87 // Handle invalid file type or path -
tradejournal/trunk/includes/csv-import.php
r3346660 r3352306 5 5 function tjwp_import_trades_from_csv($csv_file) 6 6 { 7 $post_id = 0; // default in case import fails 7 8 $csv_data = array_map('str_getcsv', file($csv_file)); 8 9 … … 49 50 ); 50 51 $post_id = wp_insert_post($post_data); 52 if (is_wp_error($post_id)) { 53 $post_id = 0; 54 } 51 55 52 56 if ($post_id) { … … 385 389 update_post_meta($post_id, 'trade_repeater', $trade_data); 386 390 } 391 return $post_id; 387 392 } -
tradejournal/trunk/readme.txt
r3346660 r3352306 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8.2 6 Stable tag: 1.2. 06 Stable tag: 1.2.1 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 86 86 87 87 == Changelog == 88 89 = 1.2.1 = 90 * Admin: After CSV import, show success notice with quick links to Edit post and View post. 91 * Importer: Return created post ID to support admin notice links. 88 92 89 93 = 1.2.0 = -
tradejournal/trunk/tradejournal.php
r3346660 r3352306 3 3 Plugin Name: TradeJournal WP 4 4 Description: TradeJournal WP imports trades from NinjaTrader CSV files, creating detailed journal entries for each trading day. Includes trade management, P&L calculation, responsive tables, lightbox for screenshots, and compatibility with custom post types and block-based themes. Track performance, analyze setups, and organize screenshots easily within WordPress. 5 Version: 1.2. 05 Version: 1.2.1 6 6 Author: Laith Sinawi 7 7 Author URI: https://sinawiwebdesign.com
Note: See TracChangeset
for help on using the changeset viewer.