本文整理汇总了PHP中messages::printDie方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::printDie方法的具体用法?PHP messages::printDie怎么用?PHP messages::printDie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类messages
的用法示例。
在下文中一共展示了messages::printDie方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
* Производим поиск/замену во всех шаблонах скрипта
*/
foreach (filesys::getChildDirs('templates/site/') as $template) {
$formFileName = 'templates/site/' . $template . '/resume.form.tpl';
if (is_file($formFileName)) {
file_put_contents($formFileName, str_replace($arrSearch, $arrRreplace, file_get_contents($formFileName)));
}
$formFileName = 'templates/site/' . $template . '/resume.preview.tpl';
if (is_file($formFileName)) {
file_put_contents($formFileName, str_replace($arrSearch, $arrRreplace, file_get_contents($formFileName)));
}
}
file_put_contents('templates/admin/adm.announces.resume.edit.tpl', str_replace($arrSearch, $arrRreplace, file_get_contents('templates/admin/adm.announces.resume.edit.tpl')));
messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, CONF_ADMIN_FILE . '?m=announces&s=common&action=confQuestResume');
} else {
messages::printDie(ERROR_FILE_NOT_WRITE);
}
}
$arrDescriptFields = array();
// Описание основных полей анкеты
foreach (array_keys(array_merge($arrBindFields, $arrNoBindFields)) as $indexField) {
$arrDescriptFields['basic'][$indexField] = @constant('ANNOUNCE_BASIC_FIELD_DESCRIPT_' . strtoupper($indexField)) or $arrDescriptFields['basic'][$indexField] = @constant('RESUME_BASIC_FIELD_DESCRIPT_' . strtoupper($indexField));
}
// Описание дополнительных полей анкеты - Образование
foreach (array_keys(array_merge($arrEducation['arrBindFields'], $arrEducation['arrNoBindFields'])) as $indexField) {
$arrDescriptFields['education'][$indexField] = @constant('ANNOUNCE_EXT_EDUCATION_FIELD_DESCRIPT_' . strtoupper($indexField));
}
// Описание дополнительных полей анкеты - Опыт работы
foreach (array_keys(array_merge($arrExpire['arrBindFields'], $arrExpire['arrNoBindFields'])) as $indexField) {
$arrDescriptFields['expire'][$indexField] = @constant('ANNOUNCE_EXT_EXPIRE_FIELD_DESCRIPT_' . strtoupper($indexField));
}
示例2: implode
$arrActData[] = "\t\t\t\t\t\t\t\t\t\t\t\t'{$actionKey}' => {$actionVal}";
}
$data .= implode(",\n", $arrActData) . "\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t );\n";
if (!tools::saveConfig($fileName, $data, CONF_ADMIN_FILE . '?m=service&s=robot&action=config')) {
$arrErrors[] = ERROR_FILES_MISSING_FILE;
}
} elseif (isset($_POST['ctrl_save'])) {
$arrCtrl = array('updateCounters' => isset($_POST['arrCtrl']['updateCounters']) ? 'true' : 'false', 'delNonverifyUsers' => isset($_POST['arrCtrl']['delNonverifyUsers']) ? 'true' : 'false', 'delNontypeUsers' => isset($_POST['arrCtrl']['delNontypeUsers']) ? 'true' : 'false', 'delUnpaidUsers' => isset($_POST['arrCtrl']['delUnpaidUsers']) ? 'true' : 'false', 'delUnpaidSubscr' => isset($_POST['arrCtrl']['delUnpaidSubscr']) ? 'true' : 'false', 'vacActionSlo' => isset($_POST['arrCtrl']['vacActionSlo']) && ('deleted' === $_POST['arrCtrl']['vacActionSlo'] || 'archived' === $_POST['arrCtrl']['vacActionSlo']) ? secure::escQuoteData($_POST['arrCtrl']['vacActionSlo']) : 'false', 'resActionSlo' => isset($_POST['arrCtrl']['resActionSlo']) && ('deleted' === $_POST['arrCtrl']['resActionSlo'] || 'archived' === $_POST['arrCtrl']['resActionSlo']) ? secure::escQuoteData($_POST['arrCtrl']['resActionSlo']) : 'false', 'vacDelNonverify' => isset($_POST['arrCtrl']['vacDelNonverify']) ? 'true' : 'false', 'resDelNonverify' => isset($_POST['arrCtrl']['resDelNonverify']) ? 'true' : 'false', 'vacDelUnpaid' => isset($_POST['arrCtrl']['vacDelUnpaid']) ? 'true' : 'false', 'resDelUnpaid' => isset($_POST['arrCtrl']['resDelUnpaid']) ? 'true' : 'false', 'vacVipResetSlo' => isset($_POST['arrCtrl']['vacVipResetSlo']) ? 'true' : 'false', 'resVipResetSlo' => isset($_POST['arrCtrl']['resVipResetSlo']) ? 'true' : 'false', 'vacHotResetSlo' => isset($_POST['arrCtrl']['vacHotResetSlo']) ? 'true' : 'false', 'resHotResetSlo' => isset($_POST['arrCtrl']['resHotResetSlo']) ? 'true' : 'false');
$data = "<?php\n\n" . "(!defined('SDG')) ? die ('Triple protection!') : null;\n\n" . '$arrRobotConf = array(' . "\n\t'configs' => array(\n";
foreach ($arrRobotConf['configs'] as $configKey => $configVal) {
$configVal = false === $configVal ? 'false' : (true === $configVal ? 'true' : $configVal);
$arrConfData[] = "\t\t'{$configKey}' => {$configVal}";
}
$data .= implode(",\n", $arrConfData) . "\n\t),\n\n\t'actions' => array(\n";
foreach ($arrCtrl as $ctrlKey => $ctrlVal) {
$arrActData[] = "\t\t'{$ctrlKey}' => {$ctrlVal}";
}
$data .= implode(",\n", $arrActData) . "\n\t)\n);\n";
if (!tools::saveConfig($fileName, $data, CONF_ADMIN_FILE . '?m=service&s=robot&action=config')) {
$arrErrors[] = ERROR_FILES_MISSING_FILE;
}
}
} else {
messages::printDie(ERROR_CRITICAL_FILE_NOT_EXISTS);
}
}
} else {
messages::error404();
}
$smarty->assignByRef('errors', $arrErrors);
$smarty->assignByRef('action', $arrActions);
示例3: recXmlTemplate
/**
* static функция записи шаблона сайта в xml-файл
*
* @return bool
*/
static function recXmlTemplate(&$arrXmlTemplate)
{
if (is_array($arrXmlTemplate)) {
$xmlData = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?><root></root>');
!isset($arrXmlTemplate['arrBlocks']['head_site']) || !is_array($arrXmlTemplate['arrBlocks']['head_site']) ? $arrData['head_site'] = false : ($arrData['head_site'] =& array_reverse($arrXmlTemplate['arrBlocks']['head_site']));
!isset($arrXmlTemplate['arrBlocks']['left_side']) || !is_array($arrXmlTemplate['arrBlocks']['left_side']) ? $arrData['left_side'] = false : ($arrData['left_side'] =& array_reverse($arrXmlTemplate['arrBlocks']['left_side']));
!isset($arrXmlTemplate['arrBlocks']['center_side']) || !is_array($arrXmlTemplate['arrBlocks']['center_side']) ? $arrData['center_side'] = false : ($arrData['center_side'] =& array_reverse($arrXmlTemplate['arrBlocks']['center_side']));
!isset($arrXmlTemplate['arrBlocks']['right_side']) || !is_array($arrXmlTemplate['arrBlocks']['right_side']) ? $arrData['right_side'] = false : ($arrData['right_side'] =& array_reverse($arrXmlTemplate['arrBlocks']['right_side']));
!isset($arrXmlTemplate['arrBlocks']['foot_site']) || !is_array($arrXmlTemplate['arrBlocks']['foot_site']) ? $arrData['foot_site'] = false : ($arrData['foot_site'] =& array_reverse($arrXmlTemplate['arrBlocks']['foot_site']));
$xmlTemplate = $xmlData->addChild('template');
foreach ($arrData as $nameSide => $arrBlocks) {
$xmlSide = $xmlTemplate->addChild($nameSide);
if (!empty($arrBlocks) && is_array($arrBlocks)) {
foreach ($arrBlocks as $block) {
$xmlSide->addChild('block', $block);
}
} else {
$xmlSide->addChild('block');
}
}
!file_put_contents('core/xml/main.temlate.xml', $xmlData->asXML()) ? messages::printDie(ERROR_FILE_NOT_WRITE) : messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, CONF_ADMIN_FILE . '?m=service&s=designer');
} else {
return false;
}
}
示例4: sendEmails
/**
* private функция рассылки почтовых сообщений
*
* @param string $typeAnnounce - тип объявления (должно соответствовать имени таблицы БД)
* @param array $arrAnnounceData - массив данных объявления
* @param bool $screenMessageOn [default = true] - завершение работы скрипта, выводом информационного сообщения
*
* @return bool
*/
private function sendEmails(&$typeAnnounce, &$arrAnnounceData, $screenMessageOn = true)
{
if (isset($_SESSION['referer'])) {
unset($_SESSION['referer']);
}
$user_type = !empty($_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type']) ? 'ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&' : '';
switch ($arrAnnounceData['token']) {
case 'new':
/**
* отправляем письмо пользователю
*/
$mailer = new mailer();
// дата удаления неактивированного объявления
$deldate = date(terms::dateFormatFromSmarty(CONF_DATE_FORMAT, CONF_TIME_FORMAT), strtotime(terms::calcDateTimeOfTerm(constant('CONF_' . strtoupper($typeAnnounce) . '_ACTIVATE_THERM'))));
$mailer->setAddReplace(array('%ANNOUNCE_TYPE%' => constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)), '%ANNOUNCE_TITLE%' => $arrAnnounceData['title'], '%CODE%' => $arrAnnounceData['unikey'], '%DELDATE%' => $deldate, '%ACTIVATE_PAGE%' => CONF_SCRIPT_URL . 'index.php?' . $user_type . 'do=' . $typeAnnounce . '&action=activate', '%ACTIVATE_LINK%' => CONF_SCRIPT_URL . 'index.php?' . $user_type . 'do=' . $typeAnnounce . '&action=activate&code=' . $arrAnnounceData['unikey']));
$result = $mailer->sendEmail(CONF_MAIL_ADMIN_EMAIL, CONF_SITE_NAME, false, $arrAnnounceData['email'], $arrAnnounceData['email'], MAIL_SUBJ_ACTIVATE_ANNOUNCE . constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)) . ' - ' . $arrAnnounceData['title'], 'announce.user.activate.txt');
unset($mailer);
// уничтожаем объект
if (!$result && !empty($screenMessageOn)) {
messages::printDie(ERROR_SEND_EMAIL);
} elseif (!empty($screenMessageOn)) {
messages::messageChangeSaved(ANNOUNCE_ADD_ACTIVATE_TITLE, ANNOUNCE_ADD_ACTIVATE_MESSAGE, CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=' . $typeAnnounce . '&action=activate', 5000);
} else {
return $result;
}
case 'moderate':
// массив для замены в шаблоне
$arrAddReplace = array('%ANNOUNCE_TYPE%' => constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)), '%ANNOUNCE_TITLE%' => $arrAnnounceData['title']);
/**
* отправляем письмо администратору
*/
$mailer = new mailer();
// передаем массив для замены в шаблоне
$mailer->setAddReplace($arrAddReplace + array('%ADMIN_PANEL_LINK%' => CONF_SCRIPT_URL . CONF_ADMIN_FILE . '?m=announces&s=' . $typeAnnounce . 's&action=moderate'));
$mailer->sendEmail(CONF_MAIL_ADMIN_EMAIL, CONF_SITE_NAME, false, CONF_MAIL_ADMIN_EMAIL, false, MAIL_SUBJ_NEW_ANNOUNCE . $arrAnnounceData['title'], empty($arrAnnounceData['comments']) ? 'adm.moderate.announce.txt' : 'adm.edited.announce.txt');
unset($mailer);
// уничтожаем объект
/**
* отправляем письмо пользователю
*/
$mailer = new mailer();
// передаем массив для замены в шаблоне
$mailer->setAddReplace($arrAddReplace);
$result = $mailer->sendEmail(CONF_MAIL_ADMIN_EMAIL, CONF_SITE_NAME, false, $arrAnnounceData['email'], $arrAnnounceData['email'], MAIL_SUBJ_MODERATE_ANNOUNCE . constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)) . ' - ' . $arrAnnounceData['title'], 'announce.user.moderate.txt');
unset($mailer);
// уничтожаем объект
if (!$result && !empty($screenMessageOn)) {
messages::printDie(ERROR_SEND_EMAIL);
} elseif (!empty($screenMessageOn)) {
$link = !empty($arrAnnounceData['id_user']) ? CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=user.announces&action=' . $typeAnnounce . '&token=' . $arrAnnounceData['token'] : CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'];
messages::messageChangeSaved(ANNOUNCE_ADD_MODERATION_TITLE, ANNOUNCE_ADD_MODERATION_MESSAGE, chpu::createChpuUrl($link), 5000);
} else {
return $result;
}
case 'correction':
/**
* отправляем письмо пользователю
*/
$mailer = new mailer();
// дата удаления не исправленного объявления
$deldate = date(terms::dateFormatFromSmarty(CONF_DATE_FORMAT, CONF_TIME_FORMAT), strtotime(terms::calcDateTimeOfTerm(constant('CONF_' . strtoupper($typeAnnounce) . '_CORRECTION_THERM'))));
$mailer->setAddReplace(array('%ANNOUNCE_TYPE%' => constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)), '%ANNOUNCE_TITLE%' => $arrAnnounceData['title'], '%DELDATE%' => $deldate, '%USER_PANEL_LINK%' => chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?do=user.announces&action=' . $typeAnnounce . '&token=' . $arrAnnounceData['token']), '%COMMENTS%' => CONF_MAIL_FORMAT_HTML ? nl2br($arrAnnounceData['comments']) : $arrAnnounceData['comments']));
$result = $mailer->sendEmail(CONF_MAIL_ADMIN_EMAIL, CONF_SITE_NAME, false, $arrAnnounceData['email'], $arrAnnounceData['email'], MAIL_SUBJ_NEW_ANNOUNCE_CORRECTION . constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)) . ' - ' . $arrAnnounceData['title'], 'announce.user.correction.txt');
unset($mailer);
// уничтожаем объект
if (!$result && !empty($screenMessageOn)) {
messages::printDie(ERROR_SEND_EMAIL);
} else {
return $result;
}
case 'payment':
/**
* отправляем письмо пользователю
*/
$mailer = new mailer();
// дата удаления неоплаченого объявления
$deldate = date(terms::dateFormatFromSmarty(CONF_DATE_FORMAT, CONF_TIME_FORMAT), strtotime(terms::calcDateTimeOfTerm(constant('CONF_' . strtoupper($typeAnnounce) . '_PAYMENT_THERM'))));
$mailer->setAddReplace(array('%ANNOUNCE_TYPE%' => constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)), '%ANNOUNCE_TITLE%' => $arrAnnounceData['title'], '%CODE%' => $arrAnnounceData['unikey'], '%DELDATE%' => $deldate, '%PAYMENT_LINK%' => CONF_SCRIPT_URL . 'index.php?' . $user_type . 'do=' . $typeAnnounce . '&action=payment&id=' . $arrAnnounceData['id']));
$result = $mailer->sendEmail(CONF_MAIL_ADMIN_EMAIL, CONF_SITE_NAME, false, $arrAnnounceData['email'], $arrAnnounceData['email'], MAIL_SUBJ_NEW_ANNOUNCE_PAYMENT . constant('MAIL_ANNOUNCE_TYPE_' . strtoupper($typeAnnounce)) . ' - ' . $arrAnnounceData['title'], 'announce.user.payment.txt');
unset($mailer);
// уничтожаем объект
if (!$result && !empty($screenMessageOn)) {
messages::printDie(ERROR_SEND_EMAIL);
} elseif (!empty($screenMessageOn)) {
$_SESSION['payment'] = array('service' => 'add_' . $typeAnnounce, 'announce_type' => $typeAnnounce, 'id' => $arrAnnounceData['id'], 'tId' => $arrAnnounceData['tId'], 'announce_title' => $arrAnnounceData['title']);
messages::messageChangeSaved(ANNOUNCE_ADD_PAYMENT_TITLE, ANNOUNCE_ADD_PAYMENT_MESSAGE, chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?ut=' . $_SESSION['sd_user'][DB_PREFIX . 'conf']['user_type'] . '&do=payments'), 5000);
} else {
return $result;
}
case 'active':
// транслитерация ЧПУ
//.........这里部分代码省略.........
示例5: saveFile
private function saveFile(&$noExit = false)
{
// данные для записи в файл
$data = "<?php\n\n" . "(!defined('SDG')) ? die ('Triple protection!') : null;\n\n" . "#SYSTEM DICTIONARYS#\n" . '$arrSysDict = ' . $this->parseArrData($this->arrSysDict) . "\n" . "#END SYSTEM DICTIONARYS#\n\n" . "#ADDITIONAL DICTIONARYS#\n" . '$arrAddDict = ' . $this->parseArrData($this->arrAddDict) . "\n" . "#END ADDITIONAL DICTIONARYS#\n";
// запись файла
if (file_put_contents('lang/' . $this->currLang . '/lang.dictionarys.selects.php', $data)) {
if ($noExit) {
return true;
} else {
messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, CONF_ADMIN_FILE . '?m=dictionary&s=selects');
}
} else {
if ($noExit) {
return false;
} else {
messages::printDie(ERROR_FILE_NOT_WRITE);
}
}
}