1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-17 08:18:18 +03:00

добавлен новый тип топика: ссылка

This commit is contained in:
Mzhelskiy Maxim 2008-09-28 10:45:18 +00:00
parent 5ace24ded1
commit 8c0616e872
21 changed files with 709 additions and 54 deletions

View file

@ -0,0 +1,466 @@
<?
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Обработка УРЛа вида /link/ - управление своими топиками(тип: ссылка)
*
*/
class ActionLink extends Action {
/**
* Меню
*
* @var unknown_type
*/
protected $sMenuItemSelect='link';
/**
* СубМеню
*
* @var unknown_type
*/
protected $sMenuSubItemSelect='add';
/**
* Текущий юзер
*
* @var unknown_type
*/
protected $oUserCurrent=null;
/**
* Инициализация
*
* @return unknown
*/
public function Init() {
/**
* Проверяем авторизован ли юзер
*/
if (!$this->User_IsAuthorization()) {
$this->Message_AddErrorSingle('Для того чтобы что то написать, сначало нужно войти под своим аккаунтом.','Нет доступа');
return Router::Action('error');
}
$this->oUserCurrent=$this->User_GetUserCurrent();
$this->SetDefaultEvent('add');
$this->Viewer_AddHtmlTitle('Ссылки');
}
/**
* Регистрируем евенты
*
*/
protected function RegisterEvent() {
$this->AddEvent('add','EventAdd');
$this->AddEvent('edit','EventEdit');
$this->AddEvent('go','EventGo');
}
/**********************************************************************************
************************ РЕАЛИЗАЦИЯ ЭКШЕНА ***************************************
**********************************************************************************
*/
/**
* Переход по ссылке
*
* @return unknown
*/
protected function EventGo() {
/**
* Получаем номер топика из УРЛ и проверяем существует ли он
*/
$sTopicId=$this->GetParam(0);
if (!$oTopic=$this->Topic_GetTopicById($sTopicId,$this->oUserCurrent)) {
return parent::EventNotFound();
}
/**
* проверяем является ли топик ссылкой
*/
if ($oTopic->getType()!='link') {
return parent::EventNotFound();
}
/**
* увелививаем число переходов по ссылке
*/
$oTopic->setLinkCountJump($oTopic->getLinkCountJump()+1);
$this->Topic_UpdateTopic($oTopic);
/**
* собственно сам переход по ссылке
*/
func_header_location($oTopic->getLinkUrl());
}
/**
* Редактирование ссылки
*
* @return unknown
*/
protected function EventEdit() {
/**
* Меню
*/
$this->sMenuSubItemSelect='';
$this->sMenuItemSelect='';
/**
* Получаем номер топика из УРЛ и проверяем существует ли он
*/
$sTopicId=$this->GetParam(0);
if (!$oTopic=$this->Topic_GetTopicById($sTopicId,$this->oUserCurrent)) {
return parent::EventNotFound();
}
/**
* проверяем кто владелец топика
*/
if ($oTopic->getUserId()!=$this->oUserCurrent->getId()) {
return parent::EventNotFound();
}
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocksRight(array('block.blogInfo.tpl'));
/**
* Получаем данные для отображения формы
*/
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
$aAllowBlogsUser=array();
foreach ($aBlogsUser as $oBlogUser) {
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
// делаем через "or" чтоб дать возможность юзеру отредактировать свой топик в блоге в котором он уже не может постить, т.е. для тех топиков что были запощены раньше и был доступ в блог
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) or $oTopic->getBlogId()==$oBlog->getId()) {
$aAllowBlogsUser[]=$oBlogUser;
}
}
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('aBlogsUser',$aAllowBlogsUser);
$this->Viewer_Assign('aBlogsOwner',$aBlogsOwner);
$this->Viewer_AddHtmlTitle('Редактирование ссылки');
/**
* Устанавливаем шаблон вывода
*/
$this->SetTemplateAction('add');
/**
* Проверяем отправлена ли форма с данными(хотяб одна кнопка)
*/
if (isset($_REQUEST['submit_topic_publish']) or isset($_REQUEST['submit_topic_save'])) {
/**
* Обрабатываем отправку формы
*/
return $this->SubmitEdit($oTopic);
} else {
/**
* Заполняем поля формы для редактирования
* Только перед отправкой формы!
*/
$_REQUEST['topic_title']=$oTopic->getTitle();
$_REQUEST['topic_link_url']=$oTopic->getLinkUrl();
$_REQUEST['topic_text']=$oTopic->getTextSource();
$_REQUEST['topic_tags']=$oTopic->getTags();
$_REQUEST['blog_id']=$oTopic->getBlogId();
$_REQUEST['topic_id']=$oTopic->getId();
}
}
/**
* Добавление ссылки
*
* @return unknown
*/
protected function EventAdd() {
/**
* Меню
*/
$this->sMenuSubItemSelect='add';
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocksRight(array('block.blogInfo.tpl'));
/**
* Получаем данные для отображения формы
*/
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
$aAllowBlogsUser=array();
foreach ($aBlogsUser as $oBlogUser) {
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog)) {
$aAllowBlogsUser[]=$oBlogUser;
}
}
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('aBlogsUser',$aAllowBlogsUser);
$this->Viewer_Assign('aBlogsOwner',$aBlogsOwner);
$this->Viewer_AddHtmlTitle('Добавление ссылки');
/**
* Обрабатываем отправку формы
*/
return $this->SubmitAdd();
}
/**
* Обработка добавлени топика
*
* @return unknown
*/
protected function SubmitAdd() {
/**
* Проверяем отправлена ли форма с данными(хотяб одна кнопка)
*/
if (!isset($_REQUEST['submit_topic_publish']) and !isset($_REQUEST['submit_topic_save'])) {
return false;
}
/**
* Проверка корректности полей формы
*/
if (!$this->checkTopicFields()) {
return false;
}
/**
* Определяем в какой блог делаем запись
*/
$iBlogId=getRequest('blog_id');
if ($iBlogId==0) {
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
} else {
$oBlog=$this->Blog_GetBlogById($iBlogId);
}
/**
* Если блог не определен выдаем предупреждение
*/
if (!$oBlog) {
$this->Message_AddErrorSingle('Пытаетесь запостить топик в неизвестный блог?','Ошибка');
return false;
}
/**
* Проверка состоит ли юзер в блоге в который постит
*/
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
$this->Message_AddErrorSingle('Вы не состоите в этом блоге!','Ошибка');
return false;
}
}
/**
* Проверяем есть ли права на постинг топика в этот блог
*/
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog)) {
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
return false;
}
/**
* Теперь можно смело добавлять топик к блогу
*/
$oTopic=new TopicEntity_Topic();
$oTopic->setBlogId($oBlog->getId());
$oTopic->setUserId($this->oUserCurrent->getId());
$oTopic->setType('link');
$oTopic->setTitle(getRequest('topic_title'));
$oTopic->setText(htmlspecialchars(getRequest('topic_text')));
$oTopic->setTextShort(htmlspecialchars(getRequest('topic_text')));
$oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setLinkUrl(getRequest('topic_link_url'));
$oTopic->setTags(getRequest('topic_tags'));
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
$oTopic->setUserIp(func_getIp());
/**
* Публикуем или сохраняем
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
} else {
$oTopic->setPublish(0);
}
/**
* Добавляем топик
*/
if ($this->Topic_AddTopic($oTopic)) {
//Делаем рассылку спама всем, кто состоит в этом блоге
if ($oTopic->getPublish()==1 and $oBlog->getType()!='personal') {
$aBlogUsers=$this->Blog_GetRelationBlogUsersByBlogId($oBlog->getId());
foreach ($aBlogUsers as $oBlogUser) {
if ($oBlogUser->getUserId()==$this->oUserCurrent->getId()) {
continue;
}
$this->Mail_SetAdress($oBlogUser->getUserMail(),$oBlogUser->getUserLogin());
$this->Mail_SetSubject('Новый топик в блоге «'.htmlspecialchars($oBlog->getTitle()).'»');
$this->Mail_SetBody('
В блоге <b>«'.htmlspecialchars($oBlog->getTitle()).'»</b> опубликован топик - <a href="'.DIR_WEB_ROOT.'/blog/'.$oTopic->getId().'.html">'.htmlspecialchars($oTopic->getTitle()).'</a><br>
<br>
С уважением, администрация сайта <a href="'.DIR_WEB_ROOT.'">'.SITE_NAME.'</a>
');
$this->Mail_setHTML();
$this->Mail_Send();
}
}
func_header_location(DIR_WEB_ROOT.'/blog/'.$oTopic->getId().'.html');
} else {
$this->Message_AddErrorSingle('Возникли технические неполадки при добавлении топика, пожалуйста повторите позже.','Внутреняя ошибка');
return Router::Action('error');
}
}
/**
* Обработка редактирования топика
*
* @param unknown_type $oTopic
* @return unknown
*/
protected function SubmitEdit($oTopic) {
/**
* Проверка корректности полей формы
*/
if (!$this->checkTopicFields()) {
return false;
}
/**
* Определяем в какой блог делаем запись
*/
$iBlogId=getRequest('blog_id');
if ($iBlogId==0) {
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
} else {
$oBlog=$this->Blog_GetBlogById($iBlogId);
}
/**
* Если блог не определен выдаем предупреждение
*/
if (!$oBlog) {
$this->Message_AddErrorSingle('Пытаетесь запостить топик в неизвестный блог?','Ошибка');
return false;
}
/**
* Проверка состоит ли юзер в блоге в который постит
* Если нужно разрешить редактировать топик в блоге в котором юзер уже не стоит
*/
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
$this->Message_AddErrorSingle('Вы не сотоите в этом блоге!','Ошибка');
return false;
}
}
/**
* Проверяем есть ли права на постинг топика в этот блог
* Условие $oBlog->getId()!=$oTopic->getBlogId() для того чтоб разрешить отредактировать топик в блоге в который сейчас юзер не имеет права на постинг, но раньше успел в него запостить этот топик
*/
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and $oBlog->getId()!=$oTopic->getBlogId()) {
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
return false;
}
/**
* Теперь можно смело редактировать топик
*/
$oTopic->setBlogId($oBlog->getId());
$oTopic->setTitle(getRequest('topic_title'));
$oTopic->setText(htmlspecialchars(getRequest('topic_text')));
$oTopic->setTextShort(htmlspecialchars(getRequest('topic_text')));
$oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setLinkUrl(getRequest('topic_link_url'));
$oTopic->setTags(getRequest('topic_tags'));
$oTopic->setUserIp(func_getIp());
/**
* Публикуем или сохраняем в черновиках
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
} else {
$oTopic->setPublish(0);
}
/**
* Сохраняем топик
*/
if ($this->Topic_UpdateTopic($oTopic)) {
func_header_location(DIR_WEB_ROOT.'/blog/'.$oTopic->getId().'.html');
} else {
$this->Message_AddErrorSingle('Возникли технические неполадки при изменении топика, пожалуйста повторите позже.','Внутреняя ошибка');
return Router::Action('error');
}
}
/**
* Проверка полей формы
*
* @return unknown
*/
protected function checkTopicFields() {
$bOk=true;
/**
* Проверяем есть ли блог в кторый постим
*/
if (!func_check(getRequest('blog_id'),'id')) {
$this->Message_AddError('Что то не то с блогом..','Ошибка');
$bOk=false;
}
/**
* Проверяем есть ли заголовок топика
*/
if (!func_check(getRequest('topic_title'),'text',2,200)) {
$this->Message_AddError('Название топика должно быть от 2 до 200 символов','Ошибка');
$bOk=false;
}
/**
* Проверяем есть ли ссылка
*/
if (!func_check(getRequest('topic_link_url'),'text',3,200)) {
$this->Message_AddError('Название топика должно быть от 2 до 200 символов','Ошибка');
$bOk=false;
}
/**
* Проверяем есть ли описание топика-ссылки
*/
if (!func_check(getRequest('topic_text'),'text',10,500)) {
$this->Message_AddError('Описание ссылки должно быть от 10 до 500 символов','Ошибка');
$bOk=false;
}
/**
* Проверяем есть ли теги(метки)
*/
if (!func_check(getRequest('topic_tags'),'text',2,500)) {
$this->Message_AddError('Метки топика должны быть от 2 до 50 символов с общей диной не более 500 символов','Ошибка');
$bOk=false;
}
/**
* проверяем ввод тегов
*/
$sTags=getRequest('topic_tags');
$aTags=explode(',',$sTags);
$aTagsNew=array();
foreach ($aTags as $sTag) {
$sTag=trim($sTag);
if (func_check($sTag,'text',2,50)) {
$aTagsNew[]=$sTag;
}
}
if (!count($aTagsNew)) {
$this->Message_AddError('Проверьте правильность меток','Ошибка');
$bOk=false;
} else {
$_REQUEST['topic_tags']=join(',',$aTagsNew);
}
return $bOk;
}
/**
* При завершении экшена загружаем необходимые переменные
*
*/
public function EventShutdown() {
$this->Viewer_Assign('sMenuItemSelect',$this->sMenuItemSelect);
$this->Viewer_Assign('sMenuSubItemSelect',$this->sMenuSubItemSelect);
}
}
?>

View file

@ -82,7 +82,7 @@ class ActionTopic extends Action {
/**
* Меню
*/
$this->sMenuSubItemSelect='saved';
$this->sMenuSubItemSelect='';
$this->sMenuItemSelect='';
/**
* Получаем номер топика из УРЛ и проверяем существует ли он
@ -100,7 +100,7 @@ class ActionTopic extends Action {
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocksRight(array('actions/'.$this->GetActionClass().'/blog_info.tpl'));
$this->Viewer_AddBlocksRight(array('block.blogInfo.tpl'));
/**
* Получаем данные для отображения формы
*/
@ -157,7 +157,7 @@ class ActionTopic extends Action {
/**
* Добавляем блок вывода информации о блоге
*/
$this->Viewer_AddBlocksRight(array('actions/'.$this->GetActionClass().'/blog_info.tpl'));
$this->Viewer_AddBlocksRight(array('block.blogInfo.tpl'));
/**
* Получаем данные для отображения формы
*/
@ -322,8 +322,7 @@ class ActionTopic extends Action {
$sTestShort=str_replace('[<n>]',"\r\n",$sTestShort);
$oTopic->setText($sText);
$oTopic->setTextShort($sTestShort);
$oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setExtra('');
$oTopic->setTextSource(getRequest('topic_text'));
$oTopic->setTags(getRequest('topic_tags'));
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
$oTopic->setUserIp(func_getIp());

View file

@ -17,6 +17,13 @@
class TopicEntity_Topic extends Entity
{
/**
* массив объектов(не всегда) для дополнительных типов топиков(линки, опросы, подкасты и т.п.)
*
* @var unknown_type
*/
protected $aExtra=null;
public function getId() {
return $this->_aData['topic_id'];
}
@ -42,7 +49,10 @@ class TopicEntity_Topic extends Entity
return $this->_aData['topic_text_source'];
}
public function getExtra() {
return $this->_aData['topic_extra'];
if (isset($this->_aData['topic_extra'])) {
return $this->_aData['topic_extra'];
}
return serialize('');
}
public function getTags() {
return $this->_aData['topic_tags'];
@ -72,6 +82,7 @@ class TopicEntity_Topic extends Entity
return $this->_aData['topic_count_comment'];
}
public function getTagsLink() {
$aTags=explode(',',$this->getTags());
foreach ($aTags as $key => $value) {
@ -115,7 +126,69 @@ class TopicEntity_Topic extends Entity
/***************************************************************************************************************************************************
* методы расширения типов топика
***************************************************************************************************************************************************
*/
protected function extractExtra() {
if (is_null($this->aExtra)) {
$this->aExtra=unserialize($this->getExtra());
}
}
public function getLinkUrl($bShort=false) {
if ($this->getType()!='link') {
return null;
}
$this->extractExtra();
if (isset($this->aExtra['url'])) {
if ($bShort) {
$sUrl=ltrim($this->aExtra['url'],'http://');
$sUrlShort=substr($sUrl,0,30);
if (strlen($sUrlShort)!=strlen($sUrl)) {
return $sUrlShort.'...';
}
return $sUrl;
}
$sUrl='http://'.ltrim($this->aExtra['url'],'http://');
return $sUrl;
}
return null;
}
public function setLinkUrl($data) {
if ($this->getType()!='link') {
return;
}
$this->extractExtra();
$this->aExtra['url']=$data;
$this->setExtra($this->aExtra);
}
public function getLinkCountJump() {
if ($this->getType()!='link') {
return null;
}
$this->extractExtra();
if (isset($this->aExtra['count_jump'])) {
return (int)$this->aExtra['count_jump'];
}
return 0;
}
public function setLinkCountJump($data) {
if ($this->getType()!='link') {
return;
}
$this->extractExtra();
$this->aExtra['count_jump']=$data;
$this->setExtra($this->aExtra);
}
//*************************************************************************************************************************************************
public function setId($data) {
$this->_aData['topic_id']=$data;
}
@ -135,7 +208,7 @@ class TopicEntity_Topic extends Entity
$this->_aData['topic_text']=$data;
}
public function setExtra($data) {
$this->_aData['topic_extra']=$data;
$this->_aData['topic_extra']=serialize($data);
}
public function setTextShort($data) {
$this->_aData['topic_text_short']=$data;

View file

@ -39,6 +39,7 @@ return array(
'comments' => 'ActionComments',
'talk' => 'ActionTalk',
'rss' => 'ActionRss',
'link' => 'ActionLink',
),
'config' => array(
'action_default' => 'index',

View file

@ -24,10 +24,15 @@ chdir(dirname(dirname(dirname(__FILE__))));
require_once("./config/config.ajax.php");
$sText=@$_REQUEST['text'];
$bSave=@$_REQUEST['save'];
$bStateError=true;
$sTextResult='';
if ($oEngine->User_IsAuthorization()) {
$sTextResult=$oEngine->Text_Parser($sText);
if ($bSave) {
$sTextResult=htmlspecialchars($sText);
} else {
$sTextResult=$oEngine->Text_Parser($sText);
}
$bStateError=false;
}

View file

@ -12,7 +12,7 @@
</div>
<form action="" method="POST">
<textarea class="input_comments_reply" name="comment_text" id="form_comment_text" style="width: 100%; height: 100px;"></textarea>
<input type="submit" name="submit_comment" value="добавить"> <input type="submit" name="submit_preview" value="предпросмотр" onclick="ajaxTextPreview(document.getElementById('form_comment_text').value); return false;">
<input type="submit" name="submit_comment" value="добавить"> <input type="submit" name="submit_preview" value="предпросмотр" onclick="ajaxTextPreview(document.getElementById('form_comment_text').value,false); return false;">
<input type="hidden" name="reply" value="" id="form_comment_reply">
</form>
</div>
@ -56,7 +56,7 @@ function showCommentForm(reply) {
{if count($aComments)}
<div class="head_comments_holder">
<a name="comments"><img src="http://habrahabr.ru/i/comments.gif"></a>
<a name="comments"><img src="{$DIR_STATIC_SKIN}/img/comment.gif"></a>
<span class="news_page_comments_title">комментарии({$oTopic->getCountComment()}):</span>&nbsp;
</div>

View file

@ -0,0 +1,98 @@
{include file='header.tpl'}
{include file='menu.action.tpl'}
{include file='system_message.tpl'}
{literal}
<script>
document.addEvent('domready', function() {
var inputTags = $('topic_tags');
new Autocompleter.Request.HTML(inputTags, DIR_WEB_ROOT+'/include/ajax/tagAutocompleter.php', {
'indicatorClass': 'autocompleter-loading', // class added to the input during request
'minLength': 2, // We need at least 1 character
'selectMode': 'type-ahead', // Instant completion
'multiple': true // Tag support, by default comma separated
});
});
</script>
{/literal}
<div class="backoffice">
<div class="groups_topic_text" id="text_preview"></div>
<div style="clear: both;"></div>
<form action="" method="POST" id="thisform" enctype="multipart/form-data">
<label for="blog_id">В какой блог публикуем?</label>
<select name="blog_id" id="blog_id" style="width: 100%;" onChange="ajaxBlogInfo(this.value);">
<option value="0">мой персональный блог</option>
{foreach from=$aBlogsOwner item=oBlog}
<option value="{$oBlog->getId()}" {if $_aRequest.blog_id==$oBlog->getId()}selected{/if}>{$oBlog->getTitle()}</option>
{/foreach}
{foreach from=$aBlogsUser item=oBlogUser}
<option value="{$oBlogUser->getBlogId()}" {if $_aRequest.blog_id==$oBlogUser->getBlogId()}selected{/if}>{$oBlogUser->getBlogTitle()}</option>
{/foreach}
</select>
<script>
ajaxBlogInfo(document.getElementById('blog_id').value);
</script>
<br /><span class="form_note_red"></span></p>
<p>
<label for="topic_title">Заголовок:</label>
<input type="text" id="topic_title" name="topic_title" value="{$_aRequest.topic_title}" style="width: 100%;" /><br />
<span class="form_note">Заголовок должен быть наполнен смыслом, чтобы можно было понять, о чем будет топик.</span><br />
<span class="form_note_red"></span>
</p>
<p>
<label for="topic_link_url">Ссылка:</label>
<input type="text" id="topic_link_url" name="topic_link_url" value="{$_aRequest.topic_link_url}" style="width: 100%;" /><br />
<span class="form_note">Например, http://livestreet.ru/blog/dev_livestreet/113.html</span><br />
<span class="form_note_red"></span>
</p>
<label for="topic_text">Краткое описание (максимум 500 символов, HTML-теги запрещены):</label>
<textarea style="width: 100%;" name="topic_text" id="topic_text" rows="6">{$_aRequest.topic_text}</textarea><br>
<p>
<label for="topic_tags">Метки:</label>
<input type="text" id="topic_tags" name="topic_tags" value="{$_aRequest.topic_tags}" style="width: 100%;" /><br />
<span class="form_note">Метки нужно разделять запятой. Например: <i>клон хабры</i>, <i>блоги</i>, <i>рейтинг</i>, <i>google</i>, <i>сиськи</i>, <i>кирпич</i>.</span>
</p>
<p class="l-bot">
<input type="submit" name="submit_topic_publish" value="опубликовать">&nbsp;
<input type="submit" name="submit_topic_save" value="сохранить в черновиках">&nbsp;
<input type="submit" name="submit_preview" value="предпросмотр" onclick="ajaxTextPreview(document.getElementById('topic_text').value,true); return false;">&nbsp;
</p>
<div class="form_note">Если нажать кнопку &laquo;Сохранить в черновиках&raquo;, топик
будет виден только Вам, а рядом с его заголовком будет отображаться замочек.
Чтобы топик был виден всем, нажмите &laquo;Опубликовать&raquo;.</div>
<p>Может быть, перейти на <a href="{$DIR_WEB_ROOT}/blog/">заглавную страницу блогов</a>?</p>
<input type="hidden" name="topic_id" value="{$_aRequest.topic_id}">
</form>
</div>
</div>
</div>
{include file='footer.tpl'}

View file

@ -13,7 +13,6 @@
{/if}
<form action="{$DIR_WEB_ROOT}/login/" method="POST" id="loginform">
<input type="hidden" name="backto" value="http://habrahabr.ru/">
<p><span class="form">Логин или e-mail:</span><br />
<input type="text" name="login" id="name" value="" size="25" /><br />

View file

@ -8,7 +8,7 @@
<tr>
<td nowrap align="left"><span class="headline_tags">
<img src="http://www.habrahabr.ru/i/tagcloud.gif" border="0" width="19" height="17" title="облачко" alt="" >&nbsp;&#8594;</span></td>
<img src="{$DIR_STATIC_SKIN}/img/tagcloud.gif" border="0" width="19" height="17" title="облачко" alt="" >&nbsp;&#8594;</span></td>
<form action="" method="GET" style="margin: 0px;" onsubmit="return submitTags(this.tag.value);">
<input type="hidden" name="mode" value="blog">
<td width="100%"><input type="text" name="tag" value="{$sTag|escape:'html'}" style="width: 100%; padding-left: 4px; padding-right: 4px;" class="tag_form"></td>

View file

@ -72,7 +72,7 @@ function showCommentForm(reply) {
{if count($aComments)}
<div class="head_comments_holder">
<a name="comments"><img src="http://habrahabr.ru/i/comments.gif"></a>
<a name="comments"><img src="{$DIR_STATIC_SKIN}/img/comment.gif"></a>
<span class="news_page_comments_title">ответы({$oTalk->getCountComment()}):</span>&nbsp;
</div>
@ -99,7 +99,7 @@ function showCommentForm(reply) {
<div class="WriteCommentHolder">
<img src="http://habrahabr.ru/i/add_comment.gif"><a name="comment" href="javascript:showCommentForm(0);" class="news_page_comments_title">ответить</a>
<img src="{$DIR_STATIC_SKIN}/img/comment.gif"> <a name="comment" href="javascript:showCommentForm(0);" class="news_page_comments_title">ответить</a>
<br />
<span class="form_note">
<a href="{$DIR_WEB_ROOT}/profile/{$oUserCurrent->getLogin()}/"><img class="img_border" src="{if $oUserCurrent->getProfileAvatar()}{$oUserCurrent->getProfileAvatarPath(24)}{else}{$DIR_STATIC_SKIN}/img/avatar_24x24.jpg{/if}" width="24" height="24" alt="" title=" это я! " border="0"></a>

View file

@ -140,7 +140,7 @@ document.addEvent('domready', function() {
<p class="l-bot">
<input type="submit" name="submit_topic_publish" value="опубликовать">&nbsp;
<input type="submit" name="submit_topic_save" value="сохранить в черновиках">&nbsp;
<input type="submit" name="submit_preview" value="предпросмотр" onclick="ajaxTextPreview(document.getElementById('topic_text').value); return false;">&nbsp;
<input type="submit" name="submit_preview" value="предпросмотр" onclick="ajaxTextPreview(document.getElementById('topic_text').value,false); return false;">&nbsp;
</p>
<div class="form_note">Если нажать кнопку &laquo;Сохранить в черновиках&raquo;, текст топика

View file

@ -432,16 +432,10 @@ h3{
#screen{
position: absolute; top: 0; left: 0; right: 0; width: 100%; height: 100%; z-index: 98;
display: none;
background: url(http://www.habrahabr.ru/i/0-3.png);
}
* html #screen{
background-color: #333;
background-color: transparent;
background-image: url(http://www.habrahabr.ru/i/spacer.gif);
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
src="http://www.habrahabr.ru/i/0-3.png", sizingMethod="scale");
}
/* content */
#content{
clear: both;
@ -841,7 +835,7 @@ div.rating .company_position_up, div.rating .company_position_down {
padding: 0.5em 0;
/*margin-left:40px;*/
padding-left:20px;
background:url(http://www.habrahabr.ru/i/tags.gif) no-repeat 0 8px;
clear: both;
}
.voice {
@ -3072,10 +3066,7 @@ div.date a:hover span {
background-color:#336699!important;
color:white;
}
*html div.date a:hover span {
background-color:white;
color:#336699;
}
div.date a:hover {
background:url(../img/date.gif) center left no-repeat;
@ -3095,16 +3086,29 @@ div.user a:hover span {
background:#CC0000;
color:white;
}
*html div.user a:hover span {
background:white;
color:#CC0000;
}
div.user a:hover {
background:url(../img/user.gif) left center no-repeat;
}
div.link_url a {
padding-left:14px;
background:url(../img/link_url.gif) center left no-repeat;
color:#CC0000;
text-decoration:none;
}
div.link_url a:hover span {
background:#CC0000;
color:white;
}
div.link_url a:hover {
background:url(../img/link_url.gif) left center no-repeat;
}
div.down a {
padding-left:14px;
background:url(../img/user.giff) left center no-repeat;
background:url(../img/user.gif) left center no-repeat;
text-decoration:none;
color:#339900;
}
@ -3112,10 +3116,7 @@ div.down a:hover span {
background:#339900;
color:white;
}
*html div.down a:hover span {
background:white;
color:#339900;
}
div.down a:hover {
background:url(http://habrahabr.ru/i/plashka_down_hover.gif) center left no-repeat;
}
@ -3155,10 +3156,7 @@ div.comment_plashka a:hover span.green {
background-color:#339900!important;
color:white;
}
*html div.comment_plashka a:hover span {
background-color:white!important;
color:#336699!important;
}
div.link {

View file

@ -9,7 +9,7 @@
<LINK href="{$DIR_STATIC_SKIN}/img/favicon.ico" rel="shortcut icon">
<LINK media=all href="{$DIR_STATIC_SKIN}/css/habrahabr.css?v=1" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/backoffice.css?v=2" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/global.css?v=3" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/global.css?v=4" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/my.css?v=2" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/Roar.css" type=text/css rel=stylesheet>
<LINK media=all href="{$DIR_STATIC_SKIN}/css/Autocompleter.css" type=text/css rel=stylesheet>
@ -22,7 +22,7 @@
<script type="text/javascript" src="{$DIR_WEB_ROOT}/classes/lib/external/MooTools_1.2/plugs/Autocompleter/Autocompleter.js"></script>
<script type="text/javascript" src="{$DIR_WEB_ROOT}/classes/lib/external/MooTools_1.2/plugs/Autocompleter/Autocompleter.Request.js"></script>
<script type="text/javascript" src="{$DIR_WEB_ROOT}/classes/lib/external/MooTools_1.2/plugs/Autocompleter/Observer.js"></script>
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/main.js?v=8"></script>
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/main.js?v=9"></script>
<BODY>
{literal}

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

View file

@ -236,7 +236,7 @@ function ajaxUploadImg(value) {
req.send( { value: value } );
}
function ajaxTextPreview(text) {
function ajaxTextPreview(text,save) {
var req = new JsHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4) {
@ -251,7 +251,7 @@ function ajaxTextPreview(text) {
}
showWindowStatus('Обработка предпросмотра...');
req.open(null, DIR_WEB_ROOT+'/include/ajax/textPreview.php', true);
req.send( { text: text } );
req.send( { text: text, save: save } );
}
function submitTags(sTag) {

View file

@ -11,7 +11,7 @@
{/if}
<TD class="{$sel}width10"></TD>
<TD class="{$sel}subitem1 center">
<A class=tags_f href="{$DIR_WEB_ROOT}/topic/add/">Новые</A>
<A class=tags_f href="{$DIR_WEB_ROOT}/{if $sMenuItemSelect=='add_blog'}topic{else}{$sMenuItemSelect}{/if}/add/">Новые</A>
</TD>
<TD class="{$sel}border2px width10"></TD>
@ -40,7 +40,7 @@
</TABLE>
{if $sMenuSubItemSelect=='add'}
<TABLE {if $sEvent=='published'}class="pagesubmenu toright" id="pagemenuszd2"{else}class="pagesubmenu" id="pagemenuszd"{/if}>
<TBODY>
<TR>
@ -53,11 +53,11 @@
<TD class="subitem2 three_columns{if $sMenuItemSelect=='question'} active_personal{/if}" noWrap align=middle>
<IMG class=arrow_cc height=7 src="{$DIR_STATIC_SKIN}/img/{if $sMenuItemSelect=='question'}arrow_menu_main.gif{else}arrow_menu_main_un.gif{/if}" width=10><A href="{$DIR_WEB_ROOT}/question/{$sMenuSubItemSelect}/">Вопрос</A>
</TD>
-->
<TD class="subitem2 three_columns{if $sMenuItemSelect=='link'} active_personal{/if}" noWrap align=middle>
<IMG class=arrow_cc height=7 src="{$DIR_STATIC_SKIN}/img/{if $sMenuItemSelect=='link'}arrow_menu_main.gif{else}arrow_menu_main_un.gif{/if}" width=10><A href="{$DIR_WEB_ROOT}/link/{$sMenuSubItemSelect}/">Ссылка</A>
</TD>
-->
<TD class="subitem2 three_columns" noWrap align=middle>
<IMG class=arrow_cc height=7 src="{$DIR_STATIC_SKIN}/img/{if $sMenuItemSelect=='add_blog'}arrow_menu_main.gif{else}arrow_menu_main_un.gif{/if}" width=10><A href="{$DIR_WEB_ROOT}/blog/add/" style="color: #d00;">Создать блог</A>
</TD>
@ -66,5 +66,5 @@
</TR>
</TBODY>
</TABLE>
{/if}

View file

@ -3,12 +3,15 @@
<!--medialand_ru_context_start-->
<h1 class="blog_headline">
<a href="{$oTopic->getBlogUrlFull()}" class="blog_headline_group">{$oTopic->getBlogTitle()|escape:'html'}</a>&nbsp;&#8594;&nbsp;
{if $oTopic->getType()=='link'}
<img src="{$DIR_STATIC_SKIN}/img/link_url_big.gif" border="0" title="топик-ссылка" width="16" height="16" alt="ссылка">
{/if}
{if $oTopic->getPublish()==0}
<img src="{$DIR_STATIC_SKIN}/img/topic_unpublish.gif" border="0" title="топик находится в черновиках">
{/if}
{$oTopic->getTitle()|escape:'html'}
{if $oUserCurrent and $oUserCurrent->getId()==$oTopic->getUserId()}
<a href="{$DIR_WEB_ROOT}/topic/edit/{$oTopic->getId()}/" title="отредактировать топик"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать топик"></a>
<a href="{$DIR_WEB_ROOT}/{$oTopic->getType()}/edit/{$oTopic->getId()}/" title="отредактировать топик"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать топик"></a>
{/if}
<a href="{$DIR_WEB_ROOT}/rss/comments/{$oTopic->getId()}/" title="RSS лента"><IMG height=12 src="{$DIR_STATIC_SKIN}/img/rss_small.gif" width=12></a>
</h1>
@ -73,6 +76,11 @@
</span>&nbsp;
</div>
{/if}
{if $oTopic->getType()=='link'}
<div class="link_url">
<a href="{$DIR_WEB_ROOT}/link/go/{$oTopic->getId()}/" title="переходов по ссылке: {$oTopic->getLinkCountJump()}"><span>{$oTopic->getLinkUrl(true)}</span></a>
</div>
{/if}
<div class="user">
<a href="{$DIR_WEB_ROOT}/profile/{$oTopic->getUserLogin()}/" title="авторский текст"><span>{$oTopic->getUserLogin()}</span></a>
</div>

View file

@ -6,12 +6,15 @@
<div class="text">
<h1 class="blog_headline">
<a href="{$oTopic->getBlogUrlFull()}" class="blog_headline_group">{$oTopic->getBlogTitle()|escape:'html'}</a>&nbsp;&#8594;&nbsp;
{if $oTopic->getType()=='link'}
<img src="{$DIR_STATIC_SKIN}/img/link_url_big.gif" border="0" title="топик-ссылка" width="16" height="16" alt="ссылка">
{/if}
{if $oTopic->getPublish()==0}
<img src="{$DIR_STATIC_SKIN}/img/topic_unpublish.gif" border="0" title="топик находится в черновиках">
{/if}
<a href="{$oTopic->getUrl()}" class="headline_l">{$oTopic->getTitle()|escape:'html'}</a>
<a href="{if $oTopic->getType()=='link'}{$DIR_WEB_ROOT}/link/go/{$oTopic->getId()}/{else}{$oTopic->getUrl()}{/if}" class="headline_l">{$oTopic->getTitle()|escape:'html'}</a>
{if $oUserCurrent and $oUserCurrent->getId()==$oTopic->getUserId()}
<a href="{$DIR_WEB_ROOT}/topic/edit/{$oTopic->getId()}/" title="отредактировать топик"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать топик"></a>
<a href="{$DIR_WEB_ROOT}/{$oTopic->getType()}/edit/{$oTopic->getId()}/" title="отредактировать топик"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать топик"></a>
{/if}
</h1>
<div class="groups_topic_text">
@ -66,7 +69,12 @@
</div>
<div class="date">
<a href="#" title="дата" onclick="return false;"><span>{date_format date=$oTopic->getDateAdd()}</span></a>
</div>
</div>
{if $oTopic->getType()=='link'}
<div class="link_url">
<a href="{$DIR_WEB_ROOT}/link/go/{$oTopic->getId()}/" title="переходов по ссылке: {$oTopic->getLinkCountJump()}"><span>{$oTopic->getLinkUrl(true)}</span></a>
</div>
{/if}
<div class="user">
<a href="{$DIR_WEB_ROOT}/profile/{$oTopic->getUserLogin()}/" title="авторский текст"><span>{$oTopic->getUserLogin()}</span></a>
</div>