Viewing file: editSpooledNews.inc.php3 (3.92 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
if(checkSuperSession($superSession, $REMOTE_ADDR))
{
$userId3 = getUserSUId($superSession);
$userInfo = getUserInfo($userId3);
if(($userInfo[SuperUser] == 1) && ($userInfo[manageNewsSpool]==1) && ($userInfo[active]==1))
{
require("$mysqlCall");
include("include/rootGui.inc.php3");
if($function=='save')
{
require("$mysqlCall");
$query = "replace into $spooledNews values('$newsID', '$title', '$details', '$date', '$userId', '$itemID', '$slag')";
print("$query<br>");
$mysql_result=mysql_query($query) or die(mysql_error());
if($mysql_result)
{
print("Looks as though that worked :)");
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=index.php3?mode=listNews&superSession=$superSession\">";
}
else
{
print("Something Wrong Here");
}
}
else if($function=='post')
{
require("$mysqlCall");
$query = "insert into $news values('', '$title', '$details', '$date', '$itemID', '$userId', '$slag')";
print("$query<br>");
$mysql_result=mysql_query($query) or die(mysql_error());
if($mysql_result)
{
$extra_headers1 = "From: MINA <mnnews@mnnews.net> \n";
$extra_headers1 .= "MIME-Version: 1.0\n";
$extra_headers1 .= "Content-Type: text/plain; \n";
$extra_headers1 .= " charset=windows-1250";
$body = "<START>\n\n";
$body .= "$date\n\n";
$body .= "*";
$body .= "$slag\n";
$body .= "$title * \n\n";
$body .= "$details\n\n";
$body .= "<END>";
$message = "$body";
include("/home/mnnews/public_html/login/adresebiz.inc");
$adresa1 ="$adresa";
$extra_headers = "$extra_headers1";
mail("$adresa1", "$date - $slag - $title", "$message", "$extra_headers" );
print("Looks as though that worked :)");
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=index.php3?mode=listNews&superSession=$superSession\">";
print("<br><br>Now removing item from spool");
$query = "DELETE FROM $spooledNews WHERE(ID=$newsID)";
$insert = MYSQL_QUERY($query);
if($insert)
{
print("Deleted from spooling list.");
}
}
else
{
print("Something Wrong Here");
}
}
else
{
if($db!='no')
{
$query = "SELECT * FROM $spooledNews where ID=\"$spooledNewsId\"";
$mysql_result=mysql_query($query) or die(mysql_error());
if($row = mysql_fetch_row($mysql_result))
{
$newsID = $row[0];
$title = $row[1];
$details = $row[2];
$date = $row[3];
$userId = $row[4];
$itemID = $row[5]; /* topic, crud name for auto gen */
$slag = $row[6];
$userInfo = getUserInfo($userId);
include("editNewsTemp.inc.php3");
}
}
else
{
include("editNewsTemp.inc.php3");
}
}
}
else
{
print("You do not have access to this function<br><br>");
}
include("include/guiBase.inc.php3");
}
else
{
/* session is bad */
print("Bad Session ID ($superSession)!<BR>\n");
$superSession = "";
}
?>
|