Hi
I'm customising phpNuke as an intranet application. The client would
like the option of letting users post news stories without
administrators' approval, so I've added a function to the theme.
It just inserts into nuke_stories the contents of nuke_queue, then
empties the latter.
I know it's rough and ready. Are there any database integrity issues
I've overlooked?
John
function postStoryAutomatically()
{
global $prefix, $db;
$sql = "INSERT INTO ".$prefix."_stories
(sid,catid,aid,title,time,hometext,bodytext,commen ts,counter,topic,informant,notes,ihome,alanguage,a comm,haspoll,pollID,score,ratings)
SELECT NULL, 0, 'Administrator', subject, timestamp, story, storyext,
'0', '0', topic, uname, '', '0', '', '0', '0', '0', '0', '0' FROM
".$prefix."_queue ";
$result = $db->sql_query($sql);
$sql = "DELETE FROM ".$prefix."_queue ";
$result = $db->sql_query($sql);
}