Location: PHPKode > projects > PLiMa > plima-0.5.2/inc/compose.func.php
<?
/***
	*   pLiMa - php List Manager
  *   Copyright (C) 2003  Jinn Koriech (hide@address.com)
	*
  *		This file is part of pLiMa.
	*
	*   pLiMa is free software; you can redistribute it and/or modify
	*   it under the terms of the GNU General Public License as published by
	*   the Free Software Foundation; either version 2 of the License, or
	*   any later version.
	*
	*   pLiMa is distributed in the hope that it will be useful,
	*   but WITHOUT ANY WARRANTY; without even the implied warranty of
	*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	*   GNU General Public License for more details.
	*
	*   You should have received a copy of the GNU General Public License
	*   along with pLiMa; if not, visit http://www.gnu.org or write to the 
	*   Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
	*	  Boston, MA  02111-1307  USA
	*	
	*/

function preview_mail() {
	
	global $body, $subject, $usename, $usenum, $usesig, $beforename;
	
	if ( $body=='' ) $body="You didn't enter anything for the body of the message";
	if ( $subject=='' ) $subject='<none>';
	if ( $usename=='Y' && $beforename=='' && $aftername=='' ) $aftername=',';
	
	if ( $usenum=='Y' ) {
		$conn = db_connect();
		$sql = "SELECT COUNT(*) FROM ".$_SESSION['MALI'].";";
		$result = db_query($sql) or $errors[] = db_error();
		$list_length = db_fetch_array($result) or $errors[] = db_error();
	}
	
	if ( $usesig=='Y' ) {
		$options = getOptions($_SESSION['MALI']);

		$sig = $options['signature'];
	}

	$subject = stripslashes($subject);
	$psubject = htmlentities($subject);

	$beforename = stripslashes($beforename);
	$pbname = htmlentities($beforename);

	$aftername = stripslashes($aftername);
	$paname = htmlentities($aftername);

	$pbody = stripslashes($body);
	$pbody = htmlentities($pbody);
	
	$pbody = wordwrap($pbody, 76);
	
	$pbody = nl2br($pbody);

	$sig = wordwrap($sig, 76);
	$sig = nl2br($sig);

	include ( APP_ROOT."/inc/compose-preview.inc.php" );
}


?>
Return current item: PLiMa