1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-18 14:24:28 +03:00
Conflicts:
	templates/skin/developer-jquery/actions/ActionProfile/wall_items.tpl
This commit is contained in:
Denis Shakhov 2012-04-16 01:12:01 +07:00
commit 168ddd2297
11 changed files with 575 additions and 535 deletions

View file

@ -408,6 +408,16 @@ class ModuleStream extends Module {
$aIds = $this->oMapper->getUserSubscribes($iUserId); $aIds = $this->oMapper->getUserSubscribes($iUserId);
return $this->User_GetUsersAdditionalData($aIds); 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 * @param int $iUserId

View file

@ -112,4 +112,13 @@ class ModuleStream_MapperStream extends Mapper {
$this->oDb->query($sql, $iUserId, $iTargetUserId); $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;
}
} }

View file

@ -308,12 +308,12 @@ class ModuleTopic extends Module {
} }
if ($oTopic->getPublish()!=$oTopicOld->getPublish()) { if ($oTopic->getPublish()!=$oTopicOld->getPublish()) {
/** /**
* Обновляем избранное * Обновляем избранное
*/ */
$this->SetFavouriteTopicPublish($oTopic->getId(),$oTopic->getPublish()); $this->SetFavouriteTopicPublish($oTopic->getId(),$oTopic->getPublish());
/** /**
* Удаляем комментарий топика из прямого эфира * Удаляем комментарий топика из прямого эфира
*/ */
if ($oTopic->getPublish()==0) { if ($oTopic->getPublish()==0) {
$this->Comment_DeleteCommentOnlineByTargetId($oTopic->getId(),'topic'); $this->Comment_DeleteCommentOnlineByTargetId($oTopic->getId(),'topic');
} }
@ -489,13 +489,13 @@ class ModuleTopic extends Module {
if (false === ($data = $this->Cache_Get("topic_filter_{$s}_{$iPage}_{$iPerPage}"))) { if (false === ($data = $this->Cache_Get("topic_filter_{$s}_{$iPage}_{$iPerPage}"))) {
$data = ($iPage*$iPerPage!=0) $data = ($iPage*$iPerPage!=0)
? array( ? array(
'collection'=>$this->oMapperTopic->GetTopics($aFilter,$iCount,$iPage,$iPerPage), 'collection'=>$this->oMapperTopic->GetTopics($aFilter,$iCount,$iPage,$iPerPage),
'count'=>$iCount 'count'=>$iCount
) )
: array( : array(
'collection'=>$this->oMapperTopic->GetAllTopics($aFilter), 'collection'=>$this->oMapperTopic->GetAllTopics($aFilter),
'count'=>$this->GetCountTopicsByFilter($aFilter) 'count'=>$this->GetCountTopicsByFilter($aFilter)
); );
$this->Cache_Set($data, "topic_filter_{$s}_{$iPage}_{$iPerPage}", array('topic_update','topic_new'), 60*60*24*3); $this->Cache_Set($data, "topic_filter_{$s}_{$iPage}_{$iPerPage}", array('topic_update','topic_new'), 60*60*24*3);
} }
$data['collection']=$this->GetTopicsAdditionalData($data['collection'],$aAllowData); $data['collection']=$this->GetTopicsAdditionalData($data['collection'],$aAllowData);
@ -504,8 +504,8 @@ class ModuleTopic extends Module {
/** /**
* Количество топиков по фильтру * Количество топиков по фильтру
* *
* @param unknown_type $aFilter * @param array $aFilter
* @return unknown * @return int
*/ */
public function GetCountTopicsByFilter($aFilter) { public function GetCountTopicsByFilter($aFilter) {
$s=serialize($aFilter); $s=serialize($aFilter);
@ -515,6 +515,18 @@ class ModuleTopic extends Module {
} }
return $data; return $data;
} }
/**
* Количество черновиков у пользователя
*
* @param $iUserId
* @return int
*/
public function GetCountDraftTopicsByUserId($iUserId) {
return $this->GetCountTopicsByFilter(array(
'user_id' => $iUserId,
'topic_publish' => 0
));
}
/** /**
* Получает список хороших топиков для вывода на главную страницу(из всех блогов, как коллективных так и персональных) * Получает список хороших топиков для вывода на главную страницу(из всех блогов, как коллективных так и персональных)
* *
@ -1619,10 +1631,10 @@ class ModuleTopic extends Module {
} }
/** /**
* Добавить к топику изображение * Добавить к топику изображение
* @param type $oPhoto * @param type $oPhoto
* @return type * @return type
*/ */
public function addTopicPhoto($oPhoto) { public function addTopicPhoto($oPhoto) {
if ($sId=$this->oMapperTopic->addTopicPhoto($oPhoto)) { if ($sId=$this->oMapperTopic->addTopicPhoto($oPhoto)) {
$oPhoto->setId($sId); $oPhoto->setId($sId);
@ -1634,10 +1646,10 @@ class ModuleTopic extends Module {
/** /**
* Получить изображение из фотосета по его id * Получить изображение из фотосета по его id
* @param type $sId * @param type $sId
* @return type * @return type
*/ */
public function getTopicPhotoById($sId) { public function getTopicPhotoById($sId) {
$aPhotos=$this->GetTopicPhotosByArrayId($sId); $aPhotos=$this->GetTopicPhotosByArrayId($sId);
if (isset($aPhotos[$sId])) { if (isset($aPhotos[$sId])) {
@ -1647,39 +1659,39 @@ class ModuleTopic extends Module {
} }
/** /**
* Получить список изображений из фотосета по id топика * Получить список изображений из фотосета по id топика
* @param type $iTopicId * @param type $iTopicId
* @param type $iFromId * @param type $iFromId
* @param type $iCount * @param type $iCount
* @return type * @return type
*/ */
public function getPhotosByTopicId($iTopicId, $iFromId = null, $iCount = null) { public function getPhotosByTopicId($iTopicId, $iFromId = null, $iCount = null) {
return $this->oMapperTopic->getPhotosByTopicId($iTopicId, $iFromId, $iCount); return $this->oMapperTopic->getPhotosByTopicId($iTopicId, $iFromId, $iCount);
} }
/** /**
* Получить список изображений из фотосета по временному коду * Получить список изображений из фотосета по временному коду
* @param type $sTargetTmp * @param type $sTargetTmp
* @return type * @return type
*/ */
public function getPhotosByTargetTmp($sTargetTmp) { public function getPhotosByTargetTmp($sTargetTmp) {
return $this->oMapperTopic->getPhotosByTargetTmp($sTargetTmp); return $this->oMapperTopic->getPhotosByTargetTmp($sTargetTmp);
} }
/** /**
* Получить число изображений из фотосета по id топика * Получить число изображений из фотосета по id топика
* @param type $iTopicId * @param type $iTopicId
* @return type * @return type
*/ */
public function getCountPhotosByTopicId($iTopicId) { public function getCountPhotosByTopicId($iTopicId) {
return $this->oMapperTopic->getCountPhotosByTopicId($iTopicId); return $this->oMapperTopic->getCountPhotosByTopicId($iTopicId);
} }
/** /**
* Получить число изображений из фотосета по id топика * Получить число изображений из фотосета по id топика
* @param type $sTargetTmp * @param type $sTargetTmp
* @return type * @return type
*/ */
public function getCountPhotosByTargetTmp($sTargetTmp) { public function getCountPhotosByTargetTmp($sTargetTmp) {
return $this->oMapperTopic->getCountPhotosByTargetTmp($sTargetTmp); return $this->oMapperTopic->getCountPhotosByTargetTmp($sTargetTmp);
} }
@ -1687,19 +1699,19 @@ class ModuleTopic extends Module {
/** /**
* обновить данные по изображению * обновить данные по изображению
* @param type $oPhoto * @param type $oPhoto
*/ */
public function updateTopicPhoto($oPhoto) { public function updateTopicPhoto($oPhoto) {
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("photoset_photo_update")); $this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("photoset_photo_update"));
$this->oMapperTopic->updateTopicPhoto($oPhoto); $this->oMapperTopic->updateTopicPhoto($oPhoto);
} }
/** /**
* Удалить изображение * Удалить изображение
* @param type $oPhoto * @param type $oPhoto
* @return type * @return type
*/ */
public function deleteTopicPhoto($oPhoto) { public function deleteTopicPhoto($oPhoto) {
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("photoset_photo_update")); $this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("photoset_photo_update"));
$this->oMapperTopic->deleteTopicPhoto($oPhoto->getId()); $this->oMapperTopic->deleteTopicPhoto($oPhoto->getId());
@ -1718,10 +1730,10 @@ class ModuleTopic extends Module {
} }
/** /**
* Загрузить изображение * Загрузить изображение
* @param type $aFile * @param type $aFile
* @return string * @return string
*/ */
public function UploadTopicPhoto($aFile) { public function UploadTopicPhoto($aFile) {
if(!is_array($aFile) || !isset($aFile['tmp_name'])) { if(!is_array($aFile) || !isset($aFile['tmp_name'])) {
return false; return false;
@ -1744,9 +1756,9 @@ class ModuleTopic extends Module {
$oImage = new LiveImage($sFileTmp); $oImage = new LiveImage($sFileTmp);
/** /**
* Если объект изображения не создан, * Если объект изображения не создан,
* возвращаем ошибку * возвращаем ошибку
*/ */
if($sError=$oImage->get_last_error()) { if($sError=$oImage->get_last_error()) {
// Вывод сообщения об ошибки, произошедшей при создании объекта изображения // Вывод сообщения об ошибки, произошедшей при создании объекта изображения
$this->Message_AddError($sError,$this->Lang_Get('error')); $this->Message_AddError($sError,$this->Lang_Get('error'));
@ -1758,9 +1770,9 @@ class ModuleTopic extends Module {
* Превышает максимальные размеры из конфига * Превышает максимальные размеры из конфига
*/ */
if (($oImage->get_image_params('width')>Config::Get('view.img_max_width')) or ($oImage->get_image_params('height')>Config::Get('view.img_max_height'))) { if (($oImage->get_image_params('width')>Config::Get('view.img_max_width')) or ($oImage->get_image_params('height')>Config::Get('view.img_max_height'))) {
$this->Message_AddError($this->Lang_Get('topic_photoset_error_size'),$this->Lang_Get('error')); $this->Message_AddError($this->Lang_Get('topic_photoset_error_size'),$this->Lang_Get('error'));
@unlink($sFileTmp); @unlink($sFileTmp);
return false; return false;
} }
// Добавляем к загруженному файлу расширение // Добавляем к загруженному файлу расширение
@ -1782,14 +1794,14 @@ class ModuleTopic extends Module {
return $this->Image_GetWebPath($sFile); return $this->Image_GetWebPath($sFile);
} }
/** /**
* Пересчитывает счетчик избранных топиков * Пересчитывает счетчик избранных топиков
* *
* @return bool * @return bool
*/ */
public function RecalculateFavourite(){ public function RecalculateFavourite(){
return $this->oMapperTopic->RecalculateFavourite(); return $this->oMapperTopic->RecalculateFavourite();
} }
/** /**
* Пересчитывает счетчики голосований * Пересчитывает счетчики голосований

View file

@ -357,8 +357,8 @@ class ModuleUser extends Module {
*/ */
public function Shutdown() { public function Shutdown() {
if ($this->oUserCurrent) { if ($this->oUserCurrent) {
$iCountTalkNew=$this->Talk_GetCountTalkNew($this->oUserCurrent->getId()); $this->Viewer_Assign('iUserCurrentCountTalkNew',$this->Talk_GetCountTalkNew($this->oUserCurrent->getId()));
$this->Viewer_Assign('iUserCurrentCountTalkNew',$iCountTalkNew); $this->Viewer_Assign('iUserCurrentCountTopicDraft',$this->Topic_GetCountDraftTopicsByUserId($this->oUserCurrent->getId()));
} }
$this->Viewer_Assign('oUserCurrent',$this->oUserCurrent); $this->Viewer_Assign('oUserCurrent',$this->oUserCurrent);
} }
@ -546,8 +546,8 @@ class ModuleUser extends Module {
$this->oSession->setIpLast(func_getIp()); $this->oSession->setIpLast(func_getIp());
if (false === ($data = $this->Cache_Get("user_session_{$this->oSession->getUserId()}"))) { if (false === ($data = $this->Cache_Get("user_session_{$this->oSession->getUserId()}"))) {
$data=array( $data=array(
'time'=>time(), 'time'=>time(),
'session'=>$this->oSession 'session'=>$this->oSession
); );
} else { } else {
$data['session']=$this->oSession; $data['session']=$this->oSession;
@ -1213,68 +1213,68 @@ class ModuleUser extends Module {
} }
/** /**
* Получить дополниетльные поля профиля пользователя * Получить дополниетльные поля профиля пользователя
* @param array $aType Типы полей, null - все типы * @param array $aType Типы полей, null - все типы
* @return type * @return type
*/ */
public function getUserFields($aType=null) { public function getUserFields($aType=null) {
return $this->oMapper->getUserFields($aType); return $this->oMapper->getUserFields($aType);
} }
/** /**
* Получить значения дополнительных полей профиля пользователя * Получить значения дополнительных полей профиля пользователя
* @param int $iUserId * @param int $iUserId
* @param bool $bOnlyNoEmpty Загружать только непустые поля * @param bool $bOnlyNoEmpty Загружать только непустые поля
* @param array $aType Типы полей, null - все типы * @param array $aType Типы полей, null - все типы
* @return type * @return type
*/ */
public function getUserFieldsValues($iUserId, $bOnlyNoEmpty = true, $aType=array('')) { public function getUserFieldsValues($iUserId, $bOnlyNoEmpty = true, $aType=array('')) {
return $this->oMapper->getUserFieldsValues($iUserId, $bOnlyNoEmpty, $aType); return $this->oMapper->getUserFieldsValues($iUserId, $bOnlyNoEmpty, $aType);
} }
/** /**
* Получить по имени поля его значение дял определённого пользователя * Получить по имени поля его значение дял определённого пользователя
* @param type $iUserId * @param type $iUserId
* @param type $bOnlyNoEmpty Загружать только непустые поля * @param type $bOnlyNoEmpty Загружать только непустые поля
* @return type * @return type
*/ */
public function getUserFieldValueByName($iUserId, $sName) { public function getUserFieldValueByName($iUserId, $sName) {
return $this->oMapper->getUserFieldValueByName($iUserId, $sName); return $this->oMapper->getUserFieldValueByName($iUserId, $sName);
} }
/** /**
* Установить значения дополнительных полей профиля пользователя * Установить значения дополнительных полей профиля пользователя
* @param type $iUserId * @param type $iUserId
* @param type $aFields Ассоциативный массив полей id => value * @param type $aFields Ассоциативный массив полей id => value
* @return type * @return type
*/ */
public function setUserFieldsValues($iUserId, $aFields, $bSingle=true) { public function setUserFieldsValues($iUserId, $aFields, $bSingle=true) {
return $this->oMapper->setUserFieldsValues($iUserId, $aFields, $bSingle); return $this->oMapper->setUserFieldsValues($iUserId, $aFields, $bSingle);
} }
/** /**
* Добавить поле * Добавить поле
* @param type $sName * @param type $sName
* @return type * @return type
*/ */
public function addUserField($oField) { public function addUserField($oField) {
return $this->oMapper->addUserField($oField); return $this->oMapper->addUserField($oField);
} }
/** /**
* Изменить поле * Изменить поле
* @param type $sName * @param type $sName
* @return type * @return type
*/ */
public function updateUserField($oField) { public function updateUserField($oField) {
return $this->oMapper->updateUserField($oField); return $this->oMapper->updateUserField($oField);
} }
/** /**
* Удалить поле * Удалить поле
* @param type $iId * @param type $iId
* @return type * @return type
*/ */
public function deleteUserField($iId) { public function deleteUserField($iId) {
return $this->oMapper->deleteUserField($iId); return $this->oMapper->deleteUserField($iId);
} }

View file

@ -73,103 +73,103 @@ class ModuleUser_EntityUser extends Entity {
public function getId() { public function getId() {
return $this->_aData['user_id']; return $this->_aData['user_id'];
} }
public function getLogin() { public function getLogin() {
return $this->_aData['user_login']; return $this->_aData['user_login'];
} }
public function getPassword() { public function getPassword() {
return $this->_aData['user_password']; return $this->_aData['user_password'];
} }
public function getMail() { public function getMail() {
return $this->_aData['user_mail']; return $this->_aData['user_mail'];
} }
public function getSkill() { public function getSkill() {
return number_format(round($this->_aData['user_skill'],2), 2, '.', ''); return number_format(round($this->_aData['user_skill'],2), 2, '.', '');
} }
public function getDateRegister() { public function getDateRegister() {
return $this->_aData['user_date_register']; return $this->_aData['user_date_register'];
} }
public function getDateActivate() { public function getDateActivate() {
return $this->_aData['user_date_activate']; return $this->_aData['user_date_activate'];
} }
public function getDateCommentLast() { public function getDateCommentLast() {
return $this->_aData['user_date_comment_last']; return $this->_aData['user_date_comment_last'];
} }
public function getIpRegister() { public function getIpRegister() {
return $this->_aData['user_ip_register']; return $this->_aData['user_ip_register'];
} }
public function getRating() { public function getRating() {
return number_format(round($this->_aData['user_rating'],2), 2, '.', ''); return number_format(round($this->_aData['user_rating'],2), 2, '.', '');
} }
public function getCountVote() { public function getCountVote() {
return $this->_aData['user_count_vote']; return $this->_aData['user_count_vote'];
} }
public function getActivate() { public function getActivate() {
return $this->_aData['user_activate']; return $this->_aData['user_activate'];
} }
public function getActivateKey() { public function getActivateKey() {
return $this->_aData['user_activate_key']; return $this->_aData['user_activate_key'];
} }
public function getProfileName() { public function getProfileName() {
return $this->_aData['user_profile_name']; return $this->_aData['user_profile_name'];
} }
public function getProfileSex() { public function getProfileSex() {
return $this->_aData['user_profile_sex']; return $this->_aData['user_profile_sex'];
} }
public function getProfileCountry() { public function getProfileCountry() {
return $this->_aData['user_profile_country']; return $this->_aData['user_profile_country'];
} }
public function getProfileRegion() { public function getProfileRegion() {
return $this->_aData['user_profile_region']; return $this->_aData['user_profile_region'];
} }
public function getProfileCity() { public function getProfileCity() {
return $this->_aData['user_profile_city']; return $this->_aData['user_profile_city'];
} }
public function getProfileBirthday() { public function getProfileBirthday() {
return $this->_aData['user_profile_birthday']; return $this->_aData['user_profile_birthday'];
} }
public function getProfileAbout() { public function getProfileAbout() {
return $this->_aData['user_profile_about']; return $this->_aData['user_profile_about'];
} }
public function getProfileDate() { public function getProfileDate() {
return $this->_aData['user_profile_date']; return $this->_aData['user_profile_date'];
} }
public function getProfileAvatar() { public function getProfileAvatar() {
return $this->_aData['user_profile_avatar']; return $this->_aData['user_profile_avatar'];
} }
public function getProfileAvatarType() { public function getProfileAvatarType() {
return ($sPath=$this->getProfileAvatarPath()) ? pathinfo($sPath,PATHINFO_EXTENSION) : null; return ($sPath=$this->getProfileAvatarPath()) ? pathinfo($sPath,PATHINFO_EXTENSION) : null;
} }
public function getProfileFoto() { public function getProfileFoto() {
return $this->_aData['user_profile_foto']; return $this->_aData['user_profile_foto'];
} }
public function getSettingsNoticeNewTopic() { public function getSettingsNoticeNewTopic() {
return $this->_aData['user_settings_notice_new_topic']; return $this->_aData['user_settings_notice_new_topic'];
} }
public function getSettingsNoticeNewComment() { public function getSettingsNoticeNewComment() {
return $this->_aData['user_settings_notice_new_comment']; return $this->_aData['user_settings_notice_new_comment'];
} }
public function getSettingsNoticeNewTalk() { public function getSettingsNoticeNewTalk() {
return $this->_aData['user_settings_notice_new_talk']; return $this->_aData['user_settings_notice_new_talk'];
} }
public function getSettingsNoticeReplyComment() { public function getSettingsNoticeReplyComment() {
return $this->_aData['user_settings_notice_reply_comment']; return $this->_aData['user_settings_notice_reply_comment'];
} }
public function getSettingsNoticeNewFriend() { public function getSettingsNoticeNewFriend() {
return $this->_aData['user_settings_notice_new_friend']; return $this->_aData['user_settings_notice_new_friend'];
} }
public function getUserFieldValues($bOnlyNoEmpty = true, $sType='') { public function getUserFieldValues($bOnlyNoEmpty = true, $sType='') {
return $this->User_getUserFieldsValues($this->getId(), $bOnlyNoEmpty,$sType); return $this->User_getUserFieldsValues($this->getId(), $bOnlyNoEmpty,$sType);
} }
public function getSession() { public function getSession() {
if (!isset($this->_aData['session'])) { if (!isset($this->_aData['session'])) {
$this->_aData['session']=$this->User_GetSessionByUserId($this->getId()); $this->_aData['session']=$this->User_GetSessionByUserId($this->getId());
} }
return $this->_aData['session']; return $this->_aData['session'];
} }
public function isOnline() { public function isOnline() {
if ($oSession=$this->getSession()) { if ($oSession=$this->getSession()) {
if (time()-strtotime($oSession->getDateLast())<60*10) { // 10 минут if (time()-strtotime($oSession->getDateLast())<60*10) { // 10 минут
@ -178,13 +178,13 @@ class ModuleUser_EntityUser extends Entity {
} }
return false; return false;
} }
public function getProfileAvatarPath($iSize=100) { public function getProfileAvatarPath($iSize=100) {
if ($sPath=$this->getProfileAvatar()) { if ($sPath=$this->getProfileAvatar()) {
return str_replace('_100x100',(($iSize==0)?"":"_{$iSize}x{$iSize}"),$sPath."?".date('His',strtotime($this->getProfileDate()))); return str_replace('_100x100',(($iSize==0)?"":"_{$iSize}x{$iSize}"),$sPath."?".date('His',strtotime($this->getProfileDate())));
} else { } else {
return Config::Get('path.static.skin').'/images/avatar_'.$iSize.'x'.$iSize.'.jpg'; return Config::Get('path.static.skin').'/images/avatar_'.$iSize.'x'.$iSize.'.jpg';
} }
} }
public function getProfileFotoPath() { public function getProfileFotoPath() {
if ($this->getProfileFoto()) { if ($this->getProfileFoto()) {
return $this->getProfileFoto(); return $this->getProfileFoto();
@ -194,129 +194,139 @@ class ModuleUser_EntityUser extends Entity {
public function getProfileFotoDefault() { public function getProfileFotoDefault() {
return Config::Get('path.static.skin').'/images/user_foto_250.png'; return Config::Get('path.static.skin').'/images/user_foto_250.png';
} }
public function getVote() { public function getVote() {
return $this->_aData['vote']; return $this->_aData['vote'];
} }
public function getUserIsFriend() { public function getUserIsFriend() {
return $this->_aData['user_is_friend']; return $this->_aData['user_is_friend'];
} }
public function isAdministrator() { public function isAdministrator() {
return $this->_aData['user_is_administrator']; return $this->_aData['user_is_administrator'];
} }
public function getUserWebPath() { public function getUserWebPath() {
return Router::GetPath('profile').$this->getLogin().'/'; return Router::GetPath('profile').$this->getLogin().'/';
} }
/** /**
* Возвращает статус дружбы с текущим пользователем * Возвращает статус дружбы с текущим пользователем
* *
* @return int * @return int
*/ */
public function getUserFriend() { public function getUserFriend() {
return $this->_aData['user_friend']; 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) { public function setId($data) {
$this->_aData['user_id']=$data; $this->_aData['user_id']=$data;
} }
public function setLogin($data) { public function setLogin($data) {
$this->_aData['user_login']=$data; $this->_aData['user_login']=$data;
} }
public function setPassword($data) { public function setPassword($data) {
$this->_aData['user_password']=$data; $this->_aData['user_password']=$data;
} }
public function setMail($data) { public function setMail($data) {
$this->_aData['user_mail']=$data; $this->_aData['user_mail']=$data;
} }
public function setSkill($data) { public function setSkill($data) {
$this->_aData['user_skill']=$data; $this->_aData['user_skill']=$data;
} }
public function setDateRegister($data) { public function setDateRegister($data) {
$this->_aData['user_date_register']=$data; $this->_aData['user_date_register']=$data;
} }
public function setDateActivate($data) { public function setDateActivate($data) {
$this->_aData['user_date_activate']=$data; $this->_aData['user_date_activate']=$data;
} }
public function setDateCommentLast($data) { public function setDateCommentLast($data) {
$this->_aData['user_date_comment_last']=$data; $this->_aData['user_date_comment_last']=$data;
} }
public function setIpRegister($data) { public function setIpRegister($data) {
$this->_aData['user_ip_register']=$data; $this->_aData['user_ip_register']=$data;
} }
public function setRating($data) { public function setRating($data) {
$this->_aData['user_rating']=$data; $this->_aData['user_rating']=$data;
} }
public function setCountVote($data) { public function setCountVote($data) {
$this->_aData['user_count_vote']=$data; $this->_aData['user_count_vote']=$data;
} }
public function setActivate($data) { public function setActivate($data) {
$this->_aData['user_activate']=$data; $this->_aData['user_activate']=$data;
} }
public function setActivateKey($data) { public function setActivateKey($data) {
$this->_aData['user_activate_key']=$data; $this->_aData['user_activate_key']=$data;
} }
public function setProfileName($data) { public function setProfileName($data) {
$this->_aData['user_profile_name']=$data; $this->_aData['user_profile_name']=$data;
} }
public function setProfileSex($data) { public function setProfileSex($data) {
$this->_aData['user_profile_sex']=$data; $this->_aData['user_profile_sex']=$data;
} }
public function setProfileCountry($data) { public function setProfileCountry($data) {
$this->_aData['user_profile_country']=$data; $this->_aData['user_profile_country']=$data;
} }
public function setProfileRegion($data) { public function setProfileRegion($data) {
$this->_aData['user_profile_region']=$data; $this->_aData['user_profile_region']=$data;
} }
public function setProfileCity($data) { public function setProfileCity($data) {
$this->_aData['user_profile_city']=$data; $this->_aData['user_profile_city']=$data;
} }
public function setProfileBirthday($data) { public function setProfileBirthday($data) {
$this->_aData['user_profile_birthday']=$data; $this->_aData['user_profile_birthday']=$data;
} }
public function setProfileAbout($data) { public function setProfileAbout($data) {
$this->_aData['user_profile_about']=$data; $this->_aData['user_profile_about']=$data;
} }
public function setProfileDate($data) { public function setProfileDate($data) {
$this->_aData['user_profile_date']=$data; $this->_aData['user_profile_date']=$data;
} }
public function setProfileAvatar($data) { public function setProfileAvatar($data) {
$this->_aData['user_profile_avatar']=$data; $this->_aData['user_profile_avatar']=$data;
} }
public function setProfileFoto($data) { public function setProfileFoto($data) {
$this->_aData['user_profile_foto']=$data; $this->_aData['user_profile_foto']=$data;
} }
public function setSettingsNoticeNewTopic($data) { public function setSettingsNoticeNewTopic($data) {
$this->_aData['user_settings_notice_new_topic']=$data; $this->_aData['user_settings_notice_new_topic']=$data;
} }
public function setSettingsNoticeNewComment($data) { public function setSettingsNoticeNewComment($data) {
$this->_aData['user_settings_notice_new_comment']=$data; $this->_aData['user_settings_notice_new_comment']=$data;
} }
public function setSettingsNoticeNewTalk($data) { public function setSettingsNoticeNewTalk($data) {
$this->_aData['user_settings_notice_new_talk']=$data; $this->_aData['user_settings_notice_new_talk']=$data;
} }
public function setSettingsNoticeReplyComment($data) { public function setSettingsNoticeReplyComment($data) {
$this->_aData['user_settings_notice_reply_comment']=$data; $this->_aData['user_settings_notice_reply_comment']=$data;
} }
public function setSettingsNoticeNewFriend($data) { public function setSettingsNoticeNewFriend($data) {
$this->_aData['user_settings_notice_new_friend']=$data; $this->_aData['user_settings_notice_new_friend']=$data;
} }
public function setSession($data) { public function setSession($data) {
$this->_aData['session']=$data; $this->_aData['session']=$data;
} }
public function setUserIsFriend($data) { public function setUserIsFriend($data) {
$this->_aData['user_is_friend']=$data; $this->_aData['user_is_friend']=$data;
} }
public function setVote($data) { public function setVote($data) {
$this->_aData['vote']=$data; $this->_aData['vote']=$data;
} }
/** /**
* Устанавливаем статус дружбы с текущим пользователем * Устанавливаем статус дружбы с текущим пользователем
* *
* @param int $data * @param int $data
*/ */
public function setUserFriend($data) { public function setUserFriend($data) {
$this->_aData['user_friend']=$data; $this->_aData['user_friend']=$data;
} }
} }
?> ?>

View file

@ -151,7 +151,7 @@ class ModuleWall extends Module {
$aUserId[]=$oWall->getUserId(); $aUserId[]=$oWall->getUserId();
} }
if (isset($aAllowData['wall_user'])) { if (isset($aAllowData['wall_user'])) {
$aWallUserId[]=$oWall->getUserId(); $aWallUserId[]=$oWall->getWallUserId();
} }
/** /**
* Список последних записей хранится в строке через запятую * Список последних записей хранится в строке через запятую
@ -179,8 +179,8 @@ class ModuleWall extends Module {
} else { } else {
$oWall->setUser(null); // или $oWall->setUser(new ModuleUser_EntityUser()); $oWall->setUser(null); // или $oWall->setUser(new ModuleUser_EntityUser());
} }
if (isset($aWallUsers[$oWall->getUserId()])) { if (isset($aWallUsers[$oWall->getWallUserId()])) {
$oWall->setWallUser($aWallUsers[$oWall->getUserId()]); $oWall->setWallUser($aWallUsers[$oWall->getWallUserId()]);
} else { } else {
$oWall->setWallUser(null); $oWall->setWallUser(null);
} }
@ -243,6 +243,9 @@ class ModuleWall extends Module {
public function DeleteWall($oWall) { public function DeleteWall($oWall) {
$this->oMapper->DeleteWallsByPid($oWall->getId()); $this->oMapper->DeleteWallsByPid($oWall->getId());
$this->oMapper->DeleteWallById($oWall->getId()); $this->oMapper->DeleteWallById($oWall->getId());
if ($oWallParent=$oWall->GetPidWall()) {
$this->UpdatePidWall($oWallParent);
}
} }
} }

View file

@ -48,8 +48,8 @@
{include file='actions/ActionProfile/friend_item.tpl' oUserFriend=$oUserProfile->getUserFriend()} {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="{router page='talk'}add/?talk_users={$oUserProfile->getLogin()}">{$aLang.user_write_prvmsg}</a></li>
<li> <li>
<a href="#" onclick="ls.user.followToggle(this, {$oUserProfile->getId()}); return false;" class="{if false}follow{/if}"> <a href="#" onclick="ls.user.followToggle(this, {$oUserProfile->getId()}); return false;" class="{if $oUserProfile->isFollow()}followed{/if}">
{if false}{$aLang.profile_user_unfollow}{else}{$aLang.profile_user_follow}{/if} {if $oUserProfile->isFollow()}{$aLang.profile_user_unfollow}{else}{$aLang.profile_user_follow}{/if}
</a> </a>
</li> </li>
</ul> </ul>

View file

@ -9,21 +9,18 @@
<ul class="comment-info"> <ul class="comment-info">
<li class="comment-author"><a href="{$oWallUser->getUserWebPath()}">{$oWallUser->getLogin()}</a></li> <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> <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> </ul>
<div class="comment-content text"> <div class="comment-content text">
{$oWall->getText()} {$oWall->getText()}
</div> </div>
{if ($oUserCurrent and !$aReplyWall) or $oWall->isAllowDelete()} {if $oUserCurrent and !$aReplyWall}
<ul class="comment-actions"> <ul class="comment-actions">
{if $oUserCurrent and !$aReplyWall} <li><a href="#" class="link-dotted" onclick="return ls.wall.toggleReply({$oWall->getId()});">Ответить</a></li>
<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> </ul>
{/if} {/if}
</div> </div>

View file

@ -6,16 +6,13 @@
<ul class="comment-info"> <ul class="comment-info">
<li class="comment-author"><a href="{$oReplyUser->getUserWebPath()}">{$oReplyUser->getLogin()}</a></li> <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> <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> </ul>
<div class="comment-content text"> <div class="comment-content text">
{$oReplyWall->getText()} {$oReplyWall->getText()}
</div> </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> </div>
{/foreach} {/foreach}

View file

@ -14,7 +14,7 @@
</a> </a>
</li> </li>
<li><a href="{router page='topic'}add/" class="write" id="modal_write_show">{$aLang.topic_create}</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='settings'}profile/">{$aLang.user_settings}</a></li>
<li><a href="{router page='login'}exit/?security_ls_key={$LIVESTREET_SECURITY_KEY}">{$aLang.exit}</a></li> <li><a href="{router page='login'}exit/?security_ls_key={$LIVESTREET_SECURITY_KEY}">{$aLang.exit}</a></li>

View file

@ -27,10 +27,12 @@
<a href="{router page='blog'}add" class="write-item-image"></a> <a href="{router page='blog'}add" class="write-item-image"></a>
<a href="{router page='blog'}add" class="write-item-link">Блог</a> <a href="{router page='blog'}add" class="write-item-link">Блог</a>
</li> </li>
<li class="write-item-type-draft"> {if $iUserCurrentCountTopicDraft}
<a href="{router page='topic'}saved/" class="write-item-image"></a> <li class="write-item-type-draft">
<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-image"></a>
</li> <a href="{router page='topic'}saved/" class="write-item-link">{$aLang.topic_menu_saved} ({$iUserCurrentCountTopicDraft})</a>
</li>
{/if}
</ul> </ul>
</div> </div>
{/strip} {/strip}