Source for file comment.php
Documentation is available at comment.php
* @copyright (C) 2000 - 2007 Mambo Foundation Inc.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Mambo Foundation Inc see README.php
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $mosConfig_absolute_path, $mosConfig_usecaptcha, $task;
require_once($mosConfig_absolute_path.
"/administrator/components/com_comment/config.comment.php");
$captcha_success =
0; // captcha not required
if ($task ==
"captcha-audio"){
include ($mosConfig_absolute_path.
"/includes/captcha-audio.php");
if ($mosConfig_usecaptcha ==
'1') {
if(isset
($_SESSION['code']) &&
($_SESSION['code'] !=
"") &&
($_SESSION['code'] ==
$spamstop)) {
$captcha_success =
1; // success
$captcha_success =
2; // fail
if ($captcha_success !=
'2') {
# if registered users only
if (!$allow_anonymous_entries AND !$is_user) {
$link =
sefRelToAbs("index.php?option=content&task=view&id=$articleid");
echo
"<SCRIPT>alert('لطفا برای ارسال نظر عضو شوید.'); document.location.href='".
$link.
"';</SCRIPT>";
$comments =
mysql_escape_string(strip_tags($comments));
$startdate =
date( "Y-m-d H:i:s" );
$query =
"INSERT INTO #__comment SET articleid='$articleid', ip='$ip', name='$mcname', comments='$comments', startdate='$startdate', published='$auto_publish_comments';";
$database->setQuery($query);
if ($notify_new_entries ==
"1") {
// messaging for new items
require_once($mosConfig_absolute_path.
"/includes/mambofunc.php");
$message =
"یک نظر اضافه شده است\n\n".
$comments;
if ($auto_publish_comments ==
"0") {
$message =
$message .
"\n\nشما انتخاب کرده اید که نظرات به صورت خودکار منتشر نشوند ، به همین دلیل شما برای منتشر کردن نظر باید وارد مدیریت شوید و نظر های جدید را منتشر کنید.";
mosMail ( $mosConfig_mailfrom, $mosConfig_mailfrom, $mosConfig_mailfrom, "یک نظر ارسال شده است", $message);
$msg =
'تشکر ، نظر شما به صورت کامل ذخیره شد.';
if ($auto_publish_comments ==
"0") {
$msg =
$msg.
'مدیر بعد از باز بینی نظر شما آن را منتشر خواهد کرد.';
mosRedirect( "index.php?option=com_content&task=view&id=".
$articleid.
"&Itemid=".
$mcitemid.
"&limit=".
$limit.
"&limitstart=".
$limitstart, $msg );
echo
"<SCRIPT> alert('کد امنیتی درست وارد نشده است'); document.location='index.php?option=com_content&task=view&id=$articleid&Itemid=$mcitemid&limit=$limit&limitstart=$limitstart&comments=$comments';</SCRIPT>";
Documentation generated on Mon, 05 May 2008 16:18:00 +0400 by phpDocumentor 1.4.0