本文整理汇总了PHP中TruncateText函数的典型用法代码示例。如果您正苦于以下问题:PHP TruncateText函数的具体用法?PHP TruncateText怎么用?PHP TruncateText使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TruncateText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeSelectHtml
/**
* @param string $name
* @param array $data
* @param string $selected
* @param bool $showNotUse
* @param array $attributes
* @return string "<select>....</select>"
* @throws ArgumentTypeException
*/
public static function makeSelectHtml($name, array $data, $selected = "", $showNotUse = true, $attributes = array())
{
if (!is_array($data)) {
throw new ArgumentTypeException("data", "array");
}
if (!is_array($attributes)) {
throw new ArgumentTypeException("attributies", "array");
}
$result = '<select name="' . htmlspecialcharsbx($name) . '"';
foreach ($attributes as $attrName => $attrValue) {
$result .= " " . $attrName . "=\"" . htmlspecialcharsbx($attrValue) . "\"";
}
$result .= '>';
if ($showNotUse) {
$result .= '<option value="">' . GetMessage("SALE_ORDEREDIT_NOT_USE") . '</option>';
}
foreach ($data as $value => $title) {
$result .= '<option value="' . htmlspecialcharsbx($value) . '"' . ($selected == $value ? " selected" : "") . '>' . htmlspecialcharsbx(TruncateText($title, 40)) . '</option>';
}
$result .= '</select>';
return $result;
}
示例2: while
$lAdmin->AddHeaders($Headers);
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_SID, $arRes, "adv_type_edit.php?SID=" . $f_SID, GetMessage("ADV_EDIT_TITLE"));
$row->AddViewField("SID", "<a href='adv_type_edit.php?lang=" . LANGUAGE_ID . "&SID=" . $f_SID . "' title='" . GetMessage("ADV_EDIT_TITLE") . "'>" . $f_SID . "</a>");
$arr = explode(" ", $f_DATE_MODIFY);
$row->AddViewField("DATE_MODIFY", $arr[0] . "<br>" . $arr[1]);
if ($isAdmin || $isDemo) {
$row->AddCheckField("ACTIVE");
$row->AddInputField("SORT");
$row->AddInputField("NAME");
} else {
$row->AddCheckField("ACTIVE", false);
$row->AddViewField("SORT", $f_SORT);
$row->AddViewField("NAME", $f_NAME);
}
$row->AddViewField("DESCRIPTION", TruncateText($f_DESCRIPTION, 180));
$row->AddViewField("BANNER_COUNT", '<a href="/bitrix/admin/adv_banner_list.php?find_type_sid[]=' . $f_SID . '&set_filter=Y" title="' . GetMessage("ADV_BANNER_LIST") . '">' . $f_BANNER_COUNT . '</a>');
$arActions = array();
if ($isAdmin || $isDemo) {
$arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("AD_TYPE_EDIT"), "ACTION" => $lAdmin->ActionRedirect("adv_type_edit.php?SID=" . $f_SID));
}
$arActions[] = array("ICON" => "view", "TEXT" => GetMessage("AD_TYPE_VIEW"), "ACTION" => $lAdmin->ActionRedirect("adv_type_edit.php?SID=" . $f_SID . "&action=view"), "TITLE" => GetMessage("AD_TYPE_VIEW_SETTINGS"));
$arActions[] = array("ICON" => "adv_graph", "TEXT" => GetMessage("AD_TYPE_STATISTICS_VIEW"), "ACTION" => $lAdmin->ActionRedirect("adv_banner_graph.php?find_type_sid=" . $f_SID . "&find_what_show[]=ctr&find_banner_summa=Y&set_filter=Y&lang=" . LANGUAGE_ID), "TITLE" => GetMessage("AD_TYPE_STATISTICS_VIEW_TITLE"));
if ($isAdmin || $isDemo) {
$arActions[] = array("SEPARATOR" => true);
$arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("AD_DELETE_TYPE"), "ACTION" => "if(confirm('" . GetMessage('AD_DELETE_TYPE_CONFIRM') . "')) " . $lAdmin->ActionDoGroup($f_SID, "delete"));
}
$row->AddActions($arActions);
}
// "подвал" списка
$lAdmin->AddFooter(array(array("title" => GetMessage("MAIN_ADMIN_LIST_SELECTED"), "value" => $rsData->SelectedRowsCount()), array("counter" => true, "title" => GetMessage("MAIN_ADMIN_LIST_CHECKED"), "value" => "0")));
示例3: preg_replace
}
$text = preg_replace("#\\[img\\](.+?)\\[/img\\]#is", "", $arPost["~DETAIL_TEXT"]);
$text = preg_replace("#\\[url(.+?)\\](.*?)\\[/url\\]#is", "\\2", $text);
$text = preg_replace("#\\[video(.+?)\\](.+?)\\[/video\\]#is", "", $text);
$text = preg_replace("#^(.+?)<cut[\\s]*(/>|>).*?\$#is", "\\1", $text);
$text = preg_replace("#^(.+?)\\[cut[\\s]*(/\\]|\\]).*?\$#is", "\\1", $text);
$text = preg_replace("#(\\[|<)(/?)(b|u|i|list|code|quote|url|img|color|font|/*)(.*?)(\\]|>)#is", "", $text);
$text = TruncateText($text, $arParams["MESSAGE_LENGTH"]);
$text1 = $text;
$title = $p->convert($text1, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N"));
$text = $p->convert($text, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "Y", "NL2BR" => "N"));
$text = CBlogTools::DeleteDoubleBR($text);
$arTmp["TEXT_FORMATED"] = $text;
$arTmp["DATE_PUBLISH_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arTmp["DATE_PUBLISH"], CSite::GetDateFormat("FULL")));
if ($arTmp["MICRO"] == "Y") {
$arTmp["TITLE"] = TruncateText(str_replace(array("<br />", "<br>", "'", """, "<", ">"), "", $title), 60);
$arTmp["~TITLE"] = htmlspecialcharsback($arTmp["TITLE"]);
}
$itemCnt++;
$arResult[] = $arTmp;
$ids[] = $arTmp["ID"];
}
$arResult["IDS"] = $ids;
}
if ($arParams["CACHE_TIME"] > 0) {
$cache->EndDataCache(array("templateCachedData" => $this->GetTemplateCachedData(), "arResult" => $arResult));
}
}
if ($arParams["SHOW_RATING"] == "Y" && !empty($arResult["IDS"])) {
$arResult[0]['RATING'] = CRatings::GetRatingVoteResult('BLOG_POST', $arResult["IDS"]);
}
示例4: GetRequirementPayload
function GetRequirementPayload($ref)
{
$object = CallAPI($ref);
$requirement = null;
$type = null;
if ($object->HierarchicalRequirement) {
$requirement = $object->HierarchicalRequirement;
$type = "User Story";
} elseif ($object->Task) {
$requirement = $object->Task;
$type = "Task";
} else {
$class = get_class($object);
global $slackCommand;
$userlink = BuildUserLink($slackCommand->UserName);
print_r("Sorry {$userlink}, I can't handle a {$class} yet. I'll let @tdm know about it.");
die;
}
$projecturi = $requirement->Project->_ref;
$title = $requirement->_refObjectName;
$ProjectFull = CallAPI($projecturi);
$projectid = $ProjectFull->Project->ObjectID;
$storyid = $requirement->ObjectID;
$description = $requirement->Description;
$owner = $requirement->Owner->_refObjectName;
$projectName = $requirement->Project->_refObjectName;
$itemid = $requirement->FormattedID;
$created = $requirement->_CreatedAt;
$estimate = $requirement->PlanEstimate;
$hasparent = $requirement->HasParent;
$childcount = $requirement->DirectChildrenCount;
$state = $requirement->ScheduleState;
$blocked = $requirement->Blocked;
$blockedreason = $requirement->BlockedReason;
$ready = $requirement->Ready;
$attachmentcount = $requirement->Attachments->Count;
$firstattachment = null;
if ($attachmentcount > 0) {
$linktxt = GetRallyAttachmentLink($requirement->Attachments->_ref);
$firstattachment = MakeField("attachment", $linktxt, false);
}
$parent = null;
if ($hasparent) {
$parent = $requirement->Parent->_refObjectName;
}
$clean_description = html_entity_decode(strip_tags($description), ENT_HTML401 | ENT_COMPAT, 'UTF-8');
$short_description = TruncateText($clean_description, 300);
$storyuri = "https://rally1.rallydev.com/#/{$projectid}d/detail/userstory/{$storyid}";
$enctitle = urlencode($title);
$linktext = "<{$storyuri}|{$enctitle}>";
$dovegray = "#CEC7B8";
$fields = array(MakeField("link", $linktext, false), MakeField("parent", $parent, false), MakeField("id", $itemid, true), MakeField("owner", $owner, true), MakeField("project", $projectName, true), MakeField("created", $created, true), MakeField("estimate", $estimate, true), MakeField("state", $state, true));
if ($childcount > 0) {
array_push($fields, MakeField("children", $childcount, true));
}
if ($blocked) {
array_push($fields, MakeField("blocked", $blockedreason, true));
}
array_push($fields, MakeField("description", $short_description, false));
if ($firstattachment != null) {
array_push($fields, $firstattachment);
}
global $slackCommand;
$userlink = BuildUserLink($slackCommand->UserName);
$user_message = "Ok {$userlink}, here's the {$type} you requested.";
$obj = new stdClass();
$obj->text = "";
$obj->attachments = MakeAttachment($user_message, "", $dovegray, $fields, $storyuri);
// print_r(json_encode($obj));die;
return $obj;
}
示例5: parse_url
} else {
//FOR SEO
$url_params = parse_url($_SERVER["REQUEST_URI"]);
if (substr($url_params["path"], -1) != "/") {
$url = $url_params["path"] . "/";
if (!empty($url_params["query"])) {
$url .= "?" . $url_params["query"];
}
LocalRedirect($url, false, "301 Moved permanently");
}
}
//SEO
$APPLICATION->SetTitle($arResult["UF_TITLE"]);
$APPLICATION->SetPageProperty("title", trim($arResult["UF_TITLE"] . " " . $arResult["UF_SUB_TITLE"]));
$APPLICATION->SetPageProperty("keywords", implode(", ", $arResult["KEYWORDS"]));
$APPLICATION->SetPageProperty("description", TruncateText($arResult["UF_DESC"], 256));
$APPLICATION->SetDirProperty('og_image', $arResult["PICTURE"]["SRC"]);
$APPLICATION->SetDirProperty('og_type', 'album');
//get status schedule
$arResult["STATUS"] = \Hawkart\Megatv\CScheduleTemplate::status(array("ID" => $arResult["ID"], "UF_CHANNEL_ID" => $arResult["UF_CHANNEL_ID"], "DATE_START" => $arResult["DATE_START"], "DATE_END" => $arResult["DATE_END"]));
foreach (array("UF_DIRECTOR", "UF_PRESENTER", "UF_ACTOR") as $type) {
$_arResult[$type] = array();
$arPeoples = explode(",", $arResult[$type]);
foreach ($arPeoples as $actor) {
$actor = trim($actor);
if (!empty($actor)) {
$link = \Hawkart\Megatv\PeopleTable::getKinopoiskLinkByName($actor);
$link = str_replace("//name", "/name", $link);
if (empty($link)) {
$link = "#";
}
示例6: array
die;
}
}
$rights = "N";
if (CSocNetUser::IsCurrentUserModuleAdmin() || $APPLICATION->GetGroupRight("blog") >= "W") {
$rights = "ALL";
} else {
if (IsModuleInstalled("intranet") && $USER->IsAuthorized()) {
$rights = "OWN";
} else {
if (!IsModuleInstalled("intranet")) {
$rights = $arResult["Perm"] < BLOG_PERMS_FULL ? "OWNLAST" : "ALL";
}
}
}
$arResult["OUTPUT_LIST"] = $APPLICATION->IncludeComponent("bitrix:main.post.list", "", array("RECORDS" => $arResult["RECORDS"], "RESULT" => !!$arResult["ajax_comment"] ? $arResult["ajax_comment"] : $_GET["commentId"], "NAV_STRING" => $arResult["NAV_STRING"], "NAV_RESULT" => $arResult["NAV_RESULT"], "PREORDER" => "N", "RIGHTS" => array("MODERATE" => $arResult["Perm"] >= BLOG_PERMS_MODERATE ? "Y" : "N", "EDIT" => $rights, "DELETE" => $rights), "VISIBLE_RECORDS_COUNT" => $arResult["newCount"], "TEMPLATE_ID" => 'BLOG_COMMENT_BG_', "ENTITY_XML_ID" => $arParams["ENTITY_XML_ID"], "ERROR_MESSAGE" => !!$arResult["ERROR_MESSAGE"] ? $arResult["ERROR_MESSAGE"] : $arResult["COMMENT_ERROR"], "OK_MESSAGE" => $arResult["MESSAGE"], "SHOW_POST_FORM" => $arResult["CanUserComment"] ? "Y" : "N", "SHOW_MINIMIZED" => "Y", "FORM_ID" => $arParams["FORM_ID"], "PUSH&PULL" => array("ACTION" => !empty($_POST["post"]) && $_POST["act"] != "edit" ? "REPLY" : "DOES NOT MATTER", "ID" => $arResult["ajax_comment"]), "IMAGE_SIZE" => $arParams["IMAGE_SIZE"], "mfi" => $arParams["mfi"], "NOTIFY_TAG" => $arParams["bFromList"] ? "BLOG|COMMENT" : "", "NOTIFY_TEXT" => $arParams["bFromList"] ? TruncateText(str_replace(array("\r\n", "\n"), " ", $arParams["POST_DATA"]["~TITLE"]), 100) : "", "PATH_TO_USER" => $arParams["PATH_TO_USER"], "AVATAR_SIZE" => $arParams["AVATAR_SIZE_COMMENT"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams['SHOW_LOGIN'], "LAZYLOAD" => $arParams["LAZYLOAD"]), $this->__component);
if ($_REQUEST["AJAX_POST"] == "Y" && $arParams["ENTITY_XML_ID"] == $_REQUEST["ENTITY_XML_ID"]) {
$GLOBALS["APPLICATION"]->RestartBuffer();
echo CUtil::PhpToJSObject($arResult["OUTPUT_LIST"]["JSON"]);
die;
} else {
?>
<div class="feed-comments-block" id="blg-comment-<?php
echo $arParams["ID"];
?>
"<?php
if (empty($arResult["CommentsResult"])) {
?>
style="display:none;"<?php
}
?>
示例7: makePaymentSelectHtmlBody
public static function makePaymentSelectHtmlBody($data, $selected = '')
{
$result = '';
foreach ($data as $item) {
$result .= '<option value="' . htmlspecialcharsbx($item['ID']) . '"' . ($selected == $item['ID'] ? " selected" : "") . '>' . htmlspecialcharsbx(TruncateText($item['NAME'], 40)) . '</option>';
}
return $result;
}
示例8: GetMessage
{
$arAvailFields[$intCount]['SEP'] = GetMessage('CAT_ADM_CSV_IMP_SEP_PRICES');
$boolSep = false;
}
$intCount++;
}
}
if (isset($arOneCatalogAvailValueFields))
unset($arOneCatalogAvailValueFields);
}
}
for ($i = 0, $intCountDataFileFields = count($arDataFileFields); $i < $intCountDataFileFields; $i++)
{
?><tr>
<td width="40%"><b><? echo GetMessage("CATI_FIELD"); ?> <? echo $i+1; ?></b> (<? echo htmlspecialcharsbx(TruncateText($arDataFileFields[$i], 15)); ?>):</td>
<td width="60%">
<select name="field_<? echo $i; ?>">
<option value="" style="font-weight: bold; text-align: center;"> --- </option>
<?
foreach ($arAvailFields as &$arOneAvailField)
{
if (!empty($arOneAvailField['SEP']))
{
?><option value="" style="font-weight: bold; text-align: center;">--- <? echo htmlspecialcharsex($arOneAvailField['SEP']); ?> ---</option><?
}
if (!empty($arOneAvailField['SUB_SEP']))
{
?><option value="" style="font-style: italic; text-align: center;">--- <? echo htmlspecialcharsex($arOneAvailField['SUB_SEP']); ?> ---</option><?
}
$strStyle = '';
示例9: foreach
if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
$Vars = $cache->GetVars();
foreach ($Vars["arResult"] as $k => $v) {
$arResult[$k] = $v;
}
CBitrixComponentTemplate::ApplyCachedData($Vars["templateCachedData"]);
$cache->Output();
} else {
if ($arParams["CACHE_TIME"] > 0) {
$cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
}
$arResult["TrackBack"] = array();
$dbTrack = CBlogTrackback::GetList(array("POST_DATE" => "DESC"), array("BLOG_ID" => $arPost["BLOG_ID"], "POST_ID" => $arPost["ID"]));
while ($arTrack = $dbTrack->GetNext()) {
if ($arParams["TB_LENGTH"]) {
$arTrack["PREVIEW_TEXT"] = TruncateText($arTrack["PREVIEW_TEXT"], $arParams["TB_LENGTH"]);
}
$arTrack["urlToDelete"] = $APPLICATION->GetCurPageParam("delete_trackback_id=" . $arTrack["ID"], array("sessid", "delete_trackback_id"));
$arTrack["POST_DATE_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arTrack["POST_DATE"], CSite::GetDateFormat("FULL")));
$arResult["TrackBack"][] = $arTrack;
}
$serverName = "";
$dbSite = CSite::GetList($b = "sort", $o = "asc", array("LID" => SITE_ID));
if ($arSite = $dbSite->Fetch()) {
$serverName = $arSite["SERVER_NAME"];
}
if (strlen($serverName) <= 0) {
if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
$serverName = SITE_SERVER_NAME;
} else {
$serverName = COption::GetOptionString("main", "server_name", "");
示例10:
$arPictInfo = CFile::GetFileArray($pictNo);
if (is_array($arPictInfo))
{
if(substr($arPictInfo["SRC"], 0, 1) == "/")
$strFile = "http://".$arAcc['SERVER_NAME'].CHTTP::urnEncode($arPictInfo["SRC"], 'utf-8');
else
$strFile = $arPictInfo["SRC"];
$strTmpOff.="<picture>".$strFile."</picture>\n";
}
}
$strTmpOff.= "<name>".yandex_text2xml($arAcc["~NAME"], true)."</name>\n";
$strTmpOff.=
"<description>".
yandex_text2xml(TruncateText(
($arAcc["PREVIEW_TEXT_TYPE"]=="html"?
strip_tags(preg_replace_callback("'&[^;]*;'", "yandex_replace_special", $arAcc["~PREVIEW_TEXT"])) : preg_replace_callback("'&[^;]*;'", "yandex_replace_special", $arAcc["~PREVIEW_TEXT"])),
255), true).
"</description>\n";
$strTmpOff.= "</offer>\n";
if (100 <= $cnt)
{
$cnt = 0;
CCatalogDiscount::ClearDiscountCache(array(
'PRODUCT' => true,
'SECTIONS' => true,
'PROPERTIES' => true
));
}
}
}
}
示例11: ProcessLogEventEditPOST
//.........这里部分代码省略.........
}
if ($message === '') {
$errors[] = GetMessage('CRM_SL_EVENT_EDIT_EMPTY_MESSAGE');
}
if (empty($errors)) {
$fields = array('ENTITY_TYPE_ID' => $entityTypeID, 'ENTITY_ID' => $entityID, 'USER_ID' => $arResult['USER_ID'], 'TITLE' => $title, 'MESSAGE' => $message, 'RIGHTS' => $arSocnetRights);
$parents = array();
CCrmOwnerType::TryGetOwnerInfos($entityTypeID, $entityID, $parents, array('ENABLE_MAPPING' => true));
foreach ($arEntityData as $entityData) {
$curEntityTypeID = CCrmLiveFeedEntity::ResolveEntityTypeID($entityData['ENTITY_TYPE']);
$curEntityID = $entityData['ENTITY_ID'];
$entityKey = "{$curEntityTypeID}_{$curEntityID}";
if (!isset($parents[$entityKey]) && !($curEntityTypeID === $entityTypeID && $curEntityID === $entityID)) {
$parents[$entityKey] = array('ENTITY_TYPE_ID' => $curEntityTypeID, 'ENTITY_ID' => $curEntityID);
}
}
if (!empty($parents)) {
$fields['PARENTS'] = array_values($parents);
}
if (!empty($attachedFiles)) {
$fields['WEB_DAV_FILES'] = array($webDavFileFieldName => $attachedFiles);
}
$messageID = CCrmLiveFeed::CreateLogMessage($fields);
if (!(is_int($messageID) && $messageID > 0)) {
$errors[] = isset($fields['ERROR']) ? $fields['ERROR'] : 'UNKNOWN ERROR';
} else {
preg_match_all("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/is" . BX_UTF_PCRE_MODIFIER, $message, $arMention);
if (!empty($arMention) && !empty($arMention[1]) && CModule::IncludeModule("im")) {
$arMention = $arMention[1];
$arMention = array_unique($arMention);
$arMessageFields = array("MESSAGE_TYPE" => IM_MESSAGE_SYSTEM, "TO_USER_ID" => "", "FROM_USER_ID" => $arResult['USER_ID'], "NOTIFY_TYPE" => IM_NOTIFY_FROM, "NOTIFY_MODULE" => "crm", "NOTIFY_EVENT" => "mention");
$genderSuffix = "";
$dbUser = CUser::GetByID($arResult['USER_ID']);
if ($arUser = $dbUser->Fetch()) {
switch ($arUser["PERSONAL_GENDER"]) {
case "M":
$genderSuffix = "_M";
break;
case "F":
$genderSuffix = "_F";
break;
default:
$genderSuffix = "";
}
}
$strIMMessageTitle = str_replace(array("\r\n", "\n"), " ", strlen($title) > 0 ? $title : $message);
if (CModule::IncludeModule("blog")) {
$strIMMessageTitle = trim(blogTextParser::killAllTags($strIMMessageTitle));
}
$strIMMessageTitle = TruncateText($strIMMessageTitle, 100);
$strIMMessageTitleOut = TruncateText($strIMMessageTitle, 255);
$strLogEntryURL = COption::GetOptionString("socialnetwork", "log_entry_page", SITE_DIR . "company/personal/log/#log_id#/", SITE_ID);
$strLogEntryURL = CComponentEngine::MakePathFromTemplate($strLogEntryURL, array("log_id" => $messageID));
$strLogEntryCrmURL = CComponentEngine::MakePathFromTemplate(SITE_DIR . "crm/stream/?log_id=#log_id#", array("log_id" => $messageID));
$serverName = (CMain::IsHTTPS() ? "https" : "http") . "://" . (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0 ? SITE_SERVER_NAME : COption::GetOptionString("main", "server_name", ""));
foreach ($arMention as $val) {
$val = IntVal($val);
if ($val > 0 && $val != $arResult['USER_ID']) {
$bHasAccess = false;
if (in_array('U' . $val, $arSocnetRights)) {
$url = $strLogEntryURL;
$bHasAccess = true;
}
if (!$bHasAccess) {
$arAccessCodes = array();
$dbAccess = CAccess::GetUserCodes($val);
while ($arAccess = $dbAccess->Fetch()) {
$arAccessCodes[] = $arAccess["ACCESS_CODE"];
}
$arTmp = array_intersect($arAccess, $arSocnetRights);
if (!empty($arTmp)) {
$url = $strLogEntryURL;
$bHasAccess = true;
}
}
if (!$bHasAccess) {
$userPermissions = CCrmPerms::GetUserPermissions($val);
foreach ($arEntityData as $arEntity) {
if (CCrmAuthorizationHelper::CheckReadPermission(CCrmOwnerType::ResolveName(CCrmLiveFeedEntity::ResolveEntityTypeID($arEntity['ENTITY_TYPE'])), $arEntity['ENTITY_ID'], $userPermissions)) {
$url = $strLogEntryCrmURL;
$bHasAccess = true;
break;
}
}
}
if ($bHasAccess) {
$arMessageFields["TO_USER_ID"] = $val;
$arMessageFields["NOTIFY_TAG"] = "CRM|MESSAGE_MENTION|" . $messageID;
$arMessageFields["NOTIFY_MESSAGE"] = GetMessage("CRM_SL_EVENT_IM_MENTION_POST" . $genderSuffix, array("#title#" => "<a href=\"" . $url . "\" class=\"bx-notifier-item-action\">" . htmlspecialcharsbx($strIMMessageTitle) . "</a>"));
$arMessageFields["NOTIFY_MESSAGE_OUT"] = GetMessage("CRM_SL_EVENT_IM_MENTION_POST" . $genderSuffix, array("#title#" => htmlspecialcharsbx($strIMMessageTitleOut))) . " (" . $serverName . $url . ")";
CIMNotify::Add($arMessageFields);
}
}
}
}
return $messageID;
}
}
return $errors;
}
示例12: GetTemplateList
public static function GetTemplateList($STATUS_ID)
{
$err_mess = (CAllForm::err_mess())."<br>Function: GetTemplateList<br>Line: ";
global $DB, $strError;
$STATUS_ID = intval($STATUS_ID);
if ($STATUS_ID > 0)
{
$arrSITE = array();
$strSql = "
SELECT
F.MAIL_EVENT_TYPE,
FS.SITE_ID
FROM b_form_status F
INNER JOIN b_form_2_site FS ON (FS.FORM_ID = F.FORM_ID)
WHERE
F.ID='".$STATUS_ID."'
";
//echo '<pre>',$strSql,'</pre>';
$z = $DB->Query($strSql,false,$err_mess.__LINE__);
while ($zr = $z->Fetch())
{
$MAIL_EVENT_TYPE = $zr["MAIL_EVENT_TYPE"];
$arrSITE[] = $zr["SITE_ID"];
}
if (strlen($MAIL_EVENT_TYPE) <= 0)
return false;
$arReferenceId = array();
$arReference = array();
$arFilter = Array(
"ACTIVE" => "Y",
"SITE_ID" => $arrSITE,
"EVENT_NAME" => $MAIL_EVENT_TYPE
);
$e = CEventMessage::GetList($by="id", $order="asc", $arFilter);
while ($er=$e->Fetch())
{
if (!in_array($er["ID"], $arReferenceId))
{
$arReferenceId[] = $er["ID"];
$arReference[] = "(".$er["LID"].") ".TruncateText($er["SUBJECT"],50);
}
}
$arr = array("reference"=>$arReference,"reference_id"=>$arReferenceId);
return $arr;
}
return false;
}
示例13: TruncateText
<!-- <div class="item-photo">
<a href="#"><img src="img/placeholder.jpeg"></a>
</div>
-->
<div class="item-text">
<h3 class="item-title"><a href="i_viewitem.php?item_id=<?php
echo $item['item_id'];
?>
"><?php
echo $item['item_title'];
?>
</a></h3>
<?php
$description = $item['item_description'];
$description = TruncateText($description, 100);
?>
<p class="item-description"><?php
echo $description;
?>
</p>
<span class="pill-text">
<a href="i_school.php?school_id=<?php
echo $user_info['school_id'];
?>
&category=<?php
echo $item['cat_name'];
?>
">
<?php
echo $item['cat_name'];
示例14: array
// navigation setup
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("SEARCH_PHL_PHRASES")));
$aContext = array();
$lAdmin->AddAdminContextMenu($aContext);
$arHeaders = array(array("id" => "ID", "content" => GetMessage("SEARCH_PHL_ID"), "sort" => "ID", "default" => true, "align" => "right"), array("id" => "SITE_ID", "content" => GetMessage("SEARCH_PHL_SITE_ID"), "default" => true), array("id" => "PHRASE", "content" => GetMessage("SEARCH_PHL_PHRASE"), "sort" => "PHRASE", "default" => true), array("id" => "TAGS", "content" => GetMessage("SEARCH_PHL_TAGS"), "sort" => "TAGS", "default" => true), array("id" => "TIMESTAMP_X", "content" => GetMessage("SEARCH_PHL_TIMESTAMP_X"), "sort" => "TIMESTAMP_X", "default" => true), array("id" => "URL_TO", "content" => GetMessage("SEARCH_PHL_URL_TO"), "sort" => "URL_TO", "default" => true), array("id" => "RESULT_COUNT", "content" => GetMessage("SEARCH_PHL_RESULT_COUNT"), "sort" => "RESULT_COUNT", "default" => true, "align" => "right"), array("id" => "PAGES", "content" => GetMessage("SEARCH_PHL_PAGES"), "title" => GetMessage("SEARCH_PHL_PAGES_ALT"), "sort" => "PAGES", "default" => true, "align" => "right"));
if (IsModuleInstalled('statistic')) {
$arHeaders[] = array("id" => "STAT_SESS_ID", "content" => GetMessage("SEARCH_PHL_STAT_SESS_ID"), "sort" => "STAT_SESS_ID", "default" => true, "align" => "right");
}
$lAdmin->AddHeaders($arHeaders);
$i = 0;
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes);
if ($_REQUEST["mode"] != "excel") {
$row->AddViewField("TIMESTAMP_X", str_replace(" ", " ", $f_TIMESTAMP_X));
}
$row->AddViewField("URL_TO", ($f_URL_TO_SITE_ID ? "[" . $f_URL_TO_SITE_ID . "] " : "") . "<a " . ($f_URL_TO_404 == "Y" ? 'style="color:red"' : '') . " title=\"" . GetMessage("SEARCH_PHL_LINK_OPEN") . "\" href=\"{$f_URL_TO}\">" . TruncateText(InsertSpaces($f_URL_TO, 50, "<wbr>"), 100) . "</a> ");
$row->AddViewField("STAT_SESS_ID", "<a title=\"" . GetMessage("SEARCH_PHL_SESSION") . "\" href=\"session_list.php?lang=" . LANGUAGE_ID . "&find_id={$f_STAT_SESS_ID}&find_id_exact_match=Y&set_filter=Y\">{$f_STAT_SESS_ID}</a> ");
}
$lAdmin->AddFooter(array(array("title" => GetMessage("MAIN_ADMIN_LIST_SELECTED"), "value" => $rsData->SelectedRowsCount())));
$lAdmin->CheckListMode();
/***************************************************************************
HTML form
****************************************************************************/
$APPLICATION->SetTitle(GetMessage("SEARCH_PHL_TITLE"));
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
?>
<form name="form1" method="GET" action="<?php
echo $APPLICATION->GetCurPage();
?>
">
示例15: OnSendMentionGetEntityFields_Forum
public static function OnSendMentionGetEntityFields_Forum($arCommentFields)
{
if ($arCommentFields["EVENT_ID"] != "forum") {
return false;
}
$dbLog = CSocNetLog::GetList(array(), array("ID" => $arCommentFields["LOG_ID"], "EVENT_ID" => "forum"), false, false, array("ID", "TITLE"));
if ($arLog = $dbLog->Fetch()) {
$genderSuffix = "";
$dbUsers = CUser::GetList($by = "ID", $order = "desc", array("ID" => $arCommentFields["USER_ID"]), array("PERSONAL_GENDER", "LOGIN", "NAME", "LAST_NAME", "SECOND_NAME"));
if ($arUser = $dbUsers->Fetch()) {
$genderSuffix = $arUser["PERSONAL_GENDER"];
}
$strPathToLogEntry = str_replace("#log_id#", $arLog["ID"], COption::GetOptionString("socialnetwork", "log_entry_page", "/company/personal/log/#log_id#/", SITE_ID));
$strPathToLogEntryComment = $strPathToLogEntry . (strpos($strPathToLogEntry, "?") !== false ? "&" : "?") . "commentID=" . $arCommentFields["ID"];
$title = str_replace(array("\r\n", "\n"), " ", $arLog["TITLE"]);
$title = TruncateText($title, 100);
$title_out = TruncateText($title, 255);
$arReturn = array("URL" => $strPathToLogEntryComment, "NOTIFY_TAG" => "FORUM|COMMENT_MENTION|" . $arCommentFields["ID"], "NOTIFY_MESSAGE" => GetMessage("SONET_GLC_FORUM_MENTION" . (strlen($genderSuffix) > 0 ? "_" . $genderSuffix : ""), array("#title#" => "<a href=\"#url#\" class=\"bx-notifier-item-action\">" . $title . "</a>")), "NOTIFY_MESSAGE_OUT" => GetMessage("SONET_GLC_FORUM_MENTION" . (strlen($genderSuffix) > 0 ? "_" . $genderSuffix : ""), array("#title#" => $title_out)) . " (" . "#server_name##url#)");
return $arReturn;
} else {
return false;
}
}