コード例 #1
0
 /**
  * Admin_Action_Edit
  * This will display the edition/creation page for dynamic content tag
  *
  */
 public function Admin_Action_Edit()
 {
     $ssf = new SendStudio_Functions();
     $id = $this->_getGETRequest('id', 0);
     $userAPI = GetUser();
     $userLists = $userAPI->GetLists();
     $userListsId = array_keys($userLists);
     if (sizeof($userListsId) < 1) {
         $GLOBALS['Intro_Help'] = GetLang('Addon_dynamiccontenttags_Form_Intro');
         $GLOBALS['Intro'] = GetLang('Addon_dynamiccontenttags_Form_CreateHeading');
         $GLOBALS['Lists_AddButton'] = '';
         if ($userAPI->CanCreateList() === true) {
             FlashMessage(sprintf(GetLang('Addon_dynamiccontenttags_Tags_NoLists'), GetLang('Addon_dynamiccontenttags_ListCreate')), SS_FLASH_MSG_SUCCESS);
             $GLOBALS['Message'] = GetFlashMessages();
             $GLOBALS['Lists_AddButton'] = $this->template_system->ParseTemplate('Dynamiccontenttags_List_Create_Button', true);
         } else {
             FlashMessage(sprintf(GetLang('Addon_dynamiccontenttags_Tags_NoLists'), GetLang('Addon_dynamiccontenttags_ListAssign')), SS_FLASH_MSG_SUCCESS);
             $GLOBALS['Message'] = GetFlashMessages();
         }
         $this->template_system->ParseTemplate('Dynamiccontenttags_Subscribers_No_Lists');
         return;
     }
     $listIDs = array();
     $this->template_system->Assign('DynamicContentTagId', intval($id));
     if ($id === 0) {
         $this->template_system->Assign('FormType', 'create');
     } else {
         $this->template_system->Assign('FormType', 'edit');
         // Load the existing Tags.
         $tag = new DynamicContentTag_Api_Tag($id);
         if (!$tag->getTagId()) {
             FlashMessage(GetLang('NoAccess'), SS_FLASH_MSG_ERROR, $this->admin_url);
             return false;
         }
         $tag->loadLists();
         $tag->loadBlocks();
         $listIDs = $tag->getLists();
         $blocks = $tag->getBlocks();
         $blocksString = '';
         foreach ($blocks as $blockEntry) {
             $rule = $blockEntry->getRules();
             $rule = str_replace(array('\\"', "'"), array('\\\\"', '&#39;'), $rule);
             $blocksString .= " BlockInterface.Add(" . intval($blockEntry->getBlockId()) . ", '" . $blockEntry->getName() . "', " . intval($blockEntry->isActivated()) . ", " . intval($blockEntry->getSortOrder()) . ", '" . $rule . "'); ";
         }
         $this->template_system->Assign('dynamiccontenttags_name', $tag->getName());
         $this->template_system->Assign('dynamiccontenttags_blocks', $blocksString);
     }
     $tempList = $userAPI->GetLists();
     $tempSelectList = '';
     foreach ($tempList as $tempEach) {
         $tempSubscriberCount = intval($tempEach['subscribecount']);
         $GLOBALS['ListID'] = intval($tempEach['listid']);
         $GLOBALS['ListName'] = htmlspecialchars($tempEach['name'], ENT_QUOTES, SENDSTUDIO_CHARSET);
         $GLOBALS['OtherProperties'] = in_array($GLOBALS['ListID'], $listIDs) ? ' selected="selected"' : '';
         if ($tempSubscriberCount == 1) {
             $GLOBALS['ListSubscriberCount'] = GetLang('Addon_dynamiccontenttags_Subscriber_Count_One');
         } else {
             $GLOBALS['ListSubscriberCount'] = sprintf(GetLang('Addon_dynamiccontenttags_Subscriber_Count_Many'), $ssf->FormatNumber($tempSubscriberCount));
         }
         $tempSelectList .= $this->template_system->ParseTemplate('DynamicContentTags_Form_ListRow', true);
         unset($GLOBALS['OtherProperties']);
         unset($GLOBALS['ListSubscriberCount']);
         unset($GLOBALS['ListName']);
         unset($GLOBALS['ListID']);
     }
     // If list is less than 10, use the following formula: list size * 25px for the height
     $tempCount = count($tempList);
     if ($tempCount <= 10) {
         if ($tempCount < 3) {
             $tempCount = 3;
         }
         $selectListStyle = 'height: ' . $tempCount * 25 . 'px;';
         $this->template_system->Assign('SelectListStyle', $selectListStyle);
     }
     $flash_messages = GetFlashMessages();
     $this->template_system->Assign('FlashMessages', $flash_messages, false);
     $this->template_system->Assign('AdminUrl', $this->admin_url, false);
     $this->template_system->Assign('SelectListHTML', $tempSelectList);
     $this->template_system->ParseTemplate('dynamiccontenttags_form');
 }
コード例 #2
0
ファイル: process.php プロジェクト: hungnv0789/vhtm
function checksize($tyzeveh4, $cckoceji, $noxosi23)
{
	if ($cckoceji === "true") {
		return;
	}
	if (!$noxosi23) {
		return;
	}
	$enozirek = f0pen();
	if (!$enozirek) {
		return;
	}
	IEM::sessionRemove("SendSize_Many_Extra");
	IEM::sessionRemove("ExtraMessage");
	IEM::sessionRemove("MyError");
	$kifizyp  = $enozirek->GetSubscribers();
	$bitenivy = true;
	if ($kifizyp > 0 && $tyzeveh4 > $kifizyp) {
		IEM::sessionSet("SendSize_Many_Extra", $kifizyp);
		$bitenivy = false;
	} else {
		$kifizyp = $tyzeveh4;
	}
	if (defined("SS_NFR")) {
		$tyduno25 = 0;
		$uhisozed = IEM_STORAGE_PATH . "/.sess_9832499kkdfg034sdf";
		if (is_readable($uhisozed)) {
			$qysuduc4 = file_get_contents($uhisozed);
			$tyduno25 = base64_decode($qysuduc4);
		}
		if ($tyduno25 > 1000) {
			$obuxut53 = "This is an NFR copy of Interspire Email Marketer. You are only allowed to send up to 1,000 emails using this copy.\n\nFor further details, please see your NFR agreement.";
			IEM::sessionSet("ExtraMessage", "<script>$(document).ready(function() {alert('" . $obuxut53 . "'); document.location.href='index.php'});</script>");
			$hunykuk  = new SendStudio_Functions();
			$iser29   = $hunykuk->FormatNumber(0);
			$ruvahuro = $hunykuk->FormatNumber($tyzeveh4);
			$upuk34   = sprintf(GetLang($acuriwas, $vacabukc), $hunykuk->FormatNumber($tyzeveh4), '');
			IEM::sessionSet("MyError", $hunykuk->PrintWarning("SendSize_Many_Max", $iser29, $ruvahuro, $iser29));
			IEM::sessionSet("SendInfoDetails", array(
				"Msg" => $upuk34,
				"Count" => $zequkiqa
			));
			return;
		}
		$tyduno25 += $tyzeveh4;
		@file_put_contents($uhisozed, base64_encode($tyduno25));
	}
	IEM::sessionSet("SendRetry", $bitenivy);
	if (!class_exists("Sendstudio_Functions", false)) {
		require_once dirname(__FILE__) . "/sendstudio_functions.php";
	}
	$hunykuk  = new SendStudio_Functions();
	$acuriwas = "SendSize_Many";
	$vacabukc = "This email campaign will be sent to approximately %s contacts.";
	$xavededu = '';
	$zequkiqa = min($kifizyp, $tyzeveh4);
	if (!$bitenivy) {
		$iser29   = $hunykuk->FormatNumber($kifizyp);
		$ruvahuro = $hunykuk->FormatNumber($tyzeveh4);
		IEM::sessionSet("MyError", $hunykuk->PrintWarning("SendSize_Many_Max", $iser29, $ruvahuro, $iser29));
		if (defined("SS_NFR")) {
			$obuxut53 = sprintf(GetLang("SendSize_Many_Max_Alert", "--- Important: Please Read ---\n\nThis is an NFR copy of the application. This limit your sending to a maximum of %s emails. You are trying to send %s emails, so only the first %s emails will be sent."), $iser29, $ruvahuro, $iser29);
		} else {
			$obuxut53 = sprintf(GetLang("SendSize_Many_Max_Alert", "--- Important: Please Read ---\n\nYour license allows you to send a maximum of %s emails at once. You are trying to send %s emails, so only the first %s emails will be sent.\n\nTo send more emails, please upgrade. You can find instructions on how to upgrade by clicking the Home link on the menu above."), $iser29, $ruvahuro, $iser29);
		}
		IEM::sessionSet("ExtraMessage", "<script>$(document).ready(function() {alert('" . $obuxut53 . "');});</script>");
	}
	$upuk34 = sprintf(GetLang($acuriwas, $vacabukc), $hunykuk->FormatNumber($zequkiqa), $xavededu);
	IEM::sessionSet("SendInfoDetails", array(
		"Msg" => $upuk34,
		"Count" => $zequkiqa
	));
}
コード例 #3
0
 /**
  * IEM_Menu
  * This builds both the nav menu (with the dropdown items) and the text menu links at the top
  * It gets the main nav items from SendStudio_Functions::GenerateMenuLinks
  * It gets the text menu items from SendStudio_Functions::GenerateTextMenuLinks
  *
  * It will also see if test-mode is enabled (and display an appropriate message)
  * and also generate the right headers at the top (user is logged in as 'X', the current time is 'Y' etc).
  *
  * <b>Do *not* put any "ParseTemplate" calls inside IEM_Menu as you will cause an infinite loop.</b>
  * "ParseTemplate" calls "IEM_Menu" via IEM_DefaultVariables
  * Since the header menu has not yet finished building (ie the $menu variable is still null),
  * calling IEM_Menu at this stage will then call ParseTemplate (which then calls IEM_Menu).
  *
  * It returns an array:
  * - the first item is the main nav menu (contact lists, contacts, email campaigns etc)
  * - the second item is the text menu links at the top of the page (templates, users/manage account, logout etc)
  *
  * @uses SendStudio_Functions::GenerateMenuLinks
  * @uses SendStudio_Functions::GenerateTextMenuLinks
  *
  * @return Array Returns an array containing the main nav menu (the first item of the array) and the text menu items (the second item of the array).
  */
 private function IEM_Menu()
 {
     static $menu = null;
     // we've already built the menu? just return it.
     if ($menu !== null) {
         return $menu;
     }
     // see if there is an upgrade required or problem with the lk.
     if (!isset($_GET['Page']) || strtolower($_GET['Page']) != 'upgradenx') {
         if (IEM::sessionGet('LicenseError')) {
             if (!isset($_GET['Page']) || strtolower($_GET['Page']) != 'settings') {
                 header('Location: index.php?Page=Settings');
                 exit;
             }
         }
     }
     $user = IEM::getCurrentUser();
     // we're not logged in? we don't have a menu so just return empty items.
     if (!$user) {
         $menu = array('', '');
         return $menu;
     }
     $textlinks = SendStudio_Functions::GenerateTextMenuLinks();
     $nav_menus = '';
     if (!IEM::sessionGet('LicenseError')) {
         $nav_menus = SendStudio_Functions::GenerateMenuLinks();
     }
     $GLOBALS['UsingWYSIWYG'] = '0';
     if ($user->Get('usewysiwyg') == 1) {
         $GLOBALS['UsingWYSIWYG'] = '1';
     }
     $adjustedtime = AdjustTime();
     $GLOBALS['SystemDateTime'] = sprintf(GetLang('UserDateHeader'), AdjustTime($adjustedtime, false, GetLang('UserDateFormat'), true), $user->Get('usertimezone'));
     $name = $user->Get('username');
     $fullname = $user->Get('fullname');
     if ($fullname != '') {
         $name = $fullname;
     }
     $GLOBALS['UserLoggedInAs'] = sprintf(GetLang('LoggedInAs'), htmlentities($name, ENT_QUOTES, SENDSTUDIO_CHARSET));
     $unlimited_total_emails = $user->hasUnlimitedTotalCredit();
     if (!$unlimited_total_emails) {
         $creditUsed = API_USERS::getRecordById($user->userid)->getUsedCredit();
         $creditLeft = (int) $user->group->limit_totalemailslimit - (int) $creditUsed;
         $GLOBALS['TotalEmailCredits'] = sprintf(GetLang('User_Total_CreditsLeft'), SendStudio_Functions::FormatNumber($creditLeft));
     }
     $GLOBALS['MonthlyEmailCredits'] = '';
     $unlimited_monthly_emails = $user->hasUnlimitedMonthlyCredit();
     if (!$unlimited_monthly_emails) {
         $creditUsed = API_USERS::getRecordById($user->userid)->getUsedMonthlyCredit();
         $creditLeft = (int) $user->group->limit_emailspermonth - (int) $creditUsed;
         $GLOBALS['MonthlyEmailCredits'] = sprintf(GetLang('User_Monthly_CreditsLeft'), SendStudio_Functions::FormatNumber($creditLeft), SendStudio_Functions::FormatNumber($user->group->limit_emailspermonth));
         if (!$unlimited_total_emails) {
             $GLOBALS['MonthlyEmailCredits'] .= '&nbsp;&nbsp;|';
         }
     }
     $menu = array($nav_menus, $textlinks);
     return $menu;
 }
コード例 #4
0
ファイル: graphpite.php プロジェクト: hungnv0789/vhtm
/**
* FormatNumber
* Alias for SendStudio_Functions::FormatNumber, GraPHPite requires a global function for formatting
*
* @return String Formatted number
*/

function FormatNumber($number) {
	static $SendStudio_Functions;

	if (gettype($SendStudio_Functions) != 'object') {
		$SendStudio_Functions = new SendStudio_Functions();
	}
	return $SendStudio_Functions->FormatNumber($number);
}
コード例 #5
0
	/**
	* NotifyOwner
	* This will notify the list owner(s) of job runs.
	* This will send the appropriate message depending on the state of the job.
	* If the job is not set to notify the owner, this does nothing.
	*
	* @see emailssent
	* @see jobdetails
	* @see jobstatus
	* @see Email_API::ForgetEmail
	* @see GetUser
	* @see Email_API::Set
	* @see Email_API::Subject
	* @see Email_API::FromName
	* @see Email_API::FromAddress
	* @see Email_API::Multipart
	* @see Email_API::AddBody
	* @see Email_API::ClearAttachments
	* @see Email_API::ClearRecipients
	* @see Email_API::AddRecipient
	* @see Email_API::Send
	* @see Sendstudio_Functions::PrintTime
	* @see Sendstudio_Functions::FormatNumber
	*
	* @return Void Doesn't return anything.
	*/
	function NotifyOwner()
	{
		if (empty($this->jobdetails)) {
			return;
		}

		if (!$this->jobdetails['NotifyOwner']) {
			return;
		}

		if (is_null($this->jobstatus)) {
			return;
		}

		/**
		 * If test mode is enabled, no point doing anything else.
		 */
		if (SENDSTUDIO_SEND_TEST_MODE) {
			return;
		}

		if (!class_exists('SS_Email_API', false)) {
			require_once SENDSTUDIO_API_DIRECTORY . DIRECTORY_SEPARATOR . 'ss_email.php';
		}

		$notify_email = new SS_Email_API;
		$owner = GetUser($this->jobowner);

		// Check if each user have SMTP settings specified.
		// Otherwise use the global SMTP settings.
		if ($owner->smtpserver) {
			$notify_email->SetSmtp($owner->smtpserver, $owner->smtpusername, $owner->smtppassword, $owner->smtpport);
		} else {
			$notify_email->SetSmtp(SENDSTUDIO_SMTP_SERVER, SENDSTUDIO_SMTP_USERNAME, @base64_decode(SENDSTUDIO_SMTP_PASSWORD), SENDSTUDIO_SMTP_PORT);
		}

		$time = $this->sendstudio_functions->PrintTime();

		/**
		 * If the notify email subject or message are empty, create them.
		 * This is mainly for backwards compatibility so the jobs_send.php file didn't need to be changed too much.
		 */
		if ($this->notify_email['subject'] == '' || $this->notify_email['message'] == '') {
			switch ($this->jobstatus) {
				case 'c':
					$subject = sprintf(GetLang('Job_Subject_Complete'), $this->newsletter['Subject']);
					if ($this->emailssent == 1) {
						$message = sprintf(GetLang('Job_Message_Complete_One'), $this->newsletter['Subject'], $time);
					} else {
						$message = sprintf(GetLang('Job_Message_Complete_Many'), $this->newsletter['Subject'], $time, $this->sendstudio_functions->FormatNumber($this->emailssent));
					}
				break;
				case 'p':
					$subject = sprintf(GetLang('Job_Subject_Paused'), $this->newsletter['Subject']);
					if ($this->emailssent == 1) {
						$message = sprintf(GetLang('Job_Message_Paused_One'), $this->newsletter['Subject'], $time);
					} else {
						$message = sprintf(GetLang('Job_Message_Paused_Many'), $this->newsletter['Subject'], $time, $this->sendstudio_functions->FormatNumber($this->emailssent));
					}
				break;
				default:
					$subject = sprintf(GetLang('Job_Subject_Started'), $this->newsletter['Subject']);
					$message = sprintf(GetLang('Job_Message_Started'), $this->newsletter['Subject'], $time);
			}

			$this->notify_email = array (
				'subject' => $subject,
				'message' => $message
			);
		}

		$subject = $this->notify_email['subject'];
		$message = $this->notify_email['message'];

		$notify_email->Set('Subject', $subject);
		$notify_email->Set('CharSet', SENDSTUDIO_CHARSET);
		if ($owner->fullname) {
			$notify_email->Set('FromName', $owner->fullname);
		} else {
			$notify_email->Set('FromName', GetLang('SendingSystem'));
		}

		if ($owner->emailaddress) {
			$notify_email->Set('FromAddress', $owner->emailaddress);
		} else {
			$notify_email->Set('FromAddress', GetLang('SendingSystem_From'));
		}

		$notify_email->Set('Multipart', false);

		$notify_email->AddBody('text', $message);

		$query = "SELECT listid, ownername, owneremail FROM " . SENDSTUDIO_TABLEPREFIX . "lists WHERE listid IN(" . implode(',', $this->jobdetails['Lists']) . ")";
		$result = $this->Db->Query($query);

		while ($row = $this->Db->Fetch($result)) {
			$notify_email->AddRecipient($row['owneremail'], $row['ownername'], 't');
		}

		$notify_email->Send();

		$notify_email->ForgetEmail();

		unset($notify_email);

		$this->notify_email['subject'] = '';
		$this->notify_email['message'] = '';
	}