mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-08 09:24:25 +03:00
Merge branch 'master' of https://github.com/livestreet/livestreet
Conflicts: templates/skin/developer-jquery/actions/ActionProfile/wall_items.tpl
This commit is contained in:
commit
168ddd2297
|
@ -408,6 +408,16 @@ class ModuleStream extends Module {
|
|||
$aIds = $this->oMapper->getUserSubscribes($iUserId);
|
||||
return $this->User_GetUsersAdditionalData($aIds);
|
||||
}
|
||||
/**
|
||||
* Проверяет подписан ли пользователь на конкретного пользователя
|
||||
*
|
||||
* @param $iUserId
|
||||
* @param $iTargetUserId
|
||||
* @return bool
|
||||
*/
|
||||
public function IsSubscribe($iUserId,$iTargetUserId) {
|
||||
return $this->oMapper->IsSubscribe($iUserId,$iTargetUserId);
|
||||
}
|
||||
/**
|
||||
* Редактирование списка событий, на которые подписан юзер
|
||||
* @param int $iUserId
|
||||
|
|
|
@ -112,4 +112,13 @@ class ModuleStream_MapperStream extends Mapper {
|
|||
$this->oDb->query($sql, $iUserId, $iTargetUserId);
|
||||
}
|
||||
|
||||
public function IsSubscribe($iUserId,$iTargetUserId) {
|
||||
$sql = 'SELECT * FROM ' . Config::Get('db.table.stream_subscribe') . ' WHERE
|
||||
user_id = ?d AND target_user_id = ?d LIMIT 0,1';
|
||||
if ($this->oDb->selectRow($sql, $iUserId, $iTargetUserId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -504,8 +504,8 @@ class ModuleTopic extends Module {
|
|||
/**
|
||||
* Количество топиков по фильтру
|
||||
*
|
||||
* @param unknown_type $aFilter
|
||||
* @return unknown
|
||||
* @param array $aFilter
|
||||
* @return int
|
||||
*/
|
||||
public function GetCountTopicsByFilter($aFilter) {
|
||||
$s=serialize($aFilter);
|
||||
|
@ -515,6 +515,18 @@ class ModuleTopic extends Module {
|
|||
}
|
||||
return $data;
|
||||
}
|
||||
/**
|
||||
* Количество черновиков у пользователя
|
||||
*
|
||||
* @param $iUserId
|
||||
* @return int
|
||||
*/
|
||||
public function GetCountDraftTopicsByUserId($iUserId) {
|
||||
return $this->GetCountTopicsByFilter(array(
|
||||
'user_id' => $iUserId,
|
||||
'topic_publish' => 0
|
||||
));
|
||||
}
|
||||
/**
|
||||
* Получает список хороших топиков для вывода на главную страницу(из всех блогов, как коллективных так и персональных)
|
||||
*
|
||||
|
|
|
@ -357,8 +357,8 @@ class ModuleUser extends Module {
|
|||
*/
|
||||
public function Shutdown() {
|
||||
if ($this->oUserCurrent) {
|
||||
$iCountTalkNew=$this->Talk_GetCountTalkNew($this->oUserCurrent->getId());
|
||||
$this->Viewer_Assign('iUserCurrentCountTalkNew',$iCountTalkNew);
|
||||
$this->Viewer_Assign('iUserCurrentCountTalkNew',$this->Talk_GetCountTalkNew($this->oUserCurrent->getId()));
|
||||
$this->Viewer_Assign('iUserCurrentCountTopicDraft',$this->Topic_GetCountDraftTopicsByUserId($this->oUserCurrent->getId()));
|
||||
}
|
||||
$this->Viewer_Assign('oUserCurrent',$this->oUserCurrent);
|
||||
}
|
||||
|
|
|
@ -214,6 +214,16 @@ class ModuleUser_EntityUser extends Entity {
|
|||
public function getUserFriend() {
|
||||
return $this->_aData['user_friend'];
|
||||
}
|
||||
/**
|
||||
* Проверяет подписан ли текущий пользователь на этого
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isFollow() {
|
||||
if ($oUserCurrent=$this->User_GetUserCurrent()) {
|
||||
return $this->Stream_IsSubscribe($oUserCurrent->getId(),$this->getId());
|
||||
}
|
||||
}
|
||||
|
||||
public function setId($data) {
|
||||
$this->_aData['user_id']=$data;
|
||||
|
|
|
@ -151,7 +151,7 @@ class ModuleWall extends Module {
|
|||
$aUserId[]=$oWall->getUserId();
|
||||
}
|
||||
if (isset($aAllowData['wall_user'])) {
|
||||
$aWallUserId[]=$oWall->getUserId();
|
||||
$aWallUserId[]=$oWall->getWallUserId();
|
||||
}
|
||||
/**
|
||||
* Список последних записей хранится в строке через запятую
|
||||
|
@ -179,8 +179,8 @@ class ModuleWall extends Module {
|
|||
} else {
|
||||
$oWall->setUser(null); // или $oWall->setUser(new ModuleUser_EntityUser());
|
||||
}
|
||||
if (isset($aWallUsers[$oWall->getUserId()])) {
|
||||
$oWall->setWallUser($aWallUsers[$oWall->getUserId()]);
|
||||
if (isset($aWallUsers[$oWall->getWallUserId()])) {
|
||||
$oWall->setWallUser($aWallUsers[$oWall->getWallUserId()]);
|
||||
} else {
|
||||
$oWall->setWallUser(null);
|
||||
}
|
||||
|
@ -243,6 +243,9 @@ class ModuleWall extends Module {
|
|||
public function DeleteWall($oWall) {
|
||||
$this->oMapper->DeleteWallsByPid($oWall->getId());
|
||||
$this->oMapper->DeleteWallById($oWall->getId());
|
||||
if ($oWallParent=$oWall->GetPidWall()) {
|
||||
$this->UpdatePidWall($oWallParent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
{include file='actions/ActionProfile/friend_item.tpl' oUserFriend=$oUserProfile->getUserFriend()}
|
||||
<li><a href="{router page='talk'}add/?talk_users={$oUserProfile->getLogin()}">{$aLang.user_write_prvmsg}</a></li>
|
||||
<li>
|
||||
<a href="#" onclick="ls.user.followToggle(this, {$oUserProfile->getId()}); return false;" class="{if false}follow{/if}">
|
||||
{if false}{$aLang.profile_user_unfollow}{else}{$aLang.profile_user_follow}{/if}
|
||||
<a href="#" onclick="ls.user.followToggle(this, {$oUserProfile->getId()}); return false;" class="{if $oUserProfile->isFollow()}followed{/if}">
|
||||
{if $oUserProfile->isFollow()}{$aLang.profile_user_unfollow}{else}{$aLang.profile_user_follow}{/if}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -9,21 +9,18 @@
|
|||
<ul class="comment-info">
|
||||
<li class="comment-author"><a href="{$oWallUser->getUserWebPath()}">{$oWallUser->getLogin()}</a></li>
|
||||
<li class="comment-date"><time datetime="{date_format date=$oWall->getDateAdd() format='c'}">{date_format date=$oWall->getDateAdd() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}</time></li>
|
||||
{if $oWall->isAllowDelete()}
|
||||
<li><a href="#" onclick="return ls.wall.remove({$oWall->getId()});" class="link-dotted">Удалить</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
|
||||
<div class="comment-content text">
|
||||
{$oWall->getText()}
|
||||
</div>
|
||||
|
||||
{if ($oUserCurrent and !$aReplyWall) or $oWall->isAllowDelete()}
|
||||
<ul class="comment-actions">
|
||||
{if $oUserCurrent and !$aReplyWall}
|
||||
<ul class="comment-actions">
|
||||
<li><a href="#" class="link-dotted" onclick="return ls.wall.toggleReply({$oWall->getId()});">Ответить</a></li>
|
||||
{/if}
|
||||
|
||||
{if $oWall->isAllowDelete()}
|
||||
<li><a href="#" onclick="return ls.wall.remove({$oWall->getId()});" class="link-dotted">Удалить</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -6,16 +6,13 @@
|
|||
<ul class="comment-info">
|
||||
<li class="comment-author"><a href="{$oReplyUser->getUserWebPath()}">{$oReplyUser->getLogin()}</a></li>
|
||||
<li class="comment-date"><time datetime="{date_format date=$oReplyWall->getDateAdd() format='c'}">{date_format date=$oReplyWall->getDateAdd() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}</time></li>
|
||||
{if $oReplyWall->isAllowDelete()}
|
||||
<li><a href="#" onclick="return ls.wall.remove({$oReplyWall->getId()});" class="link-dotted">Удалить</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
|
||||
<div class="comment-content text">
|
||||
{$oReplyWall->getText()}
|
||||
</div>
|
||||
|
||||
{if $oReplyWall->isAllowDelete()}
|
||||
<ul class="comment-actions">
|
||||
<li><a href="#" onclick="return ls.wall.remove({$oReplyWall->getId()});" class="link-dotted">Удалить</a></li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{/foreach}
|
|
@ -14,7 +14,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li><a href="{router page='topic'}add/" class="write" id="modal_write_show">{$aLang.topic_create}</a></li>
|
||||
<li><a href="{router page='talk'}" {if $iUserCurrentCountTalkNew}class="new-messages"{/if} id="new_messages" title="{$aLang.user_privat_messages_new}">{$aLang.user_privat_messages} ({$iUserCurrentCountTalkNew})</a></li>
|
||||
<li><a href="{router page='talk'}" {if $iUserCurrentCountTalkNew}class="new-messages"{/if} id="new_messages" title="{if $iUserCurrentCountTalkNew}{$aLang.user_privat_messages_new}{/if}">{$aLang.user_privat_messages}{if $iUserCurrentCountTalkNew} ({$iUserCurrentCountTalkNew}){/if}</a></li>
|
||||
<li><a href="{router page='settings'}profile/">{$aLang.user_settings}</a></li>
|
||||
<li><a href="{router page='login'}exit/?security_ls_key={$LIVESTREET_SECURITY_KEY}">{$aLang.exit}</a></li>
|
||||
|
||||
|
|
|
@ -27,10 +27,12 @@
|
|||
<a href="{router page='blog'}add" class="write-item-image"></a>
|
||||
<a href="{router page='blog'}add" class="write-item-link">Блог</a>
|
||||
</li>
|
||||
{if $iUserCurrentCountTopicDraft}
|
||||
<li class="write-item-type-draft">
|
||||
<a href="{router page='topic'}saved/" class="write-item-image"></a>
|
||||
<a href="{router page='topic'}saved/" class="write-item-link">{$aLang.topic_menu_saved} (0)</a>
|
||||
<a href="{router page='topic'}saved/" class="write-item-link">{$aLang.topic_menu_saved} ({$iUserCurrentCountTopicDraft})</a>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
{/strip}
|
||||
|
|
Loading…
Reference in a new issue