WordPress.org

Plugin Directory

Changeset 564803


Ignore:
Timestamp:
06/27/12 23:33:04 (22 months ago)
Author:
ntm
Message:

8.8.10.14 beta 16

Location:
podpress/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • podpress/trunk/podpress.php

    r563942 r564803  
    11<?php 
    2 define('PODPRESS_VERSION', '8.8.10.14 beta 15'); 
     2define('PODPRESS_VERSION', '8.8.10.14 beta 16'); 
    33/* 
    44Info for WordPress: 
    55============================================================================== 
    66Plugin Name: podPress 
    7 Version: 8.8.10.14 beta 15 
     7Version: 8.8.10.14 beta 16 
    88Plugin URI: http://www.mightyseek.com/podpress/ 
    99Description: The podPress plugin gives you everything you need in one easy plugin to use WordPress for Podcasting. Set it up in <a href="admin.php?page=podpress/podpress_feed.php">'podPress'->Feed/iTunes Settings</a>. If this plugin works for you, send us a comment. 
  • podpress/trunk/podpress_feed_functions.php

    r555286 r564803  
    8080        $data['podcastFeedURL'] = $podPress->settings['podcastFeedURL']; 
    8181        if (0 >= strlen(trim($data['author']))) { 
    82             if (0 < strlen($podPress->settings['iTunesAuthor'])) { 
     82            if (isset($podPress->settings['iTunesAuthor']) AND 0 < strlen($podPress->settings['iTunesAuthor'])) { 
    8383                $data['author'] = stripslashes($podPress->settings['iTunesAuthor']); 
    8484            } else { 
     
    9696        $data['rss_ttl'] = get_option('rss_ttl'); 
    9797 
    98         if($podPress->settings['category_data']['categoryCasting'] == 'true') { 
     98        if ( (isset($podPress->settings['category_data']['categoryCasting']) AND 'true' == $podPress->settings['category_data']['categoryCasting']) ) { 
    9999            $data['podcastFeedURL'] = $podPress->settings['category_data']['podcastFeedURL']; 
    100100            if($podPress->settings['category_data']['iTunesNewFeedURL'] != '##Global##') { 
     
    204204            echo '      <url>'.$data['rss_image'].'</url>'."\n"; 
    205205            echo '      <title>'.get_bloginfo('name').'</title>'."\n"; 
    206             echo '      <link>'.get_bloginfo('home').'</link>'."\n"; 
     206            echo '      <link>'.site_url().'</link>'."\n"; 
    207207            echo '      <width>144</width>'."\n"; 
    208208            echo '      <height>144</height>'."\n"; 
     
    277277     
    278278    function podpress_post_is_password_protected() { 
    279         GLOBAL $wp_version; 
     279        GLOBAL $wp_version, $post; 
    280280        if ( TRUE === version_compare($wp_version, '2.7', '>=') ) { 
    281281            if ( TRUE === post_password_required($post) ) { 
     
    650650                    $preferredFormat = true; 
    651651                } 
    652                 if ($post->podPressMedia[$key]['rss'] == 'on' || $post->podPressMedia[$key]['atom'] == 'on' || $preferredFormat === true || $ignore_incl_selection === TRUE ) { 
     652                if ( (isset($post->podPressMedia[$key]['rss']) AND $post->podPressMedia[$key]['rss'] == 'on') || (isset($post->podPressMedia[$key]['atom']) AND $post->podPressMedia[$key]['atom'] == 'on') || $preferredFormat === true || $ignore_incl_selection === TRUE ) { 
    653653                    if ($feedtype == 'atom' && ( $post->podPressMedia[$key]['atom'] == 'on' OR $preferredFormat === TRUE OR $ignore_incl_selection === TRUE) ) { 
    654654                        $post->podPressMedia[$key]['URI'] = $podPress->convertPodcastFileNameToWebPath($post->ID, $key, $post->podPressMedia[$key]['URI'], 'feed'); 
     
    697697                        // $foundPreferred is the limiter for enclosures in RSS items 
    698698                        // $preferredFormat signals whether a file type filter is active or not 
    699                         if ( $post->podPressMedia[$key]['rss'] == 'on' || $ignore_incl_selection === TRUE) { 
     699                        if ( (isset($post->podPressMedia[$key]['rss']) AND $post->podPressMedia[$key]['rss'] == 'on') || $ignore_incl_selection === TRUE) { 
    700700                            if ( !$preferredFormat && $foundPreferred ) { 
    701701                                continue; 
     
    791791        $result = ''; 
    792792        $data = array(); 
    793         if($podPress->settings['category_data']['categoryCasting'] == 'true' && is_array($podPress->settings['category_data']['iTunesCategory'])) { 
     793        if( (isset($podPress->settings['category_data']['categoryCasting']) AND 'true' == $podPress->settings['category_data']['categoryCasting']) && is_array($podPress->settings['category_data']['iTunesCategory'])) { 
    794794            foreach ($podPress->settings['category_data']['iTunesCategory'] as $key=>$value) { 
    795795                if($value == '##Global##') { 
     
    845845                $podPress->settings['category_data']['categoryCasting'] = 'true'; 
    846846            } 
    847             if ( 'true' === $podPress->settings['category_data']['categoryCasting'] ) { 
     847            if ( isset($podPress->settings['category_data']['categoryCasting']) AND 'true' == $podPress->settings['category_data']['categoryCasting'] ) { 
    848848                switch ($selection) { 
    849849                    case 'blogname' : 
  • podpress/trunk/podpress_premium_functions.php

    r564735 r564803  
    5555#   } 
    5656    function podPress_addDigestAuth($user, $password) { 
    57         GLOBAL $podPress; 
     57        GLOBAL $podPress, $wp_version; 
    5858        podPress_var_dump('############### podPress_addDigestAuth ###############'); 
    5959        if ( FALSE === empty($user) and FALSE === empty($password) ) { 
     
    6565                return; 
    6666            } 
    67             $userdata = get_userdatabylogin($user); 
    68             $current_creds = get_usermeta($userdata->ID, 'premiumcast_creds'); 
     67            if ( version_compare($wp_version, '3.3', '>=') ) { 
     68                $userdata = get_user_by('login', $user); 
     69            } else {  
     70                $userdata = get_userdatabylogin($user); 
     71            } 
     72            if ( version_compare($wp_version, '3.0', '>=') ) { 
     73                $current_creds = get_user_meta($userdata->ID, 'premiumcast_creds', TRUE); 
     74            } else {  
     75                $current_creds = get_usermeta($userdata->ID, 'premiumcast_creds'); 
     76            } 
    6977            $correct_creds = md5($user . ':' . $podPress->realm . ':' . $password); 
    7078            podPress_var_dump($current_creds); 
    7179            podPress_var_dump($correct_creds); 
    7280            if ($current_creds != $correct_creds) { 
    73                 $result = update_usermeta($userdata->ID, 'premiumcast_creds', $correct_creds); 
     81                if ( version_compare($wp_version, '3.0', '>=') ) { 
     82                    $result = update_user_meta($userdata->ID, 'premiumcast_creds', $correct_creds); 
     83                } else {  
     84                    $result = update_usermeta($userdata->ID, 'premiumcast_creds', $correct_creds); 
     85                } 
    7486                podPress_var_dump('update_usermeta'); 
    7587                podPress_var_dump($result); 
     
    104116            } 
    105117        } 
     118        podPress_var_dump($data); 
    106119        if(!empty($needed_parts)) { 
    107120            return false; 
     
    114127        $result = array(); 
    115128        list($result['username'], $result['passwd']) = explode(':', base64_decode(substr($txt, 6))); 
    116         podPress_var_dump('############### podPress_http_basic_parse'); 
     129        podPress_var_dump('############### podPress_http_basic_parse ###############'); 
    117130        podPress_var_dump($txt); 
    118131        return $result; 
     
    128141        podPress_var_dump('############### podPress_requestLogin ###############'); 
    129142        podPress_var_dump($loginmethod); 
    130         podPress_var_dump($_SERVER['PHP_AUTH_DIGEST']); 
    131          
     143        if (isset($_SERVER['PHP_AUTH_DIGEST'])) { 
     144            podPress_var_dump($_SERVER['PHP_AUTH_DIGEST']); 
     145        } 
    132146        switch ($podPress->settings['premiumMethod']) { 
    133147            case 'Digest': 
     
    167181     
    168182    function podPress_reloadCurrentUser() { 
    169         global $wp, $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity, $current_user; 
     183        global $wp, $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity, $current_user, $wp_version; 
    170184        podPress_var_dump('############### podPress_reloadCurrentUser ###############'); 
    171185        podPress_var_dump($user_ID); 
     
    176190            $current_user = new WP_User(PODPRESS_PREMIUMID, PODPRESS_PREMIUMLOGIN); 
    177191            $user_login = PODPRESS_PREMIUMLOGIN; 
    178             $userdata    = get_userdatabylogin($user_login); 
     192            if ( version_compare($wp_version, '3.3', '>=') ) { 
     193                $userdata = get_user_by('login', $user_login); 
     194            } else {  
     195                $userdata = get_userdatabylogin($user_login); 
     196            } 
    179197            $user_level  = $userdata->user_level; 
    180198            $user_ID     = $userdata->ID; 
     
    218236                    die('Wrong Credentials!'); 
    219237                } 
    220                 $x = get_userdatabylogin($data['username']); 
    221                 $A1 = get_usermeta($x->ID, 'premiumcast_creds'); 
     238                if ( version_compare($wp_version, '3.3', '>=') ) { 
     239                    $x = get_user_by('login', $data['username']); 
     240                } else {  
     241                    $x = get_userdatabylogin($data['username']); 
     242                } 
     243                if ( version_compare($wp_version, '3.0', '>=') ) { 
     244                    $A1 = get_user_meta($x->ID, 'premiumcast_creds', TRUE); 
     245                } else {  
     246                    $A1 = get_usermeta($x->ID, 'premiumcast_creds'); 
     247                } 
    222248                podPress_var_dump('$A1'); 
    223249                podPress_var_dump($A1); 
    224                      
     250 
    225251                $A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']); 
    226252                podPress_var_dump('$A2'); 
     
    229255                 
    230256                $valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2); 
    231  
     257                podPress_var_dump($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2); 
    232258                podPress_var_dump('$valid_response'); 
    233259                podPress_var_dump($valid_response); 
     
    237263                    $user_login = $data['username']; 
    238264                    $authresult = TRUE; 
     265                } else { 
     266                    $authresult = FALSE; 
    239267                } 
    240268                break; 
     
    257285        podPress_var_dump('$authresult'); 
    258286        podPress_var_dump($authresult); 
    259  
    260         $podPress_x = $GLOBALS['wp_object_cache']->cache['userlogins'][$user_login]; 
    261  
    262         if(is_object($podPress_x)) { 
    263             if($podPress_x->wp_capabilities['premium_subscriber'] != 1 &&  
    264                $podPress_x->wp20_capabilities['premium_subscriber'] != 1) { 
     287         
     288        if ( isset($GLOBALS['wp_object_cache']->cache['userlogins'][$user_login]) ) { 
     289            $podPress_x = $GLOBALS['wp_object_cache']->cache['userlogins'][$user_login]; 
     290        } else { 
     291            $podPress_x = 0; 
     292        } 
     293        if ( is_object($podPress_x) ) { 
     294            if ( isset($podPress_x->wp_capabilities['premium_subscriber']) AND $podPress_x->wp_capabilities['premium_subscriber'] != 1 AND isset($podPress_x->wp20_capabilities['premium_subscriber']) AND $podPress_x->wp20_capabilities['premium_subscriber'] != 1 ) { 
    265295                $authresult = false; 
    266296            } 
    267         } elseif ( is_array($GLOBALS['wp_object_cache']->cache['user_meta'][$podPress_x]) AND is_array($GLOBALS['wp_object_cache']->cache['user_meta'][$podPress_x]['wp_capabilities']) ) { 
     297        } elseif ( isset($GLOBALS['wp_object_cache']->cache['user_meta'][$podPress_x]) AND is_array($GLOBALS['wp_object_cache']->cache['user_meta'][$podPress_x]) AND is_array($GLOBALS['wp_object_cache']->cache['user_meta'][$podPress_x]['wp_capabilities']) ) { 
    268298            podPress_var_dump('user_meta is object'); 
    269299            $user_has_cap = FALSE; 
     
    278308            }  
    279309        } else { 
    280             if($GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp_capabilities['premium_subscriber'] != 1 &&  
    281                $GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp20_capabilities['premium_subscriber'] != 1) { 
     310            if ( isset($GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp_capabilities['premium_subscriber']) AND $GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp_capabilities['premium_subscriber'] != 1 AND isset($GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp20_capabilities['premium_subscriber']) AND $GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp20_capabilities['premium_subscriber'] != 1 ) { 
    282311                $authresult = false; 
    283312            }  
     
    297326        } 
    298327         
    299         $userdata    = get_userdatabylogin($user_login); 
    300         $user_level  = $userdata->user_level; 
    301         $user_ID     = $userdata->ID; 
    302         $user_email  = $userdata->user_email; 
    303         $user_url    = $userdata->user_url; 
     328        if ( version_compare($wp_version, '3.3', '>=') ) { 
     329            $userdata = get_user_by('login', $user_login); 
     330        } else {  
     331            $userdata = get_userdatabylogin($user_login); 
     332        } 
     333        $user_level = $userdata->user_level; 
     334        $user_ID = $userdata->ID; 
     335        $user_email = $userdata->user_email; 
     336        $user_url = $userdata->user_url; 
    304337        $user_pass_md5 = md5($userdata->user_pass); 
    305338        $user_identity = $userdata->display_name; 
  • podpress/trunk/readme.txt

    r563942 r564803  
    6666* beta 14: bug fix: podPress did not display the player and other elements in password protected posts (Thank you [Stariel](http://wordpress.org/support/profile/stariel) for [reporting the problem](http://wordpress.org/support/topic/plugin-podpress-podpress-no-longer-working).) 
    6767* beta 15: version for debbuging a premium feed problem (podpress_premium_functions.php does also contain podPress_var_dump() calls now) 
     68* beta 16: minor bug fixes in the podpress_feed_functions.php file and further modifications in the podpress_premium_functions.php file 
    6869 
    6970= v8.8.10.13 = 
Note: See TracChangeset for help on using the changeset viewer.