Location: PHPKode > projects > Simple But Mighty Blog > sbmb03/newpost.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.
//

session_start();
include ("config.php");
include ("functions.php");
get_headers_list();

if ((isset($_SESSION["id"])) and ($_SESSION["id"]!=0) and (getstatus($_SESSION["id"],check_string($_SERVER["REMOTE_ADDR"]))>1) and (isset($_POST["topic"])))
{
$topic=check_string($_POST["topic"]);
$_SESSION["topic"]=$topic;
if (isset($_POST["post"]) and ($topic) and (mysql_num_rows(mysql_query("SELECT * FROM `$t_topics` WHERE id='$topic'"))))
{
if (getstatus($_SESSION["id"],check_string($_SERVER["REMOTE_ADDR"]))==3) {
@$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;
$text=strtr(stripslashes($_POST["post"]),$str);
$id=$_SESSION["id"];
$ip=check_string($_SERVER["REMOTE_ADDR"]);
@$result=mysql_query("INSERT INTO `$t_mess` (`id`,`text`,`author`,`status`,`date`,`time`,`topic`,`ip`) VALUES (NULL,'$text','$id',1,NOW(),NOW(),'$topic','$ip')") or die("<p>Îøèáêà äîáàâëåíèÿ ñîîáùåíèÿ!</p>");
}
else {
$text=post_change(check_string($_POST["post"]));
$id=$_SESSION["id"];
$ip=check_string($_SERVER["REMOTE_ADDR"]);
@$result=mysql_query("INSERT INTO `$t_mess` (`id`,`text`,`author`,`status`,`date`,`time`,`topic`,`ip`) VALUES (NULL,'$text','$id',1,NOW(),NOW(),'$topic','$ip')") or die("<p>Îøèáêà äîáàâëåíèÿ ñîîáùåíèÿ!</p>");
}
}
}
Header("Location: index.php?topic=".$_SESSION["topic"]."#predpr");
?>
Íàæìèòå <a href=index.php?topic=<? echo $_SESSION["topic"];?>#predpr>çäåñü</a> äëÿ ïåðåõîäà â áëîã...
Return current item: Simple But Mighty Blog