Viewing file: editSpooledNews.inc.php3 (3.31 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','$imageID')";
print("$query<br>");
$mysql_result=mysql_query($query) or die(mysql_error());
if($mysql_result)
{
print("Unijeto");
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=index.php3?mode=listNews&superSession=$superSession\">";
}
else
{
print("Doslo je do greske");
}
}
else if($function=='post')
{
require("$mysqlCall");
$query = "insert into $news values('', '$title', '$details', '$date', '$itemID', '$userId', '$slag','$imageID')";
print("$query<br>");
$mysql_result=mysql_query($query) or die(mysql_error());
if($mysql_result)
{
print("Unijeto");
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=index.php3?mode=listNews&superSession=$superSession\">";
print("<br><br>Uklanjam vijest iz medjubaze");
$query = "DELETE FROM $spooledNews WHERE(ID=$newsID)";
$insert = MYSQL_QUERY($query);
if($insert)
{
print("Obrisano iz medjubaze.");
}
}
else
{
print("Doslo je do greske");
}
}
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];
$slag = $row[6];
$imageID = $row[7];
$userInfo = getUserInfo($userId);
include("editNewsTemp.inc.php3");
}
}
else
{
include("editNewsTemp.inc.php3");
}
}
}
else
{
print("Nemate pristup ovoj funkciji<br><br>");
}
include("include/guiBase.inc.php3");
}
else
{
/* session is bad */
print("Pogresna sesija ID ($superSession)!<BR>\n");
$superSession = "";
}
?>
|