Exemplo n.º 1
0
             $errorMsg = 'You have exceeded your rate limit for commenting. Please try again in one hour.';
         } else {
             if ($commentTotals['nickel'] >= $commentLimits['nickel']) {
                 $error = true;
                 $errorMsg = 'You have exceeded your rate limit for commenting. Please try again in 5 mins.';
             }
         }
     }
 }
 // TODO: grab videoURL, validate it, stuff it in to the $comment structure
 if (isset($_POST['videoURL']) and $_POST['videoURL'] != '') {
     require_once PATH_CORE . '/classes/video.class.php';
     $videoURL = videos::getVideoURLFromEmbedCodeOrURL(stripslashes($_POST['videoURL']));
     if (videos::validateVideoURL($videoURL)) {
         $vt = new VideoTable($db);
         $videoid = $vt->createVideoForComment($userid, $videoURL, "Video Comment on story {$cid}");
     } else {
         $error = true;
         $errorMsg = 'Unsupported or invalid video URL';
     }
 } else {
     if (isset($_POST['commentMsg']) and $_POST['commentMsg'] != '') {
         $commentMsg = preg_replace("/([\\w]+:\\/\\/[\\w-?&;#~=\\.\\/\\@]+[\\w\\/])/i", "<a target=\"_blank\" href=\"\$1\">\$1</a>", $_POST['commentMsg']);
         //$commentMsg = strip_tags($_POST['commentMsg'], '<a><i><b><p>');
         $commentMsg = strip_tags($commentMsg, '<a><i><b><p>');
         $commentMsg = nl2br($commentMsg);
         // TODO: GET THIS WORKING.
         //$comments = mysql_real_escape_string($_POST['commentMsg'], $db->handle);
     } else {
         $error = true;
         $errorMsg = 'Comment empty';