Changeset 664805
- Timestamp:
- 02/07/2013 02:33:39 PM (13 years ago)
- Location:
- wp-vgwort/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-vgwort.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-vgwort/trunk/readme.txt
r663210 r664805 5 5 Requires at least: 3.0 6 6 Tested up to: 3.5 7 Stable tag: 1. 37 Stable tag: 1.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 == Changelog == 43 43 44 = 1.4 = 45 * Bugfix - Probleme mit Shortcode behoben 46 Ausgabe der Zeichen im Editor angepasst 47 Filterfunktion für Wortmarken im Benutzerprofil 48 Feedback Funktionen hinzugefügt 49 44 50 = 1.3 = 45 51 * Bugfix - Speichern der Zählmarke bei vorhandener Zählmarke -
wp-vgwort/trunk/wp-vgwort.php
r663210 r664805 5 5 Plugin URI: http://www.mywebcheck.de/vg-wort-plugin-wordpress/ 6 6 Description: Verwaltung der VG Wort Zählpixel 7 Version: 1. 37 Version: 1.4 8 8 Author: Marcus Franke 9 9 Author URI: http://mywebcheck.de … … 11 11 12 12 define(PLUGINNAME,'wp-vgwort'); 13 define(REQUIREDCHARS,1800); 13 14 define(VGWORTMETA, get_option('wp_vgwortmetaname', 'wp_vgwortmarke')); 14 15 … … 23 24 add_action( 'edit_user_profile' , array( &$this , 'wpVGWortaddProfileData' )); 24 25 add_action( 'show_user_profile' , array( &$this , 'wpVGWortaddProfileData' )); 26 add_action( 'personal_options_update', array( &$this,'wpVGWortSaveExtraUserProfileFields' )); 27 add_action( 'edit_user_profile_update', array( &$this,'wpVGWortSaveExtraUserProfileFields' )); 28 29 25 30 add_action( 'add_meta_boxes' , array( &$this , 'wpVGWortAddCustomMeta' )); 26 31 add_action( 'save_post' , array( &$this , 'wpVGWortSavePost' )); … … 79 84 <ul> 80 85 <li>Default: "wp_vgworkmarke"</li> 81 <li><a href="http://maheo.eu/355-vg-wort-plugin-fuer-wordpress.php" title="VG Wort Plugin - Heiner Otterstedt">VG-Wort Krimskram</a> -> "vgwpixel"</li>86 <li><a href="http://maheo.eu/355-vg-wort-plugin-fuer-wordpress.php" title="VG Wort Plugin - Heiner Otterstedt" target="_blank">VG-Wort Krimskram</a> -> "vgwpixel"</li> 82 87 <li>...</li> 83 88 </ul> … … 92 97 </tr> 93 98 </form> 99 <tr valign="top"> 100 <th scope="row"> <label for="paypal">Fehler und Bugs:</label> </th> 101 <td> 102 Wenn Fehler Ihr Fehler in unserem Plugin gefunden habt, dann wäre es sehr nett wenn Ihr uns diese mitteilt.<br /> 103 Dazu könnt Ihr auf unserer Plugin Seite kommentieren oder eine E-Mail an uns senden. 104 105 <ul> 106 <li>Kontakt</li> 107 <li><a href="http://www.mywebcheck.de/vg-wort-plugin-wordpress/" title="MyWebcheck - Plugin Seite" target="_blank">Plugin Seite</a></li> 108 <li><a href="[email protected]">[email protected]</li> 109 <li>...</li> 110 </ul> 111 112 </td> 113 </tr> 94 114 <tr valign="top"> 95 115 <th scope="row"> <label for="paypal">Cooles Plugin?:</label> </th> … … 121 141 122 142 if(!empty( $post->post_content )) { 123 printf('<script language="javascript" type="text/javascript"> var div = document.getElementById(" post-status-info"); if (div != undefined) { div.innerHTML = div.innerHTML + \'%s\'; } </script>', str_replace("'", "\'", sprintf('<span class="inside">Zeichen:'.' %d'.'</span> ', $this->getCharCount($post->post_content ) )));143 printf('<script language="javascript" type="text/javascript"> var div = document.getElementById("wp-word-count"); if (div != undefined) { div.innerHTML = div.innerHTML + \'%s\'; } </script>', str_replace("'", "\'", sprintf('<span class="inside"> / Zeichen:'.' %d'.'</span> ', $this->getCharCount( $post->post_title.$post->post_content ) ))); 124 144 } 125 145 } … … 183 203 184 204 <?php 185 $requiredChars = 1800; 186 187 $results = $wpdb->get_results($wpdb->prepare("SELECT * , CHAR_LENGTH(`post_content`) as charlength FROM ".$wpdb->posts." WHERE post_status = 'publish' AND post_type IN ('post','page') AND post_author = '%d' HAVING charlength > '%d'",$user->ID,$requiredChars)); 188 189 205 206 $currentFilter = get_user_meta( $user->ID, 'wp-wort-filter', true); 207 208 if(empty($currentFilter) OR $currentFilter == 'all'){ 209 $currentFilter = "all"; 210 $results = $wpdb->get_results($wpdb->prepare("SELECT * , CHAR_LENGTH(`post_content`) as charlength FROM ".$wpdb->posts." WHERE post_status = 'publish' AND post_type NOT IN ('attachment','nav_menu_item','revison') AND post_author = '%d' HAVING charlength > '%d'",$user->ID,REQUIREDCHARS)); 211 }else{ 212 $results = $wpdb->get_results($wpdb->prepare("SELECT * , CHAR_LENGTH(`post_content`) as charlength FROM ".$wpdb->posts." WHERE post_status = 'publish' AND post_type = %s AND post_author = '%d' HAVING charlength > '%d'",$currentFilter,$user->ID,REQUIREDCHARS)); 213 } 214 215 $postTypes = $wpdb->get_results("SELECT post_type FROM ".$wpdb->posts." WHERE post_type NOT IN ('attachment','nav_menu_item','revison') group by post_type ORDER BY FIELD(post_type,'post','page') DESC "); 216 217 echo 'Filtern nach Posttype:<select name="wpvgwortcurrentposttype" size="1"><option value="all">Alle</option>'; 218 219 foreach($postTypes as $postType) { 220 221 if($postType->post_type != $currentFilter){ 222 echo '<option value="'.$postType->post_type.'">'.$postType->post_type.'</option>'; 223 }else{ 224 echo '<option selected="selected" value="'.$postType->post_type.'">'.$postType->post_type.'</option>'; 225 } 226 227 228 } 229 echo '</select><input type="submit" name="Sender" value="filtern" />'; 230 190 231 if(!empty($results)) { 191 232 ?> … … 202 243 203 244 // Just Text nothing more :) 204 $clearContentCount = $this->getCharCount( $result->post_ content );245 $clearContentCount = $this->getCharCount( $result->post_title.$result->post_content ); 205 246 if($clearContentCount > $requiredChars){ 206 247 echo '<li><a href="'.get_admin_url().'post.php?post='.$result->ID.'&action=edit" title="jetzt VG Wort einfügen">'.$result->post_title.' ('.$clearContentCount.' Zeichen)</a></li>'; … … 221 262 /** 222 263 * 264 * Save the current FilterOption 265 * @param: int $user_id 266 * @return int 267 * 268 */ 269 270 public function wpVGWortSaveExtraUserProfileFields( $user_id ) { 271 272 if ( !current_user_can( 'edit_user', $user_id ) ) { return false; } 273 274 update_user_meta( $user_id, 'wp-wort-filter', $_POST['wpvgwortcurrentposttype'] ); 275 276 } 277 278 279 280 /** 281 * 223 282 * Calculate the Chars of the delivered content 224 283 * @param: string $content … … 228 287 229 288 private function getCharCount( $content ) { 230 return mb_strlen(preg_replace("/\\015\\012|\\015|\\012| {2,}|\[[a-zA-Z0-9\_=\"\' \/]*\]/", "", strip_tags(html_entity_decode($result->post_title . "" .$content ))));289 return mb_strlen(preg_replace("/\\015\\012|\\015|\\012| {2,}|\[[a-zA-Z0-9\_=\"\'\. \/]*\]/", "", strip_tags(html_entity_decode($content )))); 231 290 } 232 291
Note: See TracChangeset
for help on using the changeset viewer.