require_once dirname(__FILE__) . '/admin/index.php'; if (SENDSTUDIO_IS_SETUP != 1) { exit; } /** * This file lets us get api's, load language files and parse templates. */ require_once(SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'); if (!check('rss', true)) { exit; } $sendstudio_functions = new Sendstudio_Functions(); $sendstudio_functions->LoadLanguageFile('frontend'); $listid = (isset($_GET['List'])) ? (int)$_GET['List'] : 0; if (isset($_GET['L'])) { $listid = (int)$_GET['L']; } $baselink = SENDSTUDIO_APPLICATION_URL . '/rss.php?'; if ($listid) { $baselink .= 'List=' . $listid; }
// Make sure that the IEM controller does NOT redirect request. if (!defined('IEM_NO_CONTROLLER')) { define('IEM_NO_CONTROLLER', true); } /** * Require base sendstudio functionality. This connects to the database, sets up our base paths and so on. */ require_once dirname(__FILE__) . '/admin/index.php'; /** * This file lets us get api's, load language files and parse templates. */ require_once(SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'); $sendstudio_functions = new Sendstudio_Functions(); $sendstudio_functions->LoadLanguageFile('frontend'); $formapi = $sendstudio_functions->GetApi('Forms'); $emailapi = $sendstudio_functions->GetApi('Email'); $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $statsapi = $sendstudio_functions->GetApi('Stats'); $subscriber_id = IEM::sessionGet('Subscriber', false); $form = IEM::sessionGet('Form', false); if (!$subscriber_id || !$form) { echo GetLang('InvalidSendFriendURL'); exit();
if (SENDSTUDIO_IS_SETUP != 1) { exit; } /** * This file lets us get api's, load language files and parse templates. */ require_once(SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'); if (!check('rss', true)) { exit; } $sendstudio_functions = new Sendstudio_Functions(); $listapi = $sendstudio_functions->GetApi('Lists'); $newsletterapi = $sendstudio_functions->GetApi('Newsletters'); $autoapi = $sendstudio_functions->GetApi('Autoresponders'); $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $emailapi = $sendstudio_functions->GetApi('SS_Email'); $listid = 0; if (isset($_GET['List'])) { $listid = (int)$_GET['List']; } else { if (isset($_GET['L'])) { $listid = (int)$_GET['L']; } }
} // Require base sendstudio functionality. This connects to the database, sets up our base paths and so on. require_once dirname(__FILE__) . '/admin/index.php'; if (!SENDSTUDIO_IS_SETUP) { DisplayImage(); exit(); } /** * This file lets us get api's, load language files and parse templates. */ require_once SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'; $sendstudio_functions = new Sendstudio_Functions(); $statsapi = $sendstudio_functions->GetApi('Stats'); $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $foundparts = array(); $areas_to_check = array('M', 'L'); foreach ($areas_to_check as $p => $key) { if (!isset($_GET[$key])) { DisplayImage(); exit(); } $foundparts[strtolower($key)] = $_GET[$key]; }
$lists = array(); if (isset($_POST['SelectLists'])) { $lists = array_keys($_POST['SelectLists']); } $multiple_lists = false; if (sizeof($lists) > 1) { $multiple_lists = true; } $email = false; if (isset($_POST['Email'])) { $email = $_POST['Email']; } $sendstudio_functions = new Sendstudio_Functions(); $sendstudio_functions->LoadLanguageFile('frontend'); $formapi = $sendstudio_functions->GetApi('Forms'); $listapi = $sendstudio_functions->GetApi('Lists'); $emailapi = $sendstudio_functions->GetApi('Email'); $emailapi->SetSmtp(SENDSTUDIO_SMTP_SERVER, SENDSTUDIO_SMTP_USERNAME, @base64_decode(SENDSTUDIO_SMTP_PASSWORD), SENDSTUDIO_SMTP_PORT); $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $customfieldsapi = $sendstudio_functions->GetApi('CustomFields'); $statsapi = $sendstudio_functions->GetApi('Stats'); $loaded = $formapi->Load($form); if (!$loaded) { echo 'Invalid Form.'; exit();
define('IEM_NO_SESSION', true); } // Require base sendstudio functionality. This connects to the database, sets up our base paths and so on. require_once dirname(__FILE__) . '/admin/index.php'; if (!SENDSTUDIO_IS_SETUP) { exit(); } /** * This file lets us get api's, load language files and parse templates. */ require_once SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'; $sendstudio_functions = new Sendstudio_Functions(); $statsapi = $sendstudio_functions->GetApi('Stats'); $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $listapi = $sendstudio_functions->GetApi('Lists'); $foundparts = array(); foreach ($_GET as $p => $part) { $foundparts[strtolower($p)] = $part; } $linktype = 'u'; if (isset($foundparts['f'])) { $linktype = $foundparts['f']; }
/** * GetHTML * Gets the html for the particular form type and form design that is loaded. * This will also load up custom fields, put them into the form, add format choice dropdown (if applicable) and finally return the form html for displaying or putting on a website. * If it's a modify details form, then there are placeholders put into the form so the calling object/method can pre-fill the form as necessary. * * @param Boolean $inside_sendstudio Pass in whether we are viewing the form from inside the application or not. This allows us to include/exclude information accordingly. This stops a problem where viewing a form will log you out of the admin control panel. * * @see GetFormDesign * @see FetchFile * @see formtype * @see chooseformat * @see changeformat * @see lists * @see customfields * * @return String Returns the form's html content. */ function GetHTML($inside_sendstudio=false) { /** * This file lets us get api's, load language files and parse templates. */ if (!class_exists('sendstudio_functions', false)) { require_once(SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'); } $sendstudio_functions = new Sendstudio_Functions(); $sendstudio_functions->LoadLanguageFile('frontend'); $sendstudio_functions->LoadLanguageFile('forms'); $content = $this->GetFormDesign($this->design, $this->formtype, true); $displayoption = $this->FetchFile($this->design, $this->formtype, '_options'); $requiredoption = $this->FetchFile($this->design, false, 'required'); $notrequiredoption = $this->FetchFile($this->design, false, 'notrequired'); $javascript = ' function CheckMultiple' . $this->formid . '(frm, name) { for (var i=0; i < frm.length; i++) { fldObj = frm.elements[i]; fldId = fldObj.id; if (fldId) { var fieldnamecheck=fldObj.id.indexOf(name); if (fieldnamecheck != -1) { if (fldObj.checked) { return true; } } } } return false; } '; $javascript .= 'function CheckForm' . $this->formid . '(f) {'; $email_placeholder = ''; if ($this->formtype == 'm' || $this->formtype == 'f') { $email_placeholder = '%%Email%%'; } $alert = GetLang('Form_Javascript_EnterEmailAddress'); $javascript .= ' var email_re = /[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i; if (!email_re.test(f.email.value)) { alert("' . $alert . '"); f.email.focus(); return false; } '; $formatlist = ''; if ($this->formtype != 'u') { if ($this->formtype == 'm' && $this->changeformat) { $optionname = $requiredoption . GetLang('Form_ChooseFormat') . ':'; $option = '<select name="format">'; $option .= '<option value="h"%%Format_html%%>' . GetLang('Format_HTML') . '</option>'; $option .= '<option value="t"%%Format_text%%>' . GetLang('Format_Text') . '</option>'; $option .= '</select>'; $formatlist = str_replace(array('%%GLOBAL_OptionName%%', '%%GLOBAL_Option%%'), array($optionname, $option), $displayoption); } elseif ($this->formtype != 'm') { if ($this->chooseformat == 'c') { $optionname = $requiredoption . GetLang('Form_ChooseFormat') . ':'; $option = '<select name="format">'; $option .= '<option value="h">' . GetLang('Format_HTML') . '</option>'; $option .= '<option value="t">' . GetLang('Format_Text') . '</option>'; $option .= '</select>'; $alert = GetLang('Form_Javascript_ChooseFormat'); $javascript .= ' if (f.format.selectedIndex == -1) { alert("' . $alert . '"); f.format.focus(); return false; } '; $formatlist = str_replace(array('%%GLOBAL_OptionName%%', '%%GLOBAL_Option%%'), array($optionname, $option), $displayoption); } else { $formatlist = '<input type="hidden" name="format" value="' . str_replace('f', '', $this->chooseformat) . '" />'; } } } if ($this->usecaptcha) { $alert = GetLang('Form_Javascript_EnterCaptchaAnswer'); $javascript .= ' if (f.captcha.value == "") { alert("' . $alert . '"); f.captcha.focus(); return false; } '; } $placeholder_lists = ''; $list_intro_shown = false; if (sizeof($this->lists) > 1) { if (!class_exists('Lists_API', false)) { require_once(dirname(__FILE__) . '/lists.php'); } $lists_api = new Lists_API(0, false); $lists_api->Set('Db', $this->Db); $listlist = ''; foreach ($this->lists as $p => $listid) { $lists_api->Load($listid); $optionname = ''; if (!$list_intro_shown) { $optionname = $notrequiredoption . GetLang('MailingLists') . ':'; $list_intro_shown = true; } else { $optionname = ' '; } if ($this->formtype == 'm') { $placeholder_lists = '%%Lists_' . $listid . '%%'; } $option = '<label for="lists_' . $listid . '"><input type="checkbox" id="lists_' . $listid . '" name="lists[]" value="' . $listid . '"' . $placeholder_lists . ' /> ' . $lists_api->Get('name') . '</label>'; $listlist .= str_replace(array('%%GLOBAL_OptionName%%', '%%GLOBAL_Option%%'), array($optionname, $option), $displayoption); $alert = GetLang('Form_Javascript_ChooseLists'); $javascript .= ' lists_chosen = CheckMultiple' . $this->formid . '(f, "lists"); if (!lists_chosen) { alert("' . $alert . '"); return false; } '; } } else { $listid = current($this->lists); if ($this->formtype == 'm') { $placeholder_lists = '%%Lists_' . $listid . '%%'; } $listlist = '<input type="hidden" name="lists" value="' . $listid . '" />'; } $formcontents = ''; // custom fields is a multidimensional array with list as the key. // The subarray contains fields to show for that list. // $displayfields = array(); $displayfields = $this->fieldorder; foreach ($this->customfields as $p => $field) { if (!in_array($field, $displayfields)) { $displayfields[] = $field; } } if (!class_exists('CustomFields_API', false)) { require_once(dirname(__FILE__) . '/customfields.php'); } $customfields_api = new CustomFields_API(0, false); $customfields_api->Db = $this->Db; $shown_list_options = false; foreach ($displayfields as $p => $field) { if ($field == 'e') { $optionname = $requiredoption . GetLang('Form_EmailAddress') . ':'; $option = '<input type="text" name="email" value="' . $email_placeholder . '" />'; $formcontents .= str_replace(array('%%GLOBAL_OptionName%%', '%%GLOBAL_Option%%'), array($optionname, $option), $displayoption); continue; } if ($field == 'cl') { $shown_list_options = true; $formcontents .= $listlist; continue; } if ($this->formtype == 'u') { continue; } if ($field == 'cf') { $formcontents .= $formatlist; continue; } $option = ''; $optionvalue = ''; $loaded = $customfields_api->Load($field); if (!$loaded) { continue; } $subfield = $customfields_api->LoadSubField(); $javascript .= $subfield->CreateJavascript($this->formid); if ($subfield->IsRequired()) { $optionname = $requiredoption; } else { $optionname = $notrequiredoption; } $optionname .= $subfield->GetFieldName() . ':'; $option = $subfield->DisplayFieldOptions($customfields_api->Settings['DefaultValue'], true, $this->formid); if ($this->formtype == 'm') { switch ($subfield->fieldtype) { case 'dropdown': $option = preg_replace('/<option value="(.*?)">/', "<option value=\"\${1}\"%%CustomField_".$field."_\${1}%%>", $option); break; case 'checkbox': $option = preg_replace('/name="(.*?)" value="(.*?)">/', "name=\"\${1}\" value=\"\${2}\"%%CustomField_".$field."_\${2}%%>", $option); break; case 'radiobutton': $option = preg_replace('/value="(.*?)">/', "value=\"\${1}\"%%CustomField_".$field."_\${1}%%>", $option); break; case 'date': foreach (array('dd', 'mm', 'yy') as $p => $datepart) { $match_string = preg_quote('<select name="CustomFields[' . $field . '][' . $datepart . ']"', '%') . '.*?\>(.*?)' . preg_quote('</select>', '%'); if (preg_match('%'.$match_string.'%i', $option, $matches)) { $orig_text = $full_text = $matches[0]; $full_text = preg_replace('/value="(.*?)">/', "value=\"\${1}\"%%CustomField_" . $field . "_\${1}_" . $datepart . "%%>", $full_text); $option = str_replace($orig_text, $full_text, $option); } } break; case 'textarea': $option = str_replace('</textarea>', '%%CustomField_' . $field . '%%</textarea>', $option); break; case 'number': $option = str_replace('value="0"', 'value="%%CustomField_' . $field . '%%"', $option); break; default: $option = str_replace('value=""', 'value="%%CustomField_' . $field . '%%"', $option); break; } } $formcontents .= str_replace(array('%%GLOBAL_OptionName%%', '%%GLOBAL_Option%%'), array($optionname, $option), $displayoption); } if ($this->formtype == 'm' && !$shown_list_options) { $formcontents .= $listlist; } switch ($this->formtype) { case 's': $formaction = SENDSTUDIO_APPLICATION_URL . '/form.php?form=' . $this->formid; break; case 'u': $formaction = SENDSTUDIO_APPLICATION_URL . '/unsubform.php?form=' . $this->formid; break; case 'f': case 'm': /** * We don't hardcode the form action in case we are generating the form. Since a modify details form stays inside sendstudio, we don't want to hardcode the url (instead it's generated by the modifydetails.php file). * Why? In case we change the url - we don't want to have to change database values at the same time. */ $formaction = '%%FORMACTION%%'; break; default: $formaction = false; } if (!in_array('cf', $displayfields)) { $formcontents .= $formatlist; } if (!class_exists('captcha_api', false)) { require_once(dirname(__FILE__) . '/captcha.php'); } $captcha_api = new Captcha_API($inside_sendstudio); if ($this->usecaptcha) { $optionname = $requiredoption . GetLang('Form_EnterCaptcha') . ':'; if ($this->formtype == 'm') { $option = '%%captchaimage%%'; } else { $option = $captcha_api->ShowCaptcha(); } $option .= '<br/><input type="text" name="captcha" value="" />'; $formcontents .= str_replace(array('%%GLOBAL_OptionName%%', '%%GLOBAL_Option%%'), array($optionname, $option), $displayoption); } $javascript .= ' return true; } '; $content = str_replace(array('%%FormContents%%', '%%FormAction%%', '%%FormID%%', '%%Javascript%%'), array($formcontents, $formaction, $this->formid, $javascript), $content); $content = $sendstudio_functions->ReplaceLanguageVariables($content); return $content; }
// Make sure that the IEM controller does NOT redirect request. if (!defined('IEM_NO_CONTROLLER')) { define('IEM_NO_CONTROLLER', true); } /** * Require base sendstudio functionality. This connects to the database, sets up our base paths and so on. */ require_once dirname(__FILE__) . '/admin/index.php'; /** * This file lets us get api's, load language files and parse templates. */ require_once SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'; $sendstudio_functions = new Sendstudio_Functions(); $sendstudio_functions->LoadLanguageFile('frontend'); $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $customfieldsapi = $sendstudio_functions->GetApi('CustomFields'); $listapi = $sendstudio_functions->GetApi('Lists'); $formapi = $sendstudio_functions->GetApi('Forms'); /** * This is used in the 'updatedetails.php' file so we don't have to re-do all of these checks. */ $subscriber_on_lists = array(); $subscriber_custom_fields = array(); $errors = array();
require_once dirname(__FILE__) . '/admin/index.php'; /** * This file lets us get api's, load language files and parse templates. */ require_once(SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'); /** * Ignore requests from ClamAV */ if (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'],'ClamAV')) { exit(); } $sendstudio_functions = new Sendstudio_Functions(); $sendstudio_functions->LoadLanguageFile('frontend'); $statstype = false; $statid = 0; $validLists = array(); $foundparts = array(); $subscriber_id = 0; $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $listapi = $sendstudio_functions->GetApi('Lists'); $statsapi = $sendstudio_functions->GetApi('Stats'); $errors = array();
define('IEM_NO_CONTROLLER', true); } /** * Require base sendstudio functionality. This connects to the database, sets up our base paths and so on. */ require_once dirname(__FILE__) . '/admin/index.php'; /** * This file lets us get api's, load language files and parse templates. */ require_once(SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php'); header('Content-type: text/html; charset="' . SENDSTUDIO_CHARSET . '"'); $sendstudio_functions = new Sendstudio_Functions(); $sendstudio_functions->LoadLanguageFile('frontend'); $sendstudio_functions->LoadLanguageFile('forms'); $subscriberapi = $sendstudio_functions->GetApi('Subscribers'); $formapi = $sendstudio_functions->GetApi('Forms'); $errors = array(); $foundparts = array(); foreach ($_GET as $key => $part) { $foundparts[strtolower($key)] = $part; }