ID ) { global $wpdb; $comment_author = $wpdb->escape($user->display_name); $comment_author_email = $wpdb->escape($user->user_email); $comment_author_url = $wpdb->escape($user->user_url); } else { if ( get_option('comment_registration') ) return __('Sorry, you must be logged in to post a comment.'); } if ( get_option('require_name_email') && !$user->ID ) { if ( 6 > strlen($comment_author_email) || '' == $comment_author ) return __('Error: please fill the required fields (name, email).'); elseif ( !is_email($comment_author_email)) return __('Error: please enter a valid email address.'); } // end of wordpress validation code if (!KalturaHelpers::videoCommentsEnabled()) { return __('You do not have sufficient permissions to access this page.'); } if (!KalturaHelpers::anonymousCommentsAllowed() && !$user->ID) { return __('You must be logged in to post a comment.'); } $post_id = $_GET["postid"]; if (!$post_id) { return __('Invalid post id.'); } return ""; } $js_error = kalturaValidateVideoComment(); if ($js_error == "") { $kmodel = KalturaModel::getInstance(); $ks = $kmodel->getClientSideSession(); if (!$ks) { $js_error = __('Failed to start new session.'); } else { $viewData["swfUrl"] = KalturaHelpers::getContributionWizardUrl(KALTURA_KCW_UICONF_COMMENTS); $viewData["flashVars"] = KalturaHelpers::getContributionWizardFlashVars($ks); $viewData["postId"] = $_GET["postid"]; } } ?>