Changeset 1827857
- Timestamp:
- 02/23/2018 04:07:50 PM (8 years ago)
- Location:
- canvasflow/trunk
- Files:
-
- 6 edited
-
README.md (modified) (2 diffs)
-
assets/css/style.css (modified) (1 diff)
-
canvasflow-plugin.php (modified) (1 diff)
-
includes/canvasflow-metabox.php (modified) (2 diffs)
-
includes/views/canvasflow-metabox-view.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
canvasflow/trunk/README.md
r1826541 r1827857 55 55 56 56 #### Changelog 57 ##### 0.11.1 58 * Display publish state in canvasflow metabox 59 57 60 ##### 0.11.0 58 61 * Add support for metabox in post editor … … 92 95 93 96 #### Upgrade Notice 97 ##### 0.11.1 98 * Display publish state in canvasflow metabox 99 94 100 ##### 0.11.0 95 101 * Support for canvasflow as metabox in post editor -
canvasflow/trunk/assets/css/style.css
r1699142 r1827857 69 69 } 70 70 } 71 72 .meta-box-button { 73 display: inline-block; 74 padding: 0 12px 1px; 75 border: 1px solid; 76 box-shadow: 0 1px 0 #006799; 77 border-color: #0073aa #006799 #006799; 78 border-radius: 3px; 79 background: #0085ba; 80 color: #fff; 81 text-decoration: none; 82 text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799; 83 height: 27px; 84 line-height: 29px; 85 } 86 87 a.meta-box-button {color:#fff;} 88 89 .meta-box-post-state-in-sync { 90 color: #009932; 91 font-weight: 600; 92 } 93 94 .meta-box-post-state-unpublished { 95 color: #595959; 96 font-weight: 600; 97 } 98 99 .meta-box-post-state-out-sync { 100 color: #FF530D; 101 font-weight: 600; 102 } -
canvasflow/trunk/canvasflow-plugin.php
r1826541 r1827857 3 3 Plugin Name: Canvasflow for WordPress 4 4 Description: This out-of-the-box connector provides a quick and simple way to push your blog content directly to an existing Canvasflow publication. 5 Version: 0.11. 05 Version: 0.11.1 6 6 Developer: Canvasflow 7 7 Developer URI: https://canvasflow.io -
canvasflow/trunk/includes/canvasflow-metabox.php
r1826541 r1827857 134 134 $selected_issue_id = $selection->issue_id; 135 135 } 136 137 $post_state = $this->get_post_state($post_id); 138 $post_state_content = ""; 139 $post_state_style = ""; 140 if($post_state == "unpublished") { 141 $post_state_style = "meta-box-post-state-unpublished"; 142 $post_state_content = "Unpublished"; 143 } else if($post_state == "out_of_sync") { 144 $post_state_style = "meta-box-post-state-out-sync"; 145 $post_state_content = "Out of sync"; 146 } else { 147 $post_state_style = "meta-box-post-state-in-sync"; 148 $post_state_content = "In sync"; 149 } 136 150 137 151 include( plugin_dir_path( __FILE__ ) . 'views/canvasflow-metabox-view.php'); … … 144 158 145 159 } 160 161 function get_post_state($post_id) { 162 $user_id = $this->user_id; 163 $post_table_name = $this->wpdb->prefix."posts"; 164 $query = "SELECT canvasflow_posts.id as id, canvasflow_posts.published as published, post.post_modified as post_modified_date FROM {$post_table_name} as post LEFT JOIN wp_canvasflow_posts as canvasflow_posts ON(post.id = canvasflow_posts.post_id) WHERE canvasflow_posts.post_id = ${post_id} LIMIT 1;"; 165 166 $posts = $this->wpdb->get_results($query); 167 if(sizeof ($posts) == 0) { 168 return "unpublished"; 169 } else { 170 $post = $posts[0]; 171 $published = $post->published; 172 $post_modified_date = $post->post_modified_date; 173 if(strtotime($post_modified_date) > strtotime($published)){ 174 return "out_of_sync"; 175 } else { 176 return "in_sync"; 177 } 178 } 179 } 146 180 } 147 181 ?> -
canvasflow/trunk/includes/views/canvasflow-metabox-view.php
r1826541 r1827857 28 28 <small> 29 29 <em> 30 Issue in canvasflow where the article is going to be published.30 Target issue 31 31 </em> 32 32 </small> … … 60 60 <small> 61 61 <em> 62 Determines the style applied to an uploaded article.62 CF Style 63 63 </em> 64 64 </small> 65 </td> 66 </tr> 67 <tr> 68 <th scope="row"> 69 <label for="style_id">Publish state</label> 70 </th> 71 <td id="cf_state" class="<?php echo $post_state_style?>"> 72 <?php echo $post_state_content?> 65 73 </td> 66 74 </tr> … … 72 80 <hr> 73 81 <div style="text-align: right;"> 74 <a id="cf_publish" style="display: inline-block; padding: 0 12px 2px; border: 0; box-shadow: 0 1px 0 #006799; border-color: #0073aa #006799 #006799; border-radius: 6px; background: #0085ba; color: #fff; text-decoration: none; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px;line-height: 28px;" href="javascript:;">Update</a>82 <a id="cf_publish" class="meta-box-button" href="javascript:;">Publish to Canvasflow</a> 75 83 </div> 76 84 … … 95 103 request.done(function (response, textStatus, xhr){ 96 104 var status = xhr.status; 105 let currentClass = $('#cf_state').attr('class'); 106 $("#cf_state").removeClass(currentClass); 107 $("#cf_state").addClass('meta-box-post-state-in-sync'); 108 $("#cf_state").html("In Sync"); 97 109 alert('Article publish successfully'); 98 110 }); -
canvasflow/trunk/readme.txt
r1826541 r1827857 70 70 71 71 == Changelog == 72 = 0.11.1 = 73 * Display publish state in canvasflow metabox 74 72 75 = 0.11.0 = 73 76 * Add support for metabox in post editor … … 106 109 107 110 == Upgrade Notice == 111 = 0.11.1 = 112 Display publish state in canvasflow metabox 113 108 114 = 0.11.0 = 109 115 Support for canvasflow as metabox in post editor
Note: See TracChangeset
for help on using the changeset viewer.