本文整理汇总了PHP中reformat2函数的典型用法代码示例。如果您正苦于以下问题:PHP reformat2函数的具体用法?PHP reformat2怎么用?PHP reformat2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了reformat2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SendAdminMessage
/**
* Отправляет сообщение от администрации группе юзеров, определенных в модуле /siteadmin/admin/. Вызвается из hourly.php.
*
* Чтобы сообщение было отправлено нужно его занести в таблицу messages с полем to_id равным 0 и,
* по необходимости, определить какому виду пользователей нужно отправить сообщение.
* Кроме того, далее необходимо зарегистрировать данное сообщение в таблице переменных variables, переменной
* с именем 'admin_message_id' со значением идентификатором отправляемого сообщения.
* Отправляет уведомление о новом сообщении в личке ("Мои контакты").
*
* @return string возможная ошибка
*/
public function SendAdminMessage()
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/spam.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages.php';
if (!($message_id = spam::GetAdminMessageID())) {
return "Не зарегистрировано ни одного сообщения от администрации (таблица 'variables', имя переменной 'admin_message_id').";
}
if (!($message = messages::GetMessage($message_id))) {
return 'Тело сообщения отсутствует.';
}
$this->subject = 'Новое сообщение от Команды FL.ru';
$msg_text = reformat2($message['msg_text'], 100);
$attaches = array();
if ($message['attach']) {
foreach ($message['attach'] as $a) {
$attaches[] = new CFile($a['path'] . $a['fname']);
}
$attaches = $this->CreateAttach($attaches);
}
if (!$this->Connect()) {
return 'Невозможно соеденится с SMTP сервером';
}
for ($i = 0; $users = messages::GetZeroMessageUsers($message['from_id'], $message_id, 1000, $i * 1000); ++$i) {
foreach ($users as $ikey => $user) {
if (!$user['email'] || substr($user['subscr'], 7, 1) == '0') {
continue;
}
$this->recipient = $user['uname'] . ' ' . $user['usurname'] . ' [' . $user['login'] . '] <' . $user['email'] . '>';
$this->message = $this->GetHtml($user['uname'], $msg_text, array('header' => 'none', 'footer' => 'none'));
$this->SmtpMail('text/html', $attaches);
}
}
return '';
}
示例2: initHtmlData
/**
* @see parent::initHtmlData
*/
public function initHtmlData()
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
$pid = $this->parseLinks();
if ($pid) {
$pid = array_map('intval', $pid);
$stop_words = new stop_words();
$projects = new_projects::getProjectsById($pid);
foreach ($projects as $i => $project) {
$sTitle = $project['moderator_status'] === '0' && $project['kind'] != 4 && $project['is_pro'] != 't' ? $stop_words->replace($project['name']) : $project['name'];
$projects[$i]['sTitle'] = reformat2($sTitle, 30, 0, 1);
$projects[$i]['friendly_url'] = $this->getLinkById($project['id']);
$projects[$i]['str_cost'] = $project['cost'] ? CurToChar($project['cost'], $project['currency']) . getPricebyProject($project['priceby']) : 'По договоренности';
}
$this->html_data = $projects;
}
}
示例3: reformat2
</td>
</tr>
</table>
<input name="id" type="hidden" value="<?php
echo $ps['id'];
?>
"/>
<input name="action" type="hidden" value="Decide"/>
</form>
<?php
} else {
if ($om == masssending::OM_DENIED && $ps['denied_reason']) {
?>
<div style="margin:25px 0 2px 0"><b>Причина отказа:</b></div>
<div><?php
echo reformat2($ps['denied_reason'], 30, 0, 1);
?>
</div>
<?php
}
}
?>
</td>
</tr>
<tr valign="top">
<td colspan="2" style="border-bottom:1px solid #c0c0c0;padding-top:15px"> </td>
</tr>
<tr valign="top">
<td colspan="2" style="padding-top:30px"> </td>
</tr>
<?php
示例4: view_cost2
if ($user->cost_month > 0) {
?>
<div style="padding-bottom:15px;vertical-align:top;white-space:nowrap;"><strong>Стоимость месяца работы</strong> — <span class="money"><?php
echo view_cost2($user->cost_month, '', '', false, $user->cost_type_month);
?>
</span></div>
<?php
}
?>
</td>
<?php
$sSpecText = $user->isChangeOnModeration($user->uid, 'spec_text') && $user->is_pro != 't' ? $stop_words->replace($user->spec_text) : $user->spec_text;
?>
<td style="width:55%;vertical-align:top;padding:16px 19px 32px 16px;"><a name="spec_text"></a>
<?php
echo reformat2($sSpecText, 30, 0, 1);
?>
<?php
if (hasPermissions('users')) {
?>
<br/>
<br/>
<a class="admn" href="javascript:void(0);" onclick="adm_edit_content.editContent('admEditProfile', '<?php
echo $user->uid;
?>
_0', 0, '', {'change_id': 0, 'ucolumn': 'spec_text', 'utable': 'freelancer'})">Редактировать</a>
<?php
}
?>
</td>
</tr>
示例5: EditFav
function EditFav($msg_id, $priority = 0, $title = '', $action = 'edit')
{
global $session;
session_start();
$user_id = $_SESSION['uid'];
$objResponse = new xajaxResponse();
$msg_id = intval($msg_id);
$GLOBALS['xajax']->setCharEncoding('windows-1251');
$sort = $_COOKIE['commune_fav_order'] != '' ? $_COOKIE['commune_fav_order'] : 'date';
$action = trim($action);
$title = trim($title);
switch ($action) {
case 'update':
$title = substr($title, 0, 128);
$updatefav = commune::AddFav($msg_id, $user_id, 0, $priority, $title);
$editfav = current(commune::GetFavorites($user_id, $msg_id, $sort));
$key = $msg_id;
$om = '';
$outHTML = __commPrntFavContent($editfav, $key, $user_id, $om);
$objResponse->assign('fav' . $msg_id, 'innerHTML', $outHTML);
break;
case 'edit':
$editfav = current(commune::GetFavorites($user_id, $msg_id, $sort));
//$editfav = current($editfav);
$editfav['title'] = preg_replace('/<br.*?>/mix', "\r\n", stripslashes(reformat2($editfav['title'], 20, 0, 1)));
$outHTML = '<table border="0" cellpadding="1" cellspacing="0"><tbody><tr valign="top"><td style="padding-left: 3px;">';
$outHTML .= '<ul class="post-f-fav-sel">';
$outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $msg_id . "-0' width=\"15\" height=\"15\" src=\"" . ($editfav['priority'] == 0 ? commune::getStarByPR(0) : commune::getEmptyStarByPR(0)) . "\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriority({$msg_id}, 0)\" style=\"cursor:pointer;\"></li>";
$outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $msg_id . "-1' width=\"15\" height=\"15\" src=\"" . ($editfav['priority'] == 1 ? commune::getStarByPR(1) : commune::getEmptyStarByPR(1)) . "\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriority({$msg_id}, 1)\" style=\"cursor:pointer;\"></li>";
$outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $msg_id . "-2' width=\"15\" height=\"15\" src=\"" . ($editfav['priority'] == 2 ? commune::getStarByPR(2) : commune::getEmptyStarByPR(2)) . "\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriority({$msg_id}, 2)\" style=\"cursor:pointer;\"></li>";
$outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $msg_id . "-3' width=\"15\" height=\"15\" src=\"" . ($editfav['priority'] == 3 ? commune::getStarByPR(3) : commune::getEmptyStarByPR(3)) . "\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriority({$msg_id}, 3)\" style=\"cursor:pointer;\"></li>";
$outHTML .= '</ul></td><td>';
$outHTML .= '<div class="fav-one-edit-txt">';
$outHTML .= "<INPUT id='favpriority" . $msg_id . "' type='hidden' value='" . $editfav['priority'] . "'>";
$outHTML .= "<INPUT id='currtitle' type='hidden' value='" . $editfav['title'] . "'>";
$outHTML .= "<textarea rows=\"3\" cols=\"7\" id='favtext" . $msg_id . "'>{$editfav['title']}</textarea>";
$outHTML .= '<div class="fav-one-edit-btns">';
$outHTML .= "<INPUT type='button' value='Сохранить' onClick='if(document.getElementById(\"favtext" . $msg_id . '").value.length>128){alert("Слишком длинное название закладки!");return false;}else{xajax_EditFav(' . $msg_id . ', document.getElementById("favpriority' . $msg_id . '").value, document.getElementById("favtext' . $msg_id . "\").value, \"update\");}'>";
$outHTML .= "<INPUT type='button' value='Отмена' onClick='xajax_EditFav(" . $msg_id . ', ' . $editfav['priority'] . ", document.getElementById(\"currtitle\").value, \"default\");'>";
$outHTML .= '</div></td></tr></tbody></table>';
$objResponse->assign('fav' . $msg_id, 'innerHTML', $outHTML);
break;
default:
$editfav = current(commune::GetFavorites($user_id, $msg_id, $sort));
$key = $msg_id;
$om = '';
$outHTML = __commPrntFavContent($editfav, $key, $user_id, $om);
$objResponse->assign('fav' . $msg_id, 'innerHTML', $outHTML);
break;
}
$objResponse->script('communeObj.initFavs();');
return $objResponse;
}
示例6: reformat
?>
"><?php
echo reformat($work['name'], 17, 0, 1);
?>
</a></h4>
<a href="/users/<?php
echo $frl['login'];
?>
/viewproj.php?prjid=<?php
echo $work['id'];
?>
&f=<?php
echo stat_collector::REFID_CATALOG;
?>
" target="_blank" title="<?php
echo reformat2($work['name'], null, null, 1);
?>
">
<?php
echo view_preview($frl['login'], $work['prev_pict'], "upload", $align, true, true, '', 200);
?>
</a>
</td>
<?php
}
//else
?>
<?php
}
//if
示例7: reformat2
echo reformat2($sName, 30, 0, 1);
?>
<?php
}
//else
?>
</h3>
<?php
// ТЕКСТ ПРОЕКТА
?>
<div class="prj-full-display">
<div class="utxt">
<p id="boldPrvw">
<?php
echo reformat2($project['descr'], 40, 0, 1);
?>
</p>
<?php
if (count($project['attaches'])) {
?>
<div style="padding:10px 0 0 0">
<?php
foreach ($project['attaches'] as $a) {
?>
<div class="flw_offer_attach">
<?php
if ($a['virus'] & 1 == 1) {
?>
<a href="" onclick="alert('Обнаружен вирус. Файл удален.');return false;" target="_blank">Загрузить</a>
示例8: str_replace
<div id="commune-reason-<?php
echo $id;
?>
" class="block-box" style="display: none; overflow:hidden;"> </div>
<?php
}
?>
</ul>
</div>
<div class="b-layout__txt b-layout__txt_padbot_20 b-layout__txt_lineheight_18">
<?php
$comm['descr'] = str_replace("\r\n", "\r", $comm['descr']);
?>
<?php
echo reformat2($comm['descr'], 25, 1);
?>
</div>
<?php
// разделы
?>
<?php
//include_once(dirname(__FILE__).'/categories.php');
?>
<div class="b-menu b-menu_padbot_20 b-menu_vertical">
<h3 class="b-menu__title b-menu__title_bold b-menu__title_padbot_10">Разделы</h3>
<?php
if (!$comm['is_blocked'] && $user_mod & (commune::MOD_COMM_AUTHOR | commune::MOD_COMM_ADMIN | commune::MOD_COMM_MODERATOR) || hasGroupPermissions('administrator')) {
示例9: array
<?php
$crumbs = array(array('href' => '/' . sbr::NEW_TEMPLATE_SBR . '/', 'name' => '«Мои Сделки»'), array('href' => '/' . sbr::NEW_TEMPLATE_SBR . '/?id=' . $sbr->id, 'name' => reformat2($sbr->data['name'])), array('href' => '', 'name' => 'Резервирование денег'));
include $_SERVER['DOCUMENT_ROOT'] . '/sbr/tpl.sbr-crumbs.php';
include $_SERVER['DOCUMENT_ROOT'] . '/sbr/tpl.stage-user.php';
?>
<table class="b-layout__table b-layout__table_width_full" cellspacing="0" cellpadding="0" border="0">
<tbody><tr class="b-layout__tr">
<td class="b-layout__left b-layout__left_width_72ps"><div class="b-fon b-fon_width_full">
<div class="b-fon__body b-fon__body_pad_10 b-fon__body_padleft_30 b-fon__body_fontsize_13 b-fon__body_bg_f0ffdf">
<div class="b-layout__txt b-layout__txt_padbot_10"><span class="b-icon b-icon_sbr_gok b-icon_margleft_-25"></span>Деньги успешно зарезервированы. Исполнитель получит уведомление.<br />
Перейти <a class="b-fon__link" href="<?php
echo '/' . sbr::NEW_TEMPLATE_SBR . '/?site=Stage&id=' . $sbr->stages[0]->id;
?>
"><?php
echo count($sbr->stages) == 1 ? 'на страницу сделки' : 'в первый этап сделки';
?>
</a>.</div>
<div class="b-layout__txt">Если у вас возникнут вопросы, обращайтесь в <a class="b-layout__link" href="/about/feedback/">службу поддержки</a> или к <?php
echo webim_button(2, 'онлайн-консультанту', 'b-layout__link');
?>
.</div>
</div>
</div></td>
<td class="b-layout__right"></td>
</tr>
</tbody>
</table>
示例10: getFriendlyURL
?>
<?php
} else {
?>
<?php
if ($top['pos']) {
?>
<img src="/images/tp-w.gif" alt="" style=""><?php
}
?>
<a class="b-post__link" href='<?php
echo getFriendlyURL('commune', $msg_id);
echo $page > 1 ? '?bp=' . $page : '';
?>
'><?php
echo reformat2($sTitle, $title_max, 0, 1);
?>
</a>
<?php
}
?>
</h3>
<?php
}
?>
<?php
// seo_start(!$hideInJS)
?>
<?php
//Сообщение поста
示例11: __lentaPrntFavContent
/**
* Вывод одной закладки в блоке
* @see __lentaPrntFavs()
*
* @param array $fav закладка
* @param mixed $key ключ (ид) закладки
* @param integer $user_id ИД пользователя
* @param integer $om Для навигации
* @return string HTML
*/
function __lentaPrntFavContent($fav, $key, $user_id, $pfx, $fav_href)
{
global $stars;
$stars = array(0 => 'bsg.png', 1 => 'bsgr.png', 2 => 'bsy.png', 3 => 'bsr.png');
ob_start();
?>
<img src="/images/bookmarks/<?php
echo $stars[$fav['priority']];
?>
" alt="" id="curfavstar<?php
echo $pfx . $key;
?>
" />
<input id="favpriority<?php
echo $pfx . $key;
?>
" value="<?php
echo $fav['priority'];
?>
" type="hidden" />
<div class="bm-l">
<a href=""><img src="/images/ico_edit2.gif" alt="Редактировать закладку" onclick="if(!$('fav<?php
echo $pfx . $key;
?>
edit')) { xajax_Lenta_EditFav('<?php
echo $key;
?>
', 0, '', 'edit', '<?php
echo $pfx;
?>
'); } return false;" /></a>
<a href=""><img src="/images/ico_close2.gif" alt="Удалить из закладок" onClick="if(confirm('Удалить закладку?')) xajax_Lenta_AddFav(<?php
echo $key;
?>
, '<?php
echo $pfx;
?>
', <?php
echo $user_id;
?>
, 1); return false;" /></a>
</div>
<span><a href="<?php
echo $fav_href;
?>
"><?php
echo $fav['title'] ? reformat2($fav['title'], 18, 1, 1) : '<без темы>';
?>
</a></span>
<!--
<table border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr valign="top">
<td style="width:10px"><img alt="" src="/images/ico_star_<?php
echo $fav['priority'];
?>
.gif" align="absmiddle" border="0" width="15" height="15">
<input id="favpriority<?php
echo $pfx . $key;
?>
" value="<?php
echo $fav['priority'];
?>
" type="hidden">
</td>
<td style="width: 214px;"><a class="blue" href="<?php
echo $fav_href;
?>
"><?php
echo $fav['title'] ? stripslashes(reformat2($fav['title'], 18, 1, 1)) : '<без темы>';
?>
</a> <nobr>
<img style="cursor:pointer;" src="/images/ico_close2.gif" alt="Удалить из закладок" onClick="if(confirm('Удалить закладку?')) xajax_Lenta_AddFav(<?php
echo $key;
?>
, '<?php
echo $pfx;
?>
', <?php
echo $user_id;
?>
, 1)">
<img style="cursor:pointer;" src="/images/ico_edit2.gif" alt="Редактировать закладку" onclick="xajax_Lenta_EditFav('<?php
echo $key;
?>
', 0, '', 'edit', '<?php
echo $pfx;
?>
')"></nobr>
</td>
//.........这里部分代码省略.........
示例12: strlen
$adUid = $ppAd['uid'];
$adLogin = $toppay_usr[$adUid]['login'];
$adLink = '/users/' . $toppay_usr[$adUid]['login'] . '/?f=6&stamp=' . $_SESSION['stamp'];
$cls = "b-carusel__pic";
if ($ppAd['ad_img_file_name'] && $ppAd['ad_img_file_name'] != '/images/temp/small-pic.gif') {
$adImg = '<img width=50 height=50 src="' . WDCPREFIX . '/users/' . $adLogin . '/foto/' . $ppAd['ad_img_file_name'] . '" alt="' . $adLogin . '" class="' . $cls . '" border="0" />';
} else {
$adImg = '<img width=50 height=50 src="' . WDCPREFIX . '/images/user-default-small.png" class="' . $cls . '" border="0" />';
}
if (is_array($pp_h[$adUid])) {
$adHeader = $ppAd['ad_header'] ? $ppAd['ad_header'] : $pp_h[$adUid]['title'];
$adHeaderDots = strlen(html_entity_decode($adHeader, ENT_QUOTES)) > 22;
$adHeader = htmlentities(substr(html_entity_decode($adHeader, ENT_QUOTES), 0, 22), ENT_QUOTES, 'CP1251');
$adText = $ppAd['ad_text'] ? $ppAd['ad_text'] : $pp_h[$adUid]['descr'];
$adText = $pp_h[$adUid]['on_moder'] ? $stop_words->replace($adText) : $adText;
$adText = reformat2($adText, 22, 1, 1);
}
?>
<li class="b-carusel__item">
<?php
if (is_array($pp_h[$adUid])) {
?>
<a class="b-carusel__piclink" href="<?php
echo $adLink;
?>
" onClick="<?php
echo $yaM;
?>
">
<?php
echo $adImg;
示例13: reformat2
} else {
?>
<img class="b-post__pic b-post__pic_float_right b-post__pic_clear_right b-post__pic_margleft_10" src="<?php
echo WDCPREFIX . '/' . $prj['logo_path'] . $prj['logo_name'];
?>
" />
<?php
}
?>
<?php
}
?>
<div class="b-post__body b-post__body_padtop_15 b-post__body_padbot_10">
<div class="b-post__txt">
<?php
echo reformat2(LenghtFormatEx($prj['descr'], 300), 50, 1, 0, 1);
?>
</div>
</div>
<?php
if ($prj['pro_only'] != 't' || $is_pro) {
$i = 0;
if ($attach = projects::GetAllAttach($prj['id'])) {
foreach ($attach as $a) {
if ($a['name']) {
?>
<div class="flw_offer_attach"><a href="<?php
echo WDCPREFIX . '/' . $a['path'] . $a['name'];
?>
" target="_blank">Загрузить</a> (<?php
echo $a['ftype'];
示例14: reformat2
// | commune::MOD_COMM_MODERATOR | commune::MOD_COMM_AUTHOR)))
print '<br/><br/>';
if (($comment['member_is_banned'] || $comment['user_is_banned']) && !($mod & commune::MOD_MODER)) {
// | commune::MOD_COMM_MODERATOR | commune::MOD_COMM_AUTHOR)))
print 'Ответ от заблокированного пользователя';
} else {
if ($is_deleted) {
print '<font class="del-color">';
}
if ($comment['user_is_banned'] || $comment['member_is_banned']) {
print '<font color="#000000"><b>Пользователь забанен' . (!$top['user_is_banned'] ? ' в сообществе' : '') . '.</b></font><br/><br/>';
}
if ($comment['title']) {
print '<font class="bl_name">' . reformat2($comment['title'], 25, 0, 1) . '</font><br>';
}
print reformat2($comment['msgtext'], 82 - round((($level > 19 ? 19 : $level) - 1) * 1.9), 0, -($comment['user_is_chuck'] == 't'), 1) . '<br/>';
if ($comment['youtube_link']) {
print show_video($comment['id'], $comment['youtube_link']);
}
if ($comment['attach']) {
//$commune['attach'] = array_reverse($commune['attach']);
foreach ($comment['attach'] as $attach) {
$att_ext = CFile::getext($attach['fname']);
$str = '';
$str = viewattachLeft($comment['user_login'], $attach['fname'], 'upload', $file, commune::MSG_IMAGE_MAX_HEIGHT, commune::_MSG_IMAGE_MAX_WIDTH, commune::MSG_IMAGE_MAX_SIZE, !($attach['small'] == 't'), (int) ($attach['small'] == 't'));
print "<br/><br/>" . $str . "<br/>";
}
}
if ($is_deleted) {
print '</font>';
}
示例15: echo
echo $prj['id'];
?>
" is_text="<?php
echo (int) ($prj['prj_prev_type'] == 1);
?>
">
<?php
if ($wrk_show_preview == 't') {
?>
<?php
if ($is_pro) {
if ($prj['gr_prevs'] == 't') {
if ($prj['prj_prev_type']) {
?>
<div style="width:200px"><?php
echo reformat2($prj['descr'], 27);
?>
</div></div>
<?php
} else {
?>
<div style="width:200px;height:200px;text-align:left;vertical-align:top;"><a href="/users/<?php
echo $user->login;
?>
/viewproj.php?prjid=<?php
echo $prj['id'];
?>
" target="_blank" class="blue"><?php
echo view_preview($user->login, $prj['prev_pict'], 'upload', 'left', false, false, '', 200);
?>
</a></div>