mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-16 21:34:25 +03:00
Merge pull request #29 from fluxuator/master
Счетчик ибранных топиков и комментариев
This commit is contained in:
commit
d1079481e6
|
@ -42,6 +42,7 @@ class ActionAdmin extends Action {
|
||||||
$this->AddEvent('plugins','EventPlugins');
|
$this->AddEvent('plugins','EventPlugins');
|
||||||
$this->AddEvent('restorecomment','EventRestoreComment');
|
$this->AddEvent('restorecomment','EventRestoreComment');
|
||||||
$this->AddEvent('userfields','EventUserfields');
|
$this->AddEvent('userfields','EventUserfields');
|
||||||
|
$this->AddEvent('recalcfavourite','EventRecalculateFavourite');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,6 +68,20 @@ class ActionAdmin extends Action {
|
||||||
$this->SetTemplateAction('index');
|
$this->SetTemplateAction('index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Перестроение дерева комментариев, актуально при $config['module']['comment']['use_nested'] = true;
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function EventRecalculateFavourite() {
|
||||||
|
set_time_limit(0);
|
||||||
|
$this->Comment_RecalculateFavourite();
|
||||||
|
$this->Topic_RecalculateFavourite();
|
||||||
|
$this->Cache_Clean();
|
||||||
|
|
||||||
|
$this->Message_AddNotice($this->Lang_Get('admin_favourites_recalculated'),$this->Lang_Get('attention'));
|
||||||
|
$this->SetTemplateAction('index');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Страница со списком плагинов
|
* Страница со списком плагинов
|
||||||
*
|
*
|
||||||
|
|
|
@ -428,9 +428,11 @@ class ActionAjax extends Action {
|
||||||
'target_publish' => $oTopic->getPublish()
|
'target_publish' => $oTopic->getPublish()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($this->Topic_AddFavouriteTopic($oFavouriteTopicNew)) {
|
$oTopic->setCountFavourite($oTopic->getCountFavourite()+1);
|
||||||
|
if ($this->Topic_AddFavouriteTopic($oFavouriteTopicNew) and $this->Topic_UpdateTopic($oTopic)) {
|
||||||
$this->Message_AddNoticeSingle($this->Lang_Get('topic_favourite_add_ok'),$this->Lang_Get('attention'));
|
$this->Message_AddNoticeSingle($this->Lang_Get('topic_favourite_add_ok'),$this->Lang_Get('attention'));
|
||||||
$this->Viewer_AssignAjax('bState',true);
|
$this->Viewer_AssignAjax('bState',true);
|
||||||
|
$this->Viewer_AssignAjax('iCount', $oTopic->getCountFavourite());
|
||||||
} else {
|
} else {
|
||||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||||
return;
|
return;
|
||||||
|
@ -445,9 +447,11 @@ class ActionAjax extends Action {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($oFavouriteTopic and !$iType) {
|
if ($oFavouriteTopic and !$iType) {
|
||||||
if ($this->Topic_DeleteFavouriteTopic($oFavouriteTopic)) {
|
$oTopic->setCountFavourite($oTopic->getCountFavourite()-1);
|
||||||
|
if ($this->Topic_DeleteFavouriteTopic($oFavouriteTopic) and $this->Topic_UpdateTopic($oTopic)) {
|
||||||
$this->Message_AddNoticeSingle($this->Lang_Get('topic_favourite_del_ok'),$this->Lang_Get('attention'));
|
$this->Message_AddNoticeSingle($this->Lang_Get('topic_favourite_del_ok'),$this->Lang_Get('attention'));
|
||||||
$this->Viewer_AssignAjax('bState',false);
|
$this->Viewer_AssignAjax('bState',false);
|
||||||
|
$this->Viewer_AssignAjax('iCount', $oTopic->getCountFavourite());
|
||||||
} else {
|
} else {
|
||||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||||
return;
|
return;
|
||||||
|
@ -488,9 +492,11 @@ class ActionAjax extends Action {
|
||||||
'target_publish' => $oComment->getPublish()
|
'target_publish' => $oComment->getPublish()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($this->Comment_AddFavouriteComment($oFavouriteCommentNew)) {
|
$oComment->setCountFavourite($oComment->getCountFavourite()+1);
|
||||||
|
if ($this->Comment_AddFavouriteComment($oFavouriteCommentNew) and $this->Comment_UpdateComment($oComment)) {
|
||||||
$this->Message_AddNoticeSingle($this->Lang_Get('comment_favourite_add_ok'),$this->Lang_Get('attention'));
|
$this->Message_AddNoticeSingle($this->Lang_Get('comment_favourite_add_ok'),$this->Lang_Get('attention'));
|
||||||
$this->Viewer_AssignAjax('bState',true);
|
$this->Viewer_AssignAjax('bState',true);
|
||||||
|
$this->Viewer_AssignAjax('iCount', $oComment->getCountFavourite());
|
||||||
} else {
|
} else {
|
||||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||||
return;
|
return;
|
||||||
|
@ -505,9 +511,11 @@ class ActionAjax extends Action {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($oFavouriteComment and !$iType) {
|
if ($oFavouriteComment and !$iType) {
|
||||||
if ($this->Comment_DeleteFavouriteComment($oFavouriteComment)) {
|
$oComment->setCountFavourite($oComment->getCountFavourite()-1);
|
||||||
|
if ($this->Comment_DeleteFavouriteComment($oFavouriteComment) and $this->Comment_UpdateComment($oComment)) {
|
||||||
$this->Message_AddNoticeSingle($this->Lang_Get('comment_favourite_del_ok'),$this->Lang_Get('attention'));
|
$this->Message_AddNoticeSingle($this->Lang_Get('comment_favourite_del_ok'),$this->Lang_Get('attention'));
|
||||||
$this->Viewer_AssignAjax('bState',false);
|
$this->Viewer_AssignAjax('bState',false);
|
||||||
|
$this->Viewer_AssignAjax('iCount', $oComment->getCountFavourite());
|
||||||
} else {
|
} else {
|
||||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -886,5 +886,15 @@ class ModuleComment extends Module {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Пересчитывает счетчик избранных комментариев
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function RecalculateFavourite(){
|
||||||
|
return $this->oMapper->RecalculateFavourite();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -89,6 +89,10 @@ class ModuleComment_EntityComment extends Entity
|
||||||
return $this->_aData['comment_is_favourite'];
|
return $this->_aData['comment_is_favourite'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCountFavourite() {
|
||||||
|
return $this->_aData['comment_count_favourite'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function setId($data) {
|
public function setId($data) {
|
||||||
|
@ -156,5 +160,8 @@ class ModuleComment_EntityComment extends Entity
|
||||||
public function setIsFavourite($data) {
|
public function setIsFavourite($data) {
|
||||||
$this->_aData['comment_is_favourite']=$data;
|
$this->_aData['comment_is_favourite']=$data;
|
||||||
}
|
}
|
||||||
|
public function setCountFavourite($data) {
|
||||||
|
$this->_aData['comment_count_favourite']=$data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -489,13 +489,14 @@ class ModuleComment_MapperComment extends Mapper {
|
||||||
comment_text= ?,
|
comment_text= ?,
|
||||||
comment_rating= ?f,
|
comment_rating= ?f,
|
||||||
comment_count_vote= ?d,
|
comment_count_vote= ?d,
|
||||||
|
comment_count_favourite= ?d,
|
||||||
comment_delete = ?d ,
|
comment_delete = ?d ,
|
||||||
comment_publish = ?d ,
|
comment_publish = ?d ,
|
||||||
comment_text_hash = ?
|
comment_text_hash = ?
|
||||||
WHERE
|
WHERE
|
||||||
comment_id = ?d
|
comment_id = ?d
|
||||||
";
|
";
|
||||||
if ($this->oDb->query($sql,$oComment->getText(),$oComment->getRating(),$oComment->getCountVote(),$oComment->getDelete(),$oComment->getPublish(),$oComment->getTextHash(),$oComment->getId())) {
|
if ($this->oDb->query($sql,$oComment->getText(),$oComment->getRating(),$oComment->getCountVote(),$oComment->getCountFavourite(),$oComment->getDelete(),$oComment->getPublish(),$oComment->getTextHash(),$oComment->getId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -649,5 +650,25 @@ class ModuleComment_MapperComment extends Mapper {
|
||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function RecalculateFavourite() {
|
||||||
|
$sql = "
|
||||||
|
UPDATE ".Config::Get('db.table.comment')." c
|
||||||
|
SET c.comment_count_favourite = (
|
||||||
|
SELECT count(f.user_id)
|
||||||
|
FROM ".Config::Get('db.table.favourite')." f
|
||||||
|
WHERE
|
||||||
|
f.target_id = c.comment_id
|
||||||
|
AND
|
||||||
|
f.target_publish = 1
|
||||||
|
AND
|
||||||
|
f.target_type = 'comment'
|
||||||
|
)
|
||||||
|
";
|
||||||
|
if ($this->oDb->query($sql)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -1636,5 +1636,14 @@ class ModuleTopic extends Module {
|
||||||
return $this->Image_GetWebPath($sFile);
|
return $this->Image_GetWebPath($sFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Пересчитывает счетчик избранных топиков
|
||||||
|
*
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
public function RecalculateFavourite(){
|
||||||
|
return $this->oMapperTopic->RecalculateFavourite();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -130,6 +130,9 @@ class ModuleTopic_EntityTopic extends Entity
|
||||||
public function getIsFavourite() {
|
public function getIsFavourite() {
|
||||||
return $this->_aData['topic_is_favourite'];
|
return $this->_aData['topic_is_favourite'];
|
||||||
}
|
}
|
||||||
|
public function getCountFavourite() {
|
||||||
|
return $this->_aData['topic_count_favourite'];
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************************************************************************************************
|
/***************************************************************************************************************************************************
|
||||||
* методы расширения типов топика
|
* методы расширения типов топика
|
||||||
|
@ -394,6 +397,8 @@ class ModuleTopic_EntityTopic extends Entity
|
||||||
public function setIsFavourite($data) {
|
public function setIsFavourite($data) {
|
||||||
$this->_aData['topic_is_favourite']=$data;
|
$this->_aData['topic_is_favourite']=$data;
|
||||||
}
|
}
|
||||||
|
public function setCountFavourite($data) {
|
||||||
|
$this->_aData['topic_count_favourite']=$data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -383,13 +383,14 @@ class ModuleTopic_MapperTopic extends Mapper {
|
||||||
topic_count_vote= ?d,
|
topic_count_vote= ?d,
|
||||||
topic_count_read= ?d,
|
topic_count_read= ?d,
|
||||||
topic_count_comment= ?d,
|
topic_count_comment= ?d,
|
||||||
|
topic_count_favourite= ?d,
|
||||||
topic_cut_text = ? ,
|
topic_cut_text = ? ,
|
||||||
topic_forbid_comment = ? ,
|
topic_forbid_comment = ? ,
|
||||||
topic_text_hash = ?
|
topic_text_hash = ?
|
||||||
WHERE
|
WHERE
|
||||||
topic_id = ?d
|
topic_id = ?d
|
||||||
";
|
";
|
||||||
if ($this->oDb->query($sql,$oTopic->getBlogId(),$oTopic->getTitle(),$oTopic->getTags(),$oTopic->getDateAdd(),$oTopic->getDateEdit(),$oTopic->getUserIp(),$oTopic->getPublish(),$oTopic->getPublishDraft(),$oTopic->getPublishIndex(),$oTopic->getRating(),$oTopic->getCountVote(),$oTopic->getCountRead(),$oTopic->getCountComment(),$oTopic->getCutText(),$oTopic->getForbidComment(),$oTopic->getTextHash(),$oTopic->getId())) {
|
if ($this->oDb->query($sql,$oTopic->getBlogId(),$oTopic->getTitle(),$oTopic->getTags(),$oTopic->getDateAdd(),$oTopic->getDateEdit(),$oTopic->getUserIp(),$oTopic->getPublish(),$oTopic->getPublishDraft(),$oTopic->getPublishIndex(),$oTopic->getRating(),$oTopic->getCountVote(),$oTopic->getCountRead(),$oTopic->getCountComment(),$oTopic->getCountFavourite(),$oTopic->getCutText(),$oTopic->getForbidComment(),$oTopic->getTextHash(),$oTopic->getId())) {
|
||||||
$this->UpdateTopicContent($oTopic);
|
$this->UpdateTopicContent($oTopic);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -798,5 +799,25 @@ class ModuleTopic_MapperTopic extends Mapper {
|
||||||
id= ?d';
|
id= ?d';
|
||||||
$this->oDb->query($sql, $iPhotoId);
|
$this->oDb->query($sql, $iPhotoId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function RecalculateFavourite() {
|
||||||
|
$sql = "
|
||||||
|
UPDATE ".Config::Get('db.table.topic')." t
|
||||||
|
SET t.topic_count_favourite = (
|
||||||
|
SELECT count(f.user_id)
|
||||||
|
FROM ".Config::Get('db.table.favourite')." f
|
||||||
|
WHERE
|
||||||
|
f.target_id = t.topic_id
|
||||||
|
AND
|
||||||
|
f.target_publish = 1
|
||||||
|
AND
|
||||||
|
f.target_type = 'topic'
|
||||||
|
)
|
||||||
|
";
|
||||||
|
if ($this->oDb->query($sql)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
2
install/convert_0.5.1_to_0.5.2.sql
Normal file
2
install/convert_0.5.1_to_0.5.2.sql
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE `prefix_topic` ADD `topic_count_favourite` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `topic_count_comment`;
|
||||||
|
ALTER TABLE `prefix_comment` ADD `comment_count_favourite` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `comment_count_vote`;
|
|
@ -835,6 +835,7 @@ return array(
|
||||||
'admin_list_plugins' => 'Manage plugins',
|
'admin_list_plugins' => 'Manage plugins',
|
||||||
'admin_list_userfields' => 'Configuring custom fields',
|
'admin_list_userfields' => 'Configuring custom fields',
|
||||||
'admin_list_restorecomment' => 'Rebuilding a tree comments',
|
'admin_list_restorecomment' => 'Rebuilding a tree comments',
|
||||||
|
'admin_list_recalcfavourite' => 'Recalculate counters of favorites',
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -900,6 +901,7 @@ return array(
|
||||||
*/
|
*/
|
||||||
'admin_title' => 'Admin',
|
'admin_title' => 'Admin',
|
||||||
'admin_comment_restore_tree' => 'Tree comments restore successful',
|
'admin_comment_restore_tree' => 'Tree comments restore successful',
|
||||||
|
'admin_favourites_recalculated' => 'Favourites counters has been recalculated',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin administration page
|
* Plugin administration page
|
||||||
|
|
|
@ -834,6 +834,7 @@ return array(
|
||||||
'admin_list_plugins' => 'Управление плагинами',
|
'admin_list_plugins' => 'Управление плагинами',
|
||||||
'admin_list_userfields' => 'Настройка пользовательских полей',
|
'admin_list_userfields' => 'Настройка пользовательских полей',
|
||||||
'admin_list_restorecomment' => 'Перестроение дерева комментариев',
|
'admin_list_restorecomment' => 'Перестроение дерева комментариев',
|
||||||
|
'admin_list_recalcfavourite' => 'Пересчитать счетчики избранных',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Рейтинг TOP
|
* Рейтинг TOP
|
||||||
|
@ -898,6 +899,7 @@ return array(
|
||||||
*/
|
*/
|
||||||
'admin_title' => 'Админка',
|
'admin_title' => 'Админка',
|
||||||
'admin_comment_restore_tree' => 'Дерево комментариев перестроенно',
|
'admin_comment_restore_tree' => 'Дерево комментариев перестроенно',
|
||||||
|
'admin_favourites_recalculated' => 'Счетчики избранных пересчитаны',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Страница администрирования плагинов
|
* Страница администрирования плагинов
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<li><a href="{router page="admin"}plugins">{$aLang.admin_list_plugins}</a></li>
|
<li><a href="{router page="admin"}plugins">{$aLang.admin_list_plugins}</a></li>
|
||||||
<li><a href="{router page="admin"}userfields">{$aLang.admin_list_userfields}</a></li>
|
<li><a href="{router page="admin"}userfields">{$aLang.admin_list_userfields}</a></li>
|
||||||
<li><a href="{router page="admin"}restorecomment">{$aLang.admin_list_restorecomment}</a></li>
|
<li><a href="{router page="admin"}restorecomment">{$aLang.admin_list_restorecomment}</a></li>
|
||||||
|
<li><a href="{router page="admin"}recalcfavourite">{$aLang.admin_list_recalcfavourite}</a></li>
|
||||||
{hook run='admin_action_item'}
|
{hook run='admin_action_item'}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
<li class="goto-comment-child"><a href="#" title="{$aLang.comment_goto_child}">↓</a></li>
|
<li class="goto-comment-child"><a href="#" title="{$aLang.comment_goto_child}">↓</a></li>
|
||||||
{if $oUserCurrent and !$bNoCommentFavourites}
|
{if $oUserCurrent and !$bNoCommentFavourites}
|
||||||
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"></a></li>
|
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_comment_{$oComment->getId()}">{if $oComment->getCountFavourite()>0}{$oComment->getCountFavourite()}{else} {/if}</span></li>
|
||||||
{/if}
|
{/if}
|
||||||
{if !$oComment->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
|
{if !$oComment->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
|
||||||
<li><a href="#" class="delete" onclick="ls.comments.toggle(this,{$oComment->getId()}); return false;">{$aLang.comment_delete}</a></li>
|
<li><a href="#" class="delete" onclick="ls.comments.toggle(this,{$oComment->getId()}); return false;">{$aLang.comment_delete}</a></li>
|
||||||
|
|
|
@ -24,9 +24,10 @@
|
||||||
|
|
||||||
|
|
||||||
/* Favorite */
|
/* Favorite */
|
||||||
.favourite { background: url(../images/favorite.png) no-repeat; display: block; height: 16px; width: 16px; position: relative; top: 1px; }
|
.favourite { background: url(../images/favorite.png) no-repeat; display: block; height: 16px; width: 16px; position: relative; top: 1px; float: left;}
|
||||||
.favourite:hover { background-position: 0 -16px !important; }
|
.favourite:hover { background-position: 0 -16px !important; }
|
||||||
.favourite.active { background-position: 0 -16px; }
|
.favourite.active { background-position: 0 -16px; }
|
||||||
|
.favourite-count { color: #333; font-weight: bold; float: left; margin-left: 2px; }
|
||||||
|
|
||||||
|
|
||||||
/* Pagination */
|
/* Pagination */
|
||||||
|
|
|
@ -47,6 +47,8 @@ ls.favourite = (function ($) {
|
||||||
if (result.bState) {
|
if (result.bState) {
|
||||||
this.objFavourite.addClass(this.options.active);
|
this.objFavourite.addClass(this.options.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#fav_count_'+type+'_'+idTarget).text((result.iCount>0) ? result.iCount : '');
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
||||||
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
||||||
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
|
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></li>
|
||||||
<li><a href="{router page='link'}go/{$oTopic->getId()}/" title="{$aLang.topic_link_count_jump}: {$oTopic->getLinkCountJump()}">{$oTopic->getLinkUrl(true)}</a></li>
|
<li><a href="{router page='link'}go/{$oTopic->getId()}/" title="{$aLang.topic_link_count_jump}: {$oTopic->getLinkCountJump()}">{$oTopic->getLinkUrl(true)}</a></li>
|
||||||
{if $bTopicList}
|
{if $bTopicList}
|
||||||
<li class="comments-link">
|
<li class="comments-link">
|
||||||
|
|
|
@ -112,7 +112,7 @@ jQuery(window).load(function($) {
|
||||||
</li>
|
</li>
|
||||||
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
||||||
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
||||||
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
|
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></li>
|
||||||
{if $bTopicList}
|
{if $bTopicList}
|
||||||
<li class="comments-link">
|
<li class="comments-link">
|
||||||
{if $oTopic->getCountComment()>0}
|
{if $oTopic->getCountComment()>0}
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
||||||
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
||||||
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
|
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></li>
|
||||||
{if $bTopicList}
|
{if $bTopicList}
|
||||||
<li class="comments-link">
|
<li class="comments-link">
|
||||||
{if $oTopic->getCountComment()>0}
|
{if $oTopic->getCountComment()>0}
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
|
||||||
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
|
||||||
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
|
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></li>
|
||||||
{if $bTopicList}
|
{if $bTopicList}
|
||||||
<li class="comments-link">
|
<li class="comments-link">
|
||||||
{if $oTopic->getCountComment()>0}
|
{if $oTopic->getCountComment()>0}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<li><a href="{router page="admin"}plugins">{$aLang.admin_list_plugins}</a></li>
|
<li><a href="{router page="admin"}plugins">{$aLang.admin_list_plugins}</a></li>
|
||||||
<li><a href="{router page="admin"}userfields">{$aLang.admin_list_userfields}</a></li>
|
<li><a href="{router page="admin"}userfields">{$aLang.admin_list_userfields}</a></li>
|
||||||
<li><a href="{router page="admin"}restorecomment">{$aLang.admin_list_restorecomment}</a></li>
|
<li><a href="{router page="admin"}restorecomment">{$aLang.admin_list_restorecomment}</a></li>
|
||||||
|
<li><a href="{router page="admin"}recalcfavourite">{$aLang.admin_list_recalcfavourite}</a></li>
|
||||||
{hook run='admin_action_item'}
|
{hook run='admin_action_item'}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
<li class="goto-comment-child"><a href="#" title="{$aLang.comment_goto_child}">↓</a></li>
|
<li class="goto-comment-child"><a href="#" title="{$aLang.comment_goto_child}">↓</a></li>
|
||||||
{if $oUserCurrent and !$bNoCommentFavourites}
|
{if $oUserCurrent and !$bNoCommentFavourites}
|
||||||
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"></a></li>
|
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"><span class="favourite-count" id="fav_count_comment_{$oComment->getId()}">{if $oComment->getCountFavourite()>0}{$oComment->getCountFavourite()}{else} {/if}</span></a></li>
|
||||||
{/if}
|
{/if}
|
||||||
{if !$oComment->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
|
{if !$oComment->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
|
||||||
<li><a href="#" class="delete" onclick="ls.comments.toggle(this,{$oComment->getId()}); return false;">{$aLang.comment_delete}</a></li>
|
<li><a href="#" class="delete" onclick="ls.comments.toggle(this,{$oComment->getId()}); return false;">{$aLang.comment_delete}</a></li>
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
.comment .info li a.favourite { float: left; width: 10px; height: 8px; background: url(../images/icons.gif) -40px -40px no-repeat; position: relative; top: 4px; }
|
.comment .info li a.favourite { float: left; width: 10px; height: 8px; background: url(../images/icons.gif) -40px -40px no-repeat; position: relative; top: 4px; }
|
||||||
.comment .info li a.favourite.active { background-position: -50px -40px; }
|
.comment .info li a.favourite.active { background-position: -50px -40px; }
|
||||||
.comment .info li a.favourite:hover { background-position: -50px -40px; }
|
.comment .info li a.favourite:hover { background-position: -50px -40px; }
|
||||||
|
.comment .info li span.favourite-count { color: #390; margin-left: 2px; position: relative; top: 1px; }
|
||||||
.comment .info li a { }
|
.comment .info li a { }
|
||||||
|
|
||||||
/* Content */
|
/* Content */
|
||||||
|
|
|
@ -42,9 +42,10 @@
|
||||||
.topic .info li.comments-link a:hover span { background: #390; color: #fff; }
|
.topic .info li.comments-link a:hover span { background: #390; color: #fff; }
|
||||||
.topic .info li.url a { padding-left: 16px; background: url(../images/topic_link.gif) 0 1px no-repeat; font-size: 11px; }
|
.topic .info li.url a { padding-left: 16px; background: url(../images/topic_link.gif) 0 1px no-repeat; font-size: 11px; }
|
||||||
|
|
||||||
.topic .favourite { position: absolute; top: 8px; left: -8px; height: 16px; width: 20px; background: url(../images/icons.gif) no-repeat 0 -40px; }
|
.topic .favourite { position: absolute; top: 8px; left: -8px; height: 16px; width: 20px; background: url(../images/icons.gif) no-repeat 0 -40px; text-align: center; font-weight: bold; text-decoration: none; }
|
||||||
.topic .favourite:hover { background: url(../images/icons.gif) no-repeat -20px -40px; }
|
.topic .favourite:hover { background: url(../images/icons.gif) no-repeat -20px -40px; color: #fff; }
|
||||||
.topic .favourite.active { background: url(../images/icons.gif) no-repeat -20px -40px; }
|
.topic .favourite.active { background: url(../images/icons.gif) no-repeat -20px -40px; color: #fff; }
|
||||||
|
.topic .favourite-count { color: #390; position: absolute;top: 15px; left: -7px; width: 32px; }
|
||||||
|
|
||||||
/* Poll */
|
/* Poll */
|
||||||
.topic .poll { margin-bottom: 15px; font-size: 14px; }
|
.topic .poll { margin-bottom: 15px; font-size: 14px; }
|
||||||
|
|
|
@ -47,6 +47,8 @@ ls.favourite = (function ($) {
|
||||||
if (result.bState) {
|
if (result.bState) {
|
||||||
this.objFavourite.addClass(this.options.active);
|
this.objFavourite.addClass(this.options.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#fav_count_'+type+'_'+idTarget).text((result.iCount>0) ? result.iCount : '');
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<img src="{cfg name='path.static.skin'}/images/topic_link_big.gif" title="{$aLang.topic_link}" alt="{$aLang.topic_link}" />
|
<img src="{cfg name='path.static.skin'}/images/topic_link_big.gif" title="{$aLang.topic_link}" alt="{$aLang.topic_link}" />
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
|
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></a>
|
||||||
|
|
||||||
|
|
||||||
<div class="info-top">
|
<div class="info-top">
|
||||||
|
|
|
@ -20,7 +20,7 @@ jQuery(window).load(function($) {
|
||||||
{/if}
|
{/if}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
|
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
|
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
|
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else} {/if}</span></a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue