Merge branch '011_tokudome' into 'master'
アーカイブページ作成においての変更です。 See merge request !6
Showing
34 changed files
with
2560 additions
and
47 deletions
... | @@ -14,3 +14,12 @@ https://project.lilli.co.jp/oki/kanoya-univercity-docker | ... | @@ -14,3 +14,12 @@ https://project.lilli.co.jp/oki/kanoya-univercity-docker |
14 | ## DB/アップロードファイルのバックアップについて | 14 | ## DB/アップロードファイルのバックアップについて |
15 | ec2-uesrのホームディレクトリに毎週日曜に1度だけ取るようにしてます。 | 15 | ec2-uesrのホームディレクトリに毎週日曜に1度だけ取るようにしてます。 |
16 | ~/backup.sh をcron実行しています。 | 16 | ~/backup.sh をcron実行しています。 |
17 | |||
18 | ## インストールを必要とするモジュール、コンポーネントについて | ||
19 | srcディレクトリにて、インストールして追加したモジュール、コンポーネントのソースコードを管理しています。 | ||
20 | 追加したモジュール、コンポーネントについての詳細は各モジュール、コンポーネントディレクトリに有るREADME.mdをご覧ください。 | ||
21 | |||
22 | Joomlaのアップデートをした際に、アップデートの内容によっては追加したモジュール、コンポーネントが正常に動作しなくなる場合があります。 | ||
23 | その際は、適宜、モジュール、コンポーネントを修正してください。 | ||
24 | |||
25 | 再度、モジュール、コンポーネントをインストールする場合は、それぞれのREADMEに記述してある手順でインストールしてください。 | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
src/com/com_content_custom/README.md
0 → 100644
1 | # 月次アーカイブ用コンポーネント | ||
2 | 過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。 | ||
3 | インストールしていない場合は、管理画面よりインストールする必要があります。 | ||
4 | |||
5 | ## インストール手順 | ||
6 | 1. 管理画面ログイン | ||
7 | 2. エクステンション配下の管理を選択 | ||
8 | 3. (フォルダからインストール)を選択 | ||
9 | 4. フォームにインストールするモジュールまたは、コンポーネントのフォルダを指定(例:/var/www/html/src/com/com_hoge) | ||
10 | 5. チェックしてインストール | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/com/com_content_custom/admin/index.html
0 → 100644
File mode changed
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | COM_CONTENT_CUSTOM="archive_custom_component" | ||
7 | COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="Options" | ||
8 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="Position of Article Info" | ||
9 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive." | ||
10 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC="Puts the article information block above or below the text or splits it into two separate blocks, one above and the other below." | ||
11 | COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="Use Article Settings" | ||
12 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
13 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
14 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
15 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
16 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | COM_CONTENT_CUSTOM="archive_custom_component" | ||
7 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive." | ||
8 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
9 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
10 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
11 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
12 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)" | ||
7 | COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="オプション" | ||
8 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="記事情報の位置" | ||
9 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。" | ||
10 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC="記事情報のブロックをテキストの上か下に追加します。または1つは上、その他は下へ2つのブロックに分けます。" | ||
11 | COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="記事設定の使用" | ||
12 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
13 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
14 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
15 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
16 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)" | ||
7 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。" | ||
8 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
9 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
10 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
11 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
12 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
File mode changed
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <extension type="component" version="3.0" method="upgrade"> | ||
3 | <name>COM_CONTENT_CUSTOM</name> | ||
4 | <author>T.Tokudome</author> | ||
5 | <creationDate>July 2020</creationDate> | ||
6 | <copyright></copyright> | ||
7 | <license></license> | ||
8 | <authorEmail>tokudome@lilli.co.jp</authorEmail> | ||
9 | <authorUrl></authorUrl> | ||
10 | <version>0.0.1</version> | ||
11 | <description>COM_CONTENT_CUSTOM_XML_DESCRIPTION</description> | ||
12 | |||
13 | <update> | ||
14 | <schemas> | ||
15 | <schemapath type="mysql">sql/updates/mysql</schemapath> | ||
16 | </schemas> | ||
17 | </update> | ||
18 | |||
19 | <files folder="site"> | ||
20 | <filename>index.html</filename> | ||
21 | <filename>content_custom.php</filename> | ||
22 | <filename>controller.php</filename> | ||
23 | <folder>views</folder> | ||
24 | <folder>helpers</folder> | ||
25 | <folder>models</folder> | ||
26 | </files> | ||
27 | <languages folder="site"> | ||
28 | <language tag="en-GB">language/en-GB.com_content_custom.ini</language> | ||
29 | <language tag="ja-JP">language/ja-JP.com_content_custom.ini</language> | ||
30 | </languages> | ||
31 | <administration> | ||
32 | <menu link='index.php?option=com_content_custom'>カスタムアーカイブ</menu> | ||
33 | <files folder="admin"> | ||
34 | <filename>index.html</filename> | ||
35 | <filename>content_custom.php</filename> | ||
36 | <folder>sql</folder> | ||
37 | </files> | ||
38 | <languages folder="admin"> | ||
39 | <language tag="en-GB">language/en-GB.com_content_custom.ini</language> | ||
40 | <language tag="ja-JP">language/ja-JP.com_content_custom.ini</language> | ||
41 | <language tag="en-GB">language/en-GB.com_content_custom.sys.ini</language> | ||
42 | <language tag="ja-JP">language/ja-JP.com_content_custom.sys.ini</language> | ||
43 | </languages> | ||
44 | </administration> | ||
45 | |||
46 | </extension> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | JLoader::register('ContentCustomHelperRoute', JPATH_SITE . '/components/com_content_custom/helpers/route.php'); | ||
13 | JLoader::register('ContentCustomHelperQuery', JPATH_SITE . '/components/com_content_custom/helpers/query.php'); | ||
14 | |||
15 | $input = JFactory::getApplication()->input; | ||
16 | $user = JFactory::getUser(); | ||
17 | |||
18 | $controller = JControllerLegacy::getInstance('Content'); | ||
19 | |||
20 | $controller->execute(JFactory::getApplication()->input->get('task')); | ||
21 | $controller->redirect(); |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | use Joomla\CMS\Component\ComponentHelper; | ||
13 | |||
14 | /** | ||
15 | * Content Component Controller | ||
16 | * | ||
17 | * @since 1.5 | ||
18 | */ | ||
19 | class ContentController extends JControllerLegacy | ||
20 | { | ||
21 | /** | ||
22 | * Constructor. | ||
23 | * | ||
24 | * @param array $config An optional associative array of configuration settings. | ||
25 | * Recognized key values include 'name', 'default_task', 'model_path', and | ||
26 | * 'view_path' (this list is not meant to be comprehensive). | ||
27 | * | ||
28 | * @since 3.0.1 | ||
29 | */ | ||
30 | public function __construct($config = array()) | ||
31 | { | ||
32 | $this->input = JFactory::getApplication()->input; | ||
33 | |||
34 | // Article frontpage Editor pagebreak proxying: | ||
35 | if ($this->input->get('view') === 'article' && $this->input->get('layout') === 'pagebreak') | ||
36 | { | ||
37 | $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; | ||
38 | } | ||
39 | // Article frontpage Editor article proxying: | ||
40 | elseif ($this->input->get('view') === 'articles' && $this->input->get('layout') === 'modal') | ||
41 | { | ||
42 | JHtml::_('stylesheet', 'system/adminlist.css', array('version' => 'auto', 'relative' => true)); | ||
43 | $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; | ||
44 | } | ||
45 | |||
46 | parent::__construct($config); | ||
47 | } | ||
48 | |||
49 | /** | ||
50 | * Method to display a view. | ||
51 | * | ||
52 | * @param boolean $cachable If true, the view output will be cached. | ||
53 | * @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}. | ||
54 | * | ||
55 | * @return JController This object to support chaining. | ||
56 | * | ||
57 | * @since 1.5 | ||
58 | */ | ||
59 | public function display($cachable = false, $urlparams = false) | ||
60 | { | ||
61 | $cachable = true; | ||
62 | |||
63 | /** | ||
64 | * Set the default view name and format from the Request. | ||
65 | * Note we are using a_id to avoid collisions with the router and the return page. | ||
66 | * Frontend is a bit messier than the backend. | ||
67 | */ | ||
68 | $id = $this->input->getInt('a_id'); | ||
69 | $vName = $this->input->getCmd('view', 'categories'); | ||
70 | $this->input->set('view', $vName); | ||
71 | $user = JFactory::getUser(); | ||
72 | |||
73 | if ($user->get('id') | ||
74 | || ($this->input->getMethod() === 'POST' | ||
75 | && (($vName === 'category' && $this->input->get('layout') !== 'blog') || $vName === 'archive' ))) | ||
76 | { | ||
77 | $cachable = false; | ||
78 | } | ||
79 | |||
80 | $safeurlparams = array( | ||
81 | 'catid' => 'INT', | ||
82 | 'id' => 'INT', | ||
83 | 'cid' => 'ARRAY', | ||
84 | 'year' => 'INT', | ||
85 | 'month' => 'INT', | ||
86 | 'limit' => 'UINT', | ||
87 | 'limitstart' => 'UINT', | ||
88 | 'showall' => 'INT', | ||
89 | 'return' => 'BASE64', | ||
90 | 'filter' => 'STRING', | ||
91 | 'filter_order' => 'CMD', | ||
92 | 'filter_order_Dir' => 'CMD', | ||
93 | 'filter-search' => 'STRING', | ||
94 | 'print' => 'BOOLEAN', | ||
95 | 'lang' => 'CMD', | ||
96 | 'Itemid' => 'INT'); | ||
97 | |||
98 | parent::display($cachable, $safeurlparams); | ||
99 | |||
100 | return $this; | ||
101 | } | ||
102 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | /** | ||
13 | * Content Component Query Helper | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ContentCustomHelperQuery | ||
18 | { | ||
19 | /** | ||
20 | * Translate an order code to a field for secondary category ordering. | ||
21 | * | ||
22 | * @param string $orderby The ordering code. | ||
23 | * @param string $orderDate The ordering code for the date. | ||
24 | * | ||
25 | * @return string The SQL field(s) to order by. | ||
26 | * | ||
27 | * @since 1.5 | ||
28 | */ | ||
29 | public static function orderbySecondary($orderby, $orderDate = 'created') | ||
30 | { | ||
31 | $queryDate = self::getQueryDate($orderDate); | ||
32 | |||
33 | switch ($orderby) | ||
34 | { | ||
35 | case 'date' : | ||
36 | $orderby = $queryDate; | ||
37 | break; | ||
38 | |||
39 | case 'rdate' : | ||
40 | $orderby = $queryDate . ' DESC '; | ||
41 | break; | ||
42 | |||
43 | case 'alpha' : | ||
44 | $orderby = 'a.title'; | ||
45 | break; | ||
46 | |||
47 | case 'ralpha' : | ||
48 | $orderby = 'a.title DESC'; | ||
49 | break; | ||
50 | |||
51 | case 'hits' : | ||
52 | $orderby = 'a.hits DESC'; | ||
53 | break; | ||
54 | |||
55 | case 'rhits' : | ||
56 | $orderby = 'a.hits'; | ||
57 | break; | ||
58 | |||
59 | case 'order' : | ||
60 | $orderby = 'a.ordering'; | ||
61 | break; | ||
62 | |||
63 | case 'rorder' : | ||
64 | $orderby = 'a.ordering DESC'; | ||
65 | break; | ||
66 | |||
67 | case 'author' : | ||
68 | $orderby = 'author'; | ||
69 | break; | ||
70 | |||
71 | case 'rauthor' : | ||
72 | $orderby = 'author DESC'; | ||
73 | break; | ||
74 | |||
75 | case 'front' : | ||
76 | $orderby = 'a.featured DESC, fp.ordering, ' . $queryDate . ' DESC '; | ||
77 | break; | ||
78 | |||
79 | case 'random' : | ||
80 | $orderby = JFactory::getDbo()->getQuery(true)->Rand(); | ||
81 | break; | ||
82 | |||
83 | case 'vote' : | ||
84 | $orderby = 'a.id DESC '; | ||
85 | |||
86 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
87 | { | ||
88 | $orderby = 'rating_count DESC '; | ||
89 | } | ||
90 | break; | ||
91 | |||
92 | case 'rvote' : | ||
93 | $orderby = 'a.id ASC '; | ||
94 | |||
95 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
96 | { | ||
97 | $orderby = 'rating_count ASC '; | ||
98 | } | ||
99 | break; | ||
100 | |||
101 | case 'rank' : | ||
102 | $orderby = 'a.id DESC '; | ||
103 | |||
104 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
105 | { | ||
106 | $orderby = 'rating DESC '; | ||
107 | } | ||
108 | break; | ||
109 | |||
110 | case 'rrank' : | ||
111 | $orderby = 'a.id ASC '; | ||
112 | |||
113 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
114 | { | ||
115 | $orderby = 'rating ASC '; | ||
116 | } | ||
117 | break; | ||
118 | |||
119 | default : | ||
120 | $orderby = 'a.ordering'; | ||
121 | break; | ||
122 | } | ||
123 | |||
124 | return $orderby; | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * Translate an order code to a field for primary category ordering. | ||
129 | * | ||
130 | * @param string $orderDate The ordering code. | ||
131 | * | ||
132 | * @return string The SQL field(s) to order by. | ||
133 | * | ||
134 | * @since 1.6 | ||
135 | */ | ||
136 | public static function getQueryDate($orderDate) | ||
137 | { | ||
138 | $db = JFactory::getDbo(); | ||
139 | |||
140 | switch ($orderDate) | ||
141 | { | ||
142 | case 'modified' : | ||
143 | $queryDate = ' CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END'; | ||
144 | break; | ||
145 | |||
146 | // Use created if publish_up is not set | ||
147 | case 'published' : | ||
148 | $queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END '; | ||
149 | break; | ||
150 | |||
151 | case 'unpublished' : | ||
152 | $queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END '; | ||
153 | break; | ||
154 | case 'created' : | ||
155 | default : | ||
156 | $queryDate = ' a.created '; | ||
157 | break; | ||
158 | } | ||
159 | |||
160 | return $queryDate; | ||
161 | } | ||
162 | |||
163 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | /** | ||
13 | * Content Component Route Helper. | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | abstract class ContentCustomHelperRoute | ||
18 | { | ||
19 | /** | ||
20 | * Get the article route. | ||
21 | * | ||
22 | * @param integer $id The route of the content item. | ||
23 | * @param integer $catid The category ID. | ||
24 | * @param integer $language The language code. | ||
25 | * @param string $layout The layout value. | ||
26 | * | ||
27 | * @return string The article route. | ||
28 | * | ||
29 | * @since 1.5 | ||
30 | */ | ||
31 | public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null) | ||
32 | { | ||
33 | // Create the link | ||
34 | $link = 'index.php?option=com_content&view=article&id=' . $id; | ||
35 | |||
36 | if ((int) $catid > 1) | ||
37 | { | ||
38 | $link .= '&catid=' . $catid; | ||
39 | } | ||
40 | |||
41 | if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) | ||
42 | { | ||
43 | $link .= '&lang=' . $language; | ||
44 | } | ||
45 | |||
46 | if ($layout) | ||
47 | { | ||
48 | $link .= '&layout=' . $layout; | ||
49 | } | ||
50 | |||
51 | return $link; | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * Get the category route. | ||
56 | * | ||
57 | * @param integer $catid The category ID. | ||
58 | * @param integer $language The language code. | ||
59 | * @param string $layout The layout value. | ||
60 | * | ||
61 | * @return string The article route. | ||
62 | * | ||
63 | * @since 1.5 | ||
64 | */ | ||
65 | public static function getCategoryRoute($catid, $language = 0, $layout = null) | ||
66 | { | ||
67 | if ($catid instanceof JCategoryNode) | ||
68 | { | ||
69 | $id = $catid->id; | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | $id = (int) $catid; | ||
74 | } | ||
75 | |||
76 | if ($id < 1) | ||
77 | { | ||
78 | return ''; | ||
79 | } | ||
80 | |||
81 | $link = 'index.php?option=com_content&view=category&id=' . $id; | ||
82 | |||
83 | if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) | ||
84 | { | ||
85 | $link .= '&lang=' . $language; | ||
86 | } | ||
87 | |||
88 | if ($layout) | ||
89 | { | ||
90 | $link .= '&layout=' . $layout; | ||
91 | } | ||
92 | |||
93 | return $link; | ||
94 | } | ||
95 | |||
96 | } |
src/com/com_content_custom/site/index.html
0 → 100644
File mode changed
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | COM_CONTENT_CUSTOM_ARTICLE_HITS="Hits: %s" | ||
7 | COM_CONTENT_CUSTOM_ARTICLE_INFO="Details" | ||
8 | COM_CONTENT_CUSTOM_CATEGORY="Category: %s" | ||
9 | COM_CONTENT_CUSTOM_CREATED_DATE_ON="Created: %s" | ||
10 | COM_CONTENT_CUSTOM_LAST_UPDATED="Last Updated: %s" | ||
11 | COM_CONTENT_CUSTOM_MONTH="Month" | ||
12 | COM_CONTENT_CUSTOM_PARENT="Parent Category: %s" | ||
13 | COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="Published: %s" | ||
14 | COM_CONTENT_CUSTOM_WRITTEN_BY="Written by %s" | ||
15 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
16 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
17 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
18 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
19 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | COM_CONTENT_CUSTOM_ARTICLE_HITS="参照数: %s" | ||
7 | COM_CONTENT_CUSTOM_ARTICLE_INFO="詳細" | ||
8 | COM_CONTENT_CUSTOM_CATEGORY="カテゴリ: %s" | ||
9 | COM_CONTENT_CUSTOM_CREATED_DATE_ON="作成日:%s" | ||
10 | COM_CONTENT_CUSTOM_LAST_UPDATED="最終更新日:%s" | ||
11 | COM_CONTENT_CUSTOM_MONTH="月" | ||
12 | COM_CONTENT_CUSTOM_PARENT="親カテゴリ: %s" | ||
13 | COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="公開日:%s" | ||
14 | COM_CONTENT_CUSTOM_WRITTEN_BY="投稿者: %s" | ||
15 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
16 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
17 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
18 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
19 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | use Joomla\Utilities\ArrayHelper; | ||
13 | |||
14 | JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); | ||
15 | |||
16 | /** | ||
17 | * Content Component Archive Model | ||
18 | * | ||
19 | * @since 1.5 | ||
20 | */ | ||
21 | class ContentModelArchive extends ContentModelArticles | ||
22 | { | ||
23 | /** | ||
24 | * Model context string. | ||
25 | * | ||
26 | * @var string | ||
27 | */ | ||
28 | public $_context = 'com_content_custom.archive'; | ||
29 | |||
30 | /** | ||
31 | * Method to auto-populate the model state. | ||
32 | * | ||
33 | * Note. Calling getState in this method will result in recursion. | ||
34 | * | ||
35 | * @param string $ordering The field to order on. | ||
36 | * @param string $direction The direction to order on. | ||
37 | * | ||
38 | * @return void | ||
39 | * | ||
40 | * @since 1.6 | ||
41 | */ | ||
42 | protected function populateState($ordering = null, $direction = null) | ||
43 | { | ||
44 | parent::populateState(); | ||
45 | |||
46 | $app = JFactory::getApplication(); | ||
47 | |||
48 | // Add archive properties | ||
49 | $params = $this->state->params; | ||
50 | |||
51 | // Filter on archived articles | ||
52 | $this->setState('filter.published', 1); | ||
53 | |||
54 | // Filter on month, year | ||
55 | $this->setState('filter.month', $app->input->getInt('month')); | ||
56 | $this->setState('filter.year', $app->input->getInt('year')); | ||
57 | |||
58 | // Optional filter text | ||
59 | $this->setState('list.filter', $app->input->getString('filter-search')); | ||
60 | |||
61 | // Get list limit | ||
62 | $itemid = $app->input->get('Itemid', 0, 'int'); | ||
63 | $limit = $app->getUserStateFromRequest('com_content_custom.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint'); | ||
64 | $this->setState('list.limit', $limit); | ||
65 | |||
66 | // Set the archive ordering | ||
67 | $articleOrderby = $params->get('orderby_sec', 'rdate'); | ||
68 | $articleOrderDate = $params->get('order_date'); | ||
69 | |||
70 | // No category ordering | ||
71 | $secondary = ContentCustomHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate); | ||
72 | |||
73 | $this->setState('list.ordering', $secondary . ', a.created DESC'); | ||
74 | $this->setState('list.direction', ''); | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * Get the master query for retrieving a list of articles subject to the model state. | ||
79 | * | ||
80 | * @return JDatabaseQuery | ||
81 | * | ||
82 | * @since 1.6 | ||
83 | */ | ||
84 | protected function getListQuery() | ||
85 | { | ||
86 | $params = $this->state->params; | ||
87 | $app = JFactory::getApplication('site'); | ||
88 | $catids = ArrayHelper::toInteger($app->input->get('catid', array(), 'array')); | ||
89 | $catids = array_values(array_diff($catids, array(0))); | ||
90 | $articleOrderDate = $params->get('order_date'); | ||
91 | |||
92 | // Create a new query object. | ||
93 | $query = parent::getListQuery(); | ||
94 | |||
95 | // Add routing for archive | ||
96 | // Sqlsrv changes | ||
97 | $case_when = ' CASE WHEN '; | ||
98 | $case_when .= $query->charLength('a.alias', '!=', '0'); | ||
99 | $case_when .= ' THEN '; | ||
100 | $a_id = $query->castAsChar('a.id'); | ||
101 | $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); | ||
102 | $case_when .= ' ELSE '; | ||
103 | $case_when .= $a_id . ' END as slug'; | ||
104 | |||
105 | $query->select($case_when); | ||
106 | |||
107 | $case_when = ' CASE WHEN '; | ||
108 | $case_when .= $query->charLength('c.alias', '!=', '0'); | ||
109 | $case_when .= ' THEN '; | ||
110 | $c_id = $query->castAsChar('c.id'); | ||
111 | $case_when .= $query->concatenate(array($c_id, 'c.alias'), ':'); | ||
112 | $case_when .= ' ELSE '; | ||
113 | $case_when .= $c_id . ' END as catslug'; | ||
114 | $query->select($case_when); | ||
115 | |||
116 | // Filter on month, year | ||
117 | // First, get the date field | ||
118 | $queryDate = ContentCustomHelperQuery::getQueryDate($articleOrderDate); | ||
119 | |||
120 | if ($month = $this->getState('filter.month')) | ||
121 | { | ||
122 | $query->where($query->month($queryDate) . ' = ' . $month); | ||
123 | } | ||
124 | |||
125 | if ($year = $this->getState('filter.year')) | ||
126 | { | ||
127 | $query->where($query->year($queryDate) . ' = ' . $year); | ||
128 | } | ||
129 | |||
130 | if (count($catids) > 0) | ||
131 | { | ||
132 | $query->where('c.id IN (' . implode(', ', $catids) . ')'); | ||
133 | } | ||
134 | |||
135 | return $query; | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * Method to get the archived article list | ||
140 | * | ||
141 | * @access public | ||
142 | * @return array | ||
143 | */ | ||
144 | public function getData() | ||
145 | { | ||
146 | $app = JFactory::getApplication(); | ||
147 | |||
148 | // Lets load the content if it doesn't already exist | ||
149 | if (empty($this->_data)) | ||
150 | { | ||
151 | // Get the page/component configuration | ||
152 | $params = $app->getParams(); | ||
153 | |||
154 | // Get the pagination request variables | ||
155 | $limit = $app->input->get('limit', $params->get('display_num', 20), 'uint'); | ||
156 | $limitstart = $app->input->get('limitstart', 0, 'uint'); | ||
157 | |||
158 | $query = $this->_buildQuery(); | ||
159 | |||
160 | $this->_data = $this->_getList($query, $limitstart, $limit); | ||
161 | } | ||
162 | |||
163 | return $this->_data; | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * JModelLegacy override to add alternating value for $odd | ||
168 | * | ||
169 | * @param string $query The query. | ||
170 | * @param integer $limitstart Offset. | ||
171 | * @param integer $limit The number of records. | ||
172 | * | ||
173 | * @return array An array of results. | ||
174 | * | ||
175 | * @since 3.0.1 | ||
176 | * @throws RuntimeException | ||
177 | */ | ||
178 | protected function _getList($query, $limitstart=0, $limit=0) | ||
179 | { | ||
180 | $result = parent::_getList($query, $limitstart, $limit); | ||
181 | |||
182 | $odd = 1; | ||
183 | |||
184 | foreach ($result as $k => $row) | ||
185 | { | ||
186 | $result[$k]->odd = $odd; | ||
187 | $odd = 1 - $odd; | ||
188 | } | ||
189 | |||
190 | return $result; | ||
191 | } | ||
192 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | use Joomla\Registry\Registry; | ||
13 | use Joomla\String\StringHelper; | ||
14 | use Joomla\Utilities\ArrayHelper; | ||
15 | |||
16 | /** | ||
17 | * This models supports retrieving lists of articles. | ||
18 | * | ||
19 | * @since 1.6 | ||
20 | */ | ||
21 | class ContentModelArticles extends JModelList | ||
22 | { | ||
23 | /** | ||
24 | * Constructor. | ||
25 | * | ||
26 | * @param array $config An optional associative array of configuration settings. | ||
27 | * | ||
28 | * @see JController | ||
29 | * @since 1.6 | ||
30 | */ | ||
31 | public function __construct($config = array()) | ||
32 | { | ||
33 | if (empty($config['filter_fields'])) | ||
34 | { | ||
35 | $config['filter_fields'] = array( | ||
36 | 'id', 'a.id', | ||
37 | 'title', 'a.title', | ||
38 | 'alias', 'a.alias', | ||
39 | 'checked_out', 'a.checked_out', | ||
40 | 'checked_out_time', 'a.checked_out_time', | ||
41 | 'catid', 'a.catid', 'category_title', | ||
42 | 'state', 'a.state', | ||
43 | 'access', 'a.access', 'access_level', | ||
44 | 'created', 'a.created', | ||
45 | 'created_by', 'a.created_by', | ||
46 | 'ordering', 'a.ordering', | ||
47 | 'featured', 'a.featured', | ||
48 | 'language', 'a.language', | ||
49 | 'hits', 'a.hits', | ||
50 | 'publish_up', 'a.publish_up', | ||
51 | 'publish_down', 'a.publish_down', | ||
52 | 'images', 'a.images', | ||
53 | 'urls', 'a.urls', | ||
54 | 'filter_tag', | ||
55 | ); | ||
56 | } | ||
57 | |||
58 | parent::__construct($config); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * Method to auto-populate the model state. | ||
63 | * | ||
64 | * This method should only be called once per instantiation and is designed | ||
65 | * to be called on the first call to the getState() method unless the model | ||
66 | * configuration flag to ignore the request is set. | ||
67 | * | ||
68 | * Note. Calling getState in this method will result in recursion. | ||
69 | * | ||
70 | * @param string $ordering An optional ordering field. | ||
71 | * @param string $direction An optional direction (asc|desc). | ||
72 | * | ||
73 | * @return void | ||
74 | * | ||
75 | * @since 3.0.1 | ||
76 | */ | ||
77 | protected function populateState($ordering = 'ordering', $direction = 'ASC') | ||
78 | { | ||
79 | $app = JFactory::getApplication(); | ||
80 | |||
81 | // List state information | ||
82 | $value = $app->input->get('limit', $app->get('list_limit', 0), 'uint'); | ||
83 | $this->setState('list.limit', $value); | ||
84 | |||
85 | $value = $app->input->get('limitstart', 0, 'uint'); | ||
86 | $this->setState('list.start', $value); | ||
87 | |||
88 | $value = $app->input->get('filter_tag', 0, 'uint'); | ||
89 | $this->setState('filter.tag', $value); | ||
90 | |||
91 | $orderCol = $app->input->get('filter_order', 'a.ordering'); | ||
92 | |||
93 | if (!in_array($orderCol, $this->filter_fields)) | ||
94 | { | ||
95 | $orderCol = 'a.ordering'; | ||
96 | } | ||
97 | |||
98 | $this->setState('list.ordering', $orderCol); | ||
99 | |||
100 | $listOrder = $app->input->get('filter_order_Dir', 'ASC'); | ||
101 | |||
102 | if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) | ||
103 | { | ||
104 | $listOrder = 'ASC'; | ||
105 | } | ||
106 | |||
107 | $this->setState('list.direction', $listOrder); | ||
108 | |||
109 | $params = $app->getParams(); | ||
110 | $this->setState('params', $params); | ||
111 | $user = JFactory::getUser(); | ||
112 | |||
113 | if ((!$user->authorise('core.edit.state', 'com_content_custom')) && (!$user->authorise('core.edit', 'com_content_custom'))) | ||
114 | { | ||
115 | // Filter on published for those who do not have edit or edit.state rights. | ||
116 | $this->setState('filter.published', 1); | ||
117 | } | ||
118 | |||
119 | $this->setState('filter.language', JLanguageMultilang::isEnabled()); | ||
120 | |||
121 | // Process show_noauth parameter | ||
122 | if ((!$params->get('show_noauth')) || (!JComponentHelper::getParams('com_content_custom')->get('show_noauth'))) | ||
123 | { | ||
124 | $this->setState('filter.access', true); | ||
125 | } | ||
126 | else | ||
127 | { | ||
128 | $this->setState('filter.access', false); | ||
129 | } | ||
130 | |||
131 | $this->setState('layout', $app->input->getString('layout')); | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * Method to get a store id based on model configuration state. | ||
136 | * | ||
137 | * This is necessary because the model is used by the component and | ||
138 | * different modules that might need different sets of data or different | ||
139 | * ordering requirements. | ||
140 | * | ||
141 | * @param string $id A prefix for the store id. | ||
142 | * | ||
143 | * @return string A store id. | ||
144 | * | ||
145 | * @since 1.6 | ||
146 | */ | ||
147 | protected function getStoreId($id = '') | ||
148 | { | ||
149 | // Compile the store id. | ||
150 | $id .= ':' . serialize($this->getState('filter.published')); | ||
151 | $id .= ':' . $this->getState('filter.access'); | ||
152 | $id .= ':' . $this->getState('filter.featured'); | ||
153 | $id .= ':' . serialize($this->getState('filter.article_id')); | ||
154 | $id .= ':' . $this->getState('filter.article_id.include'); | ||
155 | $id .= ':' . serialize($this->getState('filter.category_id')); | ||
156 | $id .= ':' . $this->getState('filter.category_id.include'); | ||
157 | $id .= ':' . serialize($this->getState('filter.author_id')); | ||
158 | $id .= ':' . $this->getState('filter.author_id.include'); | ||
159 | $id .= ':' . serialize($this->getState('filter.author_alias')); | ||
160 | $id .= ':' . $this->getState('filter.author_alias.include'); | ||
161 | $id .= ':' . $this->getState('filter.date_filtering'); | ||
162 | $id .= ':' . $this->getState('filter.date_field'); | ||
163 | $id .= ':' . $this->getState('filter.start_date_range'); | ||
164 | $id .= ':' . $this->getState('filter.end_date_range'); | ||
165 | $id .= ':' . $this->getState('filter.relative_date'); | ||
166 | $id .= ':' . serialize($this->getState('filter.tag')); | ||
167 | |||
168 | return parent::getStoreId($id); | ||
169 | } | ||
170 | |||
171 | /** | ||
172 | * Get the master query for retrieving a list of articles subject to the model state. | ||
173 | * | ||
174 | * @return JDatabaseQuery | ||
175 | * | ||
176 | * @since 1.6 | ||
177 | */ | ||
178 | protected function getListQuery() | ||
179 | { | ||
180 | // Get the current user for authorisation checks | ||
181 | $user = JFactory::getUser(); | ||
182 | |||
183 | // Create a new query object. | ||
184 | $db = $this->getDbo(); | ||
185 | $query = $db->getQuery(true); | ||
186 | |||
187 | // Select the required fields from the table. | ||
188 | $query->select( | ||
189 | $this->getState( | ||
190 | 'list.select', | ||
191 | 'a.id, a.title, a.alias, a.introtext, a.fulltext, ' . | ||
192 | 'a.checked_out, a.checked_out_time, ' . | ||
193 | 'a.catid, a.created, a.created_by, a.created_by_alias, ' . | ||
194 | // Published/archived article in archive category is treats as archive article | ||
195 | // If category is not published then force 0 | ||
196 | 'CASE WHEN c.published = 2 AND a.state > 0 THEN 2 WHEN c.published != 1 THEN 0 ELSE a.state END as state,' . | ||
197 | // Use created if modified is 0 | ||
198 | 'CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END as modified, ' . | ||
199 | 'a.modified_by, uam.name as modified_by_name,' . | ||
200 | // Use created if publish_up is 0 | ||
201 | 'CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END as publish_up,' . | ||
202 | 'a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, ' . | ||
203 | 'a.hits, a.xreference, a.featured, a.language, ' . ' ' . $query->length('a.fulltext') . ' AS readmore, a.ordering' | ||
204 | ) | ||
205 | ); | ||
206 | |||
207 | $query->from('#__content AS a'); | ||
208 | |||
209 | $params = $this->getState('params'); | ||
210 | $orderby_sec = $params->get('orderby_sec'); | ||
211 | |||
212 | // Join over the frontpage articles if required. | ||
213 | if ($this->getState('filter.frontpage')) | ||
214 | { | ||
215 | if ($orderby_sec === 'front') | ||
216 | { | ||
217 | $query->select('fp.ordering'); | ||
218 | $query->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id'); | ||
219 | } | ||
220 | else | ||
221 | { | ||
222 | $query->where('a.featured = 1'); | ||
223 | } | ||
224 | } | ||
225 | elseif ($orderby_sec === 'front' || $this->getState('list.ordering') === 'fp.ordering') | ||
226 | { | ||
227 | $query->select('fp.ordering'); | ||
228 | $query->join('LEFT', '#__content_frontpage AS fp ON fp.content_id = a.id'); | ||
229 | } | ||
230 | |||
231 | // Join over the categories. | ||
232 | $query->select('c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias') | ||
233 | ->select('c.published, c.published AS parents_published, c.lft') | ||
234 | ->join('LEFT', '#__categories AS c ON c.id = a.catid'); | ||
235 | |||
236 | // Join over the users for the author and modified_by names. | ||
237 | $query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author") | ||
238 | ->select('ua.email AS author_email') | ||
239 | ->join('LEFT', '#__users AS ua ON ua.id = a.created_by') | ||
240 | ->join('LEFT', '#__users AS uam ON uam.id = a.modified_by'); | ||
241 | |||
242 | // Join over the categories to get parent category titles | ||
243 | $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias') | ||
244 | ->join('LEFT', '#__categories as parent ON parent.id = c.parent_id'); | ||
245 | |||
246 | if (JPluginHelper::isEnabled('content_custom', 'vote')) | ||
247 | { | ||
248 | // Join on voting table | ||
249 | $query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating, | ||
250 | COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count') | ||
251 | ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id'); | ||
252 | } | ||
253 | |||
254 | // Filter by access level. | ||
255 | if ($this->getState('filter.access', true)) | ||
256 | { | ||
257 | $groups = implode(',', $user->getAuthorisedViewLevels()); | ||
258 | $query->where('a.access IN (' . $groups . ')') | ||
259 | ->where('c.access IN (' . $groups . ')'); | ||
260 | } | ||
261 | |||
262 | // Filter by published state | ||
263 | $published = $this->getState('filter.published'); | ||
264 | |||
265 | if (is_numeric($published) && $published == 2) | ||
266 | { | ||
267 | /** | ||
268 | * If category is archived then article has to be published or archived. | ||
269 | * Or categogy is published then article has to be archived. | ||
270 | */ | ||
271 | $query->where('((c.published = 2 AND a.state > 0) OR (c.published = 1 AND a.state = 2))'); | ||
272 | } | ||
273 | elseif (is_numeric($published)) | ||
274 | { | ||
275 | // Category has to be published | ||
276 | $query->where('c.published = 1 AND a.state = ' . (int) $published); | ||
277 | } | ||
278 | elseif (is_array($published)) | ||
279 | { | ||
280 | $published = ArrayHelper::toInteger($published); | ||
281 | $published = implode(',', $published); | ||
282 | |||
283 | // Category has to be published | ||
284 | $query->where('c.published = 1 AND a.state IN (' . $published . ')'); | ||
285 | } | ||
286 | |||
287 | // Filter by featured state | ||
288 | $featured = $this->getState('filter.featured'); | ||
289 | |||
290 | switch ($featured) | ||
291 | { | ||
292 | case 'hide': | ||
293 | $query->where('a.featured = 0'); | ||
294 | break; | ||
295 | |||
296 | case 'only': | ||
297 | $query->where('a.featured = 1'); | ||
298 | break; | ||
299 | |||
300 | case 'show': | ||
301 | default: | ||
302 | // Normally we do not discriminate between featured/unfeatured items. | ||
303 | break; | ||
304 | } | ||
305 | |||
306 | // Filter by a single or group of articles. | ||
307 | $articleId = $this->getState('filter.article_id'); | ||
308 | |||
309 | if (is_numeric($articleId)) | ||
310 | { | ||
311 | $type = $this->getState('filter.article_id.include', true) ? '= ' : '<> '; | ||
312 | $query->where('a.id ' . $type . (int) $articleId); | ||
313 | } | ||
314 | elseif (is_array($articleId)) | ||
315 | { | ||
316 | $articleId = ArrayHelper::toInteger($articleId); | ||
317 | $articleId = implode(',', $articleId); | ||
318 | $type = $this->getState('filter.article_id.include', true) ? 'IN' : 'NOT IN'; | ||
319 | $query->where('a.id ' . $type . ' (' . $articleId . ')'); | ||
320 | } | ||
321 | |||
322 | // Filter by a single or group of categories | ||
323 | $categoryId = $this->getState('filter.category_id'); | ||
324 | |||
325 | if (is_numeric($categoryId)) | ||
326 | { | ||
327 | $type = $this->getState('filter.category_id.include', true) ? '= ' : '<> '; | ||
328 | |||
329 | // Add subcategory check | ||
330 | $includeSubcategories = $this->getState('filter.subcategories', false); | ||
331 | $categoryEquals = 'a.catid ' . $type . (int) $categoryId; | ||
332 | |||
333 | if ($includeSubcategories) | ||
334 | { | ||
335 | $levels = (int) $this->getState('filter.max_category_levels', '1'); | ||
336 | |||
337 | // Create a subquery for the subcategory list | ||
338 | $subQuery = $db->getQuery(true) | ||
339 | ->select('sub.id') | ||
340 | ->from('#__categories as sub') | ||
341 | ->join('INNER', '#__categories as this ON sub.lft > this.lft AND sub.rgt < this.rgt') | ||
342 | ->where('this.id = ' . (int) $categoryId); | ||
343 | |||
344 | if ($levels >= 0) | ||
345 | { | ||
346 | $subQuery->where('sub.level <= this.level + ' . $levels); | ||
347 | } | ||
348 | |||
349 | // Add the subquery to the main query | ||
350 | $query->where('(' . $categoryEquals . ' OR a.catid IN (' . (string) $subQuery . '))'); | ||
351 | } | ||
352 | else | ||
353 | { | ||
354 | $query->where($categoryEquals); | ||
355 | } | ||
356 | } | ||
357 | elseif (is_array($categoryId) && (count($categoryId) > 0)) | ||
358 | { | ||
359 | $categoryId = ArrayHelper::toInteger($categoryId); | ||
360 | $categoryId = implode(',', $categoryId); | ||
361 | |||
362 | if (!empty($categoryId)) | ||
363 | { | ||
364 | $type = $this->getState('filter.category_id.include', true) ? 'IN' : 'NOT IN'; | ||
365 | $query->where('a.catid ' . $type . ' (' . $categoryId . ')'); | ||
366 | } | ||
367 | } | ||
368 | |||
369 | // Filter by author | ||
370 | $authorId = $this->getState('filter.author_id'); | ||
371 | $authorWhere = ''; | ||
372 | |||
373 | if (is_numeric($authorId)) | ||
374 | { | ||
375 | $type = $this->getState('filter.author_id.include', true) ? '= ' : '<> '; | ||
376 | $authorWhere = 'a.created_by ' . $type . (int) $authorId; | ||
377 | } | ||
378 | elseif (is_array($authorId)) | ||
379 | { | ||
380 | $authorId = array_filter($authorId, 'is_numeric'); | ||
381 | |||
382 | if ($authorId) | ||
383 | { | ||
384 | $authorId = implode(',', $authorId); | ||
385 | $type = $this->getState('filter.author_id.include', true) ? 'IN' : 'NOT IN'; | ||
386 | $authorWhere = 'a.created_by ' . $type . ' (' . $authorId . ')'; | ||
387 | } | ||
388 | } | ||
389 | |||
390 | // Filter by author alias | ||
391 | $authorAlias = $this->getState('filter.author_alias'); | ||
392 | $authorAliasWhere = ''; | ||
393 | |||
394 | if (is_string($authorAlias)) | ||
395 | { | ||
396 | $type = $this->getState('filter.author_alias.include', true) ? '= ' : '<> '; | ||
397 | $authorAliasWhere = 'a.created_by_alias ' . $type . $db->quote($authorAlias); | ||
398 | } | ||
399 | elseif (is_array($authorAlias)) | ||
400 | { | ||
401 | $first = current($authorAlias); | ||
402 | |||
403 | if (!empty($first)) | ||
404 | { | ||
405 | foreach ($authorAlias as $key => $alias) | ||
406 | { | ||
407 | $authorAlias[$key] = $db->quote($alias); | ||
408 | } | ||
409 | |||
410 | $authorAlias = implode(',', $authorAlias); | ||
411 | |||
412 | if ($authorAlias) | ||
413 | { | ||
414 | $type = $this->getState('filter.author_alias.include', true) ? 'IN' : 'NOT IN'; | ||
415 | $authorAliasWhere = 'a.created_by_alias ' . $type . ' (' . $authorAlias . | ||
416 | ')'; | ||
417 | } | ||
418 | } | ||
419 | } | ||
420 | |||
421 | if (!empty($authorWhere) && !empty($authorAliasWhere)) | ||
422 | { | ||
423 | $query->where('(' . $authorWhere . ' OR ' . $authorAliasWhere . ')'); | ||
424 | } | ||
425 | elseif (empty($authorWhere) && empty($authorAliasWhere)) | ||
426 | { | ||
427 | // If both are empty we don't want to add to the query | ||
428 | } | ||
429 | else | ||
430 | { | ||
431 | // One of these is empty, the other is not so we just add both | ||
432 | $query->where($authorWhere . $authorAliasWhere); | ||
433 | } | ||
434 | |||
435 | // Define null and now dates | ||
436 | $nullDate = $db->quote($db->getNullDate()); | ||
437 | $nowDate = $db->quote(JFactory::getDate()->toSql()); | ||
438 | |||
439 | // Filter by start and end dates. | ||
440 | if ((!$user->authorise('core.edit.state', 'com_content_custom')) && (!$user->authorise('core.edit', 'com_content_custom'))) | ||
441 | { | ||
442 | $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')') | ||
443 | ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); | ||
444 | } | ||
445 | |||
446 | // Filter by Date Range or Relative Date | ||
447 | $dateFiltering = $this->getState('filter.date_filtering', 'off'); | ||
448 | $dateField = $this->getState('filter.date_field', 'a.created'); | ||
449 | |||
450 | switch ($dateFiltering) | ||
451 | { | ||
452 | case 'range': | ||
453 | $startDateRange = $db->quote($this->getState('filter.start_date_range', $nullDate)); | ||
454 | $endDateRange = $db->quote($this->getState('filter.end_date_range', $nullDate)); | ||
455 | $query->where( | ||
456 | '(' . $dateField . ' >= ' . $startDateRange . ' AND ' . $dateField . | ||
457 | ' <= ' . $endDateRange . ')' | ||
458 | ); | ||
459 | break; | ||
460 | |||
461 | case 'relative': | ||
462 | $relativeDate = (int) $this->getState('filter.relative_date', 0); | ||
463 | $query->where( | ||
464 | $dateField . ' >= ' . $query->dateAdd($nowDate, -1 * $relativeDate, 'DAY') | ||
465 | ); | ||
466 | break; | ||
467 | |||
468 | case 'off': | ||
469 | default: | ||
470 | break; | ||
471 | } | ||
472 | |||
473 | // Process the filter for list views with user-entered filters | ||
474 | if (is_object($params) && ($params->get('filter_field') !== 'hide') && ($filter = $this->getState('list.filter'))) | ||
475 | { | ||
476 | // Clean filter variable | ||
477 | $filter = StringHelper::strtolower($filter); | ||
478 | $monthFilter = $filter; | ||
479 | $hitsFilter = (int) $filter; | ||
480 | $filter = $db->quote('%' . $db->escape($filter, true) . '%', false); | ||
481 | |||
482 | switch ($params->get('filter_field')) | ||
483 | { | ||
484 | case 'author': | ||
485 | $query->where( | ||
486 | 'LOWER( CASE WHEN a.created_by_alias > ' . $db->quote(' ') . | ||
487 | ' THEN a.created_by_alias ELSE ua.name END ) LIKE ' . $filter . ' ' | ||
488 | ); | ||
489 | break; | ||
490 | |||
491 | case 'hits': | ||
492 | $query->where('a.hits >= ' . $hitsFilter . ' '); | ||
493 | break; | ||
494 | |||
495 | case 'month': | ||
496 | if ($monthFilter != '') | ||
497 | { | ||
498 | $query->where( | ||
499 | $db->quote(date("Y-m-d", strtotime($monthFilter)) . ' 00:00:00') . ' <= CASE WHEN a.publish_up = ' . | ||
500 | $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END' | ||
501 | ); | ||
502 | |||
503 | $query->where( | ||
504 | $db->quote(date("Y-m-t", strtotime($monthFilter)) . ' 23:59:59') . ' >= CASE WHEN a.publish_up = ' . | ||
505 | $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END' | ||
506 | ); | ||
507 | } | ||
508 | break; | ||
509 | |||
510 | case 'title': | ||
511 | default: | ||
512 | // Default to 'title' if parameter is not valid | ||
513 | $query->where('LOWER( a.title ) LIKE ' . $filter); | ||
514 | break; | ||
515 | } | ||
516 | } | ||
517 | |||
518 | // Filter by language | ||
519 | if ($this->getState('filter.language')) | ||
520 | { | ||
521 | $query->where('a.language IN (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); | ||
522 | } | ||
523 | |||
524 | // Filter by a single or group of tags. | ||
525 | $tagId = $this->getState('filter.tag'); | ||
526 | |||
527 | if (is_array($tagId) && count($tagId) === 1) | ||
528 | { | ||
529 | $tagId = current($tagId); | ||
530 | } | ||
531 | |||
532 | if (is_array($tagId)) | ||
533 | { | ||
534 | $tagId = implode(',', ArrayHelper::toInteger($tagId)); | ||
535 | |||
536 | if ($tagId) | ||
537 | { | ||
538 | $subQuery = $db->getQuery(true) | ||
539 | ->select('DISTINCT content_item_id') | ||
540 | ->from($db->quoteName('#__contentitem_tag_map')) | ||
541 | ->where('tag_id IN (' . $tagId . ')') | ||
542 | ->where('type_alias = ' . $db->quote('com_content_custom.article')); | ||
543 | |||
544 | $query->innerJoin('(' . (string) $subQuery . ') AS tagmap ON tagmap.content_item_id = a.id'); | ||
545 | } | ||
546 | } | ||
547 | elseif ($tagId) | ||
548 | { | ||
549 | $query->innerJoin( | ||
550 | $db->quoteName('#__contentitem_tag_map', 'tagmap') | ||
551 | . ' ON tagmap.tag_id = ' . (int) $tagId | ||
552 | . ' AND tagmap.content_item_id = a.id' | ||
553 | . ' AND tagmap.type_alias = ' . $db->quote('com_content_custom.article') | ||
554 | ); | ||
555 | } | ||
556 | |||
557 | // Add the list ordering clause. | ||
558 | $query->order($this->getState('list.ordering', 'a.ordering') . ' ' . $this->getState('list.direction', 'ASC')); | ||
559 | |||
560 | return $query; | ||
561 | } | ||
562 | |||
563 | /** | ||
564 | * Method to get a list of articles. | ||
565 | * | ||
566 | * Overriden to inject convert the attribs field into a JParameter object. | ||
567 | * | ||
568 | * @return mixed An array of objects on success, false on failure. | ||
569 | * | ||
570 | * @since 1.6 | ||
571 | */ | ||
572 | public function getItems() | ||
573 | { | ||
574 | $items = parent::getItems(); | ||
575 | $user = JFactory::getUser(); | ||
576 | $userId = $user->get('id'); | ||
577 | $guest = $user->get('guest'); | ||
578 | $groups = $user->getAuthorisedViewLevels(); | ||
579 | $input = JFactory::getApplication()->input; | ||
580 | |||
581 | // Get the global params | ||
582 | $globalParams = JComponentHelper::getParams('com_content_custom', true); | ||
583 | |||
584 | // Convert the parameter fields into objects. | ||
585 | foreach ($items as &$item) | ||
586 | { | ||
587 | $articleParams = new Registry($item->attribs); | ||
588 | |||
589 | // Unpack readmore and layout params | ||
590 | $item->alternative_readmore = $articleParams->get('alternative_readmore'); | ||
591 | $item->layout = $articleParams->get('layout'); | ||
592 | |||
593 | $item->params = clone $this->getState('params'); | ||
594 | |||
595 | /** | ||
596 | * For blogs, article params override menu item params only if menu param = 'use_article' | ||
597 | * Otherwise, menu item params control the layout | ||
598 | * If menu item is 'use_article' and there is no article param, use global | ||
599 | */ | ||
600 | if (($input->getString('layout') === 'blog') || ($input->getString('view') === 'featured') | ||
601 | || ($this->getState('params')->get('layout_type') === 'blog')) | ||
602 | { | ||
603 | // Create an array of just the params set to 'use_article' | ||
604 | $menuParamsArray = $this->getState('params')->toArray(); | ||
605 | $articleArray = array(); | ||
606 | |||
607 | foreach ($menuParamsArray as $key => $value) | ||
608 | { | ||
609 | if ($value === 'use_article') | ||
610 | { | ||
611 | // If the article has a value, use it | ||
612 | if ($articleParams->get($key) != '') | ||
613 | { | ||
614 | // Get the value from the article | ||
615 | $articleArray[$key] = $articleParams->get($key); | ||
616 | } | ||
617 | else | ||
618 | { | ||
619 | // Otherwise, use the global value | ||
620 | $articleArray[$key] = $globalParams->get($key); | ||
621 | } | ||
622 | } | ||
623 | } | ||
624 | |||
625 | // Merge the selected article params | ||
626 | if (count($articleArray) > 0) | ||
627 | { | ||
628 | $articleParams = new Registry($articleArray); | ||
629 | $item->params->merge($articleParams); | ||
630 | } | ||
631 | } | ||
632 | else | ||
633 | { | ||
634 | // For non-blog layouts, merge all of the article params | ||
635 | $item->params->merge($articleParams); | ||
636 | } | ||
637 | |||
638 | // Get display date | ||
639 | switch ($item->params->get('list_show_date')) | ||
640 | { | ||
641 | case 'modified': | ||
642 | $item->displayDate = $item->modified; | ||
643 | break; | ||
644 | |||
645 | case 'published': | ||
646 | $item->displayDate = ($item->publish_up == 0) ? $item->created : $item->publish_up; | ||
647 | break; | ||
648 | |||
649 | default: | ||
650 | case 'created': | ||
651 | $item->displayDate = $item->created; | ||
652 | break; | ||
653 | } | ||
654 | |||
655 | /** | ||
656 | * Compute the asset access permissions. | ||
657 | * Technically guest could edit an article, but lets not check that to improve performance a little. | ||
658 | */ | ||
659 | if (!$guest) | ||
660 | { | ||
661 | $asset = 'com_content_custom.article.' . $item->id; | ||
662 | |||
663 | // Check general edit permission first. | ||
664 | if ($user->authorise('core.edit', $asset)) | ||
665 | { | ||
666 | $item->params->set('access-edit', true); | ||
667 | } | ||
668 | |||
669 | // Now check if edit.own is available. | ||
670 | elseif (!empty($userId) && $user->authorise('core.edit.own', $asset)) | ||
671 | { | ||
672 | // Check for a valid user and that they are the owner. | ||
673 | if ($userId == $item->created_by) | ||
674 | { | ||
675 | $item->params->set('access-edit', true); | ||
676 | } | ||
677 | } | ||
678 | } | ||
679 | |||
680 | $access = $this->getState('filter.access'); | ||
681 | |||
682 | if ($access) | ||
683 | { | ||
684 | // If the access filter has been set, we already have only the articles this user can view. | ||
685 | $item->params->set('access-view', true); | ||
686 | } | ||
687 | else | ||
688 | { | ||
689 | // If no access filter is set, the layout takes some responsibility for display of limited information. | ||
690 | if ($item->catid == 0 || $item->category_access === null) | ||
691 | { | ||
692 | $item->params->set('access-view', in_array($item->access, $groups)); | ||
693 | } | ||
694 | else | ||
695 | { | ||
696 | $item->params->set('access-view', in_array($item->access, $groups) && in_array($item->category_access, $groups)); | ||
697 | } | ||
698 | } | ||
699 | |||
700 | // Some contexts may not use tags data at all, so we allow callers to disable loading tag data | ||
701 | if ($this->getState('load_tags', $item->params->get('show_tags', '1'))) | ||
702 | { | ||
703 | $item->tags = new JHelperTags; | ||
704 | $item->tags->getItemTags('com_content_custom.article', $item->id); | ||
705 | } | ||
706 | |||
707 | } | ||
708 | |||
709 | return $items; | ||
710 | } | ||
711 | |||
712 | /** | ||
713 | * Method to get the starting number of items for the data set. | ||
714 | * | ||
715 | * @return integer The starting number of items available in the data set. | ||
716 | * | ||
717 | * @since 3.0.1 | ||
718 | */ | ||
719 | public function getStart() | ||
720 | { | ||
721 | return $this->getState('list.start'); | ||
722 | } | ||
723 | |||
724 | /** | ||
725 | * Count Items by Month | ||
726 | * | ||
727 | * @return mixed An array of objects on success, false on failure. | ||
728 | * | ||
729 | * @since 3.9.0 | ||
730 | */ | ||
731 | public function countItemsByMonth() | ||
732 | { | ||
733 | // Create a new query object. | ||
734 | $db = $this->getDbo(); | ||
735 | $query = $db->getQuery(true); | ||
736 | |||
737 | $query | ||
738 | ->select('DATE(' . | ||
739 | $query->concatenate( | ||
740 | array( | ||
741 | $query->year($query->quoteName('publish_up')), | ||
742 | $query->quote('-'), | ||
743 | $query->month($query->quoteName('publish_up')), | ||
744 | $query->quote('-01') | ||
745 | ) | ||
746 | ) . ') as d' | ||
747 | ) | ||
748 | ->select('COUNT(*) as c') | ||
749 | ->from('(' . $this->getListQuery() . ') as b') | ||
750 | ->group($query->quoteName('d')) | ||
751 | ->order($query->quoteName('d') . ' desc'); | ||
752 | |||
753 | return $db->setQuery($query)->loadObjectList(); | ||
754 | } | ||
755 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); | ||
13 | JHtml::_('formbehavior.chosen', 'select'); | ||
14 | JHtml::_('behavior.caption'); | ||
15 | ?> | ||
16 | <div class="archive-custom<?php echo $this->pageclass_sfx; ?>"> | ||
17 | <?php if ($this->params->get('show_page_heading')) : ?> | ||
18 | <div class="page-header"> | ||
19 | <h1> | ||
20 | <?php echo $this->escape($this->params->get('page_heading')); ?> | ||
21 | </h1> | ||
22 | </div> | ||
23 | <?php endif; ?> | ||
24 | <?php echo $this->loadTemplate('items'); ?> | ||
25 | </div> |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <metadata> | ||
3 | <layout title="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE" option="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION"> | ||
4 | <help | ||
5 | key = "JHELP_MENUS_MENU_ITEM_ARTICLE_ARCHIVED" | ||
6 | /> | ||
7 | <message> | ||
8 | <![CDATA[COM_CONTENT_CUSTOM_XML_DESCRIPTION]]> | ||
9 | </message> | ||
10 | </layout> | ||
11 | |||
12 | <!-- Add fields to the request variables for the layout. --> | ||
13 | <fields name="request"> | ||
14 | <fieldset name="request" | ||
15 | addfieldpath="/administrator/components/com_categories/models/fields" | ||
16 | > | ||
17 | <field | ||
18 | name="catid" | ||
19 | type="category" | ||
20 | extension="com_content" | ||
21 | multiple="true" | ||
22 | size="5" | ||
23 | label="JCATEGORY" | ||
24 | description="JFIELD_CATEGORY_DESC" | ||
25 | > | ||
26 | <option value="">JOPTION_ALL_CATEGORIES</option> | ||
27 | </field> | ||
28 | </fieldset> | ||
29 | </fields> | ||
30 | |||
31 | <!-- Add fields to the parameters object for the layout. --> | ||
32 | <fields name="params"> | ||
33 | |||
34 | <!-- Basic options. --> | ||
35 | <fieldset name="basic" label="JGLOBAL_ARCHIVE_OPTIONS" | ||
36 | > | ||
37 | |||
38 | <field | ||
39 | name="orderby_sec" | ||
40 | type="list" | ||
41 | label="JGLOBAL_ARTICLE_ORDER_LABEL" | ||
42 | description="JGLOBAL_ARTICLE_ORDER_DESC" | ||
43 | default="rdate" | ||
44 | > | ||
45 | <option value="date">JGLOBAL_OLDEST_FIRST</option> | ||
46 | <option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option> | ||
47 | <option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option> | ||
48 | <option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option> | ||
49 | <option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option> | ||
50 | <option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option> | ||
51 | <option value="hits">JGLOBAL_MOST_HITS</option> | ||
52 | <option value="rhits">JGLOBAL_LEAST_HITS</option> | ||
53 | <option value="order">JGLOBAL_ARTICLE_MANAGER_ORDER</option> | ||
54 | <option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option> | ||
55 | <option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option> | ||
56 | <option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option> | ||
57 | <option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option> | ||
58 | </field> | ||
59 | |||
60 | <field | ||
61 | name="order_date" | ||
62 | type="list" | ||
63 | label="JGLOBAL_ORDERING_DATE_LABEL" | ||
64 | description="JGLOBAL_ORDERING_DATE_DESC" | ||
65 | default="published" | ||
66 | > | ||
67 | <option value="created">JGLOBAL_Created</option> | ||
68 | <option value="modified">JGLOBAL_Modified</option> | ||
69 | <option value="published">JPUBLISHED</option> | ||
70 | </field> | ||
71 | |||
72 | <field | ||
73 | name="display_num" | ||
74 | type="list" | ||
75 | label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL" | ||
76 | description="JGLOBAL_NUMBER_ITEMS_LIST_DESC" | ||
77 | default="5" | ||
78 | > | ||
79 | <option value="5">J5</option> | ||
80 | <option value="10">J10</option> | ||
81 | <option value="15">J15</option> | ||
82 | <option value="20">J20</option> | ||
83 | <option value="25">J25</option> | ||
84 | <option value="30">J30</option> | ||
85 | <option value="50">J50</option> | ||
86 | <option value="100">J100</option> | ||
87 | <option value="0">JALL</option> | ||
88 | </field> | ||
89 | |||
90 | <field | ||
91 | name="filter_field" | ||
92 | type="list" | ||
93 | label="JGLOBAL_FILTER_FIELD_LABEL" | ||
94 | description="JGLOBAL_FILTER_FIELD_DESC" | ||
95 | default="" | ||
96 | useglobal="true" | ||
97 | > | ||
98 | <option value="hide">JHIDE</option> | ||
99 | <option value="1">JSHOW</option> | ||
100 | </field> | ||
101 | |||
102 | <field | ||
103 | name="introtext_limit" | ||
104 | type="number" | ||
105 | label="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_LABEL" | ||
106 | description="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_DESC" | ||
107 | default="1000" | ||
108 | /> | ||
109 | |||
110 | </fieldset> | ||
111 | |||
112 | <!-- Articles options. --> | ||
113 | <fieldset name="articles" | ||
114 | label="COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL" | ||
115 | > | ||
116 | |||
117 | <field | ||
118 | name="show_intro" | ||
119 | type="list" | ||
120 | label="JGLOBAL_SHOW_INTRO_LABEL" | ||
121 | description="JGLOBAL_SHOW_INTRO_DESC" | ||
122 | class="chzn-color" | ||
123 | default="1" | ||
124 | > | ||
125 | <option value="0">JHIDE</option> | ||
126 | <option value="1">JSHOW</option> | ||
127 | </field> | ||
128 | |||
129 | <field | ||
130 | name="info_block_position" | ||
131 | type="list" | ||
132 | label="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL" | ||
133 | description="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC" | ||
134 | default="" | ||
135 | useglobal="true" | ||
136 | class="chzn-color" | ||
137 | > | ||
138 | <option value="use_article">COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS</option> | ||
139 | <option value="0">COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE</option> | ||
140 | <option value="1">COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW</option> | ||
141 | <option value="2">COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT</option> | ||
142 | </field> | ||
143 | |||
144 | <field | ||
145 | name="show_category" | ||
146 | type="list" | ||
147 | label="JGLOBAL_SHOW_CATEGORY_LABEL" | ||
148 | description="JGLOBAL_SHOW_CATEGORY_DESC" | ||
149 | useglobal="true" | ||
150 | class="chzn-color" | ||
151 | > | ||
152 | <option value="0">JHIDE</option> | ||
153 | <option value="1">JSHOW</option> | ||
154 | </field> | ||
155 | |||
156 | <field | ||
157 | name="link_category" | ||
158 | type="list" | ||
159 | label="JGLOBAL_LINK_CATEGORY_LABEL" | ||
160 | description="JGLOBAL_LINK_CATEGORY_DESC" | ||
161 | useglobal="true" | ||
162 | class="chzn-color" | ||
163 | > | ||
164 | <option value="0">JNO</option> | ||
165 | <option value="1">JYES</option> | ||
166 | </field> | ||
167 | |||
168 | <field | ||
169 | name="show_parent_category" | ||
170 | type="list" | ||
171 | label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL" | ||
172 | description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC" | ||
173 | useglobal="true" | ||
174 | > | ||
175 | <option value="0">JHIDE</option> | ||
176 | <option value="1">JSHOW</option> | ||
177 | </field> | ||
178 | |||
179 | <field | ||
180 | name="link_parent_category" | ||
181 | type="list" | ||
182 | label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL" | ||
183 | description="JGLOBAL_LINK_PARENT_CATEGORY_DESC" | ||
184 | useglobal="true" | ||
185 | > | ||
186 | <option value="0">JNO</option> | ||
187 | <option value="1">JYES</option> | ||
188 | </field> | ||
189 | |||
190 | <field | ||
191 | name="link_titles" | ||
192 | type="list" | ||
193 | label="JGLOBAL_LINKED_TITLES_LABEL" | ||
194 | description="JGLOBAL_LINKED_TITLES_DESC" | ||
195 | class="chzn-color" | ||
196 | default="1" | ||
197 | > | ||
198 | <option value="0">JNO</option> | ||
199 | <option value="1">JYES</option> | ||
200 | </field> | ||
201 | |||
202 | <field | ||
203 | name="show_author" | ||
204 | type="list" | ||
205 | label="JGLOBAL_SHOW_AUTHOR_LABEL" | ||
206 | description="JGLOBAL_SHOW_AUTHOR_DESC" | ||
207 | useglobal="true" | ||
208 | class="chzn-color" | ||
209 | > | ||
210 | <option value="0">JHIDE</option> | ||
211 | <option value="1">JSHOW</option> | ||
212 | </field> | ||
213 | |||
214 | <field | ||
215 | name="link_author" | ||
216 | type="list" | ||
217 | label="JGLOBAL_LINK_AUTHOR_LABEL" | ||
218 | description="JGLOBAL_LINK_AUTHOR_DESC" | ||
219 | useglobal="true" | ||
220 | > | ||
221 | <option value="0">JNO</option> | ||
222 | <option value="1">JYES</option> | ||
223 | </field> | ||
224 | |||
225 | <field | ||
226 | name="show_create_date" | ||
227 | type="list" | ||
228 | label="JGLOBAL_SHOW_CREATE_DATE_LABEL" | ||
229 | description="JGLOBAL_SHOW_CREATE_DATE_DESC" | ||
230 | useglobal="true" | ||
231 | class="chzn-color" | ||
232 | > | ||
233 | <option value="0">JHIDE</option> | ||
234 | <option value="1">JSHOW</option> | ||
235 | </field> | ||
236 | |||
237 | <field | ||
238 | name="show_modify_date" | ||
239 | type="list" | ||
240 | label="JGLOBAL_SHOW_MODIFY_DATE_LABEL" | ||
241 | description="JGLOBAL_SHOW_MODIFY_DATE_DESC" | ||
242 | useglobal="true" | ||
243 | class="chzn-color" | ||
244 | > | ||
245 | <option value="0">JHIDE</option> | ||
246 | <option value="1">JSHOW</option> | ||
247 | </field> | ||
248 | |||
249 | <field | ||
250 | name="show_publish_date" | ||
251 | type="list" | ||
252 | label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL" | ||
253 | description="JGLOBAL_SHOW_PUBLISH_DATE_DESC" | ||
254 | class="chzn-color" | ||
255 | default="1" | ||
256 | > | ||
257 | <option value="0">JHIDE</option> | ||
258 | <option value="1">JSHOW</option> | ||
259 | </field> | ||
260 | |||
261 | <field | ||
262 | name="show_hits" | ||
263 | type="list" | ||
264 | label="JGLOBAL_SHOW_HITS_LABEL" | ||
265 | description="JGLOBAL_SHOW_HITS_DESC" | ||
266 | useglobal="true" | ||
267 | class="chzn-color" | ||
268 | > | ||
269 | <option value="0">JHIDE</option> | ||
270 | <option value="1">JSHOW</option> | ||
271 | </field> | ||
272 | </fieldset> | ||
273 | |||
274 | </fields> | ||
275 | </metadata> |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); | ||
13 | $params = $this->params; | ||
14 | ?> | ||
15 | |||
16 | <div id="archive-items"> | ||
17 | <?php foreach ($this->items as $i => $item) : ?> | ||
18 | <?php $info = $item->params->get('info_block_position', 0); ?> | ||
19 | <div class="row<?php echo $i % 2; ?>" itemscope itemtype="https://schema.org/Article"> | ||
20 | <div class="page-header"> | ||
21 | <h2 itemprop="headline"> | ||
22 | <?php if ($params->get('link_titles')) : ?> | ||
23 | <?php | ||
24 | $url = JRoute::_(ContentCustomHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); | ||
25 | $url = "information/" . end(explode("/", $url)); | ||
26 | ?> | ||
27 | <a href="<?php echo $url; ?>" itemprop="url"> | ||
28 | <?php echo $this->escape($item->title); ?> | ||
29 | </a> | ||
30 | <?php else : ?> | ||
31 | <?php echo $this->escape($item->title); ?> | ||
32 | <?php endif; ?> | ||
33 | </h2> | ||
34 | |||
35 | <?php // Content is generated by content plugin event "onContentAfterTitle" ?> | ||
36 | <?php echo $item->event->afterDisplayTitle; ?> | ||
37 | |||
38 | <?php if ($params->get('show_author') && !empty($item->author )) : ?> | ||
39 | <div class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person"> | ||
40 | <?php $author = $item->created_by_alias ?: $item->author; ?> | ||
41 | <?php $author = '<span itemprop="name">' . $author . '</span>'; ?> | ||
42 | <?php if (!empty($item->contact_link) && $params->get('link_author') == true) : ?> | ||
43 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author, array('itemprop' => 'url'))); ?> | ||
44 | <?php else : ?> | ||
45 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', $author); ?> | ||
46 | <?php endif; ?> | ||
47 | </div> | ||
48 | <?php endif; ?> | ||
49 | </div> | ||
50 | <?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date') | ||
51 | || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category')); ?> | ||
52 | <?php if ($useDefList && ($info == 0 || $info == 2)) : ?> | ||
53 | <div class="article-info muted"> | ||
54 | <dl class="article-info"> | ||
55 | <dt class="article-info-term"> | ||
56 | <?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?> | ||
57 | </dt> | ||
58 | |||
59 | <?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?> | ||
60 | <dd> | ||
61 | <div class="parent-category-name"> | ||
62 | <?php $title = $this->escape($item->parent_title); ?> | ||
63 | <?php if ($params->get('link_parent_category') && !empty($item->parent_slug)) : ?> | ||
64 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
65 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?> | ||
66 | <?php else : ?> | ||
67 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
68 | <?php endif; ?> | ||
69 | </div> | ||
70 | </dd> | ||
71 | <?php endif; ?> | ||
72 | <?php if ($params->get('show_category')) : ?> | ||
73 | <dd> | ||
74 | <div class="category-name"> | ||
75 | <?php $title = $this->escape($item->category_title); ?> | ||
76 | <?php if ($params->get('link_category') && $item->catslug) : ?> | ||
77 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
78 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?> | ||
79 | <?php else : ?> | ||
80 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
81 | <?php endif; ?> | ||
82 | </div> | ||
83 | </dd> | ||
84 | <?php endif; ?> | ||
85 | |||
86 | <?php if ($params->get('show_publish_date')) : ?> | ||
87 | <dd> | ||
88 | <div class="published"> | ||
89 | <span class="icon-calendar" aria-hidden="true"></span> | ||
90 | <time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished"> | ||
91 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?> | ||
92 | </time> | ||
93 | </div> | ||
94 | </dd> | ||
95 | <?php endif; ?> | ||
96 | |||
97 | <?php if ($info == 0) : ?> | ||
98 | <?php if ($params->get('show_modify_date')) : ?> | ||
99 | <dd> | ||
100 | <div class="modified"> | ||
101 | <span class="icon-calendar" aria-hidden="true"></span> | ||
102 | <time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified"> | ||
103 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
104 | </time> | ||
105 | </div> | ||
106 | </dd> | ||
107 | <?php endif; ?> | ||
108 | <?php if ($params->get('show_create_date')) : ?> | ||
109 | <dd> | ||
110 | <div class="create"> | ||
111 | <span class="icon-calendar" aria-hidden="true"></span> | ||
112 | <time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated"> | ||
113 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3'))); ?> | ||
114 | </time> | ||
115 | </div> | ||
116 | </dd> | ||
117 | <?php endif; ?> | ||
118 | |||
119 | <?php if ($params->get('show_hits')) : ?> | ||
120 | <dd> | ||
121 | <div class="hits"> | ||
122 | <span class="icon-eye-open"></span> | ||
123 | <meta itemprop="interactionCount" content="UserPageVisits:<?php echo $item->hits; ?>" /> | ||
124 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?> | ||
125 | </div> | ||
126 | </dd> | ||
127 | <?php endif; ?> | ||
128 | <?php endif; ?> | ||
129 | </dl> | ||
130 | </div> | ||
131 | <?php endif; ?> | ||
132 | |||
133 | <?php // Content is generated by content plugin event "onContentBeforeDisplay" ?> | ||
134 | <?php echo $item->event->beforeDisplayContent; ?> | ||
135 | <?php if ($params->get('show_intro')) : ?> | ||
136 | <div class="intro" itemprop="articleBody"> <?php echo JHtml::_('string.truncateComplex', $item->introtext, $params->get('introtext_limit')); ?> </div> | ||
137 | <?php endif; ?> | ||
138 | |||
139 | <?php if ($useDefList && ($info == 1 || $info == 2)) : ?> | ||
140 | <div class="article-info muted"> | ||
141 | <dl class="article-info"> | ||
142 | <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?></dt> | ||
143 | |||
144 | <?php if ($info == 1) : ?> | ||
145 | <?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?> | ||
146 | <dd> | ||
147 | <div class="parent-category-name"> | ||
148 | <?php $title = $this->escape($item->parent_title); ?> | ||
149 | <?php if ($params->get('link_parent_category') && $item->parent_slug) : ?> | ||
150 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
151 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?> | ||
152 | <?php else : ?> | ||
153 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
154 | <?php endif; ?> | ||
155 | </div> | ||
156 | </dd> | ||
157 | <?php endif; ?> | ||
158 | <?php if ($params->get('show_category')) : ?> | ||
159 | <dd> | ||
160 | <div class="category-name"> | ||
161 | <?php $title = $this->escape($item->category_title); ?> | ||
162 | <?php if ($params->get('link_category') && $item->catslug) : ?> | ||
163 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
164 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?> | ||
165 | <?php else : ?> | ||
166 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
167 | <?php endif; ?> | ||
168 | </div> | ||
169 | </dd> | ||
170 | <?php endif; ?> | ||
171 | <?php if ($params->get('show_publish_date')) : ?> | ||
172 | <dd> | ||
173 | <div class="published"> | ||
174 | <span class="icon-calendar" aria-hidden="true"></span> | ||
175 | <time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished"> | ||
176 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?> | ||
177 | </time> | ||
178 | </div> | ||
179 | </dd> | ||
180 | <?php endif; ?> | ||
181 | <?php endif; ?> | ||
182 | |||
183 | <?php if ($params->get('show_create_date')) : ?> | ||
184 | <dd> | ||
185 | <div class="create"> | ||
186 | <span class="icon-calendar" aria-hidden="true"></span> | ||
187 | <time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated"> | ||
188 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
189 | </time> | ||
190 | </div> | ||
191 | </dd> | ||
192 | <?php endif; ?> | ||
193 | <?php if ($params->get('show_modify_date')) : ?> | ||
194 | <dd> | ||
195 | <div class="modified"> | ||
196 | <span class="icon-calendar" aria-hidden="true"></span> | ||
197 | <time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified"> | ||
198 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
199 | </time> | ||
200 | </div> | ||
201 | </dd> | ||
202 | <?php endif; ?> | ||
203 | <?php if ($params->get('show_hits')) : ?> | ||
204 | <dd> | ||
205 | <div class="hits"> | ||
206 | <span class="icon-eye-open"></span> | ||
207 | <meta content="UserPageVisits:<?php echo $item->hits; ?>" itemprop="interactionCount" /> | ||
208 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?> | ||
209 | </div> | ||
210 | </dd> | ||
211 | <?php endif; ?> | ||
212 | </dl> | ||
213 | </div> | ||
214 | <?php endif; ?> | ||
215 | <?php // Content is generated by content plugin event "onContentAfterDisplay" ?> | ||
216 | <?php echo $item->event->afterDisplayContent; ?> | ||
217 | </div> | ||
218 | <?php endforeach; ?> | ||
219 | </div> | ||
220 | <div class="pagination"> | ||
221 | <p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p> | ||
222 | <?php echo $this->pagination->getPagesLinks(); ?> | ||
223 | </div> |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_conten_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | /** | ||
13 | * HTML View class for the Content component | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ContentViewArchive extends JViewLegacy | ||
18 | { | ||
19 | protected $state = null; | ||
20 | |||
21 | protected $item = null; | ||
22 | |||
23 | protected $items = null; | ||
24 | |||
25 | protected $pagination = null; | ||
26 | |||
27 | /** | ||
28 | * Execute and display a template script. | ||
29 | * | ||
30 | * @param string $tpl The name of the template file to parse; automatically searches through the template paths. | ||
31 | * | ||
32 | * @return mixed A string if successful, otherwise an Error object. | ||
33 | */ | ||
34 | public function display($tpl = null) | ||
35 | { | ||
36 | $user = JFactory::getUser(); | ||
37 | $state = $this->get('State'); | ||
38 | $items = $this->get('Items'); | ||
39 | $pagination = $this->get('Pagination'); | ||
40 | |||
41 | // Flag indicates to not add limitstart=0 to URL | ||
42 | $pagination->hideEmptyLimitstart = true; | ||
43 | |||
44 | // Get the page/component configuration | ||
45 | $params = &$state->params; | ||
46 | |||
47 | JPluginHelper::importPlugin('content_custom'); | ||
48 | |||
49 | foreach ($items as $item) | ||
50 | { | ||
51 | $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; | ||
52 | $item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; | ||
53 | |||
54 | // No link for ROOT category | ||
55 | if ($item->parent_alias === 'root') | ||
56 | { | ||
57 | $item->parent_slug = null; | ||
58 | } | ||
59 | |||
60 | $item->event = new stdClass; | ||
61 | |||
62 | $dispatcher = JEventDispatcher::getInstance(); | ||
63 | |||
64 | // Old plugins: Ensure that text property is available | ||
65 | if (!isset($item->text)) | ||
66 | { | ||
67 | $item->text = $item->introtext; | ||
68 | } | ||
69 | |||
70 | $dispatcher->trigger('onContentPrepare', array ('com_content_custom.archive', &$item, &$item->params, 0)); | ||
71 | |||
72 | // Old plugins: Use processed text as introtext | ||
73 | $item->introtext = $item->text; | ||
74 | |||
75 | $results = $dispatcher->trigger('onContentAfterTitle', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
76 | $item->event->afterDisplayTitle = trim(implode("\n", $results)); | ||
77 | |||
78 | $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
79 | $item->event->beforeDisplayContent = trim(implode("\n", $results)); | ||
80 | |||
81 | $results = $dispatcher->trigger('onContentAfterDisplay', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
82 | $item->event->afterDisplayContent = trim(implode("\n", $results)); | ||
83 | } | ||
84 | |||
85 | $this->filter = $state->get('list.filter'); | ||
86 | $this->items = &$items; | ||
87 | $this->params = &$params; | ||
88 | $this->user = &$user; | ||
89 | $this->pagination = &$pagination; | ||
90 | $this->pagination->setAdditionalUrlParam('month', $state->get('filter.month')); | ||
91 | $this->pagination->setAdditionalUrlParam('year', $state->get('filter.year')); | ||
92 | |||
93 | $this->_prepareDocument(); | ||
94 | |||
95 | parent::display($tpl); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * Prepares the document | ||
100 | * | ||
101 | * @return void | ||
102 | */ | ||
103 | protected function _prepareDocument() | ||
104 | { | ||
105 | $app = JFactory::getApplication(); | ||
106 | $menus = $app->getMenu(); | ||
107 | $title = null; | ||
108 | |||
109 | // Because the application sets a default page title, | ||
110 | // we need to get it from the menu item itself | ||
111 | $menu = $menus->getActive(); | ||
112 | |||
113 | if ($menu) | ||
114 | { | ||
115 | $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | $this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES')); | ||
120 | } | ||
121 | |||
122 | $title = $this->params->get('page_title', ''); | ||
123 | |||
124 | if (empty($title)) | ||
125 | { | ||
126 | $title = $app->get('sitename'); | ||
127 | } | ||
128 | elseif ($app->get('sitename_pagetitles', 0) == 1) | ||
129 | { | ||
130 | $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); | ||
131 | } | ||
132 | elseif ($app->get('sitename_pagetitles', 0) == 2) | ||
133 | { | ||
134 | $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); | ||
135 | } | ||
136 | |||
137 | $this->document->setTitle($title); | ||
138 | |||
139 | if ($this->params->get('menu-meta_description')) | ||
140 | { | ||
141 | $this->document->setDescription($this->params->get('menu-meta_description')); | ||
142 | } | ||
143 | |||
144 | if ($this->params->get('menu-meta_keywords')) | ||
145 | { | ||
146 | $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); | ||
147 | } | ||
148 | |||
149 | if ($this->params->get('robots')) | ||
150 | { | ||
151 | $this->document->setMetadata('robots', $this->params->get('robots')); | ||
152 | } | ||
153 | } | ||
154 | } |
1 | # 月次アーカイブ用モジュール | ||
2 | 公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。 | ||
3 | インストールしていない場合は、管理画面よりインストールする必要があります。 | ||
4 | |||
5 | ## インストール手順 | ||
6 | 1. 管理画面ログイン | ||
7 | 2. エクステンション配下の管理を選択 | ||
8 | 3. (フォルダからインストール)を選択 | ||
9 | 4. フォームにインストールするモジュールまたは、コンポーネントのフォルダを指定(例:/var/www/html/src/com/com_hoge) | ||
10 | 5. チェックしてインストール | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_ARCHIVE_CUSTOM="Articles - Archived - custom" | ||
7 | MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="# of Months" | ||
8 | MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="The number of months to display (the default is 10)." | ||
9 | MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="Display a list of calendar months, including published articles. This list is automatically generated when you create a published article." | ||
10 | MOD_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_ARCHIVE_CUSTOM="Articles - Archived - custom" | ||
7 | MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="Display a list of calendar months, including published articles. This list is automatically generated when you create a published article." | ||
8 | MOD_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="Default" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_articles_archive | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | /** | ||
13 | * Helper for mod_articles_archive | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ModArchiveHelper | ||
18 | { | ||
19 | /** | ||
20 | * Retrieve list of archived articles | ||
21 | * | ||
22 | * @param \Joomla\Registry\Registry &$params module parameters | ||
23 | * | ||
24 | * @return array | ||
25 | * | ||
26 | * @since 1.5 | ||
27 | */ | ||
28 | public static function getList(&$params) | ||
29 | { | ||
30 | // Get database | ||
31 | $db = JFactory::getDbo(); | ||
32 | $query = $db->getQuery(true); | ||
33 | $query->select($query->month($db->quoteName('created')) . ' AS created_month') | ||
34 | ->select('MIN(' . $db->quoteName('created') . ') AS created') | ||
35 | ->select($query->year($db->quoteName('created')) . ' AS created_year') | ||
36 | ->from('#__content') | ||
37 | ->where('state = 1') | ||
38 | ->group($query->year($db->quoteName('created')) . ', ' . $query->month($db->quoteName('created'))) | ||
39 | ->order($query->year($db->quoteName('created')) . ' DESC, ' . $query->month($db->quoteName('created')) . ' DESC'); | ||
40 | |||
41 | // Filter by language | ||
42 | if (JFactory::getApplication()->getLanguageFilter()) | ||
43 | { | ||
44 | $query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); | ||
45 | } | ||
46 | |||
47 | $db->setQuery($query, 0, (int) $params->get('count')); | ||
48 | |||
49 | try | ||
50 | { | ||
51 | $rows = (array) $db->loadObjectList(); | ||
52 | } | ||
53 | catch (RuntimeException $e) | ||
54 | { | ||
55 | JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); | ||
56 | |||
57 | return array(); | ||
58 | } | ||
59 | |||
60 | $app = JFactory::getApplication(); | ||
61 | $menu = $app->getMenu(); | ||
62 | $item = $menu->getItems('link', 'index.php?option=com_content_custom&view=archive', true); | ||
63 | $itemid = (isset($item) && !empty($item->id)) ? '&Itemid=' . $item->id : ''; | ||
64 | |||
65 | $i = 0; | ||
66 | $lists = array(); | ||
67 | |||
68 | foreach ($rows as $row) | ||
69 | { | ||
70 | $date = JFactory::getDate($row->created); | ||
71 | |||
72 | $createdMonth = $date->format('n'); | ||
73 | $createdYear = $date->format('Y'); | ||
74 | |||
75 | $createdYearCal = JHtml::_('date', $row->created, 'Y') . "年"; | ||
76 | $monthNameCal = JHtml::_('date', $row->created, 'F'); | ||
77 | $createdDateCal = $createdYearCal . $monthNameCal; | ||
78 | |||
79 | $lists[$i] = new stdClass; | ||
80 | |||
81 | $lists[$i]->link = JRoute::_('index.php?option=com_content_custom&view=archive&year=' . $createdYear . '&month=' . $createdMonth . $itemid); | ||
82 | $lists[$i]->text = JText::sprintf($createdDateCal); | ||
83 | |||
84 | $i++; | ||
85 | } | ||
86 | |||
87 | return $lists; | ||
88 | } | ||
89 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_ARCHIVE_CUSTOM="カスタムアーカイブ(モジュール)" | ||
7 | MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="表示月数" | ||
8 | MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="表示する月数(標準は10)です。" | ||
9 | MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。" | ||
10 | MOD_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_ARCHIVE_CUSTOM="カスタムアーカイブ(モジュール)" | ||
7 | MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。" | ||
8 | MOD_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_articles_archive | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | // Include the archive functions only once | ||
13 | JLoader::register('ModArchiveHelper', __DIR__ . '/helper.php'); | ||
14 | |||
15 | $params->def('count', 10); | ||
16 | $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); | ||
17 | $list = ModArchiveHelper::getList($params); | ||
18 | |||
19 | require JModuleHelper::getLayoutPath('mod_articles_archive_custom', $params->get('layout', 'default')); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <extension type="module" version="3.1" client="site" method="upgrade"> | ||
3 | <name>MOD_ARTICLES_ARCHIVE_CUSTOM</name> | ||
4 | <author>T.Tokudome</author> | ||
5 | <creationDate>June 2020</creationDate> | ||
6 | <copyright></copyright> | ||
7 | <license></license> | ||
8 | <authorEmail>tokudome@lilli.co.jp</authorEmail> | ||
9 | <authorUrl></authorUrl> | ||
10 | <version>0.0.1</version> | ||
11 | <description>MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION</description> | ||
12 | <files> | ||
13 | <filename module="mod_articles_archive_custom">mod_articles_archive_custom.php</filename> | ||
14 | <folder>tmpl</folder> | ||
15 | <filename>helper.php</filename> | ||
16 | </files> | ||
17 | <languages> | ||
18 | <language tag="en-GB">en-GB.mod_articles_archive_custom.ini</language> | ||
19 | <language tag="en-GB">en-GB.mod_articles_archive_custom.sys.ini</language> | ||
20 | <language tag="ja-JP">ja-JP.mod_articles_archive_custom.ini</language> | ||
21 | <language tag="ja-JP">ja-JP.mod_articles_archive_custom.sys.ini</language> | ||
22 | </languages> | ||
23 | <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_ARCHIVE" /> | ||
24 | <config> | ||
25 | <fields name="params"> | ||
26 | <fieldset name="basic"> | ||
27 | <field | ||
28 | name="count" | ||
29 | type="number" | ||
30 | label="MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL" | ||
31 | description="MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC" | ||
32 | default="120" | ||
33 | filter="integer" | ||
34 | /> | ||
35 | </fieldset> | ||
36 | |||
37 | <fieldset name="advanced"> | ||
38 | <field | ||
39 | name="layout" | ||
40 | type="modulelayout" | ||
41 | label="JFIELD_ALT_LAYOUT_LABEL" | ||
42 | description="JFIELD_ALT_MODULE_LAYOUT_DESC" | ||
43 | /> | ||
44 | |||
45 | <field | ||
46 | name="moduleclass_sfx" | ||
47 | type="textarea" | ||
48 | label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" | ||
49 | description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" | ||
50 | rows="3" | ||
51 | /> | ||
52 | |||
53 | <field | ||
54 | name="cache" | ||
55 | type="list" | ||
56 | label="COM_MODULES_FIELD_CACHING_LABEL" | ||
57 | description="COM_MODULES_FIELD_CACHING_DESC" | ||
58 | default="1" | ||
59 | filter="integer" | ||
60 | > | ||
61 | <option value="1">JGLOBAL_USE_GLOBAL</option> | ||
62 | <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> | ||
63 | </field> | ||
64 | |||
65 | <field | ||
66 | name="cache_time" | ||
67 | type="number" | ||
68 | label="COM_MODULES_FIELD_CACHE_TIME_LABEL" | ||
69 | description="COM_MODULES_FIELD_CACHE_TIME_DESC" | ||
70 | default="900" | ||
71 | filter="integer" | ||
72 | /> | ||
73 | |||
74 | <field | ||
75 | name="cachemode" | ||
76 | type="hidden" | ||
77 | default="static" | ||
78 | > | ||
79 | <option value="static"></option> | ||
80 | </field> | ||
81 | </fieldset> | ||
82 | </fields> | ||
83 | </config> | ||
84 | </extension> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_articles_archive | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | ?> | ||
12 | <?php if (!empty($list)) : ?> | ||
13 | <ul class="archive-module-custom<?php echo $moduleclass_sfx; ?> mod-list"> | ||
14 | <?php foreach ($list as $item) : ?> | ||
15 | <li> | ||
16 | <a href="<?php echo $item->link; ?>"> | ||
17 | <?php echo $item->text; ?> | ||
18 | </a> | ||
19 | </li> | ||
20 | <?php endforeach; ?> | ||
21 | </ul> | ||
22 | <?php endif; ?> |
... | @@ -61,7 +61,8 @@ a.outlink { | ... | @@ -61,7 +61,8 @@ a.outlink { |
61 | color: #009fa8; | 61 | color: #009fa8; |
62 | } | 62 | } |
63 | .item-page h4 a, | 63 | .item-page h4 a, |
64 | .blog h4 a { | 64 | .blog h4 a, |
65 | .archive-custom h4 a { | ||
65 | background: url(../images/bg_arrow01.png) no-repeat left 4px; | 66 | background: url(../images/bg_arrow01.png) no-repeat left 4px; |
66 | min-height: 20px; | 67 | min-height: 20px; |
67 | padding-left: 25px; | 68 | padding-left: 25px; |
... | @@ -74,7 +75,11 @@ a.outlink { | ... | @@ -74,7 +75,11 @@ a.outlink { |
74 | .blog h4 a:link, | 75 | .blog h4 a:link, |
75 | .blog h4 a:active, | 76 | .blog h4 a:active, |
76 | .blog h4 a:hover, | 77 | .blog h4 a:hover, |
77 | .blog h4 a:visited { | 78 | .blog h4 a:visited, |
79 | .archive-custom h4 a:link, | ||
80 | .archive-custom h4 a:active, | ||
81 | .archive-custom h4 a:hover, | ||
82 | .archive-custom h4 a:visited { | ||
78 | color: #fff !important; | 83 | color: #fff !important; |
79 | } | 84 | } |
80 | .sp, .sp_gnavi { | 85 | .sp, .sp_gnavi { |
... | @@ -87,7 +92,8 @@ a.outlink { | ... | @@ -87,7 +92,8 @@ a.outlink { |
87 | display: none; | 92 | display: none; |
88 | } | 93 | } |
89 | .item-page .icons, | 94 | .item-page .icons, |
90 | .blog .icons { | 95 | .blog .icons, |
96 | .archive-custom .icons { | ||
91 | /*display: none;*/ | 97 | /*display: none;*/ |
92 | } | 98 | } |
93 | table { | 99 | table { |
... | @@ -273,6 +279,7 @@ h1, h2, h3, h4, h5, h6, .site-title { | ... | @@ -273,6 +279,7 @@ h1, h2, h3, h4, h5, h6, .site-title { |
273 | line-height: 1; | 279 | line-height: 1; |
274 | margin: 0; | 280 | margin: 0; |
275 | } | 281 | } |
282 | /* 記述エラーで機能していないため、コメントアウト | ||
276 | .item-page h2, | 283 | .item-page h2, |
277 | .item-page h3, | 284 | .item-page h3, |
278 | .item-page h4, | 285 | .item-page h4, |
... | @@ -283,16 +290,23 @@ h1, h2, h3, h4, h5, h6, .site-title { | ... | @@ -283,16 +290,23 @@ h1, h2, h3, h4, h5, h6, .site-title { |
283 | .blog h4, | 290 | .blog h4, |
284 | .blog h5, | 291 | .blog h5, |
285 | 292 | ||
293 | .archive-custom h2, | ||
294 | .archive-custom h3, | ||
295 | .archive-custom h4, | ||
296 | .archive-custom h5, | ||
297 | |||
286 | #content h2, | 298 | #content h2, |
287 | #content h3, | 299 | #content h3, |
288 | #content h4, | 300 | #content h4, |
289 | #content h5, { | 301 | #content h5, { |
290 | line-height: 1.3; | 302 | line-height: 1.3; |
291 | } | 303 | } */ |
292 | .item-page h2, | 304 | .item-page h2, |
293 | body.com_monthlyarchive h2, | 305 | body.com_monthlyarchive h2, |
294 | .blog .page-header h2, | 306 | .blog .page-header h2, |
295 | .blog h2 { | 307 | .blog h2, |
308 | .archive-custom .page-header h2, | ||
309 | .archive-custom h2 { | ||
296 | font-size: 150%; | 310 | font-size: 150%; |
297 | color: #222; | 311 | color: #222; |
298 | font-weight: normal; | 312 | font-weight: normal; |
... | @@ -304,7 +318,7 @@ body.com_monthlyarchive h2, | ... | @@ -304,7 +318,7 @@ body.com_monthlyarchive h2, |
304 | .uk-scope .uk-margin-top { | 318 | .uk-scope .uk-margin-top { |
305 | margin-top: 9px !important; | 319 | margin-top: 9px !important; |
306 | } | 320 | } |
307 | #content h3, .item-page h3, .blog h3 { | 321 | #content h3, .item-page h3, .blog h3, .archive-custom h3 { |
308 | border-left: 5px solid #003894; | 322 | border-left: 5px solid #003894; |
309 | font-size: 130%; | 323 | font-size: 130%; |
310 | font-weight: normal; | 324 | font-weight: normal; |
... | @@ -313,7 +327,7 @@ body.com_monthlyarchive h2, | ... | @@ -313,7 +327,7 @@ body.com_monthlyarchive h2, |
313 | margin-top: 20px; | 327 | margin-top: 20px; |
314 | padding: 10px 0 10px 15px; | 328 | padding: 10px 0 10px 15px; |
315 | } | 329 | } |
316 | .item-page h4, .blog h4 { | 330 | .item-page h4, .blog h4, .archive-custom h4 { |
317 | background-color: #00857F; | 331 | background-color: #00857F; |
318 | color: #fff; | 332 | color: #fff; |
319 | font-size: 110%; | 333 | font-size: 110%; |
... | @@ -322,7 +336,7 @@ body.com_monthlyarchive h2, | ... | @@ -322,7 +336,7 @@ body.com_monthlyarchive h2, |
322 | margin-top: 50px; | 336 | margin-top: 50px; |
323 | padding: 7px 10px; | 337 | padding: 7px 10px; |
324 | } | 338 | } |
325 | .item-page h5, .blog h5 { | 339 | .item-page h5, .blog h5, .archive-custom h5 { |
326 | font-size: 120%; | 340 | font-size: 120%; |
327 | font-weight: normal; | 341 | font-weight: normal; |
328 | background: url(../images/bg_h5.png) no-repeat left center; | 342 | background: url(../images/bg_h5.png) no-repeat left center; |
... | @@ -539,14 +553,19 @@ div.search input.button { | ... | @@ -539,14 +553,19 @@ div.search input.button { |
539 | 553 | ||
540 | .blog .subnavi01 ol, | 554 | .blog .subnavi01 ol, |
541 | .blog .subnavi01 ul, | 555 | .blog .subnavi01 ul, |
542 | .blog .subnavi01 ul.style01 { | 556 | .blog .subnavi01 ul.style01, |
557 | .archive-custom .subnavi01 ol, | ||
558 | .archive-custom .subnavi01 ul, | ||
559 | .archive-custom .subnavi01 ul.style01 { | ||
543 | overflow: hidden; | 560 | overflow: hidden; |
544 | margin: 0; | 561 | margin: 0; |
545 | } | 562 | } |
546 | .item-page .subnavi01 ol li, | 563 | .item-page .subnavi01 ol li, |
547 | .item-page .subnavi01 ul li, | 564 | .item-page .subnavi01 ul li, |
548 | .blog .subnavi01 ol li, | 565 | .blog .subnavi01 ol li, |
549 | .blog .subnavi01 ul li { | 566 | .blog .subnavi01 ul li, |
567 | .archive-custom.subnavi01 ol li, | ||
568 | .archive-custom .subnavi01 ul li { | ||
550 | float: left; | 569 | float: left; |
551 | list-style-type: none; | 570 | list-style-type: none; |
552 | width: 33.3%; | 571 | width: 33.3%; |
... | @@ -558,24 +577,29 @@ div.search input.button { | ... | @@ -558,24 +577,29 @@ div.search input.button { |
558 | .item-page .subnavi01 ul.style01 li, | 577 | .item-page .subnavi01 ul.style01 li, |
559 | .item-page .subnavi01 ol.style01 li, | 578 | .item-page .subnavi01 ol.style01 li, |
560 | .blog .subnavi01 ul.style01 li, | 579 | .blog .subnavi01 ul.style01 li, |
561 | .blog .subnavi01 ol.style01 li { | 580 | .blog .subnavi01 ol.style01 li, |
581 | .archive-custom .subnavi01 ul.style01 li, | ||
582 | .archive-custom .subnavi01 ol.style01 li { | ||
562 | width: 50%; | 583 | width: 50%; |
563 | padding-right: 20px; | 584 | padding-right: 20px; |
564 | box-sizing: border-box; | 585 | box-sizing: border-box; |
565 | } | 586 | } |
566 | .item-page .subnavi01 ol.style01 li, | 587 | .item-page .subnavi01 ol.style01 li, |
567 | .blog .subnavi01 ol.style01 li { | 588 | .blog .subnavi01 ol.style01 li, |
589 | .archive-custom .subnavi01 ol.style01 li { | ||
568 | border: none; | 590 | border: none; |
569 | padding-bottom: inherit; | 591 | padding-bottom: inherit; |
570 | margin-bottom: 15px; | 592 | margin-bottom: 15px; |
571 | } | 593 | } |
572 | 594 | ||
573 | .item-page .subnavi01 ul.style02 li, | 595 | .item-page .subnavi01 ul.style02 li, |
574 | .blog .subnavi01 ul.style02 li { | 596 | .blog .subnavi01 ul.style02 li, |
597 | .archive-custom .subnavi01 ul.style02 li { | ||
575 | width: inherit; | 598 | width: inherit; |
576 | } | 599 | } |
577 | .item-page .subnavi01 ul.style03 li, | 600 | .item-page .subnavi01 ul.style03 li, |
578 | .blog .subnavi01 ul.style03 li { | 601 | .blog .subnavi01 ul.style03 li, |
602 | .archive-custom .subnavi01 ul.style03 li { | ||
579 | width: auto; | 603 | width: auto; |
580 | float: none; | 604 | float: none; |
581 | } | 605 | } |
... | @@ -1097,7 +1121,8 @@ div#n2-ss-64 .n2-ss-slide { | ... | @@ -1097,7 +1121,8 @@ div#n2-ss-64 .n2-ss-slide { |
1097 | overflow: hidden; | 1121 | overflow: hidden; |
1098 | } | 1122 | } |
1099 | .item-page #topinfo_twitarea h2, | 1123 | .item-page #topinfo_twitarea h2, |
1100 | .blog #topinfo_twitarea h2 { | 1124 | .blog #topinfo_twitarea h2, |
1125 | .archive-custom #topinfo_twitarea h2 { | ||
1101 | border: none; | 1126 | border: none; |
1102 | text-align: center; | 1127 | text-align: center; |
1103 | margin: 0 0 20px; | 1128 | margin: 0 0 20px; |
... | @@ -1475,7 +1500,8 @@ table.Cindex .ph { | ... | @@ -1475,7 +1500,8 @@ table.Cindex .ph { |
1475 | margin-bottom: 15px; | 1500 | margin-bottom: 15px; |
1476 | } | 1501 | } |
1477 | .item-page table.Cindex ul, | 1502 | .item-page table.Cindex ul, |
1478 | .blog table.Cindex ul{ | 1503 | .blog table.Cindex ul, |
1504 | .archive-custom table.Cindex ul { | ||
1479 | margin: 0; | 1505 | margin: 0; |
1480 | font-size: 90%; | 1506 | font-size: 90%; |
1481 | } | 1507 | } |
... | @@ -1528,7 +1554,8 @@ td.num01 { | ... | @@ -1528,7 +1554,8 @@ td.num01 { |
1528 | } | 1554 | } |
1529 | 1555 | ||
1530 | .item-page table ul, | 1556 | .item-page table ul, |
1531 | .blog table ul { | 1557 | .blog table ul, |
1558 | .archive-custom table ul { | ||
1532 | margin: 0 0 0 15px; | 1559 | margin: 0 0 0 15px; |
1533 | } | 1560 | } |
1534 | 1561 | ||
... | @@ -1575,16 +1602,19 @@ table.style01 th.group { | ... | @@ -1575,16 +1602,19 @@ table.style01 th.group { |
1575 | width: 12%; | 1602 | width: 12%; |
1576 | } | 1603 | } |
1577 | .item-page table.style01 ul li, | 1604 | .item-page table.style01 ul li, |
1578 | .blog table.style01 ul li { | 1605 | .blog table.style01 ul li, |
1606 | .archive-custom table.style01 ul li { | ||
1579 | list-style-type: none; | 1607 | list-style-type: none; |
1580 | margin: 0; | 1608 | margin: 0; |
1581 | } | 1609 | } |
1582 | .item-page table.style01 ul.mark, | 1610 | .item-page table.style01 ul.mark, |
1583 | .blog table.style01 ul.mark { | 1611 | .blog table.style01 ul.mark, |
1612 | .archive-custom table.style01 ul.mark { | ||
1584 | margin-left: 20px; | 1613 | margin-left: 20px; |
1585 | } | 1614 | } |
1586 | .item-page table.style01 ul.mark li, | 1615 | .item-page table.style01 ul.mark li, |
1587 | .blog table.style01 ul.mark li { | 1616 | .blog table.style01 ul.mark li, |
1617 | .archive-custom table.style01 ul.mark li { | ||
1588 | list-style-type: disc; | 1618 | list-style-type: disc; |
1589 | margin-bottom: 7px; | 1619 | margin-bottom: 7px; |
1590 | } | 1620 | } |
... | @@ -1695,33 +1725,40 @@ address .title { | ... | @@ -1695,33 +1725,40 @@ address .title { |
1695 | ul, ol { | 1725 | ul, ol { |
1696 | } | 1726 | } |
1697 | .item-page ul, .item-page ol, | 1727 | .item-page ul, .item-page ol, |
1698 | .blog ul, .blog ol { | 1728 | .blog ul, .blog ol, |
1729 | .archive-custom ul, .archive-custom ol { | ||
1699 | margin-bottom: 30px; | 1730 | margin-bottom: 30px; |
1700 | } | 1731 | } |
1701 | .item-page ul ul, .item-page ol ul, | 1732 | .item-page ul ul, .item-page ol ul, |
1702 | .item-page ul ol, .item-page ol ol, | 1733 | .item-page ul ol, .item-page ol ol, |
1703 | .blog ul ul, .blog ol ul, | 1734 | .blog ul ul, .blog ol ul, |
1704 | .blog ul ol, .blog ol ul { | 1735 | .blog ul ol, .blog ol ul, |
1736 | .archive-custom ul ul, .archive-custom ol ul, | ||
1737 | .archive-custom ul ol, .archive-custom ol ul { | ||
1705 | margin-left: 20px; | 1738 | margin-left: 20px; |
1706 | margin-top: 10px; | 1739 | margin-top: 10px; |
1707 | } | 1740 | } |
1708 | .item-page ul li, .item-page ol li, | 1741 | .item-page ul li, .item-page ol li, |
1709 | .blog ul li, .blog ol li { | 1742 | .blog ul li, .blog ol li, |
1743 | .archive-custom ul li, .archive-custom ol li { | ||
1710 | margin-bottom: 12px; | 1744 | margin-bottom: 12px; |
1711 | 1745 | ||
1712 | margin-bottom: 15px; | 1746 | margin-bottom: 15px; |
1713 | } | 1747 | } |
1714 | .item-page ul li, | 1748 | .item-page ul li, |
1715 | .blog ul li { | 1749 | .blog ul li, |
1750 | .archive-custom ul li { | ||
1716 | list-style-type: disc; | 1751 | list-style-type: disc; |
1717 | line-height: 1.5; | 1752 | line-height: 1.5; |
1718 | } | 1753 | } |
1719 | .item-page li ul | 1754 | .item-page li ul |
1720 | .blog li ul { | 1755 | .blog li ul, |
1756 | .archive-custom li ul { | ||
1721 | margin-top: 15px; | 1757 | margin-top: 15px; |
1722 | } | 1758 | } |
1723 | .item-page ul.kome, | 1759 | .item-page ul.kome, |
1724 | .blog ul.kome { | 1760 | .blog ul.kome, |
1761 | .archive-custom ul.kome { | ||
1725 | /*margin-left: 10px;*/ | 1762 | /*margin-left: 10px;*/ |
1726 | } | 1763 | } |
1727 | .item-page ul.kome li, | 1764 | .item-page ul.kome li, |
... | @@ -1739,17 +1776,20 @@ ol li .title { | ... | @@ -1739,17 +1776,20 @@ ol li .title { |
1739 | padding-bottom: 5px; | 1776 | padding-bottom: 5px; |
1740 | } | 1777 | } |
1741 | .item-page ol.style01 li, | 1778 | .item-page ol.style01 li, |
1742 | .blog ol.style01 li { | 1779 | .blog ol.style01 li, |
1780 | .archive-custom ol.style01 li { | ||
1743 | border-bottom: 1px solid #b3caf0; | 1781 | border-bottom: 1px solid #b3caf0; |
1744 | padding-bottom: 10px; | 1782 | padding-bottom: 10px; |
1745 | margin-bottom: 20px; | 1783 | margin-bottom: 20px; |
1746 | } | 1784 | } |
1747 | .item-page ol.style01 li ul, | 1785 | .item-page ol.style01 li ul, |
1748 | .blog ol.style01 li ul { | 1786 | .blog ol.style01 li ul, |
1787 | .archive-custom ol.style01 li ul { | ||
1749 | margin-bottom: 0; | 1788 | margin-bottom: 0; |
1750 | } | 1789 | } |
1751 | .item-page ol.style01 li li, | 1790 | .item-page ol.style01 li li, |
1752 | .blog ol.style01 li li { | 1791 | .blog ol.style01 li li, |
1792 | .archive-custom ol.style01 li li { | ||
1753 | border: none; | 1793 | border: none; |
1754 | margin-bottom: 10px; | 1794 | margin-bottom: 10px; |
1755 | } | 1795 | } |
... | @@ -1920,7 +1960,8 @@ dl.article-info dd.create { | ... | @@ -1920,7 +1960,8 @@ dl.article-info dd.create { |
1920 | margin-bottom: 20px; | 1960 | margin-bottom: 20px; |
1921 | } | 1961 | } |
1922 | .item-page .bikoubox01 ul.kome, | 1962 | .item-page .bikoubox01 ul.kome, |
1923 | .blog .bikoubox01 ul.kome { | 1963 | .blog .bikoubox01 ul.kome, |
1964 | .archive-custom .bikoubox01 ul.kome { | ||
1924 | margin-left: 0; | 1965 | margin-left: 0; |
1925 | } | 1966 | } |
1926 | .bikoubox01 .title { | 1967 | .bikoubox01 .title { |
... | @@ -2102,7 +2143,13 @@ table.listimg td { | ... | @@ -2102,7 +2143,13 @@ table.listimg td { |
2102 | .blog .wrap_fac .subnavi02 ul li a:link, | 2143 | .blog .wrap_fac .subnavi02 ul li a:link, |
2103 | .blog .wrap_fac .subnavi02 ul li a:active, | 2144 | .blog .wrap_fac .subnavi02 ul li a:active, |
2104 | .blog .wrap_fac .subnavi02 ul li a:hover, | 2145 | .blog .wrap_fac .subnavi02 ul li a:hover, |
2105 | .blog .wrap_fac .subnavi02 ul li a:visited { | 2146 | .blog .wrap_fac .subnavi02 ul li a:visited, |
2147 | |||
2148 | .archive-custom .wrap_fac .subnavi02 ul li a, | ||
2149 | .archive-custom .wrap_fac .subnavi02 ul li a:link, | ||
2150 | .archive-custom .wrap_fac .subnavi02 ul li a:active, | ||
2151 | .archive-custom .wrap_fac .subnavi02 ul li a:hover, | ||
2152 | .archive-custom .wrap_fac .subnavi02 ul li a:visited { | ||
2106 | color: #333 !important; | 2153 | color: #333 !important; |
2107 | } | 2154 | } |
2108 | 2155 | ||
... | @@ -2210,7 +2257,8 @@ table.listimg td { | ... | @@ -2210,7 +2257,8 @@ table.listimg td { |
2210 | /*競技成績一覧ページ | 2257 | /*競技成績一覧ページ |
2211 | https://www.nifs-k.ac.jp/campus-life/activities/record.html | 2258 | https://www.nifs-k.ac.jp/campus-life/activities/record.html |
2212 | */ | 2259 | */ |
2213 | body.itemid-795 .blog .cat-children { | 2260 | body.itemid-795 .blog .cat-children, |
2261 | body.itemid-795 .archive-custom .cat-children { | ||
2214 | display: none; | 2262 | display: none; |
2215 | } | 2263 | } |
2216 | 2264 | ||
... | @@ -2272,7 +2320,19 @@ body.itemid-795 .blog .cat-children { | ... | @@ -2272,7 +2320,19 @@ body.itemid-795 .blog .cat-children { |
2272 | .blog #wrap_sitemap a:link, | 2320 | .blog #wrap_sitemap a:link, |
2273 | .blog #wrap_sitemap a:active, | 2321 | .blog #wrap_sitemap a:active, |
2274 | .blog #wrap_sitemap a:hover, | 2322 | .blog #wrap_sitemap a:hover, |
2275 | .blog #wrap_sitemap a:visited { | 2323 | .blog #wrap_sitemap a:visited, |
2324 | |||
2325 | .archive-custom #wrap_sitemap ul li a, | ||
2326 | .archive-custom #wrap_sitemap ul li a:link, | ||
2327 | .archive-custom #wrap_sitemap ul li a:active, | ||
2328 | .archive-custom #wrap_sitemap ul li a:hover, | ||
2329 | .archive-custom #wrap_sitemap ul li a:visited, | ||
2330 | |||
2331 | .archive-custom #wrap_sitemap a, | ||
2332 | .archive-custom #wrap_sitemap a:link, | ||
2333 | .archive-custom #wrap_sitemap a:active, | ||
2334 | .archive-custom #wrap_sitemap a:hover, | ||
2335 | .archive-custom #wrap_sitemap a:visited { | ||
2276 | color: #003894; | 2336 | color: #003894; |
2277 | } | 2337 | } |
2278 | 2338 | ||
... | @@ -2350,17 +2410,20 @@ body.itemid-795 .blog .cat-children { | ... | @@ -2350,17 +2410,20 @@ body.itemid-795 .blog .cat-children { |
2350 | /* ------------------------------------------------------------------------- | 2410 | /* ------------------------------------------------------------------------- |
2351 | ブログ系(information) | 2411 | ブログ系(information) |
2352 | ------------------------------------------------------------------------- */ | 2412 | ------------------------------------------------------------------------- */ |
2353 | /*.blog .page-header h2 { | 2413 | /*.blog .page-header h2, |
2414 | .archive-custom .page-header h2 { | ||
2354 | margin-top: 30px; | 2415 | margin-top: 30px; |
2355 | font-size: 130%; | 2416 | font-size: 130%; |
2356 | padding-bottom: 17px; | 2417 | padding-bottom: 17px; |
2357 | padding-top: 17px; | 2418 | padding-top: 17px; |
2358 | }*/ | 2419 | }*/ |
2359 | .blog a:link, .blog a:active, .blog a:hover, .blog a:visited { | 2420 | .blog a:link, .blog a:active, .blog a:hover, .blog a:visited, |
2421 | .archive-custom a:link, .archive-custom a:active, .archive-custom a:hover, .archive-custom a:visited { | ||
2360 | color: #009fa8; | 2422 | color: #009fa8; |
2361 | } | 2423 | } |
2362 | 2424 | ||
2363 | body.itemid-792 .blog .cat-children { | 2425 | body.itemid-792 .blog .cat-children, |
2426 | body.itemid-792 .archive-custom .cat-children { | ||
2364 | display: none; | 2427 | display: none; |
2365 | } | 2428 | } |
2366 | 2429 | ||
... | @@ -3039,12 +3102,14 @@ body.itemid-132 table { | ... | @@ -3039,12 +3102,14 @@ body.itemid-132 table { |
3039 | } | 3102 | } |
3040 | 3103 | ||
3041 | .item-page .subnavi01 ol li, .item-page .subnavi01 ul li, | 3104 | .item-page .subnavi01 ol li, .item-page .subnavi01 ul li, |
3042 | .blog .subnavi01 ol li, .blog .subnavi01 ul li { | 3105 | .blog .subnavi01 ol li, .blog .subnavi01 ul li, |
3106 | .archive-custom .subnavi01 ol li, .archive-custom .subnavi01 ul li { | ||
3043 | width: auto; | 3107 | width: auto; |
3044 | margin-right: 30px; | 3108 | margin-right: 30px; |
3045 | } | 3109 | } |
3046 | .item-page .subnavi01 ul.style01 li, .item-page .subnavi01 ol.style01 li, | 3110 | .item-page .subnavi01 ul.style01 li, .item-page .subnavi01 ol.style01 li, |
3047 | .blog .subnavi01 ul.style01 li, .blog .subnavi01 ol.style01 li { | 3111 | .blog .subnavi01 ul.style01 li, .blog .subnavi01 ol.style01 li, |
3112 | .archive-custom .subnavi01 ul.style01 li, .archive-custom .subnavi01 ol.style01 li { | ||
3048 | width: 100%; | 3113 | width: 100%; |
3049 | float: none; | 3114 | float: none; |
3050 | } | 3115 | } |
... | @@ -3186,7 +3251,7 @@ body.itemid-132 table { | ... | @@ -3186,7 +3251,7 @@ body.itemid-132 table { |
3186 | } | 3251 | } |
3187 | 3252 | ||
3188 | /*見出し*/ | 3253 | /*見出し*/ |
3189 | .item-page h2, body.com_monthlyarchive h2, .blog .page-header h2, .blog h2 { | 3254 | .item-page h2, body.com_monthlyarchive h2, .blog .page-header h2, .blog h2, .archive-custom .page-header h2, .archive-custom h2 { |
3190 | font-size: 130%; | 3255 | font-size: 130%; |
3191 | padding-bottom: 20px; | 3256 | padding-bottom: 20px; |
3192 | padding-top: 20px; | 3257 | padding-top: 20px; |
... | @@ -3271,12 +3336,12 @@ body.itemid-132 table { | ... | @@ -3271,12 +3336,12 @@ body.itemid-132 table { |
3271 | } | 3336 | } |
3272 | 3337 | ||
3273 | @media (max-width: 400px) { | 3338 | @media (max-width: 400px) { |
3274 | .item-page h2, .blog h2 { | 3339 | .item-page h2, .blog h2, .archive-custom h2 { |
3275 | font-size: 140%; | 3340 | font-size: 140%; |
3276 | padding-top: 20px; | 3341 | padding-top: 20px; |
3277 | padding-bottom: 20px; | 3342 | padding-bottom: 20px; |
3278 | } | 3343 | } |
3279 | .item-page h3, .blog h3 { | 3344 | .item-page h3, .blog h3, .archive-custom h3 { |
3280 | margin-bottom: 15px; | 3345 | margin-bottom: 15px; |
3281 | padding-left: 10px; | 3346 | padding-left: 10px; |
3282 | font-size: 120%; | 3347 | font-size: 120%; |
... | @@ -3361,5 +3426,10 @@ body.itemid-132 table { | ... | @@ -3361,5 +3426,10 @@ body.itemid-132 table { |
3361 | } | 3426 | } |
3362 | } | 3427 | } |
3363 | 3428 | ||
3364 | 3429 | /* ------------------------------------------------------------------------- | |
3365 | 3430 | app/modules/mod_articles_archive_custom/tmpl/default.phpのスタイルを変更 | |
3431 | ------------------------------------------------------------------------- */ | ||
3432 | .archive-module-custom { | ||
3433 | height: 460px; | ||
3434 | overflow: auto; | ||
3435 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -203,24 +203,37 @@ if ($this->params->get('logoFile')) { | ... | @@ -203,24 +203,37 @@ if ($this->params->get('logoFile')) { |
203 | <link rel="apple-touch-icon" href="/apple-touch-icon.png"> | 203 | <link rel="apple-touch-icon" href="/apple-touch-icon.png"> |
204 | 204 | ||
205 | <script> | 205 | <script> |
206 | window.onload = function() { | ||
206 | jQuery(function($) { | 207 | jQuery(function($) { |
207 | var obj = $("#aside"); | 208 | var obj = $("#aside"); |
208 | var offset = $(obj).offset(); | ||
209 | var topPadding = 135; | ||
210 | var sW = window.innerWidth; | 209 | var sW = window.innerWidth; |
211 | var sH = window.innerHeight; | 210 | var sH = window.innerHeight; |
212 | var cW = obj.width(); | 211 | var cW = obj.width(); |
213 | var cH = obj.height(); | 212 | var cH = obj.height(); |
214 | var cwrapH = $("#c_wrap").height(); | 213 | var cwrapH = $("#c_wrap").height(); |
214 | // 特定のページではスクロールしない | ||
215 | var excludedPages = [".record-page"]; | ||
216 | var excludedPagesSelector = excludedPages.join(', '); | ||
217 | var isExcluded = false; | ||
218 | if (document.querySelector(excludedPagesSelector)) { | ||
219 | isExcluded = true; | ||
220 | } | ||
221 | var customHeight = $(".custom").height(); | ||
222 | var paddingTop = customHeight - 80; | ||
215 | 223 | ||
216 | if (cH) { | 224 | if (cH) { |
217 | if (sH > cH) { | 225 | if (sH > cH) { |
226 | if (isExcluded) return false; | ||
227 | $(window).resize(function() { | ||
228 | customHeight = $(".custom").height(); | ||
229 | paddingTop = customHeight - 80; | ||
230 | }); | ||
218 | $(window).scroll(function() { | 231 | $(window).scroll(function() { |
219 | if ($(window).scrollTop() > offset.top) { | 232 | if ($(window).scrollTop() > customHeight) { |
220 | if ($(window).scrollTop() < cwrapH) { | 233 | if ($(window).scrollTop() < cwrapH) { |
221 | $(obj).stop().animate({ | 234 | $(obj).stop().animate({ |
222 | duration: 'fast', | 235 | duration: 'fast', |
223 | marginTop: $(window).scrollTop() - offset.top + topPadding | 236 | marginTop: $(window).scrollTop() - paddingTop |
224 | }); | 237 | }); |
225 | } else { | 238 | } else { |
226 | $(obj).stop().animate({}); | 239 | $(obj).stop().animate({}); |
... | @@ -234,6 +247,7 @@ if ($this->params->get('logoFile')) { | ... | @@ -234,6 +247,7 @@ if ($this->params->get('logoFile')) { |
234 | } | 247 | } |
235 | } | 248 | } |
236 | }); | 249 | }); |
250 | }; | ||
237 | </script> | 251 | </script> |
238 | 252 | ||
239 | </head> | 253 | </head> | ... | ... |
-
Please register or sign in to post a comment