Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/newsletter2/newsletterDetail.inc.php
<?php
if(preg_match("/^([0-9]*)$/", $newsletterID)) {
	$nlOverviewQuery = mysql_fetch_assoc(mysql_query("SELECT general.title, general.sendTime, general.newsletterID, general.options, general.categoryID FROM ".TABLE."_nl_general AS general WHERE general.newsletterID = '$newsletterID'"));
	if($newsletterID != $nlOverviewQuery[newsletterID]) {
		$nlError = true;
	}
} else {
	$nlError = true;
}

/*
* Plain Text Version löschen
*/
if($nlDeletePlainVersion == 1 && !$nlError) {
	$result = mysql_query("DELETE FROM ".TABLE."_nl_content WHERE typeID = '1' AND newsletterID = '$newsletterID'");
}

/*
* HTML Version löschen
*/
if($nlDeleteHTMLVersion == 1 && !$nlError) {
	$result = mysql_query("DELETE FROM ".TABLE."_nl_content WHERE typeID = '2' AND newsletterID = '$newsletterID'");
}

if(!$nlError) {
	/*
	* Content Typen herausfinden 
	*/
	$nlPlainVersionSet = 0;
	$nlHTMLVersionSet  = 0;
	
	$nlContentQuery = mysql_query("SELECT typeID, text FROM ".TABLE."_nl_content WHERE newsletterID = '$newsletterID'");
	while($nlContentRow = mysql_fetch_assoc($nlContentQuery)) {
		if($nlContentRow[typeID] == 1) {
			$nlPlainVersionSet = 1;
		}
		if($nlContentRow[typeID] == 2) {
			$nlHTMLVersionSet = 1;
		}
	}
	
	/*
	* Herausfinden ob Newsletter schon mal versendet wurde
	*/
	$nlSendBefore = 0;
	if(1 & $nlOverviewQuery[options]) {
		$nlSendBefore = 1;
		$nlSendTime   = $nlOverviewQuery[sendTime];
	}
	
	/*
	* Newsletter Übersicht erstellen
	*/
	$tpl->assign("nlDetail", 
		array ( "categoryID"           => $nlOverviewQuery[categoryID],
				"newsletterID"         => $newsletterID,
				"title"                => stripslashes($nlOverviewQuery[title]),
				"plainVersionSet"      => $nlPlainVersionSet,
				"htmlVersionSet"       => $nlHTMLVersionSet,
				"sendStatus"           => $nlSendBefore,
				"sendTime"             => $nlSendTime
		)
	);
	
	$tpl->assign("nlDetail_set", "1");
	
	$mainPluginContent[]  = $tpl->fetch($config['templates']."newsletter.template", null, "pluginNL".$cbUserID);
	$mainMessageContent[] = $tpl->fetch($config['templates']."messages.template", null, "pluginNL".$cbUserID);
}
?>
Return current item: Content*Builder