Go to the documentation of this file.
8 require_once(
'inc/header.inc.php');
9 require_once(CH_DIRECTORY_PATH_INC .
'design.inc.php');
10 require_once(CH_DIRECTORY_PATH_INC .
'profiles.inc.php');
11 require_once(CH_DIRECTORY_PATH_INC .
'utils.inc.php');
12 require_once(CH_DIRECTORY_PATH_CLASSES .
'ChWsbEmailTemplates.php');
19 $_page[
'css_name'] = array(
'forms_adv.css');
25 if (isset(
$_GET[
'ID'])) {
28 if (isset($_POST[
'ID'])) {
37 $bAjaxMode = isset($_SERVER[
'HTTP_X_REQUESTED_WITH']) && $_SERVER[
'HTTP_X_REQUESTED_WITH'] ==
'XMLHttpRequest';
42 'form_attrs' => array(
43 'id' =>
'invite_friend',
44 'name' =>
'invite_friend',
45 'action' => CH_WSB_URL_ROOT .
'tellfriend.php',
47 'onsubmit' =>
"return ch_ajax_form_check(this)",
51 'submit_name' =>
'do_submit',
57 'type' =>
'block_header',
62 'name' =>
'do_submit',
70 'sender_name' => array(
72 'name' =>
'sender_name',
73 'caption' =>
_t(
"_Your name"),
76 'sender_email' => array(
78 'name' =>
'sender_email',
79 'caption' =>
_t(
'_Your email'),
84 'error' =>
_t(
'_Incorrect Email'),
87 'recipient_email' => array(
89 'name' =>
'recipient_email',
90 'caption' =>
_t(
'_Friend email'),
95 'error' =>
_t(
'_sys_adm_form_err_required_field'),
100 'caption' =>
_t(
'_Enter what you see'),
101 'name' =>
'securityImageValue',
106 'error' =>
_t(
'_Incorrect Captcha' ),
109 'submit_send' => array(
111 'name' =>
'submit_send',
112 'value' =>
_t(
"_Send Letter"),
118 unset(
$aForm[
'inputs'][
'captcha']);
123 if (
$oForm->isSubmittedAndValid())
129 if (
ch_get(
'ChAjaxSubmit')) {
130 header(
'Content-type:text/html;charset=utf-8');
138 if (isset($_SERVER[
'HTTP_X_REQUESTED_WITH']) && $_SERVER[
'HTTP_X_REQUESTED_WITH'] ==
'XMLHttpRequest') {
140 'title' =>
$_page[
'header'],
143 header(
'Content-type:text/html;charset=utf-8');
144 echo
$GLOBALS[
'oFunctions']->transBox(
$GLOBALS[
'oSysTemplate']->parseHtmlByName(
'popup.html', $aVarsPopup),
true);
164 if(strlen(trim($sSenderEmail)) <= 0)
168 $sSenderLink = $iSenderID != 0 ?
getProfileLink($iSenderID) : CH_WSB_URL_ROOT;
171 if(strlen(trim($sRecipientEmail)) <= 0)
174 $sLinkAdd = $iSenderID > 0 ?
'idFriend=' . $iSenderID :
'';
177 $aTemplate = $rEmailTemplate->getTemplate(
't_TellFriendProfile',
getLoggedId());
181 $aTemplate = $rEmailTemplate->getTemplate(
't_TellFriend',
getLoggedId());
182 $Link = CH_WSB_URL_ROOT;
183 if (strlen($sLinkAdd) > 0)
184 $Link .=
'?' . $sLinkAdd;
187 return sendMail($sRecipientEmail, $aTemplate[
'Subject'], $aTemplate[
'Body'],
'', array(
189 'SenderName' => $sSenderName,
190 'SenderLink' => $sSenderLink
</code > Be careful enabling this directive if you have a redirector script that does not use the< code > Location</code > HTTP header
$_page_cont[$_ni]['page_code']
MsgBox($sText, $iTimer=0)
ch_import($sClassName, $aModule=array())
sendMail( $sRecipientEmail, $sMailSubject, $sMailBody, $iRecipientID=0, $aPlus=array(), $sEmailFlag='html', $isDisableAlert=false, $bForceSend=false)
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest') $_ni
strmaxtextlen($sInput, $iMaxLen=60)
_t($key, $arg0="", $arg1="", $arg2="")
PageCode($oTemplate=null)
getProfileLink( $iID, $sLinkAdd='')
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
SendTellFriend($iSenderID=0)