* 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 ($_SERVER['REQUEST_METHOD'] == 'POST' && !wp_verify_nonce($_REQUEST['_wpnonce'], 'chimpxpress-editLP')) { die('Invalid request!'); } 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 { $chimpxpress = new chimpxpress; $ftpstream = ftp_connect($chimpxpress->settings['ftpHost'] ); $login = ftp_login($ftpstream, $chimpxpress->settings['ftpUser'], $chimpxpress->settings['ftpPasswd']); $ftproot = ftp_chdir($ftpstream, $chimpxpress->settings['ftpPath'] ); $temp = tmpfile(); $wp_filesystem->put_contents($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('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'); ?>

chimpXpress

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



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

get_contents($archiveDirAbs . $filename); preg_match('#.*]*>#is', $content, $head); $head = (isset($head[0])) ? str_replace('"',"'",$head[0]) : ''; preg_match('%]*>(.*?)%s', $content, $body); $bodyContent = $body[0] ?? ''; $bodyContent = preg_replace('/]*>/', '', $bodyContent); $bodyContent = preg_replace('%%', '', $bodyContent); $bodyContent = preg_replace('%]*>(.*?)%s', '', $bodyContent); ?>