последняя 1.10.1
открывайте файл /templates/_default_/components/com_blog_edit_post.tpl
находите строка примерно 72
<td colspan="2">
<div class="usr_msg_bbcodebox">{$bb_toolbar}</div>
{$smilies}
{$autogrow}
заменяете чтобы стало так:
<td colspan="2">
{if !$is_admin}
<div class="usr_msg_bbcodebox">{$bb_toolbar}</div>
{$smilies}
{/if}
{$autogrow}
сохраняет файл
и открываете другой /core/classes/blog.class.php
в нем находите две одноименные функции и заменяете на те что приводятся ниже:
public function addPost($item){
$item = cmsCore::callEvent('ADD_POST', $item);
$inUser = cmsUser::getInstance();
//парсим bb-код перед записью в базу
// Парсим по отдельности части текста, если есть тег [cut
$parse_bb = $inUser->is_admin ? false : true;
$msg_to = $this->getPostShort($item['content']);
$msg_to = cmsCore::parseSmiles($msg_to, $parse_bb);
$msg_after = $this->getPostShort($item['content'], false, true);
$msg_after = cmsCore::parseSmiles($msg_after, $parse_bb);
$cut = $this->getPostCut($item['content']);
$item['content_html'] = $msg_to . $cut . $msg_after;
} else {
$item['content_html'] = cmsCore::parseSmiles($item['content'], $parse_bb);
}
// Экранируем специальные символы
if ( $parse_bb ) {
$item['content'] = cmsDatabase::escape_string($item['content']);
$item['content_html'] = cmsDatabase::escape_string($item['content_html']);
}
$post_id = $this->inDB->insert('cms_blog_posts', $item);
if(!$post_id) { return false; }
cmsInsertTags($item['tags'], $this->getTarget('tags'), $post_id);
$item['id'] = $post_id;
$item['seolink'] = $this->generatePostSeoLink($item);
$this->inDB->query("UPDATE cms_blog_posts SET seolink='{$item['seolink']}' WHERE id = '{$post_id}'");
if ($item['published']){
cmsUser::checkAwards($item['user_id']);
cmsCore::callEvent('ADD_POST_DONE', $item);
}
cmsCore::setIdUploadImage('post', $post_id);
return array('id'=>$post_id, 'seolink'=>$item['seolink']);
}
public function updatePost($post_id, $item, $update_seo_link = false){
$item['id'] = $post_id;
$item = cmsCore::callEvent('UPDATE_POST', $item);
$inUser = cmsUser::getInstance();
$parse_bb = $inUser->is_admin ? false : true;
if ($update_seo_link){
$item['seolink'] = $this->generatePostSeoLink($item);
}
$msg_to = $this->getPostShort($item['content']);
$msg_to = cmsCore::parseSmiles($msg_to, $parse_bb);
$msg_after = $this->getPostShort($item['content'], false, true);
$msg_after = cmsCore::parseSmiles($msg_after, $parse_bb);
$cut = $this->getPostCut($item['content']);
$item['content_html'] = $msg_to . $cut . $msg_after;
} else {
$item['content_html'] = cmsCore::parseSmiles($item['content'], $parse_bb);
}
if ( $parse_bb ) {
$item['content'] = cmsDatabase::escape_string($item['content']);
$item['content_html'] = cmsDatabase::escape_string($item['content_html'] . 'парсер сработал');
}
$this->inDB->update('cms_blog_posts', $item, $post_id);
cmsInsertTags($item['tags'], $this->getTarget('tags'), $post_id);
return isset($item['seolink']) ?
$item['seolink'] : true;
}