소스 검색

Ticket #404 - Integration in Posts.

AntonLV 9 년 전
부모
커밋
f6ef4f9e91

+ 1 - 0
modules/boonex/posts/classes/BxPostsConfig.php

@@ -74,6 +74,7 @@ class BxPostsConfig extends BxBaseModTextConfig
             'OBJECT_VIEWS' => 'bx_posts',
             'OBJECT_VIEWS' => 'bx_posts',
             'OBJECT_VOTES' => 'bx_posts',
             'OBJECT_VOTES' => 'bx_posts',
         	'OBJECT_FAVORITES' => 'bx_posts',
         	'OBJECT_FAVORITES' => 'bx_posts',
+            'OBJECT_FEATURED' => 'bx_posts',
             'OBJECT_METATAGS' => 'bx_posts',
             'OBJECT_METATAGS' => 'bx_posts',
             'OBJECT_COMMENTS' => 'bx_posts',
             'OBJECT_COMMENTS' => 'bx_posts',
             'OBJECT_PRIVACY_VIEW' => 'bx_posts_allow_view_to',
             'OBJECT_PRIVACY_VIEW' => 'bx_posts_allow_view_to',

+ 12 - 0
modules/boonex/posts/classes/BxPostsSearchResult.php

@@ -25,6 +25,7 @@ class BxPostsSearchResult extends BxBaseModTextSearchResult
             'searchFields' => array(),
             'searchFields' => array(),
             'restriction' => array(
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
+        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
         		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
         		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
             ),
             ),
             'paginate' => array('perPage' => getParam('bx_posts_per_page_browse'), 'start' => 0),
             'paginate' => array('perPage' => getParam('bx_posts_per_page_browse'), 'start' => 0),
@@ -74,6 +75,14 @@ class BxPostsSearchResult extends BxBaseModTextSearchResult
                 $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode;
                 $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode;
                 break;
                 break;
 
 
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_recent');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=posts/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
             case 'popular':
             case 'popular':
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
                 $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_popular');
                 $this->aCurrent['title'] = _t('_bx_posts_page_title_browse_popular');
@@ -112,6 +121,9 @@ class BxPostsSearchResult extends BxBaseModTextSearchResult
             case 'last':
             case 'last':
                 $aSql['order'] = ' ORDER BY `bx_posts_posts`.`added` DESC';
                 $aSql['order'] = ' ORDER BY `bx_posts_posts`.`added` DESC';
                 break;
                 break;
+            case 'featured':
+                $aSql['order'] = ' ORDER BY `bx_posts_posts`.`featured` DESC';
+                break;
             case 'updated':
             case 'updated':
                 $aSql['order'] = ' ORDER BY `bx_posts_posts`.`changed` DESC';
                 $aSql['order'] = ' ORDER BY `bx_posts_posts`.`changed` DESC';
                 break;
                 break;

+ 2 - 0
modules/boonex/posts/install/langs/en.xml

@@ -64,11 +64,13 @@
 	<string name="_bx_posts_page_title_browse"><![CDATA[Posts]]></string>
 	<string name="_bx_posts_page_title_browse"><![CDATA[Posts]]></string>
 	<string name="_bx_posts_page_title_search_results"><![CDATA[Posts matching "{0}"]]></string>
 	<string name="_bx_posts_page_title_search_results"><![CDATA[Posts matching "{0}"]]></string>
 	<string name="_bx_posts_page_title_browse_by_author"><![CDATA[Posts of {display_name}]]></string>
 	<string name="_bx_posts_page_title_browse_by_author"><![CDATA[Posts of {display_name}]]></string>
+	<string name="_bx_posts_page_title_browse_featured"><![CDATA[Featured]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Latest]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Latest]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Popular]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Popular]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Updated Posts]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Updated Posts]]></string>
     <string name="_bx_posts_page_title_sys_home"><![CDATA[Posts Home]]></string>
     <string name="_bx_posts_page_title_sys_home"><![CDATA[Posts Home]]></string>
     <string name="_bx_posts_page_title_home"><![CDATA[Posts]]></string>
     <string name="_bx_posts_page_title_home"><![CDATA[Posts]]></string>
+    <string name="_bx_posts_page_block_title_featured_entries_view_extended"><![CDATA[Featured]]></string>
     <string name="_bx_posts_page_block_title_recent_entries"><![CDATA[Latest (Gallery View)]]></string>
     <string name="_bx_posts_page_block_title_recent_entries"><![CDATA[Latest (Gallery View)]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_extended"><![CDATA[Latest]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_extended"><![CDATA[Latest]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_full"><![CDATA[Latest (Full View)]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_full"><![CDATA[Latest (Full View)]]></string>

+ 2 - 1
modules/boonex/posts/install/sql/enable.sql

@@ -106,7 +106,8 @@ INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module
 ('bx_posts_home', 'posts-home', '_bx_posts_page_title_sys_home', '_bx_posts_page_title_home', 'bx_posts', 2, 2147483647, 1, 'page.php?i=posts-home', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
 ('bx_posts_home', 'posts-home', '_bx_posts_page_title_sys_home', '_bx_posts_page_title_home', 'bx_posts', 2, 2147483647, 1, 'page.php?i=posts-home', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
 
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_posts_home', 1, 'bx_posts', '', '_bx_posts_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_posts_home', 1, 'bx_posts', '', '_bx_posts_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_posts_home', 1, 'bx_posts', '', '_bx_posts_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 1),
 ('bx_posts_home', 2, 'bx_posts', '', '_bx_posts_page_block_title_popular_keywords', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:2:{i:0;s:8:\"bx_posts\";i:1;s:8:\"bx_posts\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 1, 1, 0),
 ('bx_posts_home', 2, 'bx_posts', '', '_bx_posts_page_block_title_popular_keywords', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:2:{i:0;s:8:\"bx_posts\";i:1;s:8:\"bx_posts\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 1, 1, 0),
 ('bx_posts_home', 2, 'bx_posts', '', '_bx_posts_page_block_title_cats', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:15:\"categories_list\";s:6:\"params\";a:2:{i:0;s:13:\"bx_posts_cats\";i:1;a:1:{s:10:\"show_empty\";b:1;}}s:5:\"class\";s:20:\"TemplServiceCategory\";}', 0, 1, 1, 1);
 ('bx_posts_home', 2, 'bx_posts', '', '_bx_posts_page_block_title_cats', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:15:\"categories_list\";s:6:\"params\";a:2:{i:0;s:13:\"bx_posts_cats\";i:1;a:1:{s:10:\"show_empty\";b:1;}}s:5:\"class\";s:20:\"TemplServiceCategory\";}', 0, 1, 1, 1);
 
 

+ 6 - 0
modules/boonex/posts/install/sql/install.sql

@@ -18,6 +18,7 @@ CREATE TABLE IF NOT EXISTS `bx_posts_posts` (
   `favorites` int(11) NOT NULL default '0',
   `favorites` int(11) NOT NULL default '0',
   `comments` int(11) NOT NULL default '0',
   `comments` int(11) NOT NULL default '0',
   `reports` int(11) NOT NULL default '0',
   `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
   `allow_view_to` int(11) NOT NULL DEFAULT '3',
   `allow_view_to` int(11) NOT NULL DEFAULT '3',
   `status` enum('active','hidden') NOT NULL DEFAULT 'active',
   `status` enum('active','hidden') NOT NULL DEFAULT 'active',
   `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
   `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
@@ -306,6 +307,11 @@ INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigg
 INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 ('bx_posts', 'bx_posts_favorites_track', '1', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_posts_posts', 'id', 'author', 'favorites', '', '');
 ('bx_posts', 'bx_posts_favorites_track', '1', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_posts_posts', 'id', 'author', 'favorites', '', '');
 
 
+-- FEATURED
+
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_posts', '1', '1', 'page.php?i=view-post&id={object_id}', 'bx_posts_posts', 'id', 'author', 'featured', '', '');
+
 -- STUDIO: page & widget
 -- STUDIO: page & widget
 
 
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES

+ 4 - 0
modules/boonex/posts/install/sql/uninstall.sql

@@ -45,6 +45,10 @@ DELETE FROM `sys_objects_view` WHERE `name` = 'bx_posts';
 
 
 DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_posts';
 DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_posts';
 
 
+-- FEATURED
+
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_posts';
+
 -- STUDIO: page & widget
 -- STUDIO: page & widget
 
 
 DELETE FROM `tp`, `tw`, `tpw`
 DELETE FROM `tp`, `tw`, `tpw`

+ 2 - 0
modules/boonex/russian/data/langs/bx_posts/ru.xml

@@ -64,11 +64,13 @@
 	<string name="_bx_posts_page_title_browse"><![CDATA[Публикации]]></string>
 	<string name="_bx_posts_page_title_browse"><![CDATA[Публикации]]></string>
 	<string name="_bx_posts_page_title_search_results"><![CDATA[Публикации, соответствующие "{0}"]]></string>
 	<string name="_bx_posts_page_title_search_results"><![CDATA[Публикации, соответствующие "{0}"]]></string>
 	<string name="_bx_posts_page_title_browse_by_author"><![CDATA[Публикации {display_name}]]></string>
 	<string name="_bx_posts_page_title_browse_by_author"><![CDATA[Публикации {display_name}]]></string>
+	<string name="_bx_posts_page_title_browse_featured"><![CDATA[Продвинутые Публикации]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Недавние Публикации]]></string>
     <string name="_bx_posts_page_title_browse_recent"><![CDATA[Недавние Публикации]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Популярные Публикации]]></string>
     <string name="_bx_posts_page_title_browse_popular"><![CDATA[Популярные Публикации]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Обновлённые Публикации]]></string>
     <string name="_bx_posts_page_title_browse_updated"><![CDATA[Обновлённые Публикации]]></string>
     <string name="_bx_posts_page_title_sys_home"><![CDATA[Публикации - Домой]]></string>
     <string name="_bx_posts_page_title_sys_home"><![CDATA[Публикации - Домой]]></string>
     <string name="_bx_posts_page_title_home"><![CDATA[Публикации]]></string>
     <string name="_bx_posts_page_title_home"><![CDATA[Публикации]]></string>
+    <string name="_bx_posts_page_block_title_featured_entries_view_extended"><![CDATA[Продвинутые]]></string>
     <string name="_bx_posts_page_block_title_recent_entries"><![CDATA[Новые Публикации (Галерея)]]></string>
     <string name="_bx_posts_page_block_title_recent_entries"><![CDATA[Новые Публикации (Галерея)]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_extended"><![CDATA[Новые Публикации]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_extended"><![CDATA[Новые Публикации]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_full"><![CDATA[Недавние Публикации (Полный просмотр)]]></string>
     <string name="_bx_posts_page_block_title_recent_entries_view_full"><![CDATA[Недавние Публикации (Полный просмотр)]]></string>