603f4af4 by TaishiTokudome

Merge branch '011_tokudome' into 'master'

アーカイブページ作成においての変更です。

See merge request !6
2 parents 3a4444fa 34395a2c
Showing 34 changed files with 1828 additions and 70 deletions
......@@ -14,3 +14,12 @@ https://project.lilli.co.jp/oki/kanoya-univercity-docker
## DB/アップロードファイルのバックアップについて
ec2-uesrのホームディレクトリに毎週日曜に1度だけ取るようにしてます。
~/backup.sh をcron実行しています。
## インストールを必要とするモジュール、コンポーネントについて
srcディレクトリにて、インストールして追加したモジュール、コンポーネントのソースコードを管理しています。
追加したモジュール、コンポーネントについての詳細は各モジュール、コンポーネントディレクトリに有るREADME.mdをご覧ください。
Joomlaのアップデートをした際に、アップデートの内容によっては追加したモジュール、コンポーネントが正常に動作しなくなる場合があります。
その際は、適宜、モジュール、コンポーネントを修正してください。
再度、モジュール、コンポーネントをインストールする場合は、それぞれのREADMEに記述してある手順でインストールしてください。
\ No newline at end of file
......
# 月次アーカイブ用コンポーネント
過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。
インストールしていない場合は、管理画面よりインストールする必要があります。
## インストール手順
1. 管理画面ログイン
2. エクステンション配下の管理を選択
3. (フォルダからインストール)を選択
4. フォームにインストールするモジュールまたは、コンポーネントのフォルダを指定(例:/var/www/html/src/com/com_hoge)
5. チェックしてインストール
\ No newline at end of file
<?php
echo "<p>カスタムアーカイブコンポーネントです。</p>";
echo "\n";
echo "<P>このページから設定する項目はありません。</P>";
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
COM_CONTENT_CUSTOM="archive_custom_component"
COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="Options"
COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="Position of Article Info"
COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive."
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."
COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="Use Article Settings"
COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above"
COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below"
COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default"
; Joomla! Project
; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
COM_CONTENT_CUSTOM="archive_custom_component"
COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive."
COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above"
COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below"
COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default"
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)"
COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="オプション"
COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="記事情報の位置"
COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。"
COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC="記事情報のブロックをテキストの上か下に追加します。または1つは上、その他は下へ2つのブロックに分けます。"
COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="記事設定の使用"
COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上"
COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下"
COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準"
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)"
COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。"
COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上"
COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下"
COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準"
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.0" method="upgrade">
<name>COM_CONTENT_CUSTOM</name>
<author>T.Tokudome</author>
<creationDate>July 2020</creationDate>
<copyright></copyright>
<license></license>
<authorEmail>tokudome@lilli.co.jp</authorEmail>
<authorUrl></authorUrl>
<version>0.0.1</version>
<description>COM_CONTENT_CUSTOM_XML_DESCRIPTION</description>
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<files folder="site">
<filename>index.html</filename>
<filename>content_custom.php</filename>
<filename>controller.php</filename>
<folder>views</folder>
<folder>helpers</folder>
<folder>models</folder>
</files>
<languages folder="site">
<language tag="en-GB">language/en-GB.com_content_custom.ini</language>
<language tag="ja-JP">language/ja-JP.com_content_custom.ini</language>
</languages>
<administration>
<menu link='index.php?option=com_content_custom'>カスタムアーカイブ</menu>
<files folder="admin">
<filename>index.html</filename>
<filename>content_custom.php</filename>
<folder>sql</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB.com_content_custom.ini</language>
<language tag="ja-JP">language/ja-JP.com_content_custom.ini</language>
<language tag="en-GB">language/en-GB.com_content_custom.sys.ini</language>
<language tag="ja-JP">language/ja-JP.com_content_custom.sys.ini</language>
</languages>
</administration>
</extension>
\ No newline at end of file
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('ContentCustomHelperRoute', JPATH_SITE . '/components/com_content_custom/helpers/route.php');
JLoader::register('ContentCustomHelperQuery', JPATH_SITE . '/components/com_content_custom/helpers/query.php');
$input = JFactory::getApplication()->input;
$user = JFactory::getUser();
$controller = JControllerLegacy::getInstance('Content');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Component\ComponentHelper;
/**
* Content Component Controller
*
* @since 1.5
*/
class ContentController extends JControllerLegacy
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* Recognized key values include 'name', 'default_task', 'model_path', and
* 'view_path' (this list is not meant to be comprehensive).
*
* @since 3.0.1
*/
public function __construct($config = array())
{
$this->input = JFactory::getApplication()->input;
// Article frontpage Editor pagebreak proxying:
if ($this->input->get('view') === 'article' && $this->input->get('layout') === 'pagebreak')
{
$config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
}
// Article frontpage Editor article proxying:
elseif ($this->input->get('view') === 'articles' && $this->input->get('layout') === 'modal')
{
JHtml::_('stylesheet', 'system/adminlist.css', array('version' => 'auto', 'relative' => true));
$config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
}
parent::__construct($config);
}
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached.
* @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
$cachable = true;
/**
* Set the default view name and format from the Request.
* Note we are using a_id to avoid collisions with the router and the return page.
* Frontend is a bit messier than the backend.
*/
$id = $this->input->getInt('a_id');
$vName = $this->input->getCmd('view', 'categories');
$this->input->set('view', $vName);
$user = JFactory::getUser();
if ($user->get('id')
|| ($this->input->getMethod() === 'POST'
&& (($vName === 'category' && $this->input->get('layout') !== 'blog') || $vName === 'archive' )))
{
$cachable = false;
}
$safeurlparams = array(
'catid' => 'INT',
'id' => 'INT',
'cid' => 'ARRAY',
'year' => 'INT',
'month' => 'INT',
'limit' => 'UINT',
'limitstart' => 'UINT',
'showall' => 'INT',
'return' => 'BASE64',
'filter' => 'STRING',
'filter_order' => 'CMD',
'filter_order_Dir' => 'CMD',
'filter-search' => 'STRING',
'print' => 'BOOLEAN',
'lang' => 'CMD',
'Itemid' => 'INT');
parent::display($cachable, $safeurlparams);
return $this;
}
}
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content Component Query Helper
*
* @since 1.5
*/
class ContentCustomHelperQuery
{
/**
* Translate an order code to a field for secondary category ordering.
*
* @param string $orderby The ordering code.
* @param string $orderDate The ordering code for the date.
*
* @return string The SQL field(s) to order by.
*
* @since 1.5
*/
public static function orderbySecondary($orderby, $orderDate = 'created')
{
$queryDate = self::getQueryDate($orderDate);
switch ($orderby)
{
case 'date' :
$orderby = $queryDate;
break;
case 'rdate' :
$orderby = $queryDate . ' DESC ';
break;
case 'alpha' :
$orderby = 'a.title';
break;
case 'ralpha' :
$orderby = 'a.title DESC';
break;
case 'hits' :
$orderby = 'a.hits DESC';
break;
case 'rhits' :
$orderby = 'a.hits';
break;
case 'order' :
$orderby = 'a.ordering';
break;
case 'rorder' :
$orderby = 'a.ordering DESC';
break;
case 'author' :
$orderby = 'author';
break;
case 'rauthor' :
$orderby = 'author DESC';
break;
case 'front' :
$orderby = 'a.featured DESC, fp.ordering, ' . $queryDate . ' DESC ';
break;
case 'random' :
$orderby = JFactory::getDbo()->getQuery(true)->Rand();
break;
case 'vote' :
$orderby = 'a.id DESC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating_count DESC ';
}
break;
case 'rvote' :
$orderby = 'a.id ASC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating_count ASC ';
}
break;
case 'rank' :
$orderby = 'a.id DESC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating DESC ';
}
break;
case 'rrank' :
$orderby = 'a.id ASC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating ASC ';
}
break;
default :
$orderby = 'a.ordering';
break;
}
return $orderby;
}
/**
* Translate an order code to a field for primary category ordering.
*
* @param string $orderDate The ordering code.
*
* @return string The SQL field(s) to order by.
*
* @since 1.6
*/
public static function getQueryDate($orderDate)
{
$db = JFactory::getDbo();
switch ($orderDate)
{
case 'modified' :
$queryDate = ' CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END';
break;
// Use created if publish_up is not set
case 'published' :
$queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END ';
break;
case 'unpublished' :
$queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END ';
break;
case 'created' :
default :
$queryDate = ' a.created ';
break;
}
return $queryDate;
}
}
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content Component Route Helper.
*
* @since 1.5
*/
abstract class ContentCustomHelperRoute
{
/**
* Get the article route.
*
* @param integer $id The route of the content item.
* @param integer $catid The category ID.
* @param integer $language The language code.
* @param string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null)
{
// Create the link
$link = 'index.php?option=com_content&view=article&id=' . $id;
if ((int) $catid > 1)
{
$link .= '&catid=' . $catid;
}
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
if ($layout)
{
$link .= '&layout=' . $layout;
}
return $link;
}
/**
* Get the category route.
*
* @param integer $catid The category ID.
* @param integer $language The language code.
* @param string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getCategoryRoute($catid, $language = 0, $layout = null)
{
if ($catid instanceof JCategoryNode)
{
$id = $catid->id;
}
else
{
$id = (int) $catid;
}
if ($id < 1)
{
return '';
}
$link = 'index.php?option=com_content&view=category&id=' . $id;
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
if ($layout)
{
$link .= '&layout=' . $layout;
}
return $link;
}
}
; Joomla! Project
; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
COM_CONTENT_CUSTOM_ARTICLE_HITS="Hits: %s"
COM_CONTENT_CUSTOM_ARTICLE_INFO="Details"
COM_CONTENT_CUSTOM_CATEGORY="Category: %s"
COM_CONTENT_CUSTOM_CREATED_DATE_ON="Created: %s"
COM_CONTENT_CUSTOM_LAST_UPDATED="Last Updated: %s"
COM_CONTENT_CUSTOM_MONTH="Month"
COM_CONTENT_CUSTOM_PARENT="Parent Category: %s"
COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="Published: %s"
COM_CONTENT_CUSTOM_WRITTEN_BY="Written by %s"
COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above"
COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below"
COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default"
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_CONTENT_CUSTOM_ARTICLE_HITS="参照数: %s"
COM_CONTENT_CUSTOM_ARTICLE_INFO="詳細"
COM_CONTENT_CUSTOM_CATEGORY="カテゴリ: %s"
COM_CONTENT_CUSTOM_CREATED_DATE_ON="作成日:%s"
COM_CONTENT_CUSTOM_LAST_UPDATED="最終更新日:%s"
COM_CONTENT_CUSTOM_MONTH="月"
COM_CONTENT_CUSTOM_PARENT="親カテゴリ: %s"
COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="公開日:%s"
COM_CONTENT_CUSTOM_WRITTEN_BY="投稿者: %s"
COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上"
COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下"
COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事"
COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準"
\ No newline at end of file
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
JLoader::register('ContentModelArticles', __DIR__ . '/articles.php');
/**
* Content Component Archive Model
*
* @since 1.5
*/
class ContentModelArchive extends ContentModelArticles
{
/**
* Model context string.
*
* @var string
*/
public $_context = 'com_content_custom.archive';
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering The field to order on.
* @param string $direction The direction to order on.
*
* @return void
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
parent::populateState();
$app = JFactory::getApplication();
// Add archive properties
$params = $this->state->params;
// Filter on archived articles
$this->setState('filter.published', 1);
// Filter on month, year
$this->setState('filter.month', $app->input->getInt('month'));
$this->setState('filter.year', $app->input->getInt('year'));
// Optional filter text
$this->setState('list.filter', $app->input->getString('filter-search'));
// Get list limit
$itemid = $app->input->get('Itemid', 0, 'int');
$limit = $app->getUserStateFromRequest('com_content_custom.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint');
$this->setState('list.limit', $limit);
// Set the archive ordering
$articleOrderby = $params->get('orderby_sec', 'rdate');
$articleOrderDate = $params->get('order_date');
// No category ordering
$secondary = ContentCustomHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate);
$this->setState('list.ordering', $secondary . ', a.created DESC');
$this->setState('list.direction', '');
}
/**
* Get the master query for retrieving a list of articles subject to the model state.
*
* @return JDatabaseQuery
*
* @since 1.6
*/
protected function getListQuery()
{
$params = $this->state->params;
$app = JFactory::getApplication('site');
$catids = ArrayHelper::toInteger($app->input->get('catid', array(), 'array'));
$catids = array_values(array_diff($catids, array(0)));
$articleOrderDate = $params->get('order_date');
// Create a new query object.
$query = parent::getListQuery();
// Add routing for archive
// Sqlsrv changes
$case_when = ' CASE WHEN ';
$case_when .= $query->charLength('a.alias', '!=', '0');
$case_when .= ' THEN ';
$a_id = $query->castAsChar('a.id');
$case_when .= $query->concatenate(array($a_id, 'a.alias'), ':');
$case_when .= ' ELSE ';
$case_when .= $a_id . ' END as slug';
$query->select($case_when);
$case_when = ' CASE WHEN ';
$case_when .= $query->charLength('c.alias', '!=', '0');
$case_when .= ' THEN ';
$c_id = $query->castAsChar('c.id');
$case_when .= $query->concatenate(array($c_id, 'c.alias'), ':');
$case_when .= ' ELSE ';
$case_when .= $c_id . ' END as catslug';
$query->select($case_when);
// Filter on month, year
// First, get the date field
$queryDate = ContentCustomHelperQuery::getQueryDate($articleOrderDate);
if ($month = $this->getState('filter.month'))
{
$query->where($query->month($queryDate) . ' = ' . $month);
}
if ($year = $this->getState('filter.year'))
{
$query->where($query->year($queryDate) . ' = ' . $year);
}
if (count($catids) > 0)
{
$query->where('c.id IN (' . implode(', ', $catids) . ')');
}
return $query;
}
/**
* Method to get the archived article list
*
* @access public
* @return array
*/
public function getData()
{
$app = JFactory::getApplication();
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
// Get the page/component configuration
$params = $app->getParams();
// Get the pagination request variables
$limit = $app->input->get('limit', $params->get('display_num', 20), 'uint');
$limitstart = $app->input->get('limitstart', 0, 'uint');
$query = $this->_buildQuery();
$this->_data = $this->_getList($query, $limitstart, $limit);
}
return $this->_data;
}
/**
* JModelLegacy override to add alternating value for $odd
*
* @param string $query The query.
* @param integer $limitstart Offset.
* @param integer $limit The number of records.
*
* @return array An array of results.
*
* @since 3.0.1
* @throws RuntimeException
*/
protected function _getList($query, $limitstart=0, $limit=0)
{
$result = parent::_getList($query, $limitstart, $limit);
$odd = 1;
foreach ($result as $k => $row)
{
$result[$k]->odd = $odd;
$odd = 1 - $odd;
}
return $result;
}
}
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.caption');
?>
<div class="archive-custom<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
</div>
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE" option="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_ARCHIVED"
/>
<message>
<![CDATA[COM_CONTENT_CUSTOM_XML_DESCRIPTION]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_categories/models/fields"
>
<field
name="catid"
type="category"
extension="com_content"
multiple="true"
size="5"
label="JCATEGORY"
description="JFIELD_CATEGORY_DESC"
>
<option value="">JOPTION_ALL_CATEGORIES</option>
</field>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic" label="JGLOBAL_ARCHIVE_OPTIONS"
>
<field
name="orderby_sec"
type="list"
label="JGLOBAL_ARTICLE_ORDER_LABEL"
description="JGLOBAL_ARTICLE_ORDER_DESC"
default="rdate"
>
<option value="date">JGLOBAL_OLDEST_FIRST</option>
<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
<option value="hits">JGLOBAL_MOST_HITS</option>
<option value="rhits">JGLOBAL_LEAST_HITS</option>
<option value="order">JGLOBAL_ARTICLE_MANAGER_ORDER</option>
<option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option>
<option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option>
<option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option>
<option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option>
</field>
<field
name="order_date"
type="list"
label="JGLOBAL_ORDERING_DATE_LABEL"
description="JGLOBAL_ORDERING_DATE_DESC"
default="published"
>
<option value="created">JGLOBAL_Created</option>
<option value="modified">JGLOBAL_Modified</option>
<option value="published">JPUBLISHED</option>
</field>
<field
name="display_num"
type="list"
label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL"
description="JGLOBAL_NUMBER_ITEMS_LIST_DESC"
default="5"
>
<option value="5">J5</option>
<option value="10">J10</option>
<option value="15">J15</option>
<option value="20">J20</option>
<option value="25">J25</option>
<option value="30">J30</option>
<option value="50">J50</option>
<option value="100">J100</option>
<option value="0">JALL</option>
</field>
<field
name="filter_field"
type="list"
label="JGLOBAL_FILTER_FIELD_LABEL"
description="JGLOBAL_FILTER_FIELD_DESC"
default=""
useglobal="true"
>
<option value="hide">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="introtext_limit"
type="number"
label="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_LABEL"
description="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_DESC"
default="1000"
/>
</fieldset>
<!-- Articles options. -->
<fieldset name="articles"
label="COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL"
>
<field
name="show_intro"
type="list"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
class="chzn-color"
default="1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="info_block_position"
type="list"
label="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL"
description="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE</option>
<option value="1">COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW</option>
<option value="2">COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT</option>
</field>
<field
name="show_category"
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_category"
type="list"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_parent_category"
type="list"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
useglobal="true"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_parent_category"
type="list"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
useglobal="true"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="link_titles"
type="list"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
class="chzn-color"
default="1"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_author"
type="list"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_author"
type="list"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
useglobal="true"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_create_date"
type="list"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_modify_date"
type="list"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_publish_date"
type="list"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
class="chzn-color"
default="1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_hits"
type="list"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</fields>
</metadata>
<?php
/**
* @package Joomla.Site
* @subpackage com_content_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$params = $this->params;
?>
<div id="archive-items">
<?php foreach ($this->items as $i => $item) : ?>
<?php $info = $item->params->get('info_block_position', 0); ?>
<div class="row<?php echo $i % 2; ?>" itemscope itemtype="https://schema.org/Article">
<div class="page-header">
<h2 itemprop="headline">
<?php if ($params->get('link_titles')) : ?>
<?php
$url = JRoute::_(ContentCustomHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
$url = "information/" . end(explode("/", $url));
?>
<a href="<?php echo $url; ?>" itemprop="url">
<?php echo $this->escape($item->title); ?>
</a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
</h2>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $item->event->afterDisplayTitle; ?>
<?php if ($params->get('show_author') && !empty($item->author )) : ?>
<div class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person">
<?php $author = $item->created_by_alias ?: $item->author; ?>
<?php $author = '<span itemprop="name">' . $author . '</span>'; ?>
<?php if (!empty($item->contact_link) && $params->get('link_author') == true) : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author, array('itemprop' => 'url'))); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', $author); ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category')); ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<div class="article-info muted">
<dl class="article-info">
<dt class="article-info-term">
<?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?>
</dt>
<?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && !empty($item->parent_slug)) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catslug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($info == 0) : ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye-open"></span>
<meta itemprop="interactionCount" content="UserPageVisits:<?php echo $item->hits; ?>" />
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>
</dl>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $item->event->beforeDisplayContent; ?>
<?php if ($params->get('show_intro')) : ?>
<div class="intro" itemprop="articleBody"> <?php echo JHtml::_('string.truncateComplex', $item->introtext, $params->get('introtext_limit')); ?> </div>
<?php endif; ?>
<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
<div class="article-info muted">
<dl class="article-info">
<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?></dt>
<?php if ($info == 1) : ?>
<?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && $item->parent_slug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catslug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified">
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye-open"></span>
<meta content="UserPageVisits:<?php echo $item->hits; ?>" itemprop="interactionCount" />
<?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
</dl>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $item->event->afterDisplayContent; ?>
</div>
<?php endforeach; ?>
</div>
<div class="pagination">
<p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php
/**
* @package Joomla.Site
* @subpackage com_conten_custom
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Content component
*
* @since 1.5
*/
class ContentViewArchive extends JViewLegacy
{
protected $state = null;
protected $item = null;
protected $items = null;
protected $pagination = null;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
$user = JFactory::getUser();
$state = $this->get('State');
$items = $this->get('Items');
$pagination = $this->get('Pagination');
// Flag indicates to not add limitstart=0 to URL
$pagination->hideEmptyLimitstart = true;
// Get the page/component configuration
$params = &$state->params;
JPluginHelper::importPlugin('content_custom');
foreach ($items as $item)
{
$item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid;
$item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id;
// No link for ROOT category
if ($item->parent_alias === 'root')
{
$item->parent_slug = null;
}
$item->event = new stdClass;
$dispatcher = JEventDispatcher::getInstance();
// Old plugins: Ensure that text property is available
if (!isset($item->text))
{
$item->text = $item->introtext;
}
$dispatcher->trigger('onContentPrepare', array ('com_content_custom.archive', &$item, &$item->params, 0));
// Old plugins: Use processed text as introtext
$item->introtext = $item->text;
$results = $dispatcher->trigger('onContentAfterTitle', array('com_content_custom.archive', &$item, &$item->params, 0));
$item->event->afterDisplayTitle = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content_custom.archive', &$item, &$item->params, 0));
$item->event->beforeDisplayContent = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay', array('com_content_custom.archive', &$item, &$item->params, 0));
$item->event->afterDisplayContent = trim(implode("\n", $results));
}
$this->filter = $state->get('list.filter');
$this->items = &$items;
$this->params = &$params;
$this->user = &$user;
$this->pagination = &$pagination;
$this->pagination->setAdditionalUrlParam('month', $state->get('filter.month'));
$this->pagination->setAdditionalUrlParam('year', $state->get('filter.year'));
$this->_prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}
}
}
# 月次アーカイブ用モジュール
公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。
インストールしていない場合は、管理画面よりインストールする必要があります。
## インストール手順
1. 管理画面ログイン
2. エクステンション配下の管理を選択
3. (フォルダからインストール)を選択
4. フォームにインストールするモジュールまたは、コンポーネントのフォルダを指定(例:/var/www/html/src/com/com_hoge)
5. チェックしてインストール
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
MOD_ARTICLES_ARCHIVE_CUSTOM="Articles - Archived - custom"
MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="# of Months"
MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="The number of months to display (the default is 10)."
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."
MOD_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s"
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
MOD_ARTICLES_ARCHIVE_CUSTOM="Articles - Archived - custom"
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."
MOD_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="Default"
\ No newline at end of file
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_archive
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Helper for mod_articles_archive
*
* @since 1.5
*/
class ModArchiveHelper
{
/**
* Retrieve list of archived articles
*
* @param \Joomla\Registry\Registry &$params module parameters
*
* @return array
*
* @since 1.5
*/
public static function getList(&$params)
{
// Get database
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($query->month($db->quoteName('created')) . ' AS created_month')
->select('MIN(' . $db->quoteName('created') . ') AS created')
->select($query->year($db->quoteName('created')) . ' AS created_year')
->from('#__content')
->where('state = 1')
->group($query->year($db->quoteName('created')) . ', ' . $query->month($db->quoteName('created')))
->order($query->year($db->quoteName('created')) . ' DESC, ' . $query->month($db->quoteName('created')) . ' DESC');
// Filter by language
if (JFactory::getApplication()->getLanguageFilter())
{
$query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
}
$db->setQuery($query, 0, (int) $params->get('count'));
try
{
$rows = (array) $db->loadObjectList();
}
catch (RuntimeException $e)
{
JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return array();
}
$app = JFactory::getApplication();
$menu = $app->getMenu();
$item = $menu->getItems('link', 'index.php?option=com_content_custom&view=archive', true);
$itemid = (isset($item) && !empty($item->id)) ? '&Itemid=' . $item->id : '';
$i = 0;
$lists = array();
foreach ($rows as $row)
{
$date = JFactory::getDate($row->created);
$createdMonth = $date->format('n');
$createdYear = $date->format('Y');
$createdYearCal = JHtml::_('date', $row->created, 'Y') . "年";
$monthNameCal = JHtml::_('date', $row->created, 'F');
$createdDateCal = $createdYearCal . $monthNameCal;
$lists[$i] = new stdClass;
$lists[$i]->link = JRoute::_('index.php?option=com_content_custom&view=archive&year=' . $createdYear . '&month=' . $createdMonth . $itemid);
$lists[$i]->text = JText::sprintf($createdDateCal);
$i++;
}
return $lists;
}
}
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
MOD_ARTICLES_ARCHIVE_CUSTOM="カスタムアーカイブ(モジュール)"
MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="表示月数"
MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="表示する月数(標準は10)です。"
MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。"
MOD_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s"
\ No newline at end of file
; Joomla! Project
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
MOD_ARTICLES_ARCHIVE_CUSTOM="カスタムアーカイブ(モジュール)"
MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。"
MOD_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="標準"
\ No newline at end of file
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_archive
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the archive functions only once
JLoader::register('ModArchiveHelper', __DIR__ . '/helper.php');
$params->def('count', 10);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$list = ModArchiveHelper::getList($params);
require JModuleHelper::getLayoutPath('mod_articles_archive_custom', $params->get('layout', 'default'));
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1" client="site" method="upgrade">
<name>MOD_ARTICLES_ARCHIVE_CUSTOM</name>
<author>T.Tokudome</author>
<creationDate>June 2020</creationDate>
<copyright></copyright>
<license></license>
<authorEmail>tokudome@lilli.co.jp</authorEmail>
<authorUrl></authorUrl>
<version>0.0.1</version>
<description>MOD_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION</description>
<files>
<filename module="mod_articles_archive_custom">mod_articles_archive_custom.php</filename>
<folder>tmpl</folder>
<filename>helper.php</filename>
</files>
<languages>
<language tag="en-GB">en-GB.mod_articles_archive_custom.ini</language>
<language tag="en-GB">en-GB.mod_articles_archive_custom.sys.ini</language>
<language tag="ja-JP">ja-JP.mod_articles_archive_custom.ini</language>
<language tag="ja-JP">ja-JP.mod_articles_archive_custom.sys.ini</language>
</languages>
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_ARCHIVE" />
<config>
<fields name="params">
<fieldset name="basic">
<field
name="count"
type="number"
label="MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL"
description="MOD_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC"
default="120"
filter="integer"
/>
</fieldset>
<fieldset name="advanced">
<field
name="layout"
type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_MODULE_LAYOUT_DESC"
/>
<field
name="moduleclass_sfx"
type="textarea"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
rows="3"
/>
<field
name="cache"
type="list"
label="COM_MODULES_FIELD_CACHING_LABEL"
description="COM_MODULES_FIELD_CACHING_DESC"
default="1"
filter="integer"
>
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
</field>
<field
name="cache_time"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="900"
filter="integer"
/>
<field
name="cachemode"
type="hidden"
default="static"
>
<option value="static"></option>
</field>
</fieldset>
</fields>
</config>
</extension>
\ No newline at end of file
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_archive
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php if (!empty($list)) : ?>
<ul class="archive-module-custom<?php echo $moduleclass_sfx; ?> mod-list">
<?php foreach ($list as $item) : ?>
<li>
<a href="<?php echo $item->link; ?>">
<?php echo $item->text; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
......@@ -61,7 +61,8 @@ a.outlink {
color: #009fa8;
}
.item-page h4 a,
.blog h4 a {
.blog h4 a,
.archive-custom h4 a {
background: url(../images/bg_arrow01.png) no-repeat left 4px;
min-height: 20px;
padding-left: 25px;
......@@ -74,7 +75,11 @@ a.outlink {
.blog h4 a:link,
.blog h4 a:active,
.blog h4 a:hover,
.blog h4 a:visited {
.blog h4 a:visited,
.archive-custom h4 a:link,
.archive-custom h4 a:active,
.archive-custom h4 a:hover,
.archive-custom h4 a:visited {
color: #fff !important;
}
.sp, .sp_gnavi {
......@@ -87,7 +92,8 @@ a.outlink {
display: none;
}
.item-page .icons,
.blog .icons {
.blog .icons,
.archive-custom .icons {
/*display: none;*/
}
table {
......@@ -273,6 +279,7 @@ h1, h2, h3, h4, h5, h6, .site-title {
line-height: 1;
margin: 0;
}
/* 記述エラーで機能していないため、コメントアウト
.item-page h2,
.item-page h3,
.item-page h4,
......@@ -283,16 +290,23 @@ h1, h2, h3, h4, h5, h6, .site-title {
.blog h4,
.blog h5,
.archive-custom h2,
.archive-custom h3,
.archive-custom h4,
.archive-custom h5,
#content h2,
#content h3,
#content h4,
#content h5, {
line-height: 1.3;
}
} */
.item-page h2,
body.com_monthlyarchive h2,
.blog .page-header h2,
.blog h2 {
.blog h2,
.archive-custom .page-header h2,
.archive-custom h2 {
font-size: 150%;
color: #222;
font-weight: normal;
......@@ -304,7 +318,7 @@ body.com_monthlyarchive h2,
.uk-scope .uk-margin-top {
margin-top: 9px !important;
}
#content h3, .item-page h3, .blog h3 {
#content h3, .item-page h3, .blog h3, .archive-custom h3 {
border-left: 5px solid #003894;
font-size: 130%;
font-weight: normal;
......@@ -313,7 +327,7 @@ body.com_monthlyarchive h2,
margin-top: 20px;
padding: 10px 0 10px 15px;
}
.item-page h4, .blog h4 {
.item-page h4, .blog h4, .archive-custom h4 {
background-color: #00857F;
color: #fff;
font-size: 110%;
......@@ -322,7 +336,7 @@ body.com_monthlyarchive h2,
margin-top: 50px;
padding: 7px 10px;
}
.item-page h5, .blog h5 {
.item-page h5, .blog h5, .archive-custom h5 {
font-size: 120%;
font-weight: normal;
background: url(../images/bg_h5.png) no-repeat left center;
......@@ -539,14 +553,19 @@ div.search input.button {
.blog .subnavi01 ol,
.blog .subnavi01 ul,
.blog .subnavi01 ul.style01 {
.blog .subnavi01 ul.style01,
.archive-custom .subnavi01 ol,
.archive-custom .subnavi01 ul,
.archive-custom .subnavi01 ul.style01 {
overflow: hidden;
margin: 0;
}
.item-page .subnavi01 ol li,
.item-page .subnavi01 ul li,
.blog .subnavi01 ol li,
.blog .subnavi01 ul li {
.blog .subnavi01 ul li,
.archive-custom.subnavi01 ol li,
.archive-custom .subnavi01 ul li {
float: left;
list-style-type: none;
width: 33.3%;
......@@ -558,24 +577,29 @@ div.search input.button {
.item-page .subnavi01 ul.style01 li,
.item-page .subnavi01 ol.style01 li,
.blog .subnavi01 ul.style01 li,
.blog .subnavi01 ol.style01 li {
.blog .subnavi01 ol.style01 li,
.archive-custom .subnavi01 ul.style01 li,
.archive-custom .subnavi01 ol.style01 li {
width: 50%;
padding-right: 20px;
box-sizing: border-box;
}
.item-page .subnavi01 ol.style01 li,
.blog .subnavi01 ol.style01 li {
.blog .subnavi01 ol.style01 li,
.archive-custom .subnavi01 ol.style01 li {
border: none;
padding-bottom: inherit;
margin-bottom: 15px;
}
.item-page .subnavi01 ul.style02 li,
.blog .subnavi01 ul.style02 li {
.blog .subnavi01 ul.style02 li,
.archive-custom .subnavi01 ul.style02 li {
width: inherit;
}
.item-page .subnavi01 ul.style03 li,
.blog .subnavi01 ul.style03 li {
.blog .subnavi01 ul.style03 li,
.archive-custom .subnavi01 ul.style03 li {
width: auto;
float: none;
}
......@@ -1097,7 +1121,8 @@ div#n2-ss-64 .n2-ss-slide {
overflow: hidden;
}
.item-page #topinfo_twitarea h2,
.blog #topinfo_twitarea h2 {
.blog #topinfo_twitarea h2,
.archive-custom #topinfo_twitarea h2 {
border: none;
text-align: center;
margin: 0 0 20px;
......@@ -1475,7 +1500,8 @@ table.Cindex .ph {
margin-bottom: 15px;
}
.item-page table.Cindex ul,
.blog table.Cindex ul{
.blog table.Cindex ul,
.archive-custom table.Cindex ul {
margin: 0;
font-size: 90%;
}
......@@ -1528,7 +1554,8 @@ td.num01 {
}
.item-page table ul,
.blog table ul {
.blog table ul,
.archive-custom table ul {
margin: 0 0 0 15px;
}
......@@ -1575,16 +1602,19 @@ table.style01 th.group {
width: 12%;
}
.item-page table.style01 ul li,
.blog table.style01 ul li {
.blog table.style01 ul li,
.archive-custom table.style01 ul li {
list-style-type: none;
margin: 0;
}
.item-page table.style01 ul.mark,
.blog table.style01 ul.mark {
.blog table.style01 ul.mark,
.archive-custom table.style01 ul.mark {
margin-left: 20px;
}
.item-page table.style01 ul.mark li,
.blog table.style01 ul.mark li {
.blog table.style01 ul.mark li,
.archive-custom table.style01 ul.mark li {
list-style-type: disc;
margin-bottom: 7px;
}
......@@ -1695,33 +1725,40 @@ address .title {
ul, ol {
}
.item-page ul, .item-page ol,
.blog ul, .blog ol {
.blog ul, .blog ol,
.archive-custom ul, .archive-custom ol {
margin-bottom: 30px;
}
.item-page ul ul, .item-page ol ul,
.item-page ul ol, .item-page ol ol,
.blog ul ul, .blog ol ul,
.blog ul ol, .blog ol ul {
.blog ul ol, .blog ol ul,
.archive-custom ul ul, .archive-custom ol ul,
.archive-custom ul ol, .archive-custom ol ul {
margin-left: 20px;
margin-top: 10px;
}
.item-page ul li, .item-page ol li,
.blog ul li, .blog ol li {
.blog ul li, .blog ol li,
.archive-custom ul li, .archive-custom ol li {
margin-bottom: 12px;
margin-bottom: 15px;
}
.item-page ul li,
.blog ul li {
.blog ul li,
.archive-custom ul li {
list-style-type: disc;
line-height: 1.5;
}
.item-page li ul
.blog li ul {
.blog li ul,
.archive-custom li ul {
margin-top: 15px;
}
.item-page ul.kome,
.blog ul.kome {
.blog ul.kome,
.archive-custom ul.kome {
/*margin-left: 10px;*/
}
.item-page ul.kome li,
......@@ -1739,17 +1776,20 @@ ol li .title {
padding-bottom: 5px;
}
.item-page ol.style01 li,
.blog ol.style01 li {
.blog ol.style01 li,
.archive-custom ol.style01 li {
border-bottom: 1px solid #b3caf0;
padding-bottom: 10px;
margin-bottom: 20px;
}
.item-page ol.style01 li ul,
.blog ol.style01 li ul {
.blog ol.style01 li ul,
.archive-custom ol.style01 li ul {
margin-bottom: 0;
}
.item-page ol.style01 li li,
.blog ol.style01 li li {
.blog ol.style01 li li,
.archive-custom ol.style01 li li {
border: none;
margin-bottom: 10px;
}
......@@ -1920,7 +1960,8 @@ dl.article-info dd.create {
margin-bottom: 20px;
}
.item-page .bikoubox01 ul.kome,
.blog .bikoubox01 ul.kome {
.blog .bikoubox01 ul.kome,
.archive-custom .bikoubox01 ul.kome {
margin-left: 0;
}
.bikoubox01 .title {
......@@ -2102,7 +2143,13 @@ table.listimg td {
.blog .wrap_fac .subnavi02 ul li a:link,
.blog .wrap_fac .subnavi02 ul li a:active,
.blog .wrap_fac .subnavi02 ul li a:hover,
.blog .wrap_fac .subnavi02 ul li a:visited {
.blog .wrap_fac .subnavi02 ul li a:visited,
.archive-custom .wrap_fac .subnavi02 ul li a,
.archive-custom .wrap_fac .subnavi02 ul li a:link,
.archive-custom .wrap_fac .subnavi02 ul li a:active,
.archive-custom .wrap_fac .subnavi02 ul li a:hover,
.archive-custom .wrap_fac .subnavi02 ul li a:visited {
color: #333 !important;
}
......@@ -2210,7 +2257,8 @@ table.listimg td {
/*競技成績一覧ページ
https://www.nifs-k.ac.jp/campus-life/activities/record.html
*/
body.itemid-795 .blog .cat-children {
body.itemid-795 .blog .cat-children,
body.itemid-795 .archive-custom .cat-children {
display: none;
}
......@@ -2272,7 +2320,19 @@ body.itemid-795 .blog .cat-children {
.blog #wrap_sitemap a:link,
.blog #wrap_sitemap a:active,
.blog #wrap_sitemap a:hover,
.blog #wrap_sitemap a:visited {
.blog #wrap_sitemap a:visited,
.archive-custom #wrap_sitemap ul li a,
.archive-custom #wrap_sitemap ul li a:link,
.archive-custom #wrap_sitemap ul li a:active,
.archive-custom #wrap_sitemap ul li a:hover,
.archive-custom #wrap_sitemap ul li a:visited,
.archive-custom #wrap_sitemap a,
.archive-custom #wrap_sitemap a:link,
.archive-custom #wrap_sitemap a:active,
.archive-custom #wrap_sitemap a:hover,
.archive-custom #wrap_sitemap a:visited {
color: #003894;
}
......@@ -2350,17 +2410,20 @@ body.itemid-795 .blog .cat-children {
/* -------------------------------------------------------------------------
ブログ系(information)
------------------------------------------------------------------------- */
/*.blog .page-header h2 {
/*.blog .page-header h2,
.archive-custom .page-header h2 {
margin-top: 30px;
font-size: 130%;
padding-bottom: 17px;
padding-top: 17px;
}*/
.blog a:link, .blog a:active, .blog a:hover, .blog a:visited {
.blog a:link, .blog a:active, .blog a:hover, .blog a:visited,
.archive-custom a:link, .archive-custom a:active, .archive-custom a:hover, .archive-custom a:visited {
color: #009fa8;
}
body.itemid-792 .blog .cat-children {
body.itemid-792 .blog .cat-children,
body.itemid-792 .archive-custom .cat-children {
display: none;
}
......@@ -3039,12 +3102,14 @@ body.itemid-132 table {
}
.item-page .subnavi01 ol li, .item-page .subnavi01 ul li,
.blog .subnavi01 ol li, .blog .subnavi01 ul li {
.blog .subnavi01 ol li, .blog .subnavi01 ul li,
.archive-custom .subnavi01 ol li, .archive-custom .subnavi01 ul li {
width: auto;
margin-right: 30px;
}
.item-page .subnavi01 ul.style01 li, .item-page .subnavi01 ol.style01 li,
.blog .subnavi01 ul.style01 li, .blog .subnavi01 ol.style01 li {
.blog .subnavi01 ul.style01 li, .blog .subnavi01 ol.style01 li,
.archive-custom .subnavi01 ul.style01 li, .archive-custom .subnavi01 ol.style01 li {
width: 100%;
float: none;
}
......@@ -3186,7 +3251,7 @@ body.itemid-132 table {
}
/*見出し*/
.item-page h2, body.com_monthlyarchive h2, .blog .page-header h2, .blog h2 {
.item-page h2, body.com_monthlyarchive h2, .blog .page-header h2, .blog h2, .archive-custom .page-header h2, .archive-custom h2 {
font-size: 130%;
padding-bottom: 20px;
padding-top: 20px;
......@@ -3271,12 +3336,12 @@ body.itemid-132 table {
}
@media (max-width: 400px) {
.item-page h2, .blog h2 {
.item-page h2, .blog h2, .archive-custom h2 {
font-size: 140%;
padding-top: 20px;
padding-bottom: 20px;
}
.item-page h3, .blog h3 {
.item-page h3, .blog h3, .archive-custom h3 {
margin-bottom: 15px;
padding-left: 10px;
font-size: 120%;
......@@ -3361,5 +3426,10 @@ body.itemid-132 table {
}
}
/* -------------------------------------------------------------------------
 app/modules/mod_articles_archive_custom/tmpl/default.phpのスタイルを変更
------------------------------------------------------------------------- */
.archive-module-custom {
height: 460px;
overflow: auto;
}
\ No newline at end of file
......
......@@ -203,37 +203,51 @@ if ($this->params->get('logoFile')) {
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<script>
jQuery(function($) {
var obj = $("#aside");
var offset = $(obj).offset();
var topPadding = 135;
var sW = window.innerWidth;
var sH = window.innerHeight;
var cW = obj.width();
var cH = obj.height();
var cwrapH = $("#c_wrap").height();
if (cH) {
if (sH > cH) {
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
if ($(window).scrollTop() < cwrapH) {
window.onload = function() {
jQuery(function($) {
var obj = $("#aside");
var sW = window.innerWidth;
var sH = window.innerHeight;
var cW = obj.width();
var cH = obj.height();
var cwrapH = $("#c_wrap").height();
// 特定のページではスクロールしない
var excludedPages = [".record-page"];
var excludedPagesSelector = excludedPages.join(', ');
var isExcluded = false;
if (document.querySelector(excludedPagesSelector)) {
isExcluded = true;
}
var customHeight = $(".custom").height();
var paddingTop = customHeight - 80;
if (cH) {
if (sH > cH) {
if (isExcluded) return false;
$(window).resize(function() {
customHeight = $(".custom").height();
paddingTop = customHeight - 80;
});
$(window).scroll(function() {
if ($(window).scrollTop() > customHeight) {
if ($(window).scrollTop() < cwrapH) {
$(obj).stop().animate({
duration: 'fast',
marginTop: $(window).scrollTop() - paddingTop
});
} else {
$(obj).stop().animate({});
}
} else {
$(obj).stop().animate({
duration: 'fast',
marginTop: $(window).scrollTop() - offset.top + topPadding
marginTop: 0
});
} else {
$(obj).stop().animate({});
}
} else {
$(obj).stop().animate({
marginTop: 0
});
}
});
});
}
}
}
});
});
};
</script>
</head>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!