Plugin Directory

Changeset 747733


Ignore:
Timestamp:
07/29/2013 10:20:53 AM (13 years ago)
Author:
iDo8p
Message:

update for 3.5.2

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • wpmu-automatic-links/trunk/readme.txt

    r747729 r747733  
    44donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4RR68K6J9GBR8
    55Requires at least: 3.0
    6 Tested up to: 3.5
     6Tested up to: 3.5.2
    77Stable tag: trunk
    88
  • wpmu-prefill-post/trunk/readme.txt

    r375634 r747733  
    44donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4RR68K6J9GBR8
    55Requires at least: 3.0
    6 Tested up to: 3.1
     6Tested up to: 3.5.2
    77Stable tag: trunk
    88
     
    1414
    1515Add the ability to create post template.
    16 You can manage templates and use them to prefill a post. 
     16You can manage templates and use them to prefill a post.
    1717Also prefill the post title.
    1818
    1919
    20 Work with wordpress and wordpress mu. 
    21 Works with qtranslate. 
     20Work with wordpress and wordpress mu.
     21Works with qtranslate.
    2222
    2323Inspirated from "Article Templates"
  • wpmu-prefill-post/trunk/wpmu-prefill-post.php

    r375634 r747733  
    1616        public function WPMUPrefillPost(){
    1717            $this->plugin_name = plugin_basename(__FILE__);
    18 
    1918            if ( is_admin() ) {
    2019                // Start this plugin once all other plugins are fully loaded
     
    9695        }
    9796        public function add_admin_menu(){
     97            self::activate();
    9898            if (function_exists('add_options_page')) {
    9999                add_options_page(__('WPMU Prefil Post Templates',self::DOMAIN), __('WPMU Prefil Post Templates',self::DOMAIN), self::ADMINISTRATOR, self::DOMAIN, array (&$this, 'showAdminMenu'));
     
    144144        public function updateTemplate($id,$post_title,$post_content,$post_excerpt){
    145145            global $wpdb;
    146             if(get_magic_quotes_gpc()) {
     146            /*if(get_magic_quotes_gpc()) {
    147147                $post_title = stripslashes($post_title);
    148148                $post_content = stripslashes($post_content);
    149149                $post_excerpt = stripslashes($post_excerpt);
    150             }
    151             $table_name= $wpdb->prefix.self::DOMAIN;
    152             return $wpdb->update($table_name, array('post_title' => addslashes($post_title),
    153                                                     'post_content' => addslashes($post_content),
    154                                                     'post_excerpt' => addslashes($post_excerpt)
     150            }*/
     151            $table_name= $wpdb->prefix.self::DOMAIN;
     152            return $wpdb->update($table_name, array('post_title' => /*addslashes*/($post_title),
     153                                                    'post_content' => /*addslashes*/($post_content),
     154                                                    'post_excerpt' => /*addslashes*/($post_excerpt)
    155155                                            ), array('ID' => $id),array('%s','%s','%s'), '%d');
    156156
     
    158158        public function addTemplate($post_title,$post_content,$post_excerpt){
    159159            global $wpdb, $user_ID;
    160             if(get_magic_quotes_gpc()) {
     160            /*if(get_magic_quotes_gpc()) {
    161161                $post_title = stripslashes($post_title);
    162162                $post_content = stripslashes($post_content);
    163163                $post_excerpt = stripslashes($post_excerpt);
    164             }
     164            }*/
    165165            if ( is_multisite() ) {
    166166                switch_to_blog(self::MASTERBLOG);
    167167                $table_name= $wpdb->prefix.self::DOMAIN;
    168168                restore_current_blog();
    169                 if($wpdb->get_var( 'select id from $table_name where post_title ="'.addslashes($post_title).'"')) {
     169                echo 'select id from '.$table_name.' where post_title ="'./*addslashes*/($post_title).'"';
     170                if($wpdb->get_var( 'select id from '.$table_name.' where post_title ="'./*addslashes*/($post_title).'"')) {
    170171                    return false;
    171172                }
     
    173174            $table_name= $wpdb->prefix.self::DOMAIN;
    174175
    175             return $wpdb->insert($table_name, array('post_title' => addslashes($post_title),
    176                                                     'post_content' => addslashes($post_content),
    177                                                     'post_excerpt' => addslashes($post_excerpt),
     176            return $wpdb->insert($table_name, array('post_title' => /*addslashes*/($post_title),
     177                                                    'post_content' => /*addslashes*/($post_content),
     178                                                    'post_excerpt' => /*addslashes*/($post_excerpt),
    178179                                                    'post_author' => $user_ID
    179180                                            ), array('%s','%s','%s','%d'));
     
    190191            if (is_multisite() && $current_blog != self::MASTERBLOG) {
    191192                $masterElements = $this->getElements('ID','desc', true);
    192                 $this->showMetaBoxOption($masterElements, &$exclude, self::MASTERBLOG);
     193                $this->showMetaBoxOption($masterElements, $exclude, self::MASTERBLOG);
    193194
    194195                foreach($masterElements as $element){
     
    198199                }
    199200            }
    200             $this->showMetaBoxOption($elements, &$exclude, $current_blog);
     201            $this->showMetaBoxOption($elements, $exclude, $current_blog);
    201202            foreach($elements as $element){
    202203                $templates[$current_blog.'-'.$element->ID]=stripslashes($element->post_content);
     
    261262                    texcerpt.value=<?php echo self::DOMAIN;?>Excerpt[select.value];
    262263                }
    263                
     264
    264265                //if qtrans is enabled
    265266                if(typeof qtrans_get_active_language == "function"){
     
    275276                    qtrans_integrate_title();
    276277                }
    277                
    278                
     278
     279
    279280            }
    280281            function hasContent(){
     
    286287            <?php
    287288        }
    288         public function showMetaBoxOption($elements, $exclude, $blog_id){
     289        public function showMetaBoxOption($elements, &$exclude, $blog_id){
    289290            foreach($elements as $element){
    290291                if(in_array($element->post_title,$exclude)) continue;
     
    358359                        if (is_multisite() && $current_blog != self::MASTERBLOG) {
    359360                            $masterElements = $this->getElements($_GET['orderBy'], $_GET['order'], true);
    360                             $this->showTemplates($masterElements, false, __('Templates on master blog',WPMUPrefillPost::DOMAIN), &$exclude);
     361                            $this->showTemplates($masterElements, false, __('Templates on master blog',WPMUPrefillPost::DOMAIN), $exclude);
    361362                        }
    362                         $this->showTemplates($elements, true, __('Templates',WPMUPrefillPost::DOMAIN), &$exclude);
     363                        $this->showTemplates($elements, true, __('Templates',WPMUPrefillPost::DOMAIN), $exclude);
    363364
    364365
     
    381382            <?php
    382383        }
    383         public function showTemplates($elements, $editable = false, $title, $exclude = array()){?>
     384        public function showTemplates($elements, $editable = false, $title, &$exclude = array()){?>
    384385            <h3><?php echo $title; ?></h3>
    385386            <table class="widefat">
Note: See TracChangeset for help on using the changeset viewer.