Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -98,7 +98,7 @@ class _forums extends \IPS\Node\Api\NodeController
|
||||
* @apiparam int sitemap_priority 1-9 1 highest priority
|
||||
* @apiparam int min_content The minimum amount of posts to be able to view
|
||||
* @apiparam int can_see_others 0|1 Users can see topics posted by other users?
|
||||
* @return \IPS\forums\Topic
|
||||
* @return \IPS\forums\Forum
|
||||
*/
|
||||
public function POSTitem( $id )
|
||||
{
|
||||
@@ -124,10 +124,10 @@ class _forums extends \IPS\Node\Api\NodeController
|
||||
/**
|
||||
* Create or update node
|
||||
*
|
||||
* @param \IPS\node\Model $node The node
|
||||
* @return \IPS\node\Model
|
||||
* @param \IPS\Node\Model $node The node
|
||||
* @return \IPS\Node\Model
|
||||
*/
|
||||
protected function _createOrUpdate( \IPS\node\Model $forum )
|
||||
protected function _createOrUpdate( \IPS\Node\Model $forum )
|
||||
{
|
||||
if ( !\IPS\Request::i()->title )
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="forums">
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.flow.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.flow.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -220,7 +220,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.forumList.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.forumList.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -287,7 +287,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.forumPage.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.forumPage.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -346,7 +346,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.hovercard.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.hovercard.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -396,7 +396,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="forums" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.archiveRules.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="forums" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.archiveRules.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -461,7 +461,7 @@
|
||||
});
|
||||
}(jQuery, _));
|
||||
]]></file>
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.answers.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.answers.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -559,7 +559,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.reply.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.reply.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -588,7 +588,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.view.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
||||
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.view.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="forums" version="103005">
|
||||
<app key="forums" version="103038">
|
||||
<word key="__app_forums" js="0">Forums</word>
|
||||
<word key="frontnavigation_forums" js="0">Forums</word>
|
||||
<word key="__indefart_post" js="0">a post in a topic</word>
|
||||
|
||||
@@ -2307,9 +2307,9 @@
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 10,
|
||||
"length": 20,
|
||||
"name": "archive_author_id",
|
||||
"type": "INT",
|
||||
"type": "BIGINT",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
|
||||
@@ -2182,7 +2182,7 @@
|
||||
{{if $comment->canReportOrRevoke() === TRUE}}
|
||||
<li><a href='{$comment->url('report')}' data-ipsDialog data-ipsDialog-remoteSubmit data-ipsDialog-size='medium' data-ipsDialog-flashMessage='{lang="report_submit_success"}' data-ipsDialog-title="{lang="report_post"}" data-action='reportComment' title='{lang="report_content"}' class='ipsFaded ipsFaded_more'><span class='ipsResponsive_showPhone ipsResponsive_inline'><i class='fa fa-flag'></i></span><span class='ipsResponsive_hidePhone ipsResponsive_inline'>{lang="report_post"}</span></a></li>
|
||||
{{endif}}
|
||||
{{if \IPS\Member::loggedIn()->modPermission('can_use_ip_tools') and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'modcp' ) )}}
|
||||
{{if $comment->ip_address and \IPS\Member::loggedIn()->modPermission('can_use_ip_tools') and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'modcp' ) )}}
|
||||
<li><span class='ipsResponsive_hidePhone ipsType_blendLinks'>(<a href="{url="app=core&module=modcp&controller=modcp&tab=ip_tools&ip=$comment->ip_address" seoTemplate="modcp_ip_tools"}">{lang="ip_prefix" sprintf="$comment->ip_address"}</a>) </span></li>
|
||||
{{endif}}
|
||||
{{if $comment->mapped('first') }}
|
||||
@@ -3111,7 +3111,7 @@
|
||||
{{if $poll->canVote() || !member.member_id}}
|
||||
<hr class='ipsHr'>
|
||||
{{if $poll->canVote()}}<a href="{$url->setQueryString( '_poll', 'form' )}" title='{lang="show_vote_options"}' class='ipsButton ipsButton_verySmall ipsButton_light' data-action='viewResults'><i class='fa fa-caret-left'></i> {lang="show_vote_options"}</a>{{endif}}
|
||||
{{if !member.member_id}}{lang="poll_guest" htmlsprintf="\IPS\Http\Url::internal( 'app=core&module=system&controller=login', 'front', 'login' ), \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register' )"}{{endif}}
|
||||
{{if !member.member_id}}{lang="poll_guest" sprintf="\IPS\Http\Url::internal( 'app=core&module=system&controller=login', 'front', 'login' ), \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register' )"}{{endif}}
|
||||
{{endif}}
|
||||
<a class='ipsPos_right ipsType_light ipsType_small ipsType_break' href="{$url}">{lang="poll_view_topic"}</a>
|
||||
</div>
|
||||
@@ -3123,7 +3123,7 @@
|
||||
</span>
|
||||
</h3>
|
||||
<div class='ipsPad_half ipsWidget_inner ipsClearfix' data-role='pollContents'>
|
||||
{lang="no_permission_poll"}{{if !\IPS\Member::loggedIn()->member_id}} {lang="poll_guest" htmlsprintf="\IPS\Http\Url::internal( 'app=core&module=system&controller=login', 'front', 'login' ), \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register' )"}{{endif}}
|
||||
{lang="no_permission_poll"}{{if !\IPS\Member::loggedIn()->member_id}} {lang="poll_guest" sprintf="\IPS\Http\Url::internal( 'app=core&module=system&controller=login', 'front', 'login' ), \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register' )"}{{endif}}
|
||||
</div>
|
||||
{{endif}}
|
||||
{{if !isset( \IPS\Request::i()->fetchPoll )}}
|
||||
|
||||
@@ -206,9 +206,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"
|
||||
}
|
||||
@@ -23,10 +23,20 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Forums
|
||||
{
|
||||
/**
|
||||
* @brief ID Field
|
||||
*/
|
||||
public static $idField = "id";
|
||||
|
||||
public static $controllers = array( "forums", "topic" );
|
||||
|
||||
/**
|
||||
* @brief Controller classes
|
||||
*/
|
||||
public static $controllers = array(
|
||||
"IPS\\forums\\modules\\front\\forums\\forums",
|
||||
"IPS\\forums\\modules\\front\\forums\\topic",
|
||||
"IPS\\forums\\modules\\front\\forums\\index"
|
||||
);
|
||||
|
||||
/**
|
||||
* Get Setting Field
|
||||
*
|
||||
|
||||
@@ -49,14 +49,15 @@ class _Forums
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -77,27 +78,23 @@ class _Forums
|
||||
$post = \IPS\forums\Topic\Post::load( $id2 );
|
||||
}
|
||||
|
||||
/* Check forums attachments permission */
|
||||
if ( $post->container()->can( 'attachments', $member ) )
|
||||
if ( !$post->canView( $member ) )
|
||||
{
|
||||
/* Can we view post? */
|
||||
return $post->canView( $member );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return $viewOnly or $post->container()->can( 'attachments', $member );
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic = \IPS\forums\Topic::load( $id1 );
|
||||
|
||||
/* Check forums attachments permission */
|
||||
if ( $topic->container()->can( 'attachments', $member ) )
|
||||
if ( !$topic->canView( $member ) )
|
||||
{
|
||||
/* Can we view the topic? */
|
||||
return \IPS\forums\Topic::load( $id1 )->canView( $member );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return $viewOnly or $topic->container()->can( 'attachments', $member );
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
|
||||
@@ -1020,6 +1020,7 @@ class _topic extends \IPS\Content\Controller
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
\IPS\Log::log( $e, 'topic_call' );
|
||||
\IPS\Output::i()->error( 'node_error', '2F173/I', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\EditHistory, \I
|
||||
*
|
||||
* @param \IPS\Node\Model|NULL $container Container
|
||||
* @return void
|
||||
* @see \IPS\Topic\Post::incrementPostCount()
|
||||
* @see \IPS\forums\Topic\Post::incrementPostCount()
|
||||
*/
|
||||
public static function incrementPostCount( \IPS\Node\Model $container = NULL )
|
||||
{
|
||||
@@ -181,14 +181,14 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\EditHistory, \I
|
||||
public static function memberPostCount( \IPS\Member $member )
|
||||
{
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts', array(
|
||||
'author_id=? AND forum_id IN(?)',
|
||||
'author_id=? AND forums_topics.forum_id IN(?)',
|
||||
$member->member_id,
|
||||
\IPS\Db::i()->select( 'id', 'forums_forums', 'inc_postcount=1' )
|
||||
) )->join( 'forums_topics', 'tid=topic_id' )->first() ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get items with permisison check
|
||||
* Get items with permission check
|
||||
*
|
||||
* @param array $where Where clause
|
||||
* @param string $order MySQL ORDER BY clause (NULL to order by date)
|
||||
@@ -479,4 +479,36 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\EditHistory, \I
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'embed.css', 'forums', 'front' ) );
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->embedPost( $this, $this->item(), $this->url()->setQueryString( $params ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Moderator Permission
|
||||
*
|
||||
* @param string $type 'edit', 'hide', 'unhide', 'delete', etc.
|
||||
* @param \IPS\Member|NULL $member The member to check for or NULL for the currently logged in member
|
||||
* @param \IPS\Node\Model|NULL $container The container
|
||||
* @return bool
|
||||
*/
|
||||
public static function modPermission( $type, \IPS\Member $member = NULL, \IPS\Node\Model $container = NULL )
|
||||
{
|
||||
/* If this is called from a gateway script, i.e. email piping, just return false as we are a "guest" */
|
||||
if( $member === NULL AND !\IPS\Dispatcher::hasInstance() )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( \in_array( $type, array( 'edit', 'hide', 'unhide', 'delete' ) ) )
|
||||
{
|
||||
/* Load Member */
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
|
||||
/* Post related permission */
|
||||
if ( $member->modPermission( "can_{$type}_post" ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::modPermission($type, $member, $container );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -242,7 +242,7 @@ class _Topic extends \IPS\Content\Item implements
|
||||
*
|
||||
* @param \IPS\Node\Model|NULL $container Container
|
||||
* @return void
|
||||
* @see \IPS\Topic\Post::incrementPostCount()
|
||||
* @see \IPS\forums\Topic\Post::incrementPostCount()
|
||||
*/
|
||||
public static function incrementPostCount( \IPS\Node\Model $container = NULL )
|
||||
{
|
||||
@@ -310,7 +310,7 @@ class _Topic extends \IPS\Content\Item implements
|
||||
|
||||
$whereString = 'forums_forums.password=? OR ' . \IPS\Db::i()->findInSet( 'forums_forums.password_override', $member->groups );
|
||||
$whereParams = array( NULL );
|
||||
if ( $member === \IPS\Member::loggedIn() )
|
||||
if ( \IPS\Dispatcher::hasInstance() AND $member === \IPS\Member::loggedIn() )
|
||||
{
|
||||
foreach ( \IPS\Request::i()->cookie as $k => $v )
|
||||
{
|
||||
@@ -964,6 +964,18 @@ class _Topic extends \IPS\Content\Item implements
|
||||
|
||||
parent::move( $container, $keepLink );
|
||||
\IPS\Db::i()->update( 'forums_question_ratings', array( 'forum' => $container->_id ), array( 'topic=?', $this->tid ) );
|
||||
|
||||
/* While you can't normally move archived topics, when you mass manage content from the AdminCP by using the menu next to the forum,
|
||||
this still allows topics to be moved. If we don't update the archive forum database the forum counts will be off */
|
||||
if( $this->isArchived() )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\forums\Topic\ArchivedPost::db()->update( 'forums_archive_posts', array( 'archive_forum_id' => $container->_id ), array( 'archive_topic_id=?', $this->tid ) );
|
||||
}
|
||||
/* catch db exceptions if e.g. if the connection credentials didn't work or if the database doesn't exist anymore */
|
||||
catch ( \IPS\Db\Exception $e ){}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user