Changeset 2859001
- Timestamp:
- 02/02/2023 01:33:52 PM (3 years ago)
- Location:
- stacks-mobile-app-builder/trunk
- Files:
-
- 7 edited
-
api/builder/image.php (modified) (1 diff)
-
api/builder/posts.php (modified) (1 diff)
-
api/builder/views.php (modified) (1 diff)
-
api/mobile/woocommerce/api/v1/pages/views/views-controller.php (modified) (1 diff)
-
index.php (modified) (1 diff)
-
modules/db.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
stacks-mobile-app-builder/trunk/api/builder/image.php
r2739350 r2859001 29 29 mkdir($uploaddir, 0755, true); 30 30 } 31 if (move_uploaded_file( sanitize_text_field( $_FILES['file']['tmp_name'] ), $uploadfile)) { 31 if( $_SERVER['SERVER_NAME'] == 'localhost' ) { 32 move_uploaded_file( sanitize_text_field( $_FILES['file']['tmp_name'] ), $uploadfile); 33 return esc_url(stripslashes($uploadfile_url)); 34 } else if ( move_uploaded_file( sanitize_text_field( $_FILES['file']['tmp_name'] ), $uploadfile)) { 32 35 return esc_url(stripslashes(str_replace("http://", "https://", $uploadfile_url))); 33 36 } else { -
stacks-mobile-app-builder/trunk/api/builder/posts.php
r2823455 r2859001 31 31 ] 32 32 ]; 33 } else if( $args['source'] == 'by_category' ) { 34 $args['tax_query'] = [ 35 [ 36 'taxonomy' => 'category', 37 'field' => 'term_id', 38 'terms' => $args['category'], /// Where term_id of Term 1 is "1". 39 ] 40 ]; 33 41 } 42 34 43 $wp_query= null; 35 44 $wp_query = new WP_Query(); -
stacks-mobile-app-builder/trunk/api/builder/views.php
r2836674 r2859001 29 29 ) 30 30 ); 31 32 register_rest_route( 33 $namespace, 34 '/delete-all-views/', 35 array( 36 'methods' => 'POST', 37 'callback' => array($this, 'delete_all_views'), 38 'args' => array(), 39 ) 40 ); 31 41 } 32 42 33 43 public function stacks_update_view($request) { 34 44 $response = $GLOBALS['stacks_builder']->update_view( sanitize_text_field( $request['view_id'] ), $request['data'], sanitize_text_field( $request['project_id'] ), sanitize_text_field( $request['view_name'] ), sanitize_text_field( $request['status'] )); 45 return wp_send_json_success( $response ); 46 } 47 48 public function delete_all_views($request) { 49 $response = $GLOBALS['stacks_builder']->delete_all_views( $request['project_id'] ); 35 50 return wp_send_json_success( $response ); 36 51 } -
stacks-mobile-app-builder/trunk/api/mobile/woocommerce/api/v1/pages/views/views-controller.php
r2836674 r2859001 194 194 'builder_data' => $GLOBALS['stacks_builder']->get_view( $view_name, $project_id ) 195 195 ]; 196 197 196 $home_response_items['builder_data'] = $this->add_data_to_view_widgets($home_response_items['builder_data'], $page_widgets = []); 198 197 -
stacks-mobile-app-builder/trunk/index.php
r2836674 r2859001 6 6 * Author URI: stacksmarket.co 7 7 * Description: Enjoy the fast and easy experience of building your Ecommerce mobile application 8 * Version: 4.8.38 * Version: 5.0 9 9 */ 10 10 class stacks_app_builder { -
stacks-mobile-app-builder/trunk/modules/db.php
r2836674 r2859001 129 129 view_id int UNSIGNED NOT NULL, 130 130 view_name text NULL, 131 data textNULL,131 data LONGTEXT NULL, 132 132 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 133 133 updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, … … 166 166 167 167 168 public function db_column_checker($table, $column_name, $type = 'VARCHAR(255) NULL' ) {168 public function db_column_checker($table, $column_name, $type = 'VARCHAR(255) NULL', $modify = false) { 169 169 global $wpdb; 170 170 $row = $wpdb->get_results("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='{$table}' AND column_name='{$column_name}'"); 171 171 if (empty($row)) { 172 172 $wpdb->query("ALTER TABLE {$table} ADD $column_name $type"); 173 } 174 if($modify) { 175 $row_modified = $wpdb->get_results("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='{$table}' AND column_name='{$column_name}' AND DATA_TYPE='{$type}'"); 176 if (empty($row_modified)) { 177 $wpdb->query("ALTER TABLE {$table} MODIFY $column_name $type"); 178 } 173 179 } 174 180 return true; … … 219 225 global $wpdb; 220 226 $table = $wpdb->prefix . 'stacks_builder_views'; 227 $this->db_column_checker($table, 'data', 'LONGTEXT NULL', true); 221 228 $data = json_encode($data); 222 $project = $wpdb->get_results( sprintf("SELECT * FROM {$table} WHERE view_id = %d AND project_id = %d", $view_id, $project_id), ARRAY_A);223 if (!empty($project)) {224 $wpdb->update( $table, array('data' => $data, 'updated_at' => date("Y-m-d H:i:s"), 'status' => $status, 'view_name' => $view_name), array('view_id' => $view_id, 'project_id' => $project_id));229 $project = $wpdb->get_results( sprintf( "SELECT * FROM {$table} WHERE view_name = '{$view_name}' AND project_id = %d", $project_id ), ARRAY_A ); 230 if( $project ) { 231 $wpdb->update( $table, array( 'data' => $data, 'updated_at' => date("Y-m-d H:i:s"), 'status' => $status ), array( 'view_name' => $view_name, 'project_id' => $project_id ) ); 225 232 } else { 226 233 $wpdb->insert( … … 348 355 return $wpdb->insert_id; 349 356 } 357 358 public function delete_all_views($project_id) { 359 global $wpdb ; 360 $table = $wpdb->prefix.'stacks_builder_views'; 361 $wpdb->delete( $table, array( 'project_id' => $project_id ) ); 362 } 350 363 } 351 364 -
stacks-mobile-app-builder/trunk/readme.txt
r2836674 r2859001 6 6 Requires PHP: 5.6 7 7 WC tested up to: 6.5.1 8 Stable tag: 4.8.38 Stable tag: 5.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 122 122 == Changelog == 123 123 124 = 5.0 (01 February, 2023) = 125 * Rest of Views are Editable 126 * Possibility to add, edit or delete custom view 127 * Link from any view to another 128 * Add Global Header 129 * Add Header per view 130 * Possibility to disable Footer on specific views 131 * Add Global Footer 132 * Add Footer per view 133 * Possibility to disable Footer on specific views 134 124 135 = 4.8.3 (20 December, 2022) = 125 136 * Handle multiple projects connected to the same site
Note: See TracChangeset
for help on using the changeset viewer.