* or write to the Free Software Foundation, Inc., 51 Franklin St, * Fifth Floor, Boston, MA 02110-1301 USA **/ // no direct access defined( 'ABSPATH' ) or die( 'Restricted Access' ); if( isset($_POST['task']) && $_POST['task'] == 'saveLP' ){ $content = $_POST['head'] . $_POST['LPcontent'] . ''; $content = str_replace( array('\"', "\'"), array('"', "'"), $content); // write landing page html file global $wp_filesystem; if( $wp_filesystem->method == 'direct' ){ $wp_filesystem->put_contents( ABSPATH . 'archive' .DS. $_POST['lpid'], $content ); } else { $chimpexpress = new chimpexpress; $ftpstream = @ftp_connect( $chimpexpress->_settings['ftpHost'] ); $login = @ftp_login($ftpstream, $chimpexpress->_settings['ftpUser'], $chimpexpress->_settings['ftpPasswd']); $ftproot = @ftp_chdir($ftpstream, $chimpexpress->_settings['ftpPath'] ); $temp = tmpfile(); fwrite($temp, $content); rewind($temp); @ftp_fput($ftpstream, 'archive' .DS. $_POST['lpid'], $temp, FTP_ASCII); @ftp_close($ftpstream); } echo ''; } else { add_action('admin_init', 'editor_admin_init'); add_action('admin_head', 'editor_admin_head'); wp_enqueue_script( 'common' ); wp_enqueue_script( 'jquery-color' ); wp_print_scripts('editor'); if (function_exists('wp_tiny_mce')) wp_tiny_mce(); if (function_exists('add_thickbox')) add_thickbox(); wp_print_scripts('media-upload'); wp_enqueue_script('utils'); wp_admin_css(); do_action("admin_print_styles-post-php"); do_action('admin_print_styles'); ?>
%s', 'chimpexpress'), $_SESSION['MCusername']); } else { _e('connect your MailChimp account', 'chimpexpress'); }?>

ChimpExpress

method != 'direct' ){ $chimpexpress = new chimpexpress; $ftpstream = @ftp_connect( $chimpexpress->_settings['ftpHost'] ); $login = @ftp_login($ftpstream, $chimpexpress->_settings['ftpUser'], $chimpexpress->_settings['ftpPasswd']); $ftproot = @ftp_chdir($ftpstream, $chimpexpress->_settings['ftpPath'] ); $adminDir = @ftp_chdir($ftpstream, 'wp-admin' ); if ( $wp_filesystem->method != 'direct' && ( !$chimpexpress->_settings['ftpHost'] || !$chimpexpress->_settings['ftpUser'] || !$chimpexpress->_settings['ftpPasswd'] || !$ftpstream || !$login || !$ftproot || !$adminDir ) ){ ?>



'.__('Landing Page Archive', 'chimpexpress').''; } else { $filename = sanitize_title( $_POST['lpid'][0] ); $filename = str_replace('-html', '.html', $filename); ?>

]*>#is', $content, $head); $head = (isset($head[0])) ? str_replace('"',"'",$head[0]) : ''; preg_match( '!]*>(.*)!is' , $content, $body ); $bodyContent = $body[0]; $bodyContent = preg_replace( '!]*>!is', '', $bodyContent); $bodyContent = preg_replace( '!!is', '', $bodyContent); $bodyContent = preg_replace( '!!is', '', $bodyContent); ?>