[xoops-cvslog 104] CVS update: xoops2jp/html/modules/contact

Back to archive index

onokazu onoka****@users*****
2005年 6月 11日 (土) 11:32:42 JST


Index: xoops2jp/html/modules/contact/index.php
diff -u xoops2jp/html/modules/contact/index.php:1.2 xoops2jp/html/modules/contact/index.php:1.3
--- xoops2jp/html/modules/contact/index.php:1.2	Fri Mar 18 21:52:14 2005
+++ xoops2jp/html/modules/contact/index.php	Sat Jun 11 11:32:41 2005
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+// $Id: index.php,v 1.3 2005/06/11 02:32:41 onokazu Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -27,82 +27,81 @@
 
 include "header.php";
 if ( empty($HTTP_POST_VARS['submit']) ) {
-	$xoopsOption['template_main'] = 'contact_contactusform.html';
-	include XOOPS_ROOT_PATH."/header.php";
-	include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
-	$company_v = "";
-	$name_v = !empty($xoopsUser) ? $xoopsUser->getVar("uname", "E") : "";
-	$email_v = !empty($xoopsUser) ? $xoopsUser->getVar("email", "E") : "";
-	$url_v = !empty($xoopsUser) ? $xoopsUser->getVar("url", "E") : "";
-	$icq_v = !empty($xoopsUser) ? $xoopsUser->getVar("user_icq", "E") : "";
-	$location_v = !empty($xoopsUser) ? $xoopsUser->getVar("user_from", "E") : "";
-	$comment_v = "";
-	include "contactform.php";
-	$contact_form->assign($xoopsTpl);
-	include XOOPS_ROOT_PATH."/footer.php";
+    $xoopsOption['template_main'] = 'contact_contactusform.html';
+    include XOOPS_ROOT_PATH."/header.php";
+    include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+    $company_v = "";
+    $name_v = !empty($xoopsUser) ? $xoopsUser->getVar("uname", "E") : "";
+    $email_v = !empty($xoopsUser) ? $xoopsUser->getVar("email", "E") : "";
+    $url_v = !empty($xoopsUser) ? $xoopsUser->getVar("url", "E") : "";
+    $icq_v = !empty($xoopsUser) ? $xoopsUser->getVar("user_icq", "E") : "";
+    $location_v = !empty($xoopsUser) ? $xoopsUser->getVar("user_from", "E") : "";
+    $comment_v = "";
+    include "contactform.php";
+    $contact_form->assign($xoopsTpl);
+    include XOOPS_ROOT_PATH."/footer.php";
 } else {
-	extract($HTTP_POST_VARS);
-	$myts =& MyTextSanitizer::getInstance();
-	$usersEmail = $myts->stripSlashesGPC($usersEmail);
-	$usersCompanyName = $myts->stripSlashesGPC($usersCompanyName);
-	$usersCompanyLocation = $myts->stripSlashesGPC($usersCompanyLocation);
-	$usersComments = $myts->stripSlashesGPC($usersComments);
-	$usersName = $myts->stripSlashesGPC($usersName);
+    $myts =& MyTextSanitizer::getInstance();
+    $usersEmail = $myts->stripSlashesGPC($_POST['usersEmail']);
+    $usersCompanyName = $myts->stripSlashesGPC($_POST['usersCompanyName']);
+    $usersCompanyLocation = $myts->stripSlashesGPC($_POST['usersCompanyLocation']);
+    $usersComments = $myts->stripSlashesGPC($_POST['usersComments']);
+    $usersName = $myts->stripSlashesGPC($_POST['usersName']);
 
-	$adminMessage = sprintf(_CT_SUBMITTED,$usersName);
-	$adminMessage .= "\n";
-	$adminMessage .= ""._CT_EMAIL." $usersEmail\n";
-	if ( !empty($usersSite) ) {
-		$adminMessage .= ""._CT_URL." $usersSite\n";
-	}
-	if ( !empty($usersICQ) ) {
-		$adminMessage .= ""._CT_ICQ." $usersICQ\n";
-	}
-	if ( !empty($usersCompanyName) ) {
-		$adminMessage .= _CT_COMPANY. " $usersCompanyName\n";
-	}
-	if ( !empty($usersCompanyLocation) ) {
-		$adminMessage .= _CT_LOCATION." $usersCompanyLocation\n";
-	}
-	$adminMessage .= _CT_COMMENTS."\n";
-	$adminMessage .= "\n$usersComments\n";
-	$adminMessage .= "\n".$HTTP_SERVER_VARS['HTTP_USER_AGENT']."\n";
-	$subject = $xoopsConfig['sitename']." - "._CT_CONTACTFORM;
-	$xoopsMailer =& getMailer();
-	$xoopsMailer->useMail();
-	$xoopsMailer->setToEmails($xoopsConfig['adminmail']);
-	$xoopsMailer->setFromEmail($usersEmail);
-	$xoopsMailer->setFromName($xoopsConfig['sitename']);
-	$xoopsMailer->setSubject($subject);
-	$xoopsMailer->setBody($adminMessage);
-	$xoopsMailer->send();
-	$messagesent = sprintf(_CT_MESSAGESENT,$xoopsConfig['sitename'])."<br />"._CT_THANKYOU."";
+    $adminMessage = sprintf(_CT_SUBMITTED,$usersName);
+    $adminMessage .= "\n";
+    $adminMessage .= ""._CT_EMAIL." $usersEmail\n";
+    if ( !empty($_POST['usersSite']) ) {
+        $adminMessage .= _CT_URL." ".$myts->stripSlashesGPC($_POST['usersSite'])."\n";
+    }
+    if ( !empty($_POST['usersICQ']) ) {
+        $adminMessage .= _CT_ICQ." ".$myts->stripSlashesGPC($_POST['usersICQ'])."\n";
+    }
+    if ( !empty($usersCompanyName) ) {
+        $adminMessage .= _CT_COMPANY. " $usersCompanyName\n";
+    }
+    if ( !empty($usersCompanyLocation) ) {
+        $adminMessage .= _CT_LOCATION." $usersCompanyLocation\n";
+    }
+    $adminMessage .= _CT_COMMENTS."\n";
+    $adminMessage .= "\n$usersComments\n";
+    $adminMessage .= "\n".$HTTP_SERVER_VARS['HTTP_USER_AGENT']."\n";
+    $subject = $xoopsConfig['sitename']." - "._CT_CONTACTFORM;
+    $xoopsMailer =& getMailer();
+    $xoopsMailer->useMail();
+    $xoopsMailer->setToEmails($xoopsConfig['adminmail']);
+    $xoopsMailer->setFromEmail($usersEmail);
+    $xoopsMailer->setFromName($xoopsConfig['sitename']);
+    $xoopsMailer->setSubject($subject);
+    $xoopsMailer->setBody($adminMessage);
+    $xoopsMailer->send();
+    $messagesent = sprintf(_CT_MESSAGESENT,$xoopsConfig['sitename'])."<br />"._CT_THANKYOU."";
 
-	// uncomment the following lines if you want to send confirmation mail to the user
-	/*
-	$conf_subject = _CT_THANKYOU;
-	$userMessage = sprintf(_CT_HELLO,$usersName);
-	$userMessage .= "\n\n";
-	$userMessage .= sprintf(_CT_THANKYOUCOMMENTS,$xoopsConfig['sitename']);
-	$userMessage .= "\n";
-	$userMessage .= sprintf(_CT_SENTTOWEBMASTER,$xoopsConfig['sitename']);
-	$userMessage .= "\n";
-	$userMessage .= _CT_YOURMESSAGE."\n";
-	$userMessage .= "\n$usersComments\n\n";
-	$userMessage .= "--------------\n";
-	$userMessage .= "".$xoopsConfig['sitename']." "._CT_WEBMASTER."\n";
-	$userMessage .= "".$xoopsConfig['adminmail']."";
-	$xoopsMailer =& getMailer();
-	$xoopsMailer->useMail();
-	$xoopsMailer->setToEmails($usersEmail);
-	$xoopsMailer->setFromEmail($usersEmail);
-	$xoopsMailer->setFromName($xoopsConfig['sitename']);
-	$xoopsMailer->setSubject($conf_subject);
-	$xoopsMailer->setBody($userMessage);
-	$xoopsMailer->send();
-	$messagesent .= sprintf(_CT_SENTASCONFIRM,$usersEmail);
-	*/
+    // uncomment the following lines if you want to send confirmation mail to the user
+    /*
+    $conf_subject = _CT_THANKYOU;
+    $userMessage = sprintf(_CT_HELLO,$usersName);
+    $userMessage .= "\n\n";
+    $userMessage .= sprintf(_CT_THANKYOUCOMMENTS,$xoopsConfig['sitename']);
+    $userMessage .= "\n";
+    $userMessage .= sprintf(_CT_SENTTOWEBMASTER,$xoopsConfig['sitename']);
+    $userMessage .= "\n";
+    $userMessage .= _CT_YOURMESSAGE."\n";
+    $userMessage .= "\n$usersComments\n\n";
+    $userMessage .= "--------------\n";
+    $userMessage .= "".$xoopsConfig['sitename']." "._CT_WEBMASTER."\n";
+    $userMessage .= "".$xoopsConfig['adminmail']."";
+    $xoopsMailer =& getMailer();
+    $xoopsMailer->useMail();
+    $xoopsMailer->setToEmails($usersEmail);
+    $xoopsMailer->setFromEmail($usersEmail);
+    $xoopsMailer->setFromName($xoopsConfig['sitename']);
+    $xoopsMailer->setSubject($conf_subject);
+    $xoopsMailer->setBody($userMessage);
+    $xoopsMailer->send();
+    $messagesent .= sprintf(_CT_SENTASCONFIRM,$usersEmail);
+    */
 
-	redirect_header(XOOPS_URL."/index.php",2,$messagesent);
+    redirect_header(XOOPS_URL."/index.php",2,$messagesent);
 }
 ?>
\ No newline at end of file


xoops-cvslog メーリングリストの案内
Back to archive index