WordPress.org

Plugin Directory

Changeset 214131


Ignore:
Timestamp:
03/06/10 17:43:40 (4 years ago)
Author:
keithdsouza
Message:

version version 1.3.0 commits

Location:
notify-uncofirmed-subscribers/trunk
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • notify-uncofirmed-subscribers/trunk/notify-unconfirmed-subscribers.php

    r143876 r214131  
    44Plugin URI: http://techie-buzz.com/wordpress-plugins/notify-unconfirmed-subscribers-plugin-release.html 
    55Description: Allows you to notify unconfirmed subscribers from FeedBurner email subscriptions and more that they have still not subscribed to your feed, allowing you to compose a personalized message that is sent to them. Send a message now using <a href="tools.php?page=notify-unconfirmed-subscribers/notify-unconfirmed-subscribers.php">Notify Unconfirmed Subscribers</a>. 
    6 Version: 1.2.3 
     6Version: 1.3.0 
    77Author: Keith Dsouza 
    88Author URI: http://keithdsouza.com/ 
     
    2727 
    2828set_time_limit(0); 
    29 require_once ('lib/class.actionFactory.php'); 
    30  
    31 @ define('NUS_PAGE', 'notify-unconfirmed-subscribers/notify-unconfirmed-subscribers.php'); 
     29require_once ('lib/class.feedburner.com.php'); 
     30 
     31@ define('NUS_PAGE', 'notify-uncofirmed-subscribers/notify-unconfirmed-subscribers.php'); 
     32@ define('NUS_COOKIE_DIR', 'notify-uncofirmed-subscribers/cookies/'); 
    3233@ define('NUS_TEMP_TABLE', 'wp_temp_nus_subs'); 
    3334@ define('NUS_TRACKER_TABLE', 'wp_nus_tracker'); 
     
    4243} 
    4344 
     45$nus_performer = null; 
    4446 
    4547function notify_unconfirmed_subscribers() { 
     
    7173function fetch_unconfirmed_subscribers() { 
    7274    can_use_curl(); 
    73     global $wpdb; 
     75    show_fetching('Please wait while the unconfirmed subscribers are being fetched.'); 
     76    global $wpdb, $nus_performer; 
    7477    $wpdb->query("TRUNCATE table " . NUS_TEMP_TABLE); 
    7578    $perform = $_REQUEST['perform']; 
     
    7780    $password = $_REQUEST['nus_password']; 
    7881  $account_type = $_REQUEST['account_type']; 
    79   $newaccount = false; 
    80   if("google" == $account_type) { 
    81     $newaccount = true; 
    82   } 
    83     $performer = new nus_actionFactory($perform, $username, $password, $newaccount); 
     82    $nus_performer = new nus_feedBurner($username, $password); 
    8483    $unconfirmedFeedEmail = 0; 
    8584    $feederEmails = ''; 
    86     if ($performer->login()) { 
    87         $feeders = $performer->get_unconfirmed_subscribers(); 
     85    if ($nus_performer->login()) { 
     86        $feeders = $nus_performer->get_unconfirmed_subscribers(); 
    8887        foreach ($feeders as $key => $value) { 
    8988            $feedName = mysql_real_escape_string($key); 
     
    109108            "We could not find any subscribers who have not confirmed their subscriptions."; 
    110109        } 
    111  
     110         
     111        $nus_performer->delete_cookies(); 
     112        unset($nus_performer); 
    112113        $url = "tools.php?page=" . NUS_PAGE; 
    113114        nus_redirect($url, 'preparesend', $message, $unconfirmedFeedEmail); 
    114     } else { 
    115         echo '<div id="message"  class="updated fade">'; 
    116         echo "<br/><strong style='color:red'>OOPS!! Seems you provided a wrong user name and password. Please try again.</strong><br/><br/>"; 
     115    }  
     116    else { 
     117        echo "<script language='JavaScript' type='text/javascript'>"; 
     118        echo    "jQuery('#nus_fetching').hide()"; 
     119        echo "</script>"; 
     120        echo "<div id='message'  class='updated fade'>"; 
     121        echo "<br/><strong style='color:red'>OOPS!! Something went wrong while fetching unconfirmed subscribers. Error details given below.</strong><br/><br/>"; 
    117122        echo "</div>"; 
     123        $nus_performer->print_error(); 
    118124        show_login_form(); 
    119     } 
    120 } 
     125        $nus_performer->delete_cookies(); 
     126        unset($nus_performer); 
     127    } 
     128     
     129} 
     130 
     131function show_fetching($message) { 
     132    echo '<div id="nus_fetching"><img align="left" valign="middle" hspace="20" src="'.trailingslashit ( WP_PLUGIN_URL . '/' . dirname ( plugin_basename ( __FILE__ ) ) ).'img/rotate.gif" /><strong>'.$message.'</strong></div>'; 
     133} 
     134 
     135 
    121136 
    122137function show_preparesend() { 
    123     can_use_curl(); 
    124138    global $wpdb; 
    125139    $message = $_REQUEST['message']; 
     
    150164    can_use_curl(); 
    151165?> 
    152       <h4>Please follow the onscreen instructions to notify unconfirmed subscribers.</h4> 
    153             <form name="form2" method="post" action="tools.php?page=<?php echo NUS_PAGE; ?>"> 
     166      <h3>Please follow the onscreen instructions to notify unconfirmed subscribers.</h3> 
     167            <form name="nus_login" method="post" action="tools.php?page=<?php echo NUS_PAGE; ?>" onsubmit="return nus_validate();"> 
    154168            <?php wp_nonce_field('notify-unconfirmed-subscribers'); ?> 
    155169            <input type="hidden" name="nus_task" id="nus_task" value="fetch" /> 
     
    160174            <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 
    161175                <tr> 
    162           <td colspan="2"><strong>What Type of Feedburner Account are You Using?. If you use feedburner.com to login to your account choose I am using Feedburner Account, if you are using Google Account to sign in choose I have a Google Feedburner Account.</strong><br /><br /></td> 
     176          <td colspan="2"><em>Fetching unconfirmed subscribers from old Feedburner accounts has been disabled since version 1.3.0. Please migrate your old FeedBurner account to Google before using this tool.</em><br /><br /></td> 
    163177        </tr> 
    164178        <tr> 
    165                     <td colspan="2"><input type="radio" id="account_type" name="account_type" value="google" checked="checked" /> I have a Google Feedburner Account</td> 
    166                 </tr> 
    167         <tr> 
    168                     <td colspan="2"><input type="radio" id="account_type" name="account_type" value="feedburner" /> I have a Feedburner.com Account<br /><br /></td> 
    169                 </tr> 
    170         <tr> 
    171           <td colspan="2"><strong>Enter your Feedburner.com or Google Feedburner Account username and password below, we will use it to get your unconfirmed subscribers, no username and password will be stored. Swear!!!.</strong><br /><br /></td> 
     179          <td colspan="2">Enter your Google Feedburner Account username and password below, we will use it to get your unconfirmed subscribers, no username and password will be stored. Swear!!!.<br /><br /></td> 
    172180        </tr> 
    173181        <tr> 
     
    201209 
    202210function show_message_form($nusFeedId, $nusFeedName) { 
    203     can_use_curl(); 
    204211    global $wpdb, $user_ID; 
    205212 
     
    233240    $user_email = $user->user_email; 
    234241?> 
    235       <form name="form2" method="post" action="tools.php?page=<?php echo NUS_PAGE; ?>"> 
     242      <form name="nus_send_form" method="post" action="tools.php?page=<?php echo NUS_PAGE; ?>"> 
    236243            <?php wp_nonce_field('notify-unconfirmed-subscribers'); ?> 
    237244            <input type="hidden" name="nus_task" id="nus_task" value="sendmessage" /> 
     
    278285 
    279286function send_nus_message() { 
    280     can_use_curl(); 
    281287    global $wpdb; 
    282288    $nusFeedId = $_REQUEST['nus_feed_id']; 
     
    382388} 
    383389 
    384 function can_use_curl() { 
    385     if (function_exists('curl_init')) { 
    386         return true; 
    387     } 
    388     else { 
    389         echo "<br /><br />"; 
    390         echo '<div class="wrap">'; 
    391         echo 'Sorry we cannot run this on your blog. To run this you need to ask your adminsitrator to have cUrl support. ' . 
    392         'Extermely sorry am working on it. With two pair of hands you cannot expect more. You can donate to me an boost ' . 
    393         'the productivity of it. Just kidding I am seriously working on it and the next version will definitely work on your blog.'; 
    394         echo '</div>'; 
    395         return false; 
    396     } 
    397 } 
    398390/** Install related functions **/ 
    399391function nus_init() { 
     
    455447} 
    456448 
     449function can_use_curl() { 
     450    if (function_exists('curl_init')) { 
     451        return true; 
     452    } 
     453    else { 
     454        echo '<div id="message"  class="updated fade">'; 
     455        echo '<em>cUrl is disabled on this blog. Even though I use in-built code from WordPress for HTTP requests, this may not work for you. Before you can contact me about this not working, please contact your system administrator and ask them to enable cUrl support for you. If you do decide to contact me, please mention that you saw this message. Rest assured I am still working on adding support for blogs which do no support cUrl, but there is nothing much I can do about it right now.</em>'; 
     456        echo '</div>'; 
     457        return false; 
     458    } 
     459} 
     460 
    457461function nus_manage_page() { 
    458     add_submenu_page('tools.php', 'Notify Unconfirmed Subscriptions', 'Notify Unconfirmed Subscriptions', 0, 'notify-unconfirmed-subscribers/notify-unconfirmed-subscribers.php', 'notify_unconfirmed_subscribers'); 
     462    add_submenu_page('tools.php', 'Notify Unconfirmed Subscriptions', 'Notify Unconfirmed Subscriptions', 0, 'notify-uncofirmed-subscribers/notify-unconfirmed-subscribers.php', 'notify_unconfirmed_subscribers'); 
     463} 
     464 
     465function nus_curl_cookie_location($handle) { 
     466    global $nus_performer; 
     467    if($nus_performer) 
     468        $nus_performer->add_cookie_to_CURL($handle); 
     469} 
     470 
     471 
     472function nus_add_script() { 
     473    //only add if we are on our own page 
     474  if($_REQUEST['page'] == NUS_PAGE) { 
     475?> 
     476            <script type="text/javascript" language="JavaScript"> 
     477       
     478            function nus_validate() { 
     479                if(isBlank(jQuery("#nus_login input:nus_username").val()) || isBlank(jQuery("#nus_login input:nus_password").val())) { 
     480                    alert("Enter you Feedburner username and password before submitting the form"); 
     481                    return false; 
     482                } 
     483                else { 
     484                    jQuery("#nus_login").submit(); 
     485                } 
     486                return false; 
     487            } 
     488             
     489            function isBlank(s) 
     490            { 
     491                var len,k,flg; 
     492                flg=true; 
     493                if(s!=null) 
     494                { 
     495                    len=s.length; 
     496                    for(k=0;k<len;k++) 
     497                    { 
     498                        if(s.substring(k,k+1)!=" ") 
     499                            flg=false; 
     500                    } 
     501                } 
     502                return flg; 
     503            } 
     504        </script> 
     505<?php 
     506  } 
    459507} 
    460508 
    461509add_action('admin_menu', 'nus_manage_page'); 
     510add_action('http_api_curl', 'nus_curl_cookie_location'); 
     511//add_action('admin_head', 'nus_add_script'); 
     512//wp_enqueue_script('jquery'); 
    462513?> 
  • notify-uncofirmed-subscribers/trunk/readme.txt

    r143876 r214131  
    44Tags: feed, rss, atom, pause feeds 
    55Requires at least: 2.3 
    6 Tested up to: 2.8.3 
    7 Stable tag: 1.2.3 
     6Tested up to: 2.9.2 
     7Stable tag: 1.3.0 
    88 
    99Notify Unconfirmed Subscribers allows users to notify unconfirmed subscribers from FeedBurner email subscriptions. 
     
    1111== Description == 
    1212 
    13 v0.1 First Release 
    14 v1.0 Added compatibility for Google Feedburner Accounts 
    15 v1.1 Updated code to alter the column type that stored Feedburner Id, earlier versions used integer, alter changes it to Varchar 
    16 v1.2.1 Fixed a cookie issue where users could not see unsubscribed users because of faulty cookie handling on some systems 
     13Please delete the plugin directory and add the new one if you are upgrading from an older version to 1.3.0. The admin dashboard plugin update will do this automatically for you. 
     14 
     15Starting with version 1.3.0, support has been dropped for Old FeedBurner accounts. Please migrate your feeds to a Google Account before using this. See changelog for latest updates and notes about recent fixes. 
     16 
     17v1.3.0 will only work with cURL enabled websites for now, will be adding support for other http modes in future. 
     18 
    1719 
    1820Many blogs offer email subscriptions to their users, however in case of feedburner the users have to confirm their email address before they can start getting updates from the blog. In many cases, users either forget or do not know that they have to confirm their email address. 
     
    4749== Changelog == 
    4850 
     51= 1.3.0 = 
     52- Dropped support for Old FeedBurner accounts 
     53- Rewrote the module to fix issues with cookies  
     54- Updated code for better maintenance 
     55- Dropped unwanted modules from the code 
     56 
    4957= 1.2.3 = 
    5058Added supported tags for email message body in sending message page. 
Note: See TracChangeset for help on using the changeset viewer.