Plugin Directory

Changeset 664805


Ignore:
Timestamp:
02/07/2013 02:33:39 PM (13 years ago)
Author:
smoo1337
Message:

Version 1.4

Location:
wp-vgwort/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-vgwort/trunk/readme.txt

    r663210 r664805  
    55Requires at least: 3.0
    66Tested up to: 3.5
    7 Stable tag: 1.3
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4242== Changelog ==
    4343
     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
    4450= 1.3 =
    4551* Bugfix - Speichern der Zählmarke bei vorhandener Zählmarke
  • wp-vgwort/trunk/wp-vgwort.php

    r663210 r664805  
    55Plugin URI: http://www.mywebcheck.de/vg-wort-plugin-wordpress/
    66Description: Verwaltung der VG Wort Zählpixel
    7 Version: 1.3
     7Version: 1.4
    88Author: Marcus Franke
    99Author URI: http://mywebcheck.de
     
    1111
    1212define(PLUGINNAME,'wp-vgwort');
     13define(REQUIREDCHARS,1800);
    1314define(VGWORTMETA, get_option('wp_vgwortmetaname', 'wp_vgwortmarke'));
    1415
     
    2324        add_action( 'edit_user_profile' , array( &$this , 'wpVGWortaddProfileData' ));
    2425        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       
    2530        add_action( 'add_meta_boxes' , array( &$this , 'wpVGWortAddCustomMeta' ));
    2631        add_action( 'save_post' , array( &$this , 'wpVGWortSavePost' ));
     
    7984            <ul>
    8085                <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>
    8287                <li>...</li>
    8388            </ul>
     
    9297        </tr>
    9398        </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>
    94114        <tr valign="top">
    95115        <th scope="row"> <label for="paypal">Cooles Plugin?:</label> </th>
     
    121141
    122142      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 ) )));
    124144      }
    125145    }
     
    183203               
    184204            <?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               
    190231            if(!empty($results)) {
    191232                ?>
     
    202243               
    203244                        // Just Text nothing more :)
    204                         $clearContentCount = $this->getCharCount( $result->post_content );
     245                        $clearContentCount = $this->getCharCount( $result->post_title.$result->post_content );
    205246                        if($clearContentCount > $requiredChars){           
    206247                            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>';
     
    221262    /**
    222263    *
     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    *
    223282    * Calculate the Chars of the delivered content
    224283    * @param: string $content
     
    228287
    229288    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 ))));
    231290    }
    232291
Note: See TracChangeset for help on using the changeset viewer.