Changeset 1846895
- Timestamp:
- 03/26/2018 11:10:53 AM (8 years ago)
- Location:
- social-articles/trunk
- Files:
-
- 1 added
- 10 edited
-
assets/css/social-articles.css (modified) (1 diff)
-
includes/admin/assets/css/sa-admin-settings.css (modified) (1 diff)
-
includes/admin/social-articles-options.php (modified) (3 diffs)
-
includes/admin/social-articles-tools.php (modified) (1 diff)
-
includes/admin/tabs/social-articles-troubleshooting.php (added)
-
includes/sa-form/fields/commons/uploader.php (modified) (1 diff)
-
includes/sa-form/sa-form-settings-class.php (modified) (1 diff)
-
includes/sa-form/sa-helper-class.php (modified) (1 diff)
-
includes/social-articles-functions.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
social-articles.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
social-articles/trunk/assets/css/social-articles.css
r1833370 r1846895 685 685 position: absolute; 686 686 top: 0; 687 margin-top: 100px;687 /* margin-top: 100px;*/ 688 688 background: #fff; 689 689 z-index: 10; -
social-articles/trunk/includes/admin/assets/css/sa-admin-settings.css
r1833370 r1846895 632 632 float:right; 633 633 } 634 635 #content-limit-switch .onoffswitch-inner:after { 636 content: attr(data-no); 637 padding-right: 10px; 638 background-color: #00B5D1 !important; 639 color: #FFFFFF !important; 640 text-align: right; 641 } 642 643 644 .sa-troubleshooting-button:before{ 645 background: 0 0; 646 color: #fff; 647 content: "\f463"; 648 display: block; 649 font: 400 16px/20px dashicons; 650 speak: none; 651 height: 29px; 652 text-align: center; 653 width: 16px; 654 float: left; 655 margin-top: 3px; 656 margin-right: 4px; 657 } -
social-articles/trunk/includes/admin/social-articles-options.php
r1833370 r1846895 60 60 <a class="nav-tab" id="view-tab" href="#top#view"><?php _e( 'View', 'social-articles' );?></a> 61 61 <a class="nav-tab" id="form-tab" href="#top#form"><?php _e( 'Form', 'social-articles' );?></a> 62 <a class="nav-tab" id="troubleshooting-tab" href="#top#troubleshooting"><?php _e( 'Troubleshooting', 'social-articles' );?></a> 62 63 <a class="nav-tab" id="addons-tab" href="#top#addons"><?php _e( 'Add-ons', 'social-articles' );?></a> 63 64 <span id="changes-detected-message"><span class="dashicons dashicons-warning" style="color: #ff4b4b;"></span><?php _e( 'There are unsaved changes', 'social-articles');?> … … 73 74 <div id="form" class="sa-tab"> 74 75 <?php include(SA_BASE_PATH.'/includes/admin/tabs/social-articles-form-settings.php'); ?> 76 </div> 77 <div id="troubleshooting" class="sa-tab"> 78 <?php include(SA_BASE_PATH.'/includes/admin/tabs/social-articles-troubleshooting.php'); ?> 75 79 </div> 76 80 <div id="addons" class="sa-tab"> … … 118 122 119 123 <?php 120 } 124 } 125 126 121 127 ?> -
social-articles/trunk/includes/admin/social-articles-tools.php
r1748129 r1846895 32 32 foreach ($options as $val => $name) { 33 33 $checked = false; 34 foreach ( $opt[$id] as $index => $option ) { 35 if ($option == $val) 36 $checked = true; 34 if(is_array($opt) && array_key_exists($id, $opt)&& is_array($opt[$id])) { 35 foreach ($opt[$id] as $index => $option) { 36 if ($option == $val) 37 $checked = true; 38 } 37 39 } 38 40 if ($name == '') -
social-articles/trunk/includes/sa-form/fields/commons/uploader.php
r1701311 r1846895 171 171 172 172 if ($this->file->save($uploadDirectory . $filename . '.' . $ext)){ 173 $this->image_fix_orientation($uploadDirectory . $filename . '.' . $ext); 173 174 return array('success'=>true); 174 175 } else { 175 176 return array('error'=> __('Could not save uploaded file. The upload was cancelled, or server error encountered', "social-articles")); 176 177 } 177 178 } 178 } 179 180 private function image_fix_orientation($filename) { 181 if(function_exists('exif_read_data') && function_exists('imagecreatefromjpeg')){ 182 $exif = exif_read_data($filename); 183 if (!empty($exif['Orientation'])) { 184 $image = imagecreatefromjpeg($filename); 185 switch ($exif['Orientation']) { 186 case 3: 187 $image = imagerotate($image, 180, 0); 188 break; 189 case 6: 190 $image = imagerotate($image, -90, 0); 191 break; 192 case 8: 193 $image = imagerotate($image, 90, 0); 194 break; 195 } 196 imagejpeg($image, $filename, 90); 197 } 198 } 199 } 200 179 201 } -
social-articles/trunk/includes/sa-form/sa-form-settings-class.php
r1701311 r1846895 60 60 $this->available_fields = $this->all_fields; 61 61 62 foreach ($this->selected_fields as $key=>$field_config){ 63 $original_field = $this->all_fields[$key]; 64 if(is_object($original_field)) { 65 $original_config = $original_field->get_config(); 66 if(is_array($original_config)){ 67 $original_field_config = $original_config['field_config']; 68 }else{ 69 $original_field_config = get_object_vars($field_config); 62 foreach ($this->selected_fields as $key=>$field_config) { 63 64 if (array_key_exists($key, $this->all_fields)) { 65 $original_field = $this->all_fields[$key]; 66 if (is_object($original_field)) { 67 $original_config = $original_field->get_config(); 68 if (is_array($original_config)) { 69 $original_field_config = $original_config['field_config']; 70 } else { 71 $original_field_config = get_object_vars($field_config); 72 } 73 74 if (empty($field_config)) { 75 $field_config = $original_field_config; 76 } 77 78 $original_field->set_field_config(array_merge($original_field_config, get_object_vars($field_config))); 79 $this->selected_fields[$key] = $original_field; 80 unset($this->available_fields[$key]); 81 } else { 82 unset($this->selected_fields[$key]); 70 83 } 71 72 if(empty($field_config)){ 73 $field_config = $original_field_config; 74 } 75 /* 76 var_dump($original_field_config); 77 echo "<br>";social 78 var_dump(get_object_vars($field_config)); 79 echo "<br>"; 80 echo "<br>";*/ 81 82 //$original_field_config = $original_field->get_config()['field_config']; 83 $original_field->set_field_config(array_merge($original_field_config, get_object_vars($field_config))); 84 $this->selected_fields[$key] = $original_field; 85 unset($this->available_fields[$key]); 86 }else{ 84 }else{ 87 85 unset($this->selected_fields[$key]); 88 }86 } 89 87 } 90 88 } -
social-articles/trunk/includes/sa-form/sa-helper-class.php
r1701311 r1846895 63 63 $taxonomies = get_object_taxonomies( $post_type, 'objects' ); 64 64 65 $field_tax_hierarchical_class = $registered_fields[SA_Helper::TAX_HIERARCHICAL_FIELD]; 66 if(class_exists($field_tax_hierarchical_class)) { 67 if(!empty($taxonomies['category'])) 68 $all_fields['category'] = new $field_tax_hierarchical_class($taxonomies['category']->name, $taxonomies['category']->labels->name); 69 } 70 71 $field_tax_normal_class = $registered_fields[SA_Helper::TAX_REGULAR_FIELD]; 72 if(class_exists($field_tax_normal_class)) { 73 if(!empty($taxonomies['post_tag'])) 74 $all_fields['post_tag'] = new $field_tax_normal_class($taxonomies['post_tag']->name, $taxonomies['post_tag']->labels->name); 65 if(array_key_exists(SA_Helper::TAX_HIERARCHICAL_FIELD, $registered_fields )) { 66 $field_tax_hierarchical_class = $registered_fields[SA_Helper::TAX_HIERARCHICAL_FIELD]; 67 if (class_exists($field_tax_hierarchical_class)) { 68 if (!empty($taxonomies['category'])) 69 $all_fields['category'] = new $field_tax_hierarchical_class($taxonomies['category']->name, $taxonomies['category']->labels->name); 70 } 75 71 } 76 72 77 //Generate Content Instance. 78 $field_content_class = $registered_fields[SA_Helper::CONTENT_FIELD]; 79 if(class_exists($field_content_class)) { 80 $all_fields[SA_Helper::CONTENT_FIELD] = new $field_content_class(SA_Helper::CONTENT_FIELD, __("Content", "social-articles")); 73 if(array_key_exists(SA_Helper::TAX_REGULAR_FIELD, $registered_fields )) { 74 $field_tax_normal_class = $registered_fields[SA_Helper::TAX_REGULAR_FIELD]; 75 if (class_exists($field_tax_normal_class)) { 76 if (!empty($taxonomies['post_tag'])) 77 $all_fields['post_tag'] = new $field_tax_normal_class($taxonomies['post_tag']->name, $taxonomies['post_tag']->labels->name); 78 } 81 79 } 82 83 //FEATURED_IMAGE_FIELD 84 $field_image_class = $registered_fields[SA_Helper::FEATURED_IMAGE_FIELD]; 85 if(class_exists($field_image_class)) { 86 $all_fields[SA_Helper::FEATURED_IMAGE_FIELD] = new $field_image_class(SA_Helper::FEATURED_IMAGE_FIELD, __("Featured image", "social-articles")); 80 if(array_key_exists(SA_Helper::CONTENT_FIELD ,$registered_fields)) { 81 //Generate Content Instance. 82 $field_content_class = $registered_fields[SA_Helper::CONTENT_FIELD]; 83 if (class_exists($field_content_class)) { 84 $all_fields[SA_Helper::CONTENT_FIELD] = new $field_content_class(SA_Helper::CONTENT_FIELD, __("Content", "social-articles")); 85 } 86 } 87 if(array_key_exists(SA_Helper::FEATURED_IMAGE_FIELD ,$registered_fields)) { 88 //FEATURED_IMAGE_FIELD 89 $field_image_class = $registered_fields[SA_Helper::FEATURED_IMAGE_FIELD]; 90 if (class_exists($field_image_class)) { 91 $all_fields[SA_Helper::FEATURED_IMAGE_FIELD] = new $field_image_class(SA_Helper::FEATURED_IMAGE_FIELD, __("Featured image", "social-articles")); 92 } 87 93 } 88 94 -
social-articles/trunk/includes/social-articles-functions.php
r1833370 r1846895 263 263 } 264 264 265 265 add_action('wp_ajax_reset_sa_options', 'reset_sa_options' ); 266 function reset_sa_options(){ 267 delete_option('social_articles_options'); 268 delete_option('sa_registered_fields'); 269 delete_option('sa_selected_fields'); 270 $options = array(); 271 $options = set_default_options($options); 272 update_option('social_articles_options',$options); 273 274 echo "ok"; 275 die(); 276 } 266 277 267 278 add_action( 'admin_notices', 'bp_social_articles_addons_notice'); -
social-articles/trunk/readme.txt
r1833370 r1846895 6 6 Tested up to: 4.9.4 7 7 Requires PHP: 5.6 8 Stable tag: 2. 78 Stable tag: 2.8 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 75 75 76 76 == Changelog == 77 78 = 2.8 = 79 * New option to reset social articles options - Troubleshooting 80 * Bug Fixing: Image rotation fix when photos are uploaded with iphone 81 * Bug Fixing: Clean some debug errors and notices 77 82 78 83 = 2.7 = -
social-articles/trunk/social-articles.php
r1833370 r1846895 3 3 Plugin Name: Social Articles 4 4 Description: This is the first BuddyPress plugin that let you to create and manage posts from your profile. It supports all buddypres themes, so you don't need to be an expert to use it! 5 Version: 2. 75 Version: 2.8 6 6 Author: Broobe 7 7 Author URI: http://www.broobe.com … … 78 78 spl_autoload_register('sa_fields_autoload'); 79 79 80 define('SA_PLUGIN_VERSION', '2. 7');80 define('SA_PLUGIN_VERSION', '2.8'); 81 81 define('SA_PLUGIN_DIR', dirname(__FILE__)); 82 82 define('SA_SLUG', 'articles'); … … 111 111 $options = get_option('social_articles_options'); 112 112 113 if (!isset($options['post_per_page'])) 114 $options['post_per_page'] = '10'; 115 116 if (!isset($options['excerpt_length'])) 117 $options['excerpt_length'] = '30'; 118 119 if (!isset($options['excerpt_length'])) 120 $options['category_type'] = 'single'; 121 122 if (!isset($options['workflow'])) 123 $options['workflow'] = 'approval'; 124 125 if (!isset($options['bp_notifications'])) 126 $options['bp_notifications'] = 'true'; 127 128 if (!isset($options['allow_author_adition'])) 129 $options['allow_author_adition'] = 'true'; 130 131 if (!isset($options['allow_author_deletion'])) 132 $options['allow_author_deletion'] = 'true'; 133 134 if (!isset($options['published_post_counter'])) 135 $options['published_post_counter'] = 'true'; 136 137 if (!isset($options['show_to_logged_out_users'])) 138 $options['show_to_logged_out_users'] = 'true'; 113 $options = set_default_options($options); 139 114 140 115 … … 248 223 } 249 224 225 function set_default_options($options){ 226 if (!isset($options['post_per_page'])) 227 $options['post_per_page'] = '10'; 228 229 if (!isset($options['excerpt_length'])) 230 $options['excerpt_length'] = '30'; 231 232 if (!isset($options['excerpt_length'])) 233 $options['category_type'] = 'single'; 234 235 if (!isset($options['workflow'])) 236 $options['workflow'] = 'approval'; 237 238 if (!isset($options['bp_notifications'])) 239 $options['bp_notifications'] = 'false'; 240 241 if (!isset($options['allow_author_adition'])) 242 $options['allow_author_adition'] = 'true'; 243 244 if (!isset($options['allow_author_deletion'])) 245 $options['allow_author_deletion'] = 'true'; 246 247 if (!isset($options['published_post_counter'])) 248 $options['published_post_counter'] = 'true'; 249 250 if (!isset($options['show_to_logged_out_users'])) 251 $options['show_to_logged_out_users'] = 'true'; 252 253 return $options; 254 } 255 250 256 function social_articles(){ 251 257 global $socialArticles;
Note: See TracChangeset
for help on using the changeset viewer.