- 追加された行はこの色です。
- 削除された行はこの色です。
**概要 [#x1ca34dd]
tagプラグインは、一覧表示に積集合と差集合の機能はありますが和集合の機能がなかったので追加してみました。
**内容 [#j7aef615]
diff C3b tag.inc.php.orig tag.inc.php
*** tag.inc.php.orig Sat Jan 03 22:47:48 2015
--- tag.inc.php Sat Jan 03 22:31:51 2015
***************
*** 642,648 ****
*
* @static array
*/
! var $reserved_keys = array('prod' => '^', 'diff' => '-');
function Tag($items = array(), $tags = array(), $tagcloud = null)
{
--- 642,648 ----
*
* @static array
*/
! var $reserved_keys = array('prod' => '^', 'diff' => '-', 'add' => '+');
function Tag($items = array(), $tags = array(), $tagcloud = null)
{
***************
*** 1263,1268 ****
--- 1263,1271 ----
case $this->reserved_keys['diff']:
array_push($operands, $this->reserved_keys['diff']);
break;
+ case $this->reserved_keys['add']:
+ array_push($operands, $this->reserved_keys['add']);
+ break;
case $this->reserved_keys['prod']:
default:
array_push($operands, $this->reserved_keys['prod']);
***************
*** 1279,1284 ****
--- 1282,1290 ----
switch ($operands[$i]) {
case $this->reserved_keys['diff']:
$items = array_diff($items, $this->get_items($tag));
+ break;
+ case $this->reserved_keys['add']:
+ $items = array_unique(array_merge($items, $this->get_items($tag)));
break;
case $this->reserved_keys['prod']:
default:
**使用法 [#w4aa9bb7]
^(積集合) や -(差集合)と同様に + で和集合になります。
#taglist(タグ1+タグ2)
#comment