PDA

View Full Version : parse error?


sabret00the
12-01-2005, 08:13 AM
i don't seem to be able to see where i've gone wrong with this

$vbulletin->db->query_write("
INSERT INTO grps_thread
(groupid, userid, username, title, dateline, iconid, lastposterid, lastpostdateline, replies)
VALUES
($groupid, " . $vbulletin->userinfo['userid'] . ", '" . addslashes($vbulletin->userinfo['username'] . "', '" . addslashes($post['title']) . "', '" . $dateline . "', $post[iconid], " . $vbulletin->userinfo['userid'] . ", '" . $dateline . "', 0)
"); // parse error here
$newthreadfirstpostid = $vbulletin->db->insert_id();
the parse error is marked with a comment.

the block of code around and including that is

// ### POST NEW THREAD ###
// doublepost check
$doublepost = $vbulletin->db->query_first("
SELECT postid, pagetext, userid
FROM grps_post
WHERE pagetext = $post[message]
AND dateline > " . (TIMENOW - 3600) . "
AND userid = " . $vbulletin->userinfo[userid] . "
AND groupid = $groupid
ORDER BY dateline DESC
LIMIT 1
");

if ($doublepost AND $doublepost['userid'] == $vbulletin->userinfo['userid'])
{
eval(standard_error(fetch_error('Thread Already Exists')));
}
else
{
$dateline = TIMENOW;

$vbulletin->db->query_write("
INSERT INTO grps_thread
(groupid, userid, username, title, dateline, iconid, lastposterid, lastpostdateline, replies)
VALUES
($groupid, " . $vbulletin->userinfo['userid'] . ", '" . addslashes($vbulletin->userinfo['username'] . "', '" . addslashes($post['title']) . "', '" . $dateline . "', $post[iconid], " . $vbulletin->userinfo['userid'] . ", '" . $dateline . "', 0)
");
$newthreadfirstpostid = $vbulletin->db->insert_id();

$vbulletin->db->query_write("
INSERT INTO grps_post
(threadid, groupid, parentid, username, userid, title, dateline, pagetext, ipaddress, iconid, visible, attach, allowsmilie, showsignature)
VALUES
($newthreadfirstpostid, $groupid, $parentid, '" . addslashes($vbulletin->userinfo['username']) . "', " . $vbulletin->userinfo[userid] . ", '" . addslashes($post['title']) . "', '" . $dateline . "', '" . addslashes($post['message']) . "', '" . addslashes($post['ipaddress']) . "', $post[iconid], $post[visible], 0, $post[enablesmilies], $post[signature])
");
}

Marco van Herwaarden
12-01-2005, 08:45 AM
addslashes($vbulletin->userinfo['username']should be:addslashes($vbulletin->userinfo['username'])

sabret00the
12-01-2005, 09:23 AM
thanks marco it was indeedy that :)