Location: PHPKode > projects > Simple But Mighty Blog > sbmb03/preview.php
<?
//Simple But Mighty Blog, version 0.3.1
//copyright © 2007, Mighty Mind
// @license http://opensource.org/licenses/gpl-license.php GNU Public License
// Äàííàÿ ïðîãðàììà ÿâëÿåòñÿ ñâîáîäíûì ïðîãðàììíûì îáåñïå÷åíèåì. Âû âïðàâå ðàñïðîñòðàíÿòü åå è/èëè ìîäèôèöèðîâàòü â ñîîòâåòñòâèè ñ
//óñëîâèÿìè âåðñèè 3 Ñòàíäàðòíîé Îáùåñòâåííîé Ëèöåíçèè GNU, îïóáëèêîâàííîé Free Software Foundation. 
// Ìû ðàñïðîñòðàíÿåì äàííóþ ïðîãðàììó â íàäåæäå íà òî, ÷òî îíà áóäåò âàì ïîëåçíîé, îäíàêî ÍÅ ÏÐÅÄÎÑÒÀÂËßÅÌ ÍÀ ÍÅÅ ÍÈÊÀÊÈÕ ÃÀÐÀÍÒÈÉ,
//â òîì ÷èñëå ÃÀÐÀÍÒÈÈ ÒÎÂÀÐÍÎÃÎ ÑÎÑÒÎßÍÈß ÏÐÈ ÏÐÎÄÀÆÅ è ÏÐÈÃÎÄÍÎÑÒÈ ÄËß ÈÑÏÎËÜÇÎÂÀÍÈß Â ÊÎÍÊÐÅÒÍÛÕ ÖÅËßÕ.
//Äëÿ ïîëó÷åíèÿ áîëåå ïîäðîáíîé èíôîðìàöèè îçíàêîìüòåñü ñî Ñòàíäàðòíîé Îáùåñòâåííîé Ëèöåíçèåé GNU.
//Âìåñòå ñ äàííîé ïðîãðàììîé âû äîëæíû áûëè ïîëó÷èòü ýêçåìïëÿð Ñòàíäàðòíîé Îáùåñòâåííîé Ëèöåíçèè GNU.
//Åñëè âû åãî íå ïîëó÷èëè, ñîîáùèòå îá ýòîì â Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

function message_admin_preview($date,$time,$text,$author,$id,$theme)
{
global $_SESSION;
global $_SERVER;
?>
<br>
<div align="justify" style="padding-right: 10; padding-left: 15; margin:5;">
<p align=center><b><? echo getusername($author);?></b></p>
<p align=center><? echo $theme;?></p>
<p align=center><? echo $date.", ".$time;?></p>
<p align=justify><? echo nl2br($text);?></p>
</div>
<?
}

session_start();
include ("config.php");
include ("functions.php");
get_headers_list();
if (isset($_GET["topic"])) {
	$topic=check_string($_GET["topic"]);
	previewtopic($topic);
}
else {
	if (isset($_POST["message"])) {
		if (getstatus($_SESSION["id"],check_string($_SERVER["REMOTE_ADDR"]))==3) {
			$post=iconv("UTF-8", $CONFIG["charset"], $_POST["message"]);
			$theme=iconv("UTF-8", $CONFIG["charset"], $_POST["theme"]);
			$theme=check_string($theme);
			@$result=mysql_query("SELECT `file`,`change` FROM `$t_smiles`") or die("<p>Îøèáêà âûáîðà ñìàéëîâ!<p>");
			while ($row=mysql_fetch_array($result)):
			$file=$row["file"];
			$change=$row["change"];
			$str["$change"]="<img src=smiles/$file>";
			endwhile;
			$post=strtr($post,$str);
			message_admin_preview(date("Y-m-d"),date("H:i:s"),stripslashes($post),$_SESSION["id"],'',$theme);
		} else {
			message_comment($_SESSION["id"],date("Y-m-d"),date("H:i:s"),post_change(check_string(iconv("UTF-8", $CONFIG["charset"], $_POST["message"]))),'','');
			}
	}
}
?>
Return current item: Simple But Mighty Blog