login now or create a new account.","\n"; } if(!isset($_REQUEST['appId'])) { errorpage('Internal Database Access Error'); exit; } if(!$_REQUEST['versionId']) { $versionId = 0; } if(!$_REQUEST['thread']) { $thread = 0; } ############################ # ADDS COMMENT TO DATABASE # ############################ if($_REQUEST[body]) { $hostname = get_remote(); $subject = strip_tags($subject); $subject = mysql_escape_string($subject); $body1 = mysql_escape_string($body); // get current userid $userId = $_SESSION['current']->userid; $result = mysql_query("INSERT INTO appComments VALUES (NOW(), null, $thread, ". "$appId, $versionId, $userId, '$hostname', '$subject', ". "'$body1', 0)"); if (!$result) { errorpage('Internal Database Access Error',mysql_error()); exit; } else { if ($originator) { if (UserWantsEmail($originator)) { $email = lookupEmail($originator); $fullAppName = "Application: ".lookupAppName($appId)." Version: ".lookupVersionName($appId, $versionId); $ms .= APPDB_ROOT."appview.php?appId=$appId&versionId=$versionId"."\n"; $ms .= "\n"; $ms .= ($_SESSION['current']->username ? $_SESSION['current']->username : "Anonymous")." added comment to ".$fullAppName."\n"; $ms .= "\n"; $ms .= "Subject: ".$subject."\n"; $ms .= "\n"; $ms .= $body."\n"; $ms .= "\n"; $ms .= "------- You are receiving this mail because: -------\n"; $ms .= "Someone posted a comment in responce to your comment\n"; $ms .= "to change your preverences go to: http://appdb.winehq.org/preferences.php\n"; mail(stripslashes($email), "[AppDB] (Comment Reply): ".$fullAppName ,$ms); addmsg("Comment message sent to original poster", "green"); } } $email = getNotifyEmailAddressList($appId, $versionId); if($email) { $fullAppName = "Application: ".lookupAppName($appId)." Version: ".lookupVersionName($appId, $versionId); $ms = APPDB_ROOT."appview.php?appId=$appId&versionId=$versionId"."\n"; $ms .= "\n"; $ms .= $_SESSION['current']->username." added comment to ".$fullAppName."\n"; $ms .= "\n"; $ms .= "Subject: ".$subject."\n"; $ms .= "\n"; $ms .= $body."\n"; $ms .= "\n"; $ms .= STANDARD_NOTIFY_FOOTER; mail(stripslashes($email), "[AppDB] ".$fullAppName ,$ms); } else { $email = "no one"; } addmsg("mesage sent to: ".$email, green); addmsg("New Comment Posted", "green"); redirect(apidb_fullurl("appview.php?appId=$appId&versionId=$versionId")); } } ################################ # USER WANTS TO SUBMIT COMMENT # ################################ else if(loggedin()) { apidb_header("Add Comment"); $mesTitle = "Post New Comment"; if($_REQUEST['thread']) { $result = mysql_query("SELECT * FROM appComments WHERE commentId = $thread"); $ob = mysql_fetch_object($result); if($ob) { $mesTitle = "Replying To ... $ob->subject\n"; $originator = $ob->userId; echo html_frame_start($ob->subject,500); echo htmlify_urls($ob->body), "

\n"; echo html_frame_end(); } } echo "
\n"; echo html_frame_start($mesTitle,500,"",0); echo '',"\n"; echo "\n"; echo " \n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo "
From:  ".$_SESSION['current']->username."
Subject:  
\n"; echo " \n"; echo " \n"; echo "
\n"; echo html_frame_end(); echo "\n"; echo "\n"; echo "\n"; if ($thread) { echo "\n"; } echo "
"; } ?>