From b5d8fcca23c3a268efa938d2cb4e5aded4c40e48 Mon Sep 17 00:00:00 2001 From: Alexey Yelizarov Date: Mon, 16 Apr 2012 15:40:13 +0400 Subject: [PATCH 01/11] Fix css --- templates/skin/developer-jquery/css/common.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/skin/developer-jquery/css/common.css b/templates/skin/developer-jquery/css/common.css index b35a1a81..c0e17e69 100644 --- a/templates/skin/developer-jquery/css/common.css +++ b/templates/skin/developer-jquery/css/common.css @@ -1,4 +1,3 @@ - /* Голосование ---------------------------------------------------------------*/ .vote { } @@ -219,7 +218,7 @@ .fl-r { float: right !important; } .fl-l { float: left !important; } -.hidden { display: none !important; } +.hidden { display: none; } .user, .ls-user { font-weight: bold; color: #333; } .user .icon-user { margin-right: 3px; } From 46364c39a2d95da932b3aeb434f9d398391eca0d Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Fri, 20 Apr 2012 14:36:07 +0400 Subject: [PATCH 02/11] fix menu --- classes/actions/ActionPeople.class.php | 4 ++++ classes/actions/ActionProfile.class.php | 10 +++++++++- classes/actions/ActionTalk.class.php | 13 +++++++++++-- templates/skin/developer-jquery/menu.people.tpl | 6 +++--- .../skin/developer-jquery/menu.profile_created.tpl | 6 +++--- .../developer-jquery/menu.profile_favourite.tpl | 4 ++-- templates/skin/developer-jquery/menu.talk.tpl | 10 +++++----- 7 files changed, 37 insertions(+), 16 deletions(-) diff --git a/classes/actions/ActionPeople.class.php b/classes/actions/ActionPeople.class.php index 1041f878..9f83b810 100644 --- a/classes/actions/ActionPeople.class.php +++ b/classes/actions/ActionPeople.class.php @@ -26,6 +26,7 @@ class ActionPeople extends Action { * @var unknown_type */ protected $sMenuHeadItemSelect='people'; + protected $sMenuItemSelect='all'; /** * Инициализация @@ -162,6 +163,7 @@ class ActionPeople extends Action { * */ protected function EventOnline() { + $this->sMenuItemSelect='online'; /** * Последние по визиту на сайт */ @@ -177,6 +179,7 @@ class ActionPeople extends Action { * */ protected function EventNew() { + $this->sMenuItemSelect='new'; /** * Последние по регистрации */ @@ -268,6 +271,7 @@ class ActionPeople extends Action { * Загружаем в шаблон необходимые переменные */ $this->Viewer_Assign('sMenuHeadItemSelect',$this->sMenuHeadItemSelect); + $this->Viewer_Assign('sMenuItemSelect',$this->sMenuItemSelect); } } ?> \ No newline at end of file diff --git a/classes/actions/ActionProfile.class.php b/classes/actions/ActionProfile.class.php index c5c2113e..9b94bc1e 100644 --- a/classes/actions/ActionProfile.class.php +++ b/classes/actions/ActionProfile.class.php @@ -27,6 +27,8 @@ class ActionProfile extends Action { */ protected $oUserProfile; + protected $sMenuSubItemSelect=''; + protected $oUserCurrent; public function Init() { @@ -137,6 +139,7 @@ class ActionProfile extends Action { if (!$this->CheckUserProfile()) { return parent::EventNotFound(); } + $this->sMenuSubItemSelect='topics'; /** * Передан ли номер страницы */ @@ -174,6 +177,7 @@ class ActionProfile extends Action { if (!$this->CheckUserProfile()) { return parent::EventNotFound(); } + $this->sMenuSubItemSelect='comments'; /** * Передан ли номер страницы */ @@ -207,6 +211,7 @@ class ActionProfile extends Action { if (!$this->CheckUserProfile()) { return parent::EventNotFound(); } + $this->sMenuSubItemSelect='topics'; /** * Передан ли номер страницы */ @@ -247,7 +252,7 @@ class ActionProfile extends Action { if (!$this->oUserCurrent or $this->oUserProfile->getId()!=$this->oUserCurrent->getId()) { return parent::EventNotFound(); } - + $this->sMenuSubItemSelect='topics'; $sTag=$this->GetParamEventMatch(3,0); /* * Передан ли номер страницы @@ -287,6 +292,7 @@ class ActionProfile extends Action { if (!$this->CheckUserProfile()) { return parent::EventNotFound(); } + $this->sMenuSubItemSelect='comments'; /** * Передан ли номер страницы */ @@ -587,6 +593,7 @@ class ActionProfile extends Action { if (!$this->CheckUserProfile()) { return parent::EventNotFound(); } + $this->sMenuSubItemSelect='notes'; /** * Заметки может читать только сам пользователь */ @@ -1157,6 +1164,7 @@ class ActionProfile extends Action { } $this->Viewer_Assign('iCountFriendsUser',$this->User_GetCountUsersFriend($this->oUserProfile->getId())); + $this->Viewer_Assign('sMenuSubItemSelect',$this->sMenuSubItemSelect); $this->Viewer_Assign('USER_FRIEND_NULL',ModuleUser::USER_FRIEND_NULL); $this->Viewer_Assign('USER_FRIEND_OFFER',ModuleUser::USER_FRIEND_OFFER); $this->Viewer_Assign('USER_FRIEND_ACCEPT',ModuleUser::USER_FRIEND_ACCEPT); diff --git a/classes/actions/ActionTalk.class.php b/classes/actions/ActionTalk.class.php index bbe98f24..a892e439 100644 --- a/classes/actions/ActionTalk.class.php +++ b/classes/actions/ActionTalk.class.php @@ -26,6 +26,8 @@ class ActionTalk extends Action { * @var unknown_type */ protected $oUserCurrent=null; + + protected $sMenuSubItemSelect=''; /** * Массив ID юзеров адресатов * @@ -126,6 +128,7 @@ class ActionTalk extends Action { $this->Talk_MarkReadTalkUserByArray(array_keys($aTalksIdDel),$this->oUserCurrent->getId()); } } + $this->sMenuSubItemSelect='inbox'; /** * Количество сообщений на страницу */ @@ -138,6 +141,7 @@ class ActionTalk extends Action { * Если только новые, то добавляем условие в фильтр */ if ($this->GetParam(0)=='new') { + $this->sMenuSubItemSelect='new'; $aFilter['only_new']=true; $iPerPage=50; // новых отображаем только последние 50 писем, без постраничности } @@ -268,11 +272,13 @@ class ActionTalk extends Action { } protected function EventBlacklist() { + $this->sMenuSubItemSelect='blacklist'; $aUsersBlacklist=$this->Talk_GetBlacklistByUserId($this->oUserCurrent->getId()); $this->Viewer_Assign('aUsersBlacklist',$aUsersBlacklist); } - protected function EventFavourites() { + protected function EventFavourites() { + $this->sMenuSubItemSelect='favourites'; /** * Передан ли номер страницы */ @@ -300,7 +306,8 @@ class ActionTalk extends Action { $this->Viewer_AddHtmlTitle($this->Lang_Get('talk_favourite_inbox')); } - protected function EventAdd() { + protected function EventAdd() { + $this->sMenuSubItemSelect='add'; $this->Viewer_AddHtmlTitle($this->Lang_Get('talk_menu_inbox_create')); /** @@ -340,6 +347,7 @@ class ActionTalk extends Action { protected function EventRead() { + $this->sMenuSubItemSelect='read'; /** * Получаем номер сообщения из УРЛ и проверяем существует ли оно */ @@ -1073,6 +1081,7 @@ class ActionTalk extends Action { $this->Viewer_Assign('iCountFavourite',$iCountCommentFavourite+$iCountTopicFavourite); $this->Viewer_Assign('iCountFriendsUser',$this->User_GetCountUsersFriend($this->oUserCurrent->getId())); + $this->Viewer_Assign('sMenuSubItemSelect',$this->sMenuSubItemSelect); /** * Передаем во вьевер константы состояний участников разговора */ diff --git a/templates/skin/developer-jquery/menu.people.tpl b/templates/skin/developer-jquery/menu.people.tpl index e963e90f..e0deced3 100644 --- a/templates/skin/developer-jquery/menu.people.tpl +++ b/templates/skin/developer-jquery/menu.people.tpl @@ -1,9 +1,9 @@ diff --git a/templates/skin/developer-jquery/menu.profile_created.tpl b/templates/skin/developer-jquery/menu.profile_created.tpl index 51771d6a..bdf20395 100644 --- a/templates/skin/developer-jquery/menu.profile_created.tpl +++ b/templates/skin/developer-jquery/menu.profile_created.tpl @@ -1,16 +1,16 @@

{$aLang.user_menu_publication}

+{hook run='admin_action'} + {include file='footer.tpl'} \ No newline at end of file diff --git a/templates/skin/developer-jquery/actions/ActionBlog/blog.tpl b/templates/skin/developer-jquery/actions/ActionBlog/blog.tpl index 12e7d9f9..73fb764a 100644 --- a/templates/skin/developer-jquery/actions/ActionBlog/blog.tpl +++ b/templates/skin/developer-jquery/actions/ActionBlog/blog.tpl @@ -81,6 +81,7 @@
+ {hook run='blog_info_begin' oBlog=$oBlog} {$aLang.blog_user_administrators} ({$iCountBlogAdministrators}): {$oUserOwner->getLogin()} {if $aBlogAdministrators} @@ -115,13 +116,14 @@ {else} {$aLang.blog_user_readers_empty} {/if} + {hook run='blog_info_end' oBlog=$oBlog}
{$aLang.blog_expand_info} - +{hook run='blog_info' oBlog=$oBlog} {/strip} From e3a04c5f3ec6855d9ec766a62e873ad595f98169 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sat, 21 Apr 2012 07:17:10 +0400 Subject: [PATCH 06/11] =?UTF-8?q?fix=20=D1=81=D1=82=D0=B5=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/modules/wall/Wall.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/modules/wall/Wall.class.php b/classes/modules/wall/Wall.class.php index 47e17ad5..31a6c946 100644 --- a/classes/modules/wall/Wall.class.php +++ b/classes/modules/wall/Wall.class.php @@ -231,8 +231,11 @@ class ModuleWall extends Module { $aKeys=array_keys($aResult['collection']); sort($aKeys,SORT_NUMERIC); $oWall->setLastReply(join(',',$aKeys)); - $this->UpdateWall($oWall); + } else { + $oWall->setCountReply(0); + $oWall->setLastReply(''); } + $this->UpdateWall($oWall); } /** From 53836994c4cdbc754c4c9975d3b282dbe29b3eb7 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sat, 21 Apr 2012 08:11:28 +0400 Subject: [PATCH 07/11] =?UTF-8?q?=D0=AD=D0=BA=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=81=D1=81=D1=8B?= =?UTF-8?q?=D0=BB=D0=BE=D0=BA=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0?= =?UTF-8?q?=D0=BA=D1=82=D0=B0=D1=85=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/convert_0.5.1_to_1.0.sql | 16 ++++++++-------- install/sql.sql | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/install/convert_0.5.1_to_1.0.sql b/install/convert_0.5.1_to_1.0.sql index fafa2822..49bc60b9 100644 --- a/install/convert_0.5.1_to_1.0.sql +++ b/install/convert_0.5.1_to_1.0.sql @@ -101,13 +101,13 @@ DROP TABLE `prefix_city`; INSERT INTO `prefix_user_field` (`type`, `name`, `title`, `pattern`) VALUES ('contact', 'phone', 'Телефон', ''), -('contact', 'mail', 'E-mail', '{*}'), -('contact', 'skype', 'Skype', '{*}'), -('contact', 'icq', 'ICQ', '{*}'), -('contact', 'www', 'Сайт', '{*}'), -('social', 'twitter', 'Twitter', '{*}'), -('social', 'facebook', 'Facebook', '{*}'), -('social', 'vkontakte', 'ВКонтакте', '{*}'), -('social', 'odnoklassniki', 'Одноклассники', '{*}'); +('contact', 'mail', 'E-mail', '{*}'), +('contact', 'skype', 'Skype', '{*}'), +('contact', 'icq', 'ICQ', '{*}'), +('contact', 'www', 'Сайт', '{*}'), +('social', 'twitter', 'Twitter', '{*}'), +('social', 'facebook', 'Facebook', '{*}'), +('social', 'vkontakte', 'ВКонтакте', '{*}'), +('social', 'odnoklassniki', 'Одноклассники', '{*}'); ALTER TABLE `prefix_favourite_tag` ADD INDEX ( `text` ); \ No newline at end of file diff --git a/install/sql.sql b/install/sql.sql index c8dede0c..73666de3 100644 --- a/install/sql.sql +++ b/install/sql.sql @@ -706,14 +706,14 @@ CREATE TABLE IF NOT EXISTS `prefix_user_field` ( INSERT INTO `prefix_user_field` (`id`, `type`, `name`, `title`, `pattern`) VALUES (1, 'contact', 'phone', 'Телефон', ''), -(2, 'contact', 'mail', 'E-mail', '{*}'), -(3, 'contact', 'skype', 'Skype', '{*}'), -(4, 'contact', 'icq', 'ICQ', '{*}'), -(5, 'contact', 'www', 'Сайт', '{*}'), -(6, 'social', 'twitter', 'Twitter', '{*}'), -(7, 'social', 'facebook', 'Facebook', '{*}'), -(8, 'social', 'vkontakte', 'ВКонтакте', '{*}'), -(9, 'social', 'odnoklassniki', 'Одноклассники', '{*}'); +(2, 'contact', 'mail', 'E-mail', '{*}'), +(3, 'contact', 'skype', 'Skype', '{*}'), +(4, 'contact', 'icq', 'ICQ', '{*}'), +(5, 'contact', 'www', 'Сайт', '{*}'), +(6, 'social', 'twitter', 'Twitter', '{*}'), +(7, 'social', 'facebook', 'Facebook', '{*}'), +(8, 'social', 'vkontakte', 'ВКонтакте', '{*}'), +(9, 'social', 'odnoklassniki', 'Одноклассники', '{*}'); -- -------------------------------------------------------- From 521ac89350aa7cb46d7c431620f721892539824f Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sat, 21 Apr 2012 08:40:14 +0400 Subject: [PATCH 08/11] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=B1=D0=BB=D0=BE=D0=BA=D0=BE=D0=B2=20=D0=B2=20/blocks/,=20?= =?UTF-8?q?=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=20=D1=82=D0=B0=D0=BA=20=D0=B6=D0=B5=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=BB=D0=B6=D0=BD=D1=8B=20=D0=BD=D0=B0=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=D1=81=D1=8F=20=D0=B2=20=D0=BA=D0=B0=D1=82?= =?UTF-8?q?=D0=B0=D0=BB=D0=BE=D0=B3=D0=B5=20/blocks/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/actions/ActionAjax.class.php | 10 +++++----- classes/blocks/BlockBlogs.class.php | 2 +- classes/blocks/BlockStream.class.php | 2 +- config/config.php | 2 +- engine/modules/viewer/Viewer.class.php | 4 ++-- engine/modules/viewer/plugs/insert.block.php | 20 +++++++++---------- .../{ => blocks}/block.blogInfo.tpl | 0 .../{ => blocks}/block.blogs.tpl | 0 .../{ => blocks}/block.blogs_top.tpl | 0 .../{ => blocks}/block.stream.tpl | 0 .../{ => blocks}/block.streamConfig.tpl | 0 .../{ => blocks}/block.stream_comment.tpl | 0 .../{ => blocks}/block.stream_topic.tpl | 0 .../{ => blocks}/block.tags.tpl | 0 .../{ => blocks}/block.tagsCity.tpl | 0 .../{ => blocks}/block.tagsCountry.tpl | 0 .../{ => blocks}/block.tagsFavouriteTopic.tpl | 0 .../{ => blocks}/block.userfeedBlogs.tpl | 0 .../{ => blocks}/block.userfeedUsers.tpl | 0 19 files changed, 20 insertions(+), 20 deletions(-) rename templates/skin/developer-jquery/{ => blocks}/block.blogInfo.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.blogs.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.blogs_top.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.stream.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.streamConfig.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.stream_comment.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.stream_topic.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.tags.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.tagsCity.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.tagsCountry.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.tagsFavouriteTopic.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.userfeedBlogs.tpl (100%) rename templates/skin/developer-jquery/{ => blocks}/block.userfeedUsers.tpl (100%) diff --git a/classes/actions/ActionAjax.class.php b/classes/actions/ActionAjax.class.php index 8bc7cbb4..493e8241 100644 --- a/classes/actions/ActionAjax.class.php +++ b/classes/actions/ActionAjax.class.php @@ -723,7 +723,7 @@ class ActionAjax extends Action { if ($aComments=$this->Comment_GetCommentsOnline('topic',Config::Get('block.stream.row'))) { $oViewer=$this->Viewer_GetLocalViewer(); $oViewer->Assign('aComments',$aComments); - $sTextResult=$oViewer->Fetch("block.stream_comment.tpl"); + $sTextResult=$oViewer->Fetch("blocks/block.stream_comment.tpl"); $this->Viewer_AssignAjax('sText',$sTextResult); } else { $this->Message_AddErrorSingle($this->Lang_Get('block_stream_comments_no'),$this->Lang_Get('attention')); @@ -740,7 +740,7 @@ class ActionAjax extends Action { if ($oTopics=$this->Topic_GetTopicsLast(Config::Get('block.stream.row'))) { $oViewer=$this->Viewer_GetLocalViewer(); $oViewer->Assign('oTopics',$oTopics); - $sTextResult=$oViewer->Fetch("block.stream_topic.tpl"); + $sTextResult=$oViewer->Fetch("blocks/block.stream_topic.tpl"); $this->Viewer_AssignAjax('sText',$sTextResult); } else { $this->Message_AddErrorSingle($this->Lang_Get('block_stream_topics_no'),$this->Lang_Get('attention')); @@ -758,7 +758,7 @@ class ActionAjax extends Action { $aBlogs=$aResult['collection']; $oViewer=$this->Viewer_GetLocalViewer(); $oViewer->Assign('aBlogs',$aBlogs); - $sTextResult=$oViewer->Fetch("block.blogs_top.tpl"); + $sTextResult=$oViewer->Fetch("blocks/block.blogs_top.tpl"); $this->Viewer_AssignAjax('sText',$sTextResult); } else { $this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error')); @@ -779,7 +779,7 @@ class ActionAjax extends Action { if ($aBlogs=$this->Blog_GetBlogsRatingSelf($this->oUserCurrent->getId(),Config::Get('block.blogs.row'))) { $oViewer=$this->Viewer_GetLocalViewer(); $oViewer->Assign('aBlogs',$aBlogs); - $sTextResult=$oViewer->Fetch("block.blogs_top.tpl"); + $sTextResult=$oViewer->Fetch("blocks/block.blogs_top.tpl"); $this->Viewer_AssignAjax('sText',$sTextResult); } else { $this->Message_AddErrorSingle($this->Lang_Get('block_blogs_self_error'),$this->Lang_Get('attention')); @@ -800,7 +800,7 @@ class ActionAjax extends Action { if ($aBlogs=$this->Blog_GetBlogsRatingJoin($this->oUserCurrent->getId(),Config::Get('block.blogs.row'))) { $oViewer=$this->Viewer_GetLocalViewer(); $oViewer->Assign('aBlogs',$aBlogs); - $sTextResult=$oViewer->Fetch("block.blogs_top.tpl"); + $sTextResult=$oViewer->Fetch("blocks/block.blogs_top.tpl"); $this->Viewer_AssignAjax('sText',$sTextResult); } else { $this->Message_AddErrorSingle($this->Lang_Get('block_blogs_join_error'),$this->Lang_Get('attention')); diff --git a/classes/blocks/BlockBlogs.class.php b/classes/blocks/BlockBlogs.class.php index dcd79b01..6d0154a1 100644 --- a/classes/blocks/BlockBlogs.class.php +++ b/classes/blocks/BlockBlogs.class.php @@ -25,7 +25,7 @@ class BlockBlogs extends Block { $aBlogs=$aResult['collection']; $oViewer=$this->Viewer_GetLocalViewer(); $oViewer->Assign('aBlogs',$aBlogs); - $sTextResult=$oViewer->Fetch("block.blogs_top.tpl"); + $sTextResult=$oViewer->Fetch("blocks/block.blogs_top.tpl"); $this->Viewer_Assign('sBlogsTop',$sTextResult); } } diff --git a/classes/blocks/BlockStream.class.php b/classes/blocks/BlockStream.class.php index 3942184b..5a4bf92c 100644 --- a/classes/blocks/BlockStream.class.php +++ b/classes/blocks/BlockStream.class.php @@ -24,7 +24,7 @@ class BlockStream extends Block { if ($aComments=$this->Comment_GetCommentsOnline('topic',Config::Get('block.stream.row'))) { $oViewer=$this->Viewer_GetLocalViewer(); $oViewer->Assign('aComments',$aComments); - $sTextResult=$oViewer->Fetch("block.stream_comment.tpl"); + $sTextResult=$oViewer->Fetch("blocks/block.stream_comment.tpl"); $this->Viewer_Assign('sStreamComments',$sTextResult); } } diff --git a/config/config.php b/config/config.php index 3d2fc897..5646c589 100644 --- a/config/config.php +++ b/config/config.php @@ -419,7 +419,7 @@ $config['block']['rule_topic_type'] = array( 'topic' => array('add','edit'), 'photoset' => array('add','edit') ), - 'blocks' => array( 'right' => array('block.blogInfo.tpl') ), + 'blocks' => array( 'right' => array('blocks/block.blogInfo.tpl') ), ); $config['block']['rule_people'] = array( 'action' => array( 'people' ), diff --git a/engine/modules/viewer/Viewer.class.php b/engine/modules/viewer/Viewer.class.php index 1455faf6..62423934 100644 --- a/engine/modules/viewer/Viewer.class.php +++ b/engine/modules/viewer/Viewer.class.php @@ -553,8 +553,8 @@ class ModuleViewer extends Module { * @param string $sName * @return string('block','template','undefined') */ - protected function DefineTypeBlock($sName,$sDir=null) { - if ($this->TemplateExists(is_null($sDir)?'block.'.$sName.'.tpl':rtrim($sDir,'/').'/block.'.$sName.'.tpl')) { + protected function DefineTypeBlock($sName,$sDir=null) { + if ($this->TemplateExists(is_null($sDir)?'blocks/block.'.$sName.'.tpl':rtrim($sDir,'/').'/blocks/block.'.$sName.'.tpl')) { /** * Если найден шаблон вида block.name.tpl то считаем что тип 'block' */ diff --git a/engine/modules/viewer/plugs/insert.block.php b/engine/modules/viewer/plugs/insert.block.php index 7772a063..c35c9561 100644 --- a/engine/modules/viewer/plugs/insert.block.php +++ b/engine/modules/viewer/plugs/insert.block.php @@ -23,25 +23,25 @@ * @param Smarty $oSmarty * @return string */ -function smarty_insert_block($aParams,&$oSmarty) { +function smarty_insert_block($aParams,&$oSmarty) { /** * Устанавливаем шаблон */ - $sBlock=ucfirst(basename($aParams['block'])); + $sBlock=ucfirst(basename($aParams['block'])); /** - * Проверяем наличие шаблона. Определяем значения параметров работы в зависимости от того, + * Проверяем наличие шаблона. Определяем значения параметров работы в зависимости от того, * принадлежит ли блок одному из плагинов, или является пользовательским классом движка */ if(isset($aParams['params']) and isset($aParams['params']['plugin'])) { - $sBlockTemplate = Plugin::GetTemplatePath($aParams['params']['plugin']).'/block.'.$aParams['block'].'.tpl'; - $sBlock ='Plugin'.ucfirst($aParams['params']['plugin']).'_Block'.$sBlock; - } else { - $sBlockTemplate = Engine::getInstance()->Plugin_GetDelegate('template','block.'.$aParams['block'].'.tpl'); - $sBlock ='Block'.$sBlock; + $sBlockTemplate = Plugin::GetTemplatePath($aParams['params']['plugin']).'/blocks/block.'.$aParams['block'].'.tpl'; + $sBlock ='Plugin'.ucfirst($aParams['params']['plugin']).'_Block'.$sBlock; + } else { + $sBlockTemplate = Engine::getInstance()->Plugin_GetDelegate('template','blocks/block.'.$aParams['block'].'.tpl'); + $sBlock ='Block'.$sBlock; } - $sBlock=Engine::getInstance()->Plugin_GetDelegate('block',$sBlock); - + $sBlock=Engine::getInstance()->Plugin_GetDelegate('block',$sBlock); + if (!isset($aParams['block']) or !$oSmarty->templateExists($sBlockTemplate)) { trigger_error("Not found template for block: ".$sBlockTemplate,E_USER_WARNING); return ; diff --git a/templates/skin/developer-jquery/block.blogInfo.tpl b/templates/skin/developer-jquery/blocks/block.blogInfo.tpl similarity index 100% rename from templates/skin/developer-jquery/block.blogInfo.tpl rename to templates/skin/developer-jquery/blocks/block.blogInfo.tpl diff --git a/templates/skin/developer-jquery/block.blogs.tpl b/templates/skin/developer-jquery/blocks/block.blogs.tpl similarity index 100% rename from templates/skin/developer-jquery/block.blogs.tpl rename to templates/skin/developer-jquery/blocks/block.blogs.tpl diff --git a/templates/skin/developer-jquery/block.blogs_top.tpl b/templates/skin/developer-jquery/blocks/block.blogs_top.tpl similarity index 100% rename from templates/skin/developer-jquery/block.blogs_top.tpl rename to templates/skin/developer-jquery/blocks/block.blogs_top.tpl diff --git a/templates/skin/developer-jquery/block.stream.tpl b/templates/skin/developer-jquery/blocks/block.stream.tpl similarity index 100% rename from templates/skin/developer-jquery/block.stream.tpl rename to templates/skin/developer-jquery/blocks/block.stream.tpl diff --git a/templates/skin/developer-jquery/block.streamConfig.tpl b/templates/skin/developer-jquery/blocks/block.streamConfig.tpl similarity index 100% rename from templates/skin/developer-jquery/block.streamConfig.tpl rename to templates/skin/developer-jquery/blocks/block.streamConfig.tpl diff --git a/templates/skin/developer-jquery/block.stream_comment.tpl b/templates/skin/developer-jquery/blocks/block.stream_comment.tpl similarity index 100% rename from templates/skin/developer-jquery/block.stream_comment.tpl rename to templates/skin/developer-jquery/blocks/block.stream_comment.tpl diff --git a/templates/skin/developer-jquery/block.stream_topic.tpl b/templates/skin/developer-jquery/blocks/block.stream_topic.tpl similarity index 100% rename from templates/skin/developer-jquery/block.stream_topic.tpl rename to templates/skin/developer-jquery/blocks/block.stream_topic.tpl diff --git a/templates/skin/developer-jquery/block.tags.tpl b/templates/skin/developer-jquery/blocks/block.tags.tpl similarity index 100% rename from templates/skin/developer-jquery/block.tags.tpl rename to templates/skin/developer-jquery/blocks/block.tags.tpl diff --git a/templates/skin/developer-jquery/block.tagsCity.tpl b/templates/skin/developer-jquery/blocks/block.tagsCity.tpl similarity index 100% rename from templates/skin/developer-jquery/block.tagsCity.tpl rename to templates/skin/developer-jquery/blocks/block.tagsCity.tpl diff --git a/templates/skin/developer-jquery/block.tagsCountry.tpl b/templates/skin/developer-jquery/blocks/block.tagsCountry.tpl similarity index 100% rename from templates/skin/developer-jquery/block.tagsCountry.tpl rename to templates/skin/developer-jquery/blocks/block.tagsCountry.tpl diff --git a/templates/skin/developer-jquery/block.tagsFavouriteTopic.tpl b/templates/skin/developer-jquery/blocks/block.tagsFavouriteTopic.tpl similarity index 100% rename from templates/skin/developer-jquery/block.tagsFavouriteTopic.tpl rename to templates/skin/developer-jquery/blocks/block.tagsFavouriteTopic.tpl diff --git a/templates/skin/developer-jquery/block.userfeedBlogs.tpl b/templates/skin/developer-jquery/blocks/block.userfeedBlogs.tpl similarity index 100% rename from templates/skin/developer-jquery/block.userfeedBlogs.tpl rename to templates/skin/developer-jquery/blocks/block.userfeedBlogs.tpl diff --git a/templates/skin/developer-jquery/block.userfeedUsers.tpl b/templates/skin/developer-jquery/blocks/block.userfeedUsers.tpl similarity index 100% rename from templates/skin/developer-jquery/block.userfeedUsers.tpl rename to templates/skin/developer-jquery/blocks/block.userfeedUsers.tpl From 9df99b6f0032f301912158208ca50acae8344271 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sat, 21 Apr 2012 09:01:21 +0400 Subject: [PATCH 09/11] =?UTF-8?q?fix=20=D1=81=D0=BE=D1=80=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=BA=D0=B8=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=20=D1=82=D1=83=D0=BB=D0=B1=D0=B0=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/modules/viewer/Viewer.class.php | 5 ++++- engine/modules/viewer/plugs/function.get_blocks.php | 2 +- templates/skin/developer-jquery/header.tpl | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/modules/viewer/Viewer.class.php b/engine/modules/viewer/Viewer.class.php index 62423934..bfad15a1 100644 --- a/engine/modules/viewer/Viewer.class.php +++ b/engine/modules/viewer/Viewer.class.php @@ -544,7 +544,10 @@ class ModuleViewer extends Module { * * @return array */ - public function GetBlocks() { + public function GetBlocks($bSort=false) { + if ($bSort) { + $this->SortBlocks(); + } return $this->aBlocks; } /** diff --git a/engine/modules/viewer/plugs/function.get_blocks.php b/engine/modules/viewer/plugs/function.get_blocks.php index e64d76dc..e11d0b56 100644 --- a/engine/modules/viewer/plugs/function.get_blocks.php +++ b/engine/modules/viewer/plugs/function.get_blocks.php @@ -29,7 +29,7 @@ function smarty_function_get_blocks($params, &$smarty) return; } - $smarty->assign($params['assign'], Engine::getInstance()->Viewer_GetBlocks()); + $smarty->assign($params['assign'], Engine::getInstance()->Viewer_GetBlocks(true)); return ''; } diff --git a/templates/skin/developer-jquery/header.tpl b/templates/skin/developer-jquery/header.tpl index 865615a9..733de83e 100644 --- a/templates/skin/developer-jquery/header.tpl +++ b/templates/skin/developer-jquery/header.tpl @@ -80,8 +80,8 @@ {assign var=body_classes value=$body_classes|cat:' ls-user-role-not-admin'} {/if} -{add_block group='toolbar' name='toolbar_admin.tpl'} -{add_block group='toolbar' name='toolbar_scrollup.tpl'} +{add_block group='toolbar' name='toolbar_admin.tpl' priority=100} +{add_block group='toolbar' name='toolbar_scrollup.tpl' priority=-100} {hook run='body_begin'} From ee34fe74dd28687a70dc044a13acfeb057b9e76a Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sat, 21 Apr 2012 11:04:16 +0400 Subject: [PATCH 10/11] =?UTF-8?q?=D0=A3=D1=87=D0=B5=D1=82=20IP=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=B3=D0=BE=D0=BB=D0=BE=D1=81=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/modules/vote/Vote.class.php | 3 +++ classes/modules/vote/entity/Vote.entity.class.php | 6 ++++++ classes/modules/vote/mapper/Vote.mapper.class.php | 7 ++++--- install/convert_0.5.1_to_1.0.sql | 5 ++++- install/sql.sql | 4 +++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/classes/modules/vote/Vote.class.php b/classes/modules/vote/Vote.class.php index 4240b9f8..a20ba228 100644 --- a/classes/modules/vote/Vote.class.php +++ b/classes/modules/vote/Vote.class.php @@ -37,6 +37,9 @@ class ModuleVote extends Module { * @return unknown */ public function AddVote(ModuleVote_EntityVote $oVote) { + if (!$oVote->getIp()) { + $oVote->setIp(func_getIp()); + } if ($this->oMapper->AddVote($oVote)) { $this->Cache_Delete("vote_{$oVote->getTargetType()}_{$oVote->getTargetId()}_{$oVote->getVoterId()}"); $this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array("vote_update_{$oVote->getTargetType()}_{$oVote->getVoterId()}")); diff --git a/classes/modules/vote/entity/Vote.entity.class.php b/classes/modules/vote/entity/Vote.entity.class.php index 0bcf97ac..a4ff4874 100644 --- a/classes/modules/vote/entity/Vote.entity.class.php +++ b/classes/modules/vote/entity/Vote.entity.class.php @@ -35,6 +35,9 @@ class ModuleVote_EntityVote extends Entity public function getDate() { return $this->_aData['vote_date']; } + public function getIp() { + return $this->_getDataOne('vote_ip'); + } @@ -56,5 +59,8 @@ class ModuleVote_EntityVote extends Entity public function setDate($data) { $this->_aData['vote_date']=$data; } + public function setIp($data) { + $this->_aData['vote_ip']=$data; + } } ?> \ No newline at end of file diff --git a/classes/modules/vote/mapper/Vote.mapper.class.php b/classes/modules/vote/mapper/Vote.mapper.class.php index d884ee2f..cbf9dcd5 100644 --- a/classes/modules/vote/mapper/Vote.mapper.class.php +++ b/classes/modules/vote/mapper/Vote.mapper.class.php @@ -25,11 +25,12 @@ class ModuleVote_MapperVote extends Mapper { user_voter_id, vote_direction, vote_value, - vote_date + vote_date, + vote_ip ) - VALUES(?d, ?, ?d, ?d, ?f, ?) + VALUES(?d, ?, ?d, ?d, ?f, ?, ?) "; - if ($this->oDb->query($sql,$oVote->getTargetId(),$oVote->getTargetType(),$oVote->getVoterId(),$oVote->getDirection(),$oVote->getValue(),$oVote->getDate())===0) + if ($this->oDb->query($sql,$oVote->getTargetId(),$oVote->getTargetType(),$oVote->getVoterId(),$oVote->getDirection(),$oVote->getValue(),$oVote->getDate(),$oVote->getIp())===0) { return true; } diff --git a/install/convert_0.5.1_to_1.0.sql b/install/convert_0.5.1_to_1.0.sql index 49bc60b9..11063aea 100644 --- a/install/convert_0.5.1_to_1.0.sql +++ b/install/convert_0.5.1_to_1.0.sql @@ -110,4 +110,7 @@ INSERT INTO `prefix_user_field` (`type`, `name`, `title`, `pattern`) VALUES ('social', 'vkontakte', 'ВКонтакте', '{*}'), ('social', 'odnoklassniki', 'Одноклассники', '{*}'); -ALTER TABLE `prefix_favourite_tag` ADD INDEX ( `text` ); \ No newline at end of file +ALTER TABLE `prefix_favourite_tag` ADD INDEX ( `text` ); + +ALTER TABLE `prefix_vote` ADD `vote_ip` VARCHAR( 15 ) NOT NULL DEFAULT '', +ADD INDEX ( `vote_ip` ); \ No newline at end of file diff --git a/install/sql.sql b/install/sql.sql index 73666de3..64d06b8b 100644 --- a/install/sql.sql +++ b/install/sql.sql @@ -769,8 +769,10 @@ CREATE TABLE IF NOT EXISTS `prefix_vote` ( `vote_direction` tinyint(2) DEFAULT '0', `vote_value` float(9,3) NOT NULL DEFAULT '0.000', `vote_date` datetime NOT NULL, + `vote_ip` varchar(15) NOT NULL DEFAULT '', PRIMARY KEY (`target_id`,`target_type`,`user_voter_id`), - KEY `user_voter_id` (`user_voter_id`) + KEY `user_voter_id` (`user_voter_id`), + KEY `vote_ip` (`vote_ip`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- From 32edb52a597bbfc1e93729d004206229af5e6198 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Sat, 21 Apr 2012 12:00:15 +0400 Subject: [PATCH 11/11] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=20=D1=81=D1=83=D1=89=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/blog/entity/Blog.entity.class.php | 38 +++++----- .../blog/entity/BlogUser.entity.class.php | 10 +-- .../blog/entity/BlogVote.entity.class.php | 42 ----------- .../comment/entity/Comment.entity.class.php | 42 +++++------ .../entity/CommentOnline.entity.class.php | 8 +- .../entity/CommentVote.entity.class.php | 41 ----------- .../entity/Favourite.entity.class.php | 8 +- .../notify/entity/Task.entity.class.php | 14 ++-- .../modules/talk/entity/Talk.entity.class.php | 30 ++++---- .../talk/entity/TalkUser.entity.class.php | 16 ++-- .../topic/entity/Topic.entity.class.php | 73 +++++++++---------- .../topic/entity/TopicPhoto.entity.class.php | 10 +-- .../entity/TopicQuestionVote.entity.class.php | 6 +- .../topic/entity/TopicRead.entity.class.php | 10 +-- .../topic/entity/TopicTag.entity.class.php | 14 ++-- .../topic/entity/TopicVote.entity.class.php | 42 ----------- .../user/entity/Field.entity.class.php | 10 +-- .../user/entity/Friend.entity.class.php | 18 ++--- .../user/entity/Invite.entity.class.php | 14 ++-- .../user/entity/Reminder.entity.class.php | 12 +-- .../user/entity/Session.entity.class.php | 12 +-- .../modules/user/entity/User.entity.class.php | 68 ++++++++--------- .../user/entity/UserVote.entity.class.php | 42 ----------- .../modules/vote/entity/Vote.entity.class.php | 12 +-- .../modules/wall/entity/Wall.entity.class.php | 4 +- 25 files changed, 210 insertions(+), 386 deletions(-) delete mode 100644 classes/modules/blog/entity/BlogVote.entity.class.php delete mode 100644 classes/modules/comment/entity/CommentVote.entity.class.php delete mode 100644 classes/modules/topic/entity/TopicVote.entity.class.php delete mode 100644 classes/modules/user/entity/UserVote.entity.class.php diff --git a/classes/modules/blog/entity/Blog.entity.class.php b/classes/modules/blog/entity/Blog.entity.class.php index 0915d990..df0adb4f 100644 --- a/classes/modules/blog/entity/Blog.entity.class.php +++ b/classes/modules/blog/entity/Blog.entity.class.php @@ -18,46 +18,46 @@ class ModuleBlog_EntityBlog extends Entity { public function getId() { - return $this->_aData['blog_id']; + return $this->_getDataOne('blog_id'); } public function getOwnerId() { - return $this->_aData['user_owner_id']; + return $this->_getDataOne('user_owner_id'); } public function getTitle() { - return $this->_aData['blog_title']; + return $this->_getDataOne('blog_title'); } public function getDescription() { - return $this->_aData['blog_description']; + return $this->_getDataOne('blog_description'); } public function getType() { - return $this->_aData['blog_type']; + return $this->_getDataOne('blog_type'); } public function getDateAdd() { - return $this->_aData['blog_date_add']; + return $this->_getDataOne('blog_date_add'); } public function getDateEdit() { - return $this->_aData['blog_date_edit']; + return $this->_getDataOne('blog_date_edit'); } public function getRating() { - return number_format(round($this->_aData['blog_rating'],2), 2, '.', ''); + return number_format(round($this->_getDataOne('blog_rating'),2), 2, '.', ''); } public function getCountVote() { - return $this->_aData['blog_count_vote']; + return $this->_getDataOne('blog_count_vote'); } public function getCountUser() { - return $this->_aData['blog_count_user']; + return $this->_getDataOne('blog_count_user'); } public function getCountTopic() { - return $this->_aData['blog_count_topic']; + return $this->_getDataOne('blog_count_topic'); } public function getLimitRatingTopic() { - return $this->_aData['blog_limit_rating_topic']; + return $this->_getDataOne('blog_limit_rating_topic'); } public function getUrl() { - return $this->_aData['blog_url']; + return $this->_getDataOne('blog_url'); } public function getAvatar() { - return $this->_aData['blog_avatar']; + return $this->_getDataOne('blog_avatar'); } public function getAvatarType() { return ($sPath=$this->getAvatarPath()) ? pathinfo($sPath,PATHINFO_EXTENSION) : null; @@ -66,10 +66,10 @@ class ModuleBlog_EntityBlog extends Entity public function getOwner() { - return $this->_aData['owner']; + return $this->_getDataOne('owner'); } public function getVote() { - return $this->_aData['vote']; + return $this->_getDataOne('vote'); } public function getAvatarPath($iSize=48) { if ($sPath=$this->getAvatar()) { @@ -79,13 +79,13 @@ class ModuleBlog_EntityBlog extends Entity } } public function getUserIsJoin() { - return $this->_aData['user_is_join']; + return $this->_getDataOne('user_is_join'); } public function getUserIsAdministrator() { - return $this->_aData['user_is_administrator']; + return $this->_getDataOne('user_is_administrator'); } public function getUserIsModerator() { - return $this->_aData['user_is_moderator']; + return $this->_getDataOne('user_is_moderator'); } public function getUrlFull() { if ($this->getType()=='personal') { diff --git a/classes/modules/blog/entity/BlogUser.entity.class.php b/classes/modules/blog/entity/BlogUser.entity.class.php index 72c9b4ca..ff142c82 100644 --- a/classes/modules/blog/entity/BlogUser.entity.class.php +++ b/classes/modules/blog/entity/BlogUser.entity.class.php @@ -18,10 +18,10 @@ class ModuleBlog_EntityBlogUser extends Entity { public function getBlogId() { - return $this->_aData['blog_id']; + return $this->_getDataOne('blog_id'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getIsModerator() { return ($this->getUserRole()==ModuleBlog::BLOG_USER_ROLE_MODERATOR); @@ -30,14 +30,14 @@ class ModuleBlog_EntityBlogUser extends Entity return ($this->getUserRole()==ModuleBlog::BLOG_USER_ROLE_ADMINISTRATOR); } public function getUserRole() { - return $this->_aData['user_role']; + return $this->_getDataOne('user_role'); } public function getBlog() { - return $this->_aData['blog']; + return $this->_getDataOne('blog'); } public function getUser() { - return $this->_aData['user']; + return $this->_getDataOne('user'); } diff --git a/classes/modules/blog/entity/BlogVote.entity.class.php b/classes/modules/blog/entity/BlogVote.entity.class.php deleted file mode 100644 index cb371689..00000000 --- a/classes/modules/blog/entity/BlogVote.entity.class.php +++ /dev/null @@ -1,42 +0,0 @@ -_aData['blog_id']; - } - public function getVoterId() { - return $this->_aData['user_voter_id']; - } - public function getDelta() { - return $this->_aData['vote_delta']; - } - - - - public function setBlogId($data) { - $this->_aData['blog_id']=$data; - } - public function setVoterId($data) { - $this->_aData['user_voter_id']=$data; - } - public function setDelta($data) { - $this->_aData['vote_delta']=$data; - } -} -?> \ No newline at end of file diff --git a/classes/modules/comment/entity/Comment.entity.class.php b/classes/modules/comment/entity/Comment.entity.class.php index e91769c4..8376e138 100644 --- a/classes/modules/comment/entity/Comment.entity.class.php +++ b/classes/modules/comment/entity/Comment.entity.class.php @@ -18,57 +18,57 @@ class ModuleComment_EntityComment extends Entity { public function getId() { - return $this->_aData['comment_id']; + return $this->_getDataOne('comment_id'); } public function getPid() { - return $this->_aData['comment_pid']; + return $this->_getDataOne('comment_pid'); } public function getLeft() { - return $this->_aData['comment_left']; + return $this->_getDataOne('comment_left'); } public function getRight() { - return $this->_aData['comment_right']; + return $this->_getDataOne('comment_right'); } public function getTargetId() { - return $this->_aData['target_id']; + return $this->_getDataOne('target_id'); } public function getTargetType() { - return $this->_aData['target_type']; + return $this->_getDataOne('target_type'); } public function getTargetParentId() { - return (array_key_exists('target_parent_id',$this->_aData)) ? $this->_aData['target_parent_id'] : 0; + return $this->_getDataOne('target_parent_id') ? $this->_getDataOne('target_parent_id') : 0; } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getText() { - return $this->_aData['comment_text']; + return $this->_getDataOne('comment_text'); } public function getDate() { - return $this->_aData['comment_date']; + return $this->_getDataOne('comment_date'); } public function getUserIp() { - return $this->_aData['comment_user_ip']; + return $this->_getDataOne('comment_user_ip'); } public function getRating() { - return number_format(round($this->_aData['comment_rating'],2), 0, '.', ''); + return number_format(round($this->_getDataOne('comment_rating'),2), 0, '.', ''); } public function getCountVote() { - return $this->_aData['comment_count_vote']; + return $this->_getDataOne('comment_count_vote'); } public function getDelete() { - return $this->_aData['comment_delete']; + return $this->_getDataOne('comment_delete'); } public function getPublish() { return $this->_getDataOne('comment_publish') ? 1 : 0; } public function getTextHash() { - return $this->_aData['comment_text_hash']; + return $this->_getDataOne('comment_text_hash'); } public function getLevel() { - return $this->_aData['comment_level']; + return $this->_getDataOne('comment_level'); } public function isBad() { if ($this->getRating()<=Config::Get('module.comment.bad')) { @@ -77,20 +77,20 @@ class ModuleComment_EntityComment extends Entity return false; } public function getUser() { - return $this->_aData['user']; + return $this->_getDataOne('user'); } public function getTarget() { - return $this->_aData['target']; + return $this->_getDataOne('target'); } public function getVote() { - return $this->_aData['vote']; + return $this->_getDataOne('vote'); } public function getIsFavourite() { - return $this->_aData['comment_is_favourite']; + return $this->_getDataOne('comment_is_favourite'); } public function getCountFavourite() { - return $this->_aData['comment_count_favourite']; + return $this->_getDataOne('comment_count_favourite'); } diff --git a/classes/modules/comment/entity/CommentOnline.entity.class.php b/classes/modules/comment/entity/CommentOnline.entity.class.php index 5967f3df..ff24dbc2 100644 --- a/classes/modules/comment/entity/CommentOnline.entity.class.php +++ b/classes/modules/comment/entity/CommentOnline.entity.class.php @@ -18,16 +18,16 @@ class ModuleComment_EntityCommentOnline extends Entity { public function getTargetId() { - return $this->_aData['target_id']; + return $this->_getDataOne('target_id'); } public function getTargetType() { - return $this->_aData['target_type']; + return $this->_getDataOne('target_type'); } public function getCommentId() { - return $this->_aData['comment_id']; + return $this->_getDataOne('comment_id'); } public function getTargetParentId() { - return (array_key_exists('target_parent_id',$this->_aData)) ? $this->_aData['target_parent_id'] : 0; + return $this->_getDataOne('target_parent_id') ? $this->_getDataOne('target_parent_id') : 0; } public function setTargetId($data) { diff --git a/classes/modules/comment/entity/CommentVote.entity.class.php b/classes/modules/comment/entity/CommentVote.entity.class.php deleted file mode 100644 index e37e0306..00000000 --- a/classes/modules/comment/entity/CommentVote.entity.class.php +++ /dev/null @@ -1,41 +0,0 @@ -_aData['comment_id']; - } - public function getVoterId() { - return $this->_aData['user_voter_id']; - } - public function getDelta() { - return $this->_aData['vote_delta']; - } - - - public function setCommentId($data) { - $this->_aData['comment_id']=$data; - } - public function setVoterId($data) { - $this->_aData['user_voter_id']=$data; - } - public function setDelta($data) { - $this->_aData['vote_delta']=$data; - } -} -?> \ No newline at end of file diff --git a/classes/modules/favourite/entity/Favourite.entity.class.php b/classes/modules/favourite/entity/Favourite.entity.class.php index 3273c427..1d75a83e 100644 --- a/classes/modules/favourite/entity/Favourite.entity.class.php +++ b/classes/modules/favourite/entity/Favourite.entity.class.php @@ -18,16 +18,16 @@ class ModuleFavourite_EntityFavourite extends Entity { public function getTargetId() { - return $this->_aData['target_id']; + return $this->_getDataOne('target_id'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getTargetPublish() { - return $this->_aData['target_publish']; + return $this->_getDataOne('target_publish'); } public function getTargetType() { - return $this->_aData['target_type']; + return $this->_getDataOne('target_type'); } public function getTagsArray() { if ($this->getTags()) { diff --git a/classes/modules/notify/entity/Task.entity.class.php b/classes/modules/notify/entity/Task.entity.class.php index 789becef..957b3a2f 100644 --- a/classes/modules/notify/entity/Task.entity.class.php +++ b/classes/modules/notify/entity/Task.entity.class.php @@ -18,25 +18,25 @@ class ModuleNotify_EntityTask extends Entity { public function getTaskId() { - return $this->_aData['notify_task_id']; + return $this->_getDataOne('notify_task_id'); } public function getUserMail() { - return $this->_aData['user_mail']; + return $this->_getDataOne('user_mail'); } public function getUserLogin() { - return $this->_aData['user_login']; + return $this->_getDataOne('user_login'); } public function getNotifyText() { - return $this->_aData['notify_text']; + return $this->_getDataOne('notify_text'); } public function getDateCreated() { - return $this->_aData['date_created']; + return $this->_getDataOne('date_created'); } public function getTaskStatus() { - return $this->_aData['notify_task_status']; + return $this->_getDataOne('notify_task_status'); } public function getNotifySubject() { - return $this->_aData['notify_subject']; + return $this->_getDataOne('notify_subject'); } diff --git a/classes/modules/talk/entity/Talk.entity.class.php b/classes/modules/talk/entity/Talk.entity.class.php index 6a238a27..708d2ad2 100644 --- a/classes/modules/talk/entity/Talk.entity.class.php +++ b/classes/modules/talk/entity/Talk.entity.class.php @@ -18,34 +18,34 @@ class ModuleTalk_EntityTalk extends Entity { public function getId() { - return $this->_aData['talk_id']; + return $this->_getDataOne('talk_id'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getTitle() { - return $this->_aData['talk_title']; + return $this->_getDataOne('talk_title'); } public function getText() { - return $this->_aData['talk_text']; + return $this->_getDataOne('talk_text'); } public function getDate() { - return $this->_aData['talk_date']; + return $this->_getDataOne('talk_date'); } public function getDateLast() { - return $this->_aData['talk_date_last']; + return $this->_getDataOne('talk_date_last'); } public function getUserIdLast() { - return $this->_aData['talk_user_id_last']; + return $this->_getDataOne('talk_user_id_last'); } public function getUserIp() { - return $this->_aData['talk_user_ip']; + return $this->_getDataOne('talk_user_ip'); } public function getCommentIdLast() { - return $this->_aData['talk_comment_id_last']; + return $this->_getDataOne('talk_comment_id_last'); } public function getCountComment() { - return $this->_aData['talk_count_comment']; + return $this->_getDataOne('talk_count_comment'); } @@ -61,13 +61,13 @@ class ModuleTalk_EntityTalk extends Entity return $this->getText(); } public function getUsers() { - return $this->_aData['users']; + return $this->_getDataOne('users'); } public function getUser() { - return $this->_aData['user']; + return $this->_getDataOne('user'); } public function getTalkUser() { - return $this->_aData['talk_user']; + return $this->_getDataOne('talk_user'); } /** * Возращает true, если разговор занесен в избранное @@ -75,7 +75,7 @@ class ModuleTalk_EntityTalk extends Entity * @return bool */ public function getIsFavourite() { - return $this->_aData['talk_is_favourite']; + return $this->_getDataOne('talk_is_favourite'); } /** * Получает пользователей разговора @@ -83,7 +83,7 @@ class ModuleTalk_EntityTalk extends Entity * @return array */ public function getTalkUsers() { - return $this->_aData['talk_users']; + return $this->_getDataOne('talk_users'); } diff --git a/classes/modules/talk/entity/TalkUser.entity.class.php b/classes/modules/talk/entity/TalkUser.entity.class.php index c379b2b2..edb98ad4 100644 --- a/classes/modules/talk/entity/TalkUser.entity.class.php +++ b/classes/modules/talk/entity/TalkUser.entity.class.php @@ -18,19 +18,19 @@ class ModuleTalk_EntityTalkUser extends Entity { public function getTalkId() { - return $this->_aData['talk_id']; + return $this->_getDataOne('talk_id'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getDateLast() { - return $this->_aData['date_last']; + return $this->_getDataOne('date_last'); } public function getCommentIdLast() { - return $this->_aData['comment_id_last']; + return $this->_getDataOne('comment_id_last'); } public function getCommentCountNew() { - return $this->_aData['comment_count_new']; + return $this->_getDataOne('comment_count_new'); } /** @@ -39,9 +39,7 @@ class ModuleTalk_EntityTalkUser extends Entity * @return int */ public function getUserActive(){ - return (array_key_exists('talk_user_active',$this->_aData)) - ? $this->_aData['talk_user_active'] - : ModuleTalk::TALK_USER_ACTIVE; + return $this->_getDataOne('talk_user_active') ? $this->_getDataOne('talk_user_active') : ModuleTalk::TALK_USER_ACTIVE; } /** * Возвращает соответствующий пользователю объект UserEntity @@ -49,7 +47,7 @@ class ModuleTalk_EntityTalkUser extends Entity * @return UserEntity | null */ public function getUser() { - return $this->_aData['user']; + return $this->_getDataOne('user'); } diff --git a/classes/modules/topic/entity/Topic.entity.class.php b/classes/modules/topic/entity/Topic.entity.class.php index 3808a364..2a992bd5 100644 --- a/classes/modules/topic/entity/Topic.entity.class.php +++ b/classes/modules/topic/entity/Topic.entity.class.php @@ -64,7 +64,7 @@ class ModuleTopic_EntityTopic extends Entity { public function ValidateTopicUnique($sValue,$aParams) { $this->setTextHash(md5($this->getType().$sValue.$this->getTitle())); if ($oTopicEquivalent=$this->Topic_GetTopicUnique($this->getUserId(),$this->getTextHash())) { - if ($iId=$this->getTopicId() and $oTopicEquivalent->getId()==$iId) { // хак, запрашиваем не getId(), а getTopicId() - вернет null если это новый топик без ID + if ($iId=$this->getId() and $oTopicEquivalent->getId()==$iId) { return true; } return $this->Lang_Get('topic_create_text_error_unique'); @@ -90,85 +90,82 @@ class ModuleTopic_EntityTopic extends Entity { public function getId() { - return $this->_aData['topic_id']; + return $this->_getDataOne('topic_id'); } public function getBlogId() { - return $this->_aData['blog_id']; + return $this->_getDataOne('blog_id'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getType() { - return $this->_aData['topic_type']; + return $this->_getDataOne('topic_type'); } public function getTitle() { - return $this->_aData['topic_title']; + return $this->_getDataOne('topic_title'); } public function getText() { - return $this->_aData['topic_text']; + return $this->_getDataOne('topic_text'); } public function getTextShort() { - return $this->_aData['topic_text_short']; + return $this->_getDataOne('topic_text_short'); } public function getTextSource() { - return $this->_aData['topic_text_source']; + return $this->_getDataOne('topic_text_source'); } public function getExtra() { - if (isset($this->_aData['topic_extra'])) { - return $this->_aData['topic_extra']; - } - return serialize(''); + return $this->_getDataOne('topic_extra') ? $this->_getDataOne('topic_extra') : serialize(''); } public function getTags() { - return $this->_aData['topic_tags']; + return $this->_getDataOne('topic_tags'); } public function getDateAdd() { - return $this->_aData['topic_date_add']; + return $this->_getDataOne('topic_date_add'); } public function getDateEdit() { - return $this->_aData['topic_date_edit']; + return $this->_getDataOne('topic_date_edit'); } public function getUserIp() { - return $this->_aData['topic_user_ip']; + return $this->_getDataOne('topic_user_ip'); } public function getPublish() { - return $this->_aData['topic_publish']; + return $this->_getDataOne('topic_publish'); } public function getPublishDraft() { - return $this->_aData['topic_publish_draft']; + return $this->_getDataOne('topic_publish_draft'); } public function getPublishIndex() { - return $this->_aData['topic_publish_index']; + return $this->_getDataOne('topic_publish_index'); } public function getRating() { - return number_format(round($this->_aData['topic_rating'],2), 0, '.', ''); + return number_format(round($this->_getDataOne('topic_rating'),2), 0, '.', ''); } public function getCountVote() { - return $this->_aData['topic_count_vote']; + return $this->_getDataOne('topic_count_vote'); } public function getCountVoteUp() { - return $this->_aData['topic_count_vote_up']; + return $this->_getDataOne('topic_count_vote_up'); } public function getCountVoteDown() { - return $this->_aData['topic_count_vote_down']; + return $this->_getDataOne('topic_count_vote_down'); } public function getCountVoteAbstain() { - return $this->_aData['topic_count_vote_abstain']; + return $this->_getDataOne('topic_count_vote_abstain'); } public function getCountRead() { - return $this->_aData['topic_count_read']; + return $this->_getDataOne('topic_count_read'); } public function getCountComment() { - return $this->_aData['topic_count_comment']; + return $this->_getDataOne('topic_count_comment'); } public function getCutText() { - return $this->_aData['topic_cut_text']; + return $this->_getDataOne('topic_cut_text'); } public function getForbidComment() { - return $this->_aData['topic_forbid_comment']; + return $this->_getDataOne('topic_forbid_comment'); } public function getTextHash() { - return $this->_aData['topic_text_hash']; + return $this->_getDataOne('topic_text_hash'); } public function getTagsArray() { @@ -178,19 +175,19 @@ class ModuleTopic_EntityTopic extends Entity { return array(); } public function getCountCommentNew() { - return $this->_aData['count_comment_new']; + return $this->_getDataOne('count_comment_new'); } public function getDateRead() { - return $this->_aData['date_read']; + return $this->_getDataOne('date_read'); } public function getUser() { - if (!isset($this->_aData['user'])) { + if (!$this->_getDataOne('user')) { $this->_aData['user']=$this->User_GetUserById($this->getUserId()); } - return $this->_aData['user']; + return $this->_getDataOne('user'); } public function getBlog() { - return $this->_aData['blog']; + return $this->_getDataOne('blog'); } @@ -202,10 +199,10 @@ class ModuleTopic_EntityTopic extends Entity { } } public function getVote() { - return $this->_aData['vote']; + return $this->_getDataOne('vote'); } public function getUserQuestionIsVote() { - return $this->_aData['user_question_is_vote']; + return $this->_getDataOne('user_question_is_vote'); } public function getIsFavourite() { if ($this->getFavourite()) { @@ -214,7 +211,7 @@ class ModuleTopic_EntityTopic extends Entity { return false; } public function getCountFavourite() { - return $this->_aData['topic_count_favourite']; + return $this->_getDataOne('topic_count_favourite'); } public function getSubscribeNewComment() { if (!($oUserCurrent=$this->User_GetUserCurrent())) { diff --git a/classes/modules/topic/entity/TopicPhoto.entity.class.php b/classes/modules/topic/entity/TopicPhoto.entity.class.php index 512eae0e..31878f11 100644 --- a/classes/modules/topic/entity/TopicPhoto.entity.class.php +++ b/classes/modules/topic/entity/TopicPhoto.entity.class.php @@ -4,24 +4,24 @@ class ModuleTopic_EntityTopicPhoto extends Entity { public function getId() { - return $this->_aData['id']; + return $this->_getDataOne('id'); } public function getTopicId() { - return ( isset($this->_aData['topic_id'])) ? $this->_aData['topic_id'] : null; + return $this->_getDataOne('topic_id'); } public function getTargetTmp() { - return $this->_aData['target_tmp']; + return $this->_getDataOne('target_tmp'); } public function getDescription() { - return ( isset($this->_aData['description'])) ? $this->_aData['description'] : null; + return $this->_getDataOne('description'); } public function getPath() { - return isset($this->_aData['path']) ? $this->_aData['path'] : null; + return $this->_getDataOne('path'); } public function getWebPath($sWidth = null) diff --git a/classes/modules/topic/entity/TopicQuestionVote.entity.class.php b/classes/modules/topic/entity/TopicQuestionVote.entity.class.php index 7d15c06a..95dc0705 100644 --- a/classes/modules/topic/entity/TopicQuestionVote.entity.class.php +++ b/classes/modules/topic/entity/TopicQuestionVote.entity.class.php @@ -18,13 +18,13 @@ class ModuleTopic_EntityTopicQuestionVote extends Entity { public function getTopicId() { - return $this->_aData['topic_id']; + return $this->_getDataOne('topic_id'); } public function getVoterId() { - return $this->_aData['user_voter_id']; + return $this->_getDataOne('user_voter_id'); } public function getAnswer() { - return $this->_aData['answer']; + return $this->_getDataOne('answer'); } diff --git a/classes/modules/topic/entity/TopicRead.entity.class.php b/classes/modules/topic/entity/TopicRead.entity.class.php index 836cb123..6fe52769 100644 --- a/classes/modules/topic/entity/TopicRead.entity.class.php +++ b/classes/modules/topic/entity/TopicRead.entity.class.php @@ -18,19 +18,19 @@ class ModuleTopic_EntityTopicRead extends Entity { public function getTopicId() { - return $this->_aData['topic_id']; + return $this->_getDataOne('topic_id'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getDateRead() { - return $this->_aData['date_read']; + return $this->_getDataOne('date_read'); } public function getCommentCountLast() { - return $this->_aData['comment_count_last']; + return $this->_getDataOne('comment_count_last'); } public function getCommentIdLast() { - return $this->_aData['comment_id_last']; + return $this->_getDataOne('comment_id_last'); } diff --git a/classes/modules/topic/entity/TopicTag.entity.class.php b/classes/modules/topic/entity/TopicTag.entity.class.php index 506beea3..e1859edd 100644 --- a/classes/modules/topic/entity/TopicTag.entity.class.php +++ b/classes/modules/topic/entity/TopicTag.entity.class.php @@ -18,26 +18,26 @@ class ModuleTopic_EntityTopicTag extends Entity { public function getId() { - return $this->_aData['topic_tag_id']; + return $this->_getDataOne('topic_tag_id'); } public function getTopicId() { - return $this->_aData['topic_id']; + return $this->_getDataOne('topic_id'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getBlogId() { - return $this->_aData['blog_id']; + return $this->_getDataOne('blog_id'); } public function getText() { - return $this->_aData['topic_tag_text']; + return $this->_getDataOne('topic_tag_text'); } public function getCount() { - return $this->_aData['count']; + return $this->_getDataOne('count'); } public function getSize() { - return $this->_aData['size']; + return $this->_getDataOne('size'); } diff --git a/classes/modules/topic/entity/TopicVote.entity.class.php b/classes/modules/topic/entity/TopicVote.entity.class.php deleted file mode 100644 index fd5efa3f..00000000 --- a/classes/modules/topic/entity/TopicVote.entity.class.php +++ /dev/null @@ -1,42 +0,0 @@ -_aData['topic_id']; - } - public function getVoterId() { - return $this->_aData['user_voter_id']; - } - public function getDelta() { - return $this->_aData['vote_delta']; - } - - - - public function setTopicId($data) { - $this->_aData['topic_id']=$data; - } - public function setVoterId($data) { - $this->_aData['user_voter_id']=$data; - } - public function setDelta($data) { - $this->_aData['vote_delta']=$data; - } -} -?> \ No newline at end of file diff --git a/classes/modules/user/entity/Field.entity.class.php b/classes/modules/user/entity/Field.entity.class.php index db8936bf..59401d4a 100644 --- a/classes/modules/user/entity/Field.entity.class.php +++ b/classes/modules/user/entity/Field.entity.class.php @@ -17,19 +17,19 @@ class ModuleUser_EntityField extends Entity { public function getId() { - return $this->_aData['id']; + return $this->_getDataOne('id'); } public function getName(){ - return $this->_aData['name']; + return $this->_getDataOne('name'); } public function getType(){ - return $this->_aData['type']; + return $this->_getDataOne('type'); } public function getTitle(){ - return $this->_aData['title']; + return $this->_getDataOne('title'); } public function getPattern(){ - return $this->_aData['pattern']; + return $this->_getDataOne('pattern'); } public function getValue($bEscapeValue = false, $bTransformed = false){ if (!isset($this->_aData['value']) || !$this->_aData['value']) return ''; diff --git a/classes/modules/user/entity/Friend.entity.class.php b/classes/modules/user/entity/Friend.entity.class.php index 9f51ee0e..41ef5beb 100644 --- a/classes/modules/user/entity/Friend.entity.class.php +++ b/classes/modules/user/entity/Friend.entity.class.php @@ -28,10 +28,10 @@ class ModuleUser_EntityFriend extends Entity if(!$sUserId) { $sUserId=$this->getUserId(); } - if($this->_aData['user_from']==$sUserId) { + if($this->_getDataOne('user_from')==$sUserId) { return $this->_aData['user_to']; } - if($this->_aData['user_to']==$sUserId) { + if($this->_getDataOne('user_to')==$sUserId) { return $this->_aData['user_from']; } return false; @@ -43,24 +43,20 @@ class ModuleUser_EntityFriend extends Entity * @return int */ public function getUserId() { - return array_key_exists('user',$this->_aData) - ? $this->_aData['user'] - : null; + return $this->_getDataOne('user'); } public function getUserFrom() { - return $this->_aData['user_from']; + return $this->_getDataOne('user_from'); } public function getUserTo() { - return $this->_aData['user_to']; + return $this->_getDataOne('user_to'); } public function getStatusFrom() { - return $this->_aData['status_from']; + return $this->_getDataOne('status_from'); } public function getStatusTo() { - return (empty($this->_aData['status_to'])) - ? ModuleUser::USER_FRIEND_NULL - : $this->_aData['status_to']; + return $this->_getDataOne('status_to') ? $this->_getDataOne('status_to') : ModuleUser::USER_FRIEND_NULL; } public function getFriendStatus() { return $this->getStatusFrom()+$this->getStatusTo(); diff --git a/classes/modules/user/entity/Invite.entity.class.php b/classes/modules/user/entity/Invite.entity.class.php index d796361e..9d9ebd9c 100644 --- a/classes/modules/user/entity/Invite.entity.class.php +++ b/classes/modules/user/entity/Invite.entity.class.php @@ -18,25 +18,25 @@ class ModuleUser_EntityInvite extends Entity { public function getId() { - return $this->_aData['invite_id']; + return $this->_getDataOne('invite_id'); } public function getCode() { - return $this->_aData['invite_code']; + return $this->_getDataOne('invite_code'); } public function getUserFromId() { - return $this->_aData['user_from_id']; + return $this->_getDataOne('user_from_id'); } public function getUserToId() { - return $this->_aData['user_to_id']; + return $this->_getDataOne('user_to_id'); } public function getDateAdd() { - return $this->_aData['invite_date_add']; + return $this->_getDataOne('invite_date_add'); } public function getDateUsed() { - return $this->_aData['invite_date_used']; + return $this->_getDataOne('invite_date_used'); } public function getUsed() { - return $this->_aData['invite_used']; + return $this->_getDataOne('invite_used'); } diff --git a/classes/modules/user/entity/Reminder.entity.class.php b/classes/modules/user/entity/Reminder.entity.class.php index 28324915..3975b94e 100644 --- a/classes/modules/user/entity/Reminder.entity.class.php +++ b/classes/modules/user/entity/Reminder.entity.class.php @@ -18,22 +18,22 @@ class ModuleUser_EntityReminder extends Entity { public function getCode() { - return $this->_aData['reminder_code']; + return $this->_getDataOne('reminder_code'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getDateAdd() { - return $this->_aData['reminder_date_add']; + return $this->_getDataOne('reminder_date_add'); } public function getDateUsed() { - return $this->_aData['reminder_date_used']; + return $this->_getDataOne('reminder_date_used'); } public function getDateExpire() { - return $this->_aData['reminder_date_expire']; + return $this->_getDataOne('reminder_date_expire'); } public function getIsUsed() { - return $this->_aData['reminde_is_used']; + return $this->_getDataOne('reminde_is_used'); } diff --git a/classes/modules/user/entity/Session.entity.class.php b/classes/modules/user/entity/Session.entity.class.php index eafd8223..af1c7bb4 100644 --- a/classes/modules/user/entity/Session.entity.class.php +++ b/classes/modules/user/entity/Session.entity.class.php @@ -18,22 +18,22 @@ class ModuleUser_EntitySession extends Entity { public function getKey() { - return $this->_aData['session_key']; + return $this->_getDataOne('session_key'); } public function getUserId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getIpCreate() { - return $this->_aData['session_ip_create']; + return $this->_getDataOne('session_ip_create'); } public function getIpLast() { - return $this->_aData['session_ip_last']; + return $this->_getDataOne('session_ip_last'); } public function getDateCreate() { - return $this->_aData['session_date_create']; + return $this->_getDataOne('session_date_create'); } public function getDateLast() { - return $this->_aData['session_date_last']; + return $this->_getDataOne('session_date_last'); } diff --git a/classes/modules/user/entity/User.entity.class.php b/classes/modules/user/entity/User.entity.class.php index 1db5224c..3169b5cd 100644 --- a/classes/modules/user/entity/User.entity.class.php +++ b/classes/modules/user/entity/User.entity.class.php @@ -73,91 +73,91 @@ class ModuleUser_EntityUser extends Entity { public function getId() { - return $this->_aData['user_id']; + return $this->_getDataOne('user_id'); } public function getLogin() { - return $this->_aData['user_login']; + return $this->_getDataOne('user_login'); } public function getPassword() { - return $this->_aData['user_password']; + return $this->_getDataOne('user_password'); } public function getMail() { - return $this->_aData['user_mail']; + return $this->_getDataOne('user_mail'); } public function getSkill() { - return number_format(round($this->_aData['user_skill'],2), 2, '.', ''); + return number_format(round($this->_getDataOne('user_skill'),2), 2, '.', ''); } public function getDateRegister() { - return $this->_aData['user_date_register']; + return $this->_getDataOne('user_date_register'); } public function getDateActivate() { - return $this->_aData['user_date_activate']; + return $this->_getDataOne('user_date_activate'); } public function getDateCommentLast() { - return $this->_aData['user_date_comment_last']; + return $this->_getDataOne('user_date_comment_last'); } public function getIpRegister() { - return $this->_aData['user_ip_register']; + return $this->_getDataOne('user_ip_register'); } public function getRating() { - return number_format(round($this->_aData['user_rating'],2), 2, '.', ''); + return number_format(round($this->_getDataOne('user_rating'),2), 2, '.', ''); } public function getCountVote() { - return $this->_aData['user_count_vote']; + return $this->_getDataOne('user_count_vote'); } public function getActivate() { - return $this->_aData['user_activate']; + return $this->_getDataOne('user_activate'); } public function getActivateKey() { - return $this->_aData['user_activate_key']; + return $this->_getDataOne('user_activate_key'); } public function getProfileName() { - return $this->_aData['user_profile_name']; + return $this->_getDataOne('user_profile_name'); } public function getProfileSex() { - return $this->_aData['user_profile_sex']; + return $this->_getDataOne('user_profile_sex'); } public function getProfileCountry() { - return $this->_aData['user_profile_country']; + return $this->_getDataOne('user_profile_country'); } public function getProfileRegion() { - return $this->_aData['user_profile_region']; + return $this->_getDataOne('user_profile_region'); } public function getProfileCity() { - return $this->_aData['user_profile_city']; + return $this->_getDataOne('user_profile_city'); } public function getProfileBirthday() { - return $this->_aData['user_profile_birthday']; + return $this->_getDataOne('user_profile_birthday'); } public function getProfileAbout() { - return $this->_aData['user_profile_about']; + return $this->_getDataOne('user_profile_about'); } public function getProfileDate() { - return $this->_aData['user_profile_date']; + return $this->_getDataOne('user_profile_date'); } public function getProfileAvatar() { - return $this->_aData['user_profile_avatar']; + return $this->_getDataOne('user_profile_avatar'); } public function getProfileAvatarType() { return ($sPath=$this->getProfileAvatarPath()) ? pathinfo($sPath,PATHINFO_EXTENSION) : null; } public function getProfileFoto() { - return $this->_aData['user_profile_foto']; + return $this->_getDataOne('user_profile_foto'); } public function getSettingsNoticeNewTopic() { - return $this->_aData['user_settings_notice_new_topic']; + return $this->_getDataOne('user_settings_notice_new_topic'); } public function getSettingsNoticeNewComment() { - return $this->_aData['user_settings_notice_new_comment']; + return $this->_getDataOne('user_settings_notice_new_comment'); } public function getSettingsNoticeNewTalk() { - return $this->_aData['user_settings_notice_new_talk']; + return $this->_getDataOne('user_settings_notice_new_talk'); } public function getSettingsNoticeReplyComment() { - return $this->_aData['user_settings_notice_reply_comment']; + return $this->_getDataOne('user_settings_notice_reply_comment'); } public function getSettingsNoticeNewFriend() { - return $this->_aData['user_settings_notice_new_friend']; + return $this->_getDataOne('user_settings_notice_new_friend'); } @@ -165,10 +165,10 @@ class ModuleUser_EntityUser extends Entity { return $this->User_getUserFieldsValues($this->getId(), $bOnlyNoEmpty,$sType); } public function getSession() { - if (!isset($this->_aData['session'])) { + if (!$this->_getDataOne('session')) { $this->_aData['session']=$this->User_GetSessionByUserId($this->getId()); } - return $this->_aData['session']; + return $this->_getDataOne('session'); } public function isOnline() { if ($oSession=$this->getSession()) { @@ -195,13 +195,13 @@ class ModuleUser_EntityUser extends Entity { return Config::Get('path.static.skin').'/images/user_foto_250.png'; } public function getVote() { - return $this->_aData['vote']; + return $this->_getDataOne('vote'); } public function getUserIsFriend() { - return $this->_aData['user_is_friend']; + return $this->_getDataOne('user_is_friend'); } public function isAdministrator() { - return $this->_aData['user_is_administrator']; + return $this->_getDataOne('user_is_administrator'); } public function getUserWebPath() { return Router::GetPath('profile').$this->getLogin().'/'; @@ -212,7 +212,7 @@ class ModuleUser_EntityUser extends Entity { * @return int */ public function getUserFriend() { - return $this->_aData['user_friend']; + return $this->_getDataOne('user_friend'); } /** * Проверяет подписан ли текущий пользователь на этого diff --git a/classes/modules/user/entity/UserVote.entity.class.php b/classes/modules/user/entity/UserVote.entity.class.php deleted file mode 100644 index 4337205a..00000000 --- a/classes/modules/user/entity/UserVote.entity.class.php +++ /dev/null @@ -1,42 +0,0 @@ -_aData['user_id']; - } - public function getVoterId() { - return $this->_aData['user_voter_id']; - } - public function getDelta() { - return $this->_aData['vote_delta']; - } - - - - public function setUserId($data) { - $this->_aData['user_id']=$data; - } - public function setVoterId($data) { - $this->_aData['user_voter_id']=$data; - } - public function setDelta($data) { - $this->_aData['vote_delta']=$data; - } -} -?> \ No newline at end of file diff --git a/classes/modules/vote/entity/Vote.entity.class.php b/classes/modules/vote/entity/Vote.entity.class.php index a4ff4874..3d450e34 100644 --- a/classes/modules/vote/entity/Vote.entity.class.php +++ b/classes/modules/vote/entity/Vote.entity.class.php @@ -18,22 +18,22 @@ class ModuleVote_EntityVote extends Entity { public function getTargetId() { - return $this->_aData['target_id']; + return $this->_getDataOne('target_id'); } public function getTargetType() { - return $this->_aData['target_type']; + return $this->_getDataOne('target_type'); } public function getVoterId() { - return $this->_aData['user_voter_id']; + return $this->_getDataOne('user_voter_id'); } public function getDirection() { - return $this->_aData['vote_direction']; + return $this->_getDataOne('vote_direction'); } public function getValue() { - return $this->_aData['vote_value']; + return $this->_getDataOne('vote_value'); } public function getDate() { - return $this->_aData['vote_date']; + return $this->_getDataOne('vote_date'); } public function getIp() { return $this->_getDataOne('vote_ip'); diff --git a/classes/modules/wall/entity/Wall.entity.class.php b/classes/modules/wall/entity/Wall.entity.class.php index cc226e9b..1c3047d8 100644 --- a/classes/modules/wall/entity/Wall.entity.class.php +++ b/classes/modules/wall/entity/Wall.entity.class.php @@ -100,10 +100,10 @@ class ModuleWall_EntityWall extends Entity { * @return mixed */ public function getWallUser() { - if (!isset($this->_aData['wall_user'])) { + if (!$this->_getDataOne('wall_user')) { $this->_aData['wall_user']=$this->User_GetUserById($this->getWallUserId()); } - return $this->_aData['wall_user']; + return $this->_getDataOne('wall_user'); } /**