Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<javascript app="blog">
<file javascript_app="blog" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.grid.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
<file javascript_app="blog" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.grid.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -37,7 +37,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="blog" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
<file javascript_app="blog" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="blog" version="103005">
<app key="blog" version="103038">
<word key="__app_blog" js="0">Blogs</word>
<word key="frontnavigation_blogs" js="0">Blogs</word>
<word key="__indefart_blog_entry_comment" js="0">a comment on a blog entry</word>
+4 -4
View File
@@ -491,9 +491,9 @@
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"length": 20,
"name": "entry_author_id",
"type": "INT",
"type": "BIGINT",
"unsigned": false,
"values": [],
"zerofill": false
@@ -603,9 +603,9 @@
"comment": "",
"decimals": null,
"default": null,
"length": 10,
"length": 20,
"name": "entry_last_comment_mid",
"type": "INT",
"type": "BIGINT",
"unsigned": false,
"values": [],
"zerofill": false
+16 -12
View File
@@ -57,7 +57,7 @@
<div class='ipsBox'>
{$table|raw}
</div>]]></template>
<template template_group="browse" template_name="indexButtons" template_data="$blogs=array(), $viewMode" template_location="front" template_app="blog"><![CDATA[{{if count( $blogs ) || \IPS\blog\Blog::canCreate()}}
<template template_group="browse" template_name="indexButtons" template_data="$blogs=array(), $viewMode" template_location="front" template_app="blog"><![CDATA[{{if count( $blogs ) || \IPS\blog\Blog::canCreate() || \IPS\Settings::i()->blog_allow_grid}}
<ul class="ipsToolList ipsToolList_horizontal ipsClearfix ipsSpacer_bottom">
{{if count( $blogs )}}
<li class='ipsToolList_primaryAction'>
@@ -85,7 +85,8 @@
{{endforeach}}
{{endif}}
</li>
{{if \IPS\Settings::i()->blog_allow_grid}}
{{endif}}
{{if \IPS\Settings::i()->blog_allow_grid}}
<li class='ipsType_center'>
<ul class='ipsButton_split'>
<li class='ipsType_center'>
@@ -96,7 +97,8 @@
</li>
</ul>
</li>
{{endif}}
{{endif}}
{{if count( $blogs )}}
{{if count( $blogs ) > 1}}
<li class='ipsType_center'>
<a href='{url="app=blog&module=blogs&controller=browse&page=1&filter=my_blogs&sortby=blog_last_edate" seoTemplate="blogs"}' data-ipsMenu id='elMyBlogs' class='ipsButton ipsButton_medium ipsButton_fullWidth ipsButton_link'>{lang="my_blogs"} <i class='fa fa-caret-down'></i></a>
@@ -171,7 +173,7 @@
{template="pagination" app="core" location="global" group="global" params="$pagination['url'], $pagination['pages'], $pagination['page'], $pagination['perpage'], TRUE, 'page'"}
{{endif}}]]></template>
<template template_group="browse" template_name="indexGridEntry" template_data="$entry, $primary=false, $table=false" template_location="front" template_app="blog"><![CDATA[<article class='cBlog_grid_item ipsClear ipsClearfix ipsBox ipsSpacer_bottom {{if $entry->hidden() OR $entry->status === 'draft'}}ipsModerated{{endif}}'>
<div class='cBlog_grid_catBadge'><a href="{$entry->container()->url()}">{$entry->container()->_title}</a></div>
{{if !\IPS\Request::i()->id}}<div class='cBlog_grid_catBadge'><a href="{$entry->container()->url()}">{$entry->container()->_title}</a></div>{{endif}}
{{if $table and $table->canModerate()}}
{{$idField = $entry::$databaseColumnId;}}
<input type='checkbox' data-role='moderation' name="moderate[{$entry->$idField}]" data-actions="{expression="implode( ' ', $table->multimodActions( $entry ) )"}" data-state='{{if $entry->tableStates()}}{$entry->tableStates()}{{endif}}'>
@@ -384,7 +386,7 @@
<p class='ipsType_normal ipsType_light ipsType_blendLinks ipsType_reset'>
{{if $entry->container()->owner() instanceof \IPS\Member}}
{lang="blog_by" htmlsprintf="$entry->container()->owner()->link()"}
{{elseif $club = $blog->club()}}
{{elseif $club = $entry->container()->club()}}
<i class='fa fa-users'></i> {lang="club_blog_for" sprintf="$club->name"}
{{else}}
<i class='fa fa-users'></i> {lang="group_blog_by" sprintf="\IPS\Member::loggedIn()->language()->addToStack( 'blogs_groupblog_name_' . $entry->container()->id )"}
@@ -450,7 +452,7 @@
{{if $blog->latestEntry()}}
<hr class='ipsHr'>
<p class='ipsType_medium ipsType_reset ipsSpacer_top ipsSpacer_half ipsType_blendLinks'>
<span class='ipsType_light'>{lang="latest_entry"}:</span> <a href='{$blog->latestEntry()->url}' title="{$blog->latestEntry()->mapped('title')}">{$blog->latestEntry()->mapped('title')}</a>
<span class='ipsType_light'>{lang="latest_entry"}:</span> <a href='{$blog->latestEntry()->url()}' title="{$blog->latestEntry()->mapped('title')}">{$blog->latestEntry()->mapped('title')}</a>
</p>
{{endif}}
</div>
@@ -1410,11 +1412,11 @@
<li class='ipsMenu_item'>
<a href='{$blog->url()->setQueryString( array( 'do' => 'editBlog', 'csrfKey' => \IPS\Session::i()->csrfKey ) )}' title="{lang="edit_blog"}" data-ipsDialog data-ipsDialog-title="{lang="edit_blog"}">{lang="edit_blog"}</a>
</li>
{{if \IPS\Settings::i()->blog_allow_rssimport }}
<li class='ipsMenu_item'>
<a href='{$blog->url()->setQueryString( array( 'do' => 'rssImport', 'csrfKey' => \IPS\Session::i()->csrfKey ) )}' title="{lang="blog_rss_import"}" data-ipsDialog data-ipsDialog-title="{lang="blog_rss_import"}">{lang="blog_rss_import"}</a>
</li>
{{endif}}
{{endif}}
{{if $blog->canEdit() AND \IPS\Settings::i()->blog_allow_rssimport }}
<li class='ipsMenu_item'>
<a href='{$blog->url()->setQueryString( array( 'do' => 'rssImport', 'csrfKey' => \IPS\Session::i()->csrfKey ) )}' title="{lang="blog_rss_import"}" data-ipsDialog data-ipsDialog-title="{lang="blog_rss_import"}">{lang="blog_rss_import"}</a>
</li>
{{endif}}
{{if $blog->pinned and \IPS\Member::loggedIn()->modPermission('can_unpin_content')}}
@@ -1841,7 +1843,7 @@ html[dir="rtl"] .cBlogInfo {
}
.cBlockView_stats {
max-width: 300px;
max-width: 80%;
}
.cBlockView_stats > li {
@@ -2076,6 +2078,8 @@ html[dir=&quot;rtl&quot;] .cBlogEmbed .ipsRichEmbed_moreInfo .ipsNotificationCou
flex-direction: column;
cursor: pointer;
position: relative;
-webkit-flex-basis: calc(50% - 2px);
flex-basis: calc(50% - 2px);
}
.cBlog_grid .cBlog_grid_item [data-role='moderation'] {
+35 -1
View File
@@ -245,9 +245,43 @@
"102046": "4.2.7",
"102047": "4.2.8",
"102048": "4.2.8",
"102049": "4.2.9",
"103000": "4.3.0 Beta 1",
"103002": "4.3.0 Beta 2",
"103003": "4.3.0 Beta 3",
"103004": "4.3.0 Beta 4",
"103005": "4.3.0"
"103005": "4.3.0",
"103006": "4.3.1",
"103007": "4.3.1",
"103008": "4.3.1",
"103009": "4.3.2",
"103010": "4.3.2",
"103011": "4.3.3",
"103012": "4.3.3",
"103013": "4.3.3",
"103014": "4.3.3",
"103015": "4.3.3",
"103016": "4.3.3",
"103017": "4.3.3",
"103018": "4.3.3",
"103019": "4.3.3",
"103020": "4.3.3",
"103021": "4.3.4",
"103022": "4.3.4",
"103023": "4.3.4",
"103024": "4.3.4",
"103025": "4.3.4",
"103026": "4.3.5 Beta 1",
"103027": "4.3.5 Beta 2",
"103028": "4.3.5",
"103029": "4.3.5",
"103030": "4.3.5",
"103031": "4.3.5",
"103032": "4.3.5",
"103033": "4.3.6 Beta 1",
"103034": "4.3.6 Beta 2",
"103035": "4.3.6",
"103036": "4.3.6",
"103037": "4.3.6",
"103038": "4.3.6"
}
@@ -49,14 +49,15 @@ class _Blogs
/**
* Permission check for attachments
*
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param array $attachment The attachment data
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
* @return bool
*/
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
{
/* The attachment is attached to a comment */
if ( $id2 )
@@ -49,14 +49,15 @@ class _Entries
/**
* Permission check for attachments
*
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param array $attachment The attachment data
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
* @return bool
*/
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
{
return \IPS\blog\Entry::load( $id1 )->canView( $member );
}
@@ -70,13 +70,13 @@ class _Blog
* Get where clause to add to the member retrieval database query
*
* @param mixed $data The array returned from the save() method
* @return string|array|NULL Where clause
* @return array|NULL Where clause - must be a single array( "clause", ...binds )
*/
public function getQueryWhereClause( $data )
{
if( isset( $data['has_blog'] ) )
{
return ( $data['has_blog'] == 'yes' ) ? array( array( "blog_blogs.blog_id IS NOT NULL" ) ) : array( array( "blog_blogs.blog_id IS NULL" ) );
return ( $data['has_blog'] == 'yes' ) ? array( "blog_blogs.blog_id IS NOT NULL" ) : array( "blog_blogs.blog_id IS NULL" );
}
return NULL;
+23 -10
View File
@@ -94,40 +94,53 @@ class _blogs extends \IPS\Node\Controller
}
);
/* Row buttons */
$table->rowButtons = function( $row )
{
$blog = \IPS\blog\Blog::constructFromData( $row );
return array(
'edit' => array(
$return = array();
if ( $blog->canEdit() )
{
$return['edit'] = array(
'icon' => 'pencil',
'title' => 'edit',
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=form&id=' ) . $row['blog_id'],
'data' => array(),
'hotkey'=> 'e return'
),
'copy' => array(
);
}
$return['copy'] = array(
'icon' => 'files-o',
'title' => 'copy',
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=copy&id=' ) . $row['blog_id'],
'data' => array()
),
'content' => array(
);
$return['content'] =
array(
'icon' => 'arrow-right',
'title' => 'mass_manage_content',
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=massManageContent&id=' ) . $row['blog_id'],
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('empty') ),
'hotkey'=> 'm'
),
'delete' => array(
);
if ( $blog->canDelete() )
{
$return['delete'] = array(
'icon' => 'times-circle',
'title' => 'delete',
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=delete&id=' ) . $row['blog_id'],
'data' => ( $blog->getContentItemCount() ) ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('delete') ) : array( 'delete' => '' ),
'hotkey'=> 'd'
)
);
);
}
return $return;
};
/* Root buttons */
@@ -64,8 +64,8 @@ class _browse extends \IPS\Dispatcher\Controller
}
/* @note We cannot check individual member permissions here, so entries in draft status are excluded. */
$count = \IPS\blog\Entry::getItemsWithPermission( array( "entry_status!=?", 'draft' ), 'entry_date desc', NULL, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, FALSE, FALSE, FALSE, TRUE );
$entries = \IPS\blog\Entry::getItemsWithPermission( array( "entry_status!=?", 'draft' ), 'entry_date desc', array( ( $perpage * ( $page - 1 ) ), $perpage ) );
$count = \IPS\blog\Entry::getItemsWithPermission( array( array( "entry_status!=?", 'draft' ) ), 'entry_date desc', NULL, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, NULL, FALSE, FALSE, FALSE, TRUE );
$entries = \IPS\blog\Entry::getItemsWithPermission( array( array( "entry_status!=?", 'draft' ) ), 'entry_date desc', array( ( $perpage * ( $page - 1 ) ), $perpage ) );
$pagination = array(
'page' => $page,
'pages' => ceil( $count / $perpage ),
@@ -44,7 +44,11 @@ class _entry extends \IPS\Content\Controller
\IPS\Output::i()->error( 'node_error', '2B202/1', 403, '' );
}
if ( $this->entry->container()->cover_photo )
if( $this->entry->cover_photo )
{
\IPS\Output::i()->metaTags['og:image'] = \IPS\File::get( 'blog_Entries', $this->entry->cover_photo )->url;
}
elseif ( $this->entry->container()->cover_photo )
{
\IPS\Output::i()->metaTags['og:image'] = \IPS\File::get( 'blog_Blogs', $this->entry->container()->cover_photo )->url;
}
+4 -9
View File
@@ -171,11 +171,6 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
if ( $club = $this->club() )
{
if ( !$member->member_id )
{
return FALSE;
}
switch ( $permission )
{
case 'add':
@@ -249,7 +244,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
if ( $club = $this->club() )
{
if ( $club->type == $club::TYPE_PUBLIC or $club->type == $club::TYPE_READONLY )
if ( $club->type == $club::TYPE_PUBLIC or $club->type == $club::TYPE_READONLY or $club->type == $club::TYPE_OPEN)
{
return 'ca';
}
@@ -1221,14 +1216,14 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
{
$member = $member ?: \IPS\Member::loggedIn();
$where[] = array( 'blog_club_id IS NOT NULL' );
if ( $member->modPermission('can_access_all_clubs') )
{
return static::nodesWithPermission( NULL, $member, $where );
}
else
{
$where[] = array( 'blog_club_id IS NOT NULL' );
if ( $permissionCheck === 'add' )
{
$statuses = array( \IPS\Member\Club::STATUS_LEADER, \IPS\Member\Club::STATUS_MODERATOR );
@@ -1239,7 +1234,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
}
$where[] = array( \IPS\Db::i()->in( 'status', $statuses ) );
return new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'blog_blogs', $where )->join( 'core_clubs_memberships', array( 'club_id=blog_club_id AND member_id=?', \IPS\Member::loggedIn()->member_id ) ), get_called_class() );
return new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'blog_blogs', $where )->join( 'core_clubs_memberships', array( 'club_id=blog_club_id AND member_id=?', $member->member_id ) ), get_called_class() );
}
}
}
+3 -2
View File
@@ -84,7 +84,6 @@ class _Feed extends \IPS\Patterns\ActiveRecord
$entry = \IPS\blog\Entry::createItem( \IPS\Member::load( $this->member ), NULL, $article['date'], $container );
$entry->name = $article['title'];
$entry->content = \IPS\Text\Parser::parseStatic( $article['content'], TRUE );
if ( $article['link'] )
{
@@ -107,8 +106,10 @@ class _Feed extends \IPS\Patterns\ActiveRecord
}
$link = htmlspecialchars( $this->import_show_link, ENT_QUOTES | ENT_DISALLOWED, 'UTF-8', FALSE );
$entry->content .= "<br><p><a href='{$article['link']}' {$linkRelPart}>{$link}</a></p>";
$article['content'] .= "<br><p><a href='{$article['link']}' {$linkRelPart}>{$link}</a></p>";
}
$entry->content = \IPS\Text\Parser::parseStatic( $article['content'], TRUE, NULL, \IPS\Member::load( $this->member ) );
$entry->status = 'published';
$entry->save();
+6 -4
View File
@@ -323,11 +323,11 @@ class _Entry extends \IPS\Content\Item implements
$joins[] = array( 'from' => 'core_clubs', 'where' => 'core_clubs.id=blog_blogs.blog_club_id' );
if ( $member->member_id )
{
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR ' . \IPS\Db::i()->in( 'blog_blogs.blog_club_id', $member->clubs() ) . ' OR core_clubs.type=? OR core_clubs.type=? )', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY );
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR ' . \IPS\Db::i()->in( 'blog_blogs.blog_club_id', $member->clubs() ) . ' OR core_clubs.type=? OR core_clubs.type=? OR core_clubs.type=?)', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY, \IPS\Member\Club::TYPE_OPEN, );
}
else
{
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR core_clubs.type=? OR core_clubs.type=? )', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY );
$where[] = array( '( blog_blogs.blog_club_id IS NULL OR core_clubs.type=? OR core_clubs.type=? OR core_clubs.type=? )', \IPS\Member\Club::TYPE_PUBLIC, \IPS\Member\Club::TYPE_READONLY, \IPS\Member\Club::TYPE_OPEN, );
}
}
}
@@ -427,14 +427,16 @@ class _Entry extends \IPS\Content\Item implements
*/
public function processForm( $values )
{
$new = $this->_new;
parent::processForm( $values );
if ( !$this->_new )
if ( !$new )
{
$oldContent = $this->content;
}
$this->content = $values['blog_entry_content'];
if ( !$this->_new )
if ( !$new )
{
$this->sendAfterEditNotifications( $oldContent );
}