Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

+4 -4
View File
@@ -1,9 +1,9 @@
<?php
/**
* @brief Forums Application Class
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2014 Invision Power Services, Inc.
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @package Invision Community
* @subpackage Forums
* @since 07 Jan 2014
* @version
@@ -168,7 +168,7 @@ class _Application extends \IPS\Application
*/
public function convertLegacyParameters()
{
/* Convert &showtopic= @link https://community.invisionpower.com/4bugtrack/active-reports/double-redirects-in-legacyredirect-method-may-cause-seo-issues-r8934/ */
/* Convert &showtopic= @link */
if ( isset( \IPS\Request::i()->showtopic ) and is_numeric( \IPS\Request::i()->showtopic ) )
{
$base = NULL;
+153
View File
@@ -0,0 +1,153 @@
<?php
/**
* @brief Forums API
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 3 Apr 2017
*/
namespace IPS\forums\api;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* @brief Forums API
*/
class _forums extends \IPS\Node\Api\NodeController
{
/**
* Class
*/
protected $class = 'IPS\forums\Forum';
/**
* GET /forums/forums
* Get list of forums
*
* @return \IPS\Api\PaginatedResponse<IPS\forums\Forum>
*/
public function GETindex()
{
/* Return */
return $this->_list();
}
/**
* GET /forums/forums/{id}
* Get specific forum
*
* @param int $id ID Number
*
* @return \IPS\Api\PaginatedResponse<IPS\forums\Forum>
*/
public function GETitem( $id )
{
/* Return */
return $this->_view( $id );
}
/**
* POST /forums/forums
* Create a forum
*
* @reqapiparam string title The forum title
* @apiparam string description The forum description
* @apiparam string type normal|qa|redirect|category
* @apiparam int|null parent The ID number of the parent the forum should be created in. NULL for root.
* @apiparam string password Forum password
* @apiparam int theme Theme to use as an override
* @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\Forum
*/
public function POSTindex()
{
return $this->_create();
}
/**
* POST /forums/forums/{id}
* Edit a forum
*
* @reqapiparam string title The forum title
* @apiparam string description The forum description
* @apiparam string type normal|qa|redirect|category
* @apiparam int|null parent The ID number of the parent the forum should be created in. NULL for root.
* @apiparam string password Forum password
* @apiparam int theme Theme to use as an override
* @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
*/
public function POSTitem( $id )
{
$class = static::$class;
$forum = $class::load( $id );
$forum = $this->_createOrUpdate( $forum );
return $forum;
}
/**
* DELETE /forums/forums/{id}
* Delete a forum
*
* @param int $id ID Number
* @return void
*/
public function DELETEitem( $id )
{
return $this->_delete( $id );
}
/**
* Create or update node
*
* @param \IPS\node\Model $node The node
* @return \IPS\node\Model
*/
protected function _createOrUpdate( \IPS\node\Model $forum )
{
if ( !\IPS\Request::i()->title )
{
throw new \IPS\Api\Exception( 'NO_TITLE', '', 400 );
}
foreach ( array( 'title' => "forums_forum_{$forum->id}", 'description' => "forums_forum_{$forum->id}_desc" ) as $fieldKey => $langKey )
{
if ( isset( \IPS\Request::i()->$fieldKey ) )
{
\IPS\Lang::saveCustom( 'forums', $langKey, \IPS\Request::i()->$fieldKey );
if ( $fieldKey === 'title' )
{
$forum->name_seo = \IPS\Http\Url\Friendly::seoTitle( \IPS\Request::i()->$fieldKey );
}
}
}
$forum->parent_id = (int) \IPS\Request::i()->parent?: -1;
if ( isset( \IPS\Request::i()->password ) )
{
$forum->password = \IPS\Request::i()->password;
}
if ( isset( \IPS\Request::i()->theme ) )
{
$forum->skin_id = \IPS\Request::i()->theme;
}
return parent::_createOrUpdate( $forum );
}
}
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Posts API
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 7 Dec 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\api;
+26 -7
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Topics API
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 4 Dec 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\api;
@@ -81,9 +80,29 @@ class _topics extends \IPS\Content\Api\ItemController
/* Return */
return $this->_list( $where, 'forums' );
}
/**
* GET /forums/topics/{id}
* View information about a specific topic
*
* @param int $id ID Number
* @throws 2F294/9 INVALID_ID The topic ID does not exist
* @return \IPS\forums\Topic
*/
public function GETitem( $id )
{
try
{
return $this->_view( $id );
}
catch ( \OutOfRangeException $e )
{
throw new \IPS\Api\Exception( 'INVALID_ID', '2F294/9', 404 );
}
}
/**
* GET /forums/topics/{id}/posts
* Get posts in a topic
*
* @param int $id ID Number
@@ -93,7 +112,7 @@ class _topics extends \IPS\Content\Api\ItemController
* @throws 1F294/1 INVALID_ID The topic ID does not exist
* @return \IPS\Api\PaginatedResponse<IPS\forums\Topic\Post>
*/
public function GETitem( $id )
public function GETitem_posts( $id )
{
try
{
@@ -5,6 +5,7 @@
"forums_add": "forums_add",
"forums_edit": "forums_edit",
"forums_perms": "forums_perms",
"forums_massManageContent": "forums_massManageContent",
"forums_delete": "forums_delete"
},
"settings": {
+11
View File
@@ -814,6 +814,17 @@
"questions"
]
},
"app=forums&module=forums&controller=settings&searchResult=form_forums_default_view": {
"lang_key": "forums_default_view",
"restriction": "settings_access",
"keywords": [
"fluid",
"grid",
"mode",
"table",
"view"
]
},
"app=forums&module=forums&controller=settings&searchResult=form_forums_new_questions": {
"lang_key": "forums_new_questions",
"restriction": "settings_access",
+8
View File
@@ -33,6 +33,10 @@
"real": "app=forums&module=forums&controller=forums",
"verify": "\\IPS\\forums\\Forum"
},
"topic_copy": {
"friendly": "topic/{#id}-{?}/copy",
"real": "app=cms&module=database&controller=topic"
},
"forums_topic": {
"friendly": "topic/{#id}-{?}",
"real": "app=forums&module=forums&controller=topic",
@@ -45,6 +49,10 @@
"topic_create": {
"friendly": "submit",
"real": "app=forums&module=forums&controller=forums&do=createMenu"
},
"topic_non_forum_add_button": {
"friendly": "startTopic",
"real": "app=forums&module=forums&controller=forums&do=add"
}
}
}
+276 -32
View File
@@ -1,8 +1,233 @@
<?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.forumList.js" javascript_type="controller" javascript_version="101099" javascript_position="1000050"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.flow.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.forum.flow.js - Flow filter controller
*
* Author: Matt Mecham, certainly not Rikki Tissier (yet)
*/
;( function($, _, undefined){
"use strict";
ips.controller.register('forums.front.forum.flow', {
_ids: [],
_button: null,
initialize: function () {
this.on( 'click', '[data-node-id]', this.toggleFilters );
this.setup();
},
/**
* Um, set up...
*/
setup: function () {
/* Populate forum IDs */
var _ids = ips.utils.url.getParam( 'forumId' );
if ( ! _.isUndefined( _ids ) ) {
/* Check URL */
this._ids = decodeURIComponent( ips.utils.url.getParam( 'forumId' ) ).split(',');
} else if( ! _.isUndefined( ips.utils.cookie.get('forums_flowIds') ) ) {
/* Check local storage */
var _ids = ips.utils.cookie.get('forums_flowIds').split(',');
var self = this;
if( _.isObject( _ids ) && _.size( _ids ) ){
_.each( _ids, function (val, key) {
if ( val ) {
self.childSelect( val );
}
});
}
}
this._button = $('body').find('[data-role="fluidForumMobileDesc"]');
this._updateButtonText();
},
/**
* Event handler for toggling a filter
*
* @param {event} e Event object
* @returns {void}
*/
toggleFilters: function (e) {
e.preventDefault();
var link = $( e.currentTarget );
var id = link.attr('data-node-id');
var parentId = link.attr('data-parent-id');
var hasChildren = link.attr('data-has-children');
if ( _.indexOf( this._ids, id ) == -1 ) {
/* Does not exist, so add it */
this.childSelect( id );
} else {
/* Exists, so remove it */
this.childUnselect( id );
}
this._updateButtonText();
$( document ).trigger( 'updateTableURL', { forumId: this._ids.join(',') } );
},
/**
* Is item selected
*
*/
isSelected: function(id) {
return this.scope.find('[data-node-id="' + id + '"]').hasClass('cForumMiniList_selected') ? true : false;
},
/**
* Select a child
*
*/
childSelect: function(id) {
Debug.log("Select child: " + id );
this._ids.push( id );
var node = this.scope.find('[data-node-id="' + id + '"]');
node.addClass('cForumMiniList_selected');
var parentId = node.attr('data-parent-id');
this.updateCookie();
/* Now unselect any parents */
if ( id != parentId ) {
this.parentUnselect( parentId );
}
/* Mark any children, but we do not need to keep individual row markings */
if ( node.attr('data-has-children') || id == parentId ) {
node.closest('li').addClass('cForumMiniList_categorySelected');
var self = this;
_.each( this.scope.find('[data-parent-id="' + id + '"]'), function( v, k ) {
var _cId = $(v).attr('data-node-id');
if ( _cId != id ) {
self.childUnselect( _cId );
}
} );
}
},
/**
* Unselect a child
*
*/
childUnselect: function(id) {
Debug.log("UNselect child: " + id );
/* Remove marking */
this.scope.find('[data-node-id="' + id + '"]').removeClass('cForumMiniList_selected');
this.scope.find('[data-node-id="' + id + '"]').closest('li').removeClass('cForumMiniList_categorySelected');
/* Remove from local storage and id stack */
this._ids = _.without( this._ids, id );
this.updateCookie();
/* Check for children of this and unselect those too */
var self = this;
_.each( this.scope.find('[data-parent-id="' + id + '"]'), function( v, k ) {
var _cId = $(v).attr('data-node-id');
if ( _cId != id ) {
self.childUnselect( _cId );
}
} );
},
/**
* Select a parent
*
*/
parentSelect: function(parentId) {
Debug.log("Select parent: " + parentId );
/* Mark category and children as selected */
this.scope.find('[data-node-id="' + parentId + '"]').addClass('cForumMiniList_selected');
this.scope.find('[data-node-id="' + parentId + '"]').closest('li').addClass('cForumMiniList_categorySelected');
/* Remove children from the arrays as PHP handles this */
var self = this;
_.each( this.scope.find('[data-parent-id="' + parentId + '"]'), function( v, k ) {
var _cId = $(v).attr('data-node-id');
if ( _cId != parentId ) {
self.childUnselect( _cId );
}
} );
},
/**
* Unselect a parent
*
*/
parentUnselect: function(parentId) {
Debug.log("UNselect parent: " + parentId );
/* Unselect parent as marked */
var node = this.scope.find('[data-node-id="' + parentId + '"]');
node.removeClass('cForumMiniList_selected');
node.closest('li').removeClass('cForumMiniList_categorySelected');
this._ids = _.without( this._ids, parentId );
this.updateCookie();
/* Off up the tree we go */
Debug.log( "Looking for parent ID " + node.attr('data-parent-id') );
var self = this;
_.each( this.scope.find('[data-node-id="' + node.attr('data-parent-id') + '"]'), function( v, k ) {
var _cId = $(v).attr('data-node-id');
if ( _cId != parentId ) {
Debug.log( "Found " + _cId );
self.parentUnselect( _cId );
}
} );
},
/**
* Update the cookie
*/
updateCookie: function(id) {
var cookie = _.uniq( _.values( this._ids ) ).join(',');
Debug.log("Updating cookie: " + cookie );
ips.utils.cookie.set('forums_flowIds', cookie, true);
},
/**
* Updates the mobile button text based on selected forums
*
* @param {event} e The submit event
* @param {element} elem The element this widget is being created on
* @returns {void}
*/
_updateButtonText: function () {
var blobs = this.scope.find('.cForumMiniList_blob');
var selectedBlobRows = blobs.filter( function () {
if( $( this ).closest('.cForumMiniList_selected, .cForumMiniList_categorySelected').length ){
return true;
}
return false;
});
var text = '';
// If the counts are the same, we know we've selected all of them
if( blobs.length == selectedBlobRows.length || selectedBlobRows.length === 0 ){
text = ips.getString('topicsFromAllForums');
} else {
text = ips.pluralize( ips.getString( 'topicsFromXForums' ), selectedBlobRows.length );
}
this._button.text( text );
}
});
}(jQuery, _));]]></file>
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.forumList.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.forum.forumList.js - Controller for a forum listing
*
@@ -67,9 +292,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.forumPage.js" javascript_type="controller" javascript_version="101099" javascript_position="1000050">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.forumPage.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.forum.forumPage.js - Forum page controller
*
@@ -93,25 +318,42 @@
markForumRead: function (e) {
e.preventDefault();
// Trigger event on the table to hide unread markets
this.triggerOn( 'core.global.core.table', 'markTableRead' );
var self = this;
// Hide the link we've just clicked
ips.utils.anim.go( 'fadeOut', $( e.currentTarget ) );
ips.ui.alert.show( {
type: 'confirm',
icon: 'question',
message: ips.getString('markForumAsReadConfirm'),
subText: '',
callbacks: {
ok: function () {
var url = $( e.currentTarget ).attr('href');
// Do request to do the marking
ips.getAjax()( $( e.currentTarget ).attr('href'), {
bypassRedirect: true
} )
.done( function () {
ips.ui.flashMsg.show( ips.getString('forumMarkedRead') );
});
ips.getAjax()( url, {
showLoading: true,
bypassRedirect: true
})
.done( function () {
// Trigger event on the table to hide unread markets
self.triggerOn( 'core.global.core.table', 'markTableRead' );
// Hide the link we've just clicked
ips.utils.anim.go( 'fadeOut', $( e.currentTarget ) );
ips.ui.flashMsg.show( ips.getString('forumMarkedRead') );
})
.fail( function (jqXHR, textStatus, errorThrown) {
window.location = url;
});
}
}
});
}
});
}(jQuery, _));</file>
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.hovercard.js" javascript_type="controller" javascript_version="101099" javascript_position="1000050">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/forum" javascript_name="ips.forum.hovercard.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.forum.hovercard.js - Topic hovercard in forum view
*
@@ -159,9 +401,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="forums" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.archiveRules.js" javascript_type="controller" javascript_version="101099" javascript_position="1000050"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="forums" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.archiveRules.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.forums.archiveRules.js - makes the progress bar increase as archive rules settings are changed
*
@@ -224,9 +466,9 @@
});
}(jQuery, _));
]]></file>
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.answers.js" javascript_type="controller" javascript_version="101099" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.answers.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.topic.answers.js - Profile body controller
*
@@ -322,9 +564,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.reply.js" javascript_type="controller" javascript_version="101099" javascript_position="1000100">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.reply.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.topic.reply.js - Topic reply controller for &quot;Reply&quot; button
*
@@ -351,9 +593,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.view.js" javascript_type="controller" javascript_version="101099" javascript_position="1000100">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="forums" javascript_location="front" javascript_path="controllers/topic" javascript_name="ips.topic.view.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.topic.view.js - Topic view controller
*
@@ -398,4 +640,6 @@ app.js</order>
<order app="global" path="/dev/js//library//jquery">jquery.js
jquery.history.js
jquery.transform.js</order>
<order app="global" path="/dev/js//library//linkify">linkify.min.js
linkify-jquery.min.js</order>
</javascript>
+52 -7
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="forums" version="101099">
<app key="forums" version="102002">
<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>
@@ -18,6 +18,7 @@
<word key="module__forums_stats" js="0">Statistics</word>
<word key="filestorage__forums_Icons" js="0">Forum Icons</word>
<word key="post" js="0">Post</word>
<word key="post_lc" js="0">post</word>
<word key="editor__forums_Forums" js="0">Forums and Topics</word>
<word key="acp_search_title_forums_Forums" js="0">Forums</word>
<word key="menu__forums_forums" js="0">Forums</word>
@@ -25,13 +26,14 @@
<word key="menu__forums_forums_savedActions" js="0">Saved Actions</word>
<word key="menu__forums_forums_rss" js="0">RSS/Atom Feeds</word>
<word key="menu__forums_stats" js="0">Forums</word>
<word key="menu__forums_stats_topics" js="0">New Topic Statistics</word>
<word key="menu__forums_stats_posts" js="0">New Post Statistics</word>
<word key="menu__forums_stats_topics" js="0">New Topics</word>
<word key="menu__forums_stats_posts" js="0">New Posts</word>
<word key="r__forums" js="0">Forums</word>
<word key="r__forums_manage" js="0">Can view forums?</word>
<word key="r__forums_add" js="0">Can create forums?</word>
<word key="r__forums_edit" js="0">Can edit forums?</word>
<word key="r__forums_perms" js="0">Can manage forum permissions?</word>
<word key="r__forums_massManageContent" js="0">Can mass move/delete topics in forums?</word>
<word key="r__forums_delete" js="0">Can delete forums?</word>
<word key="r__archive_manage" js="0">Can manage archive settings?</word>
<word key="r__settings_access" js="0">Can access settings?</word>
@@ -61,6 +63,7 @@
<word key="can_unhide_topic" js="0">Can unhide topics/questions?</word>
<word key="can_view_hidden_topic" js="0">Can view hidden topics/questions?</word>
<word key="can_move_topic" js="0">Can move topics/questions?</word>
<word key="can_move_topic_desc" js="0">Will be able to move topics/questions only between the forums they have permission to moderate, not to any other forum.</word>
<word key="can_lock_topic" js="0">Can lock topics/questions?</word>
<word key="can_unlock_topic" js="0">Can unlock topics/questions?</word>
<word key="can_reply_to_locked_topic" js="0">Can reply to locked topics/questions?</word>
@@ -74,6 +77,11 @@
<word key="can_read_all_topics" js="0">Can view all topics/questions?</word>
<word key="can_read_all_topics_desc" js="0">Some forums are set up to only show topics/questions to the user that posted them. When this setting is enabled, the moderator will be able to view topics/questions they did not post in those forums.</word>
<word key="can_set_best_answer" js="0">Can set best answer for questions?</word>
<word key="can_feature_comments_topic" js="0">Can recommend posts on a topic?</word>
<word key="can_unfeature_comments_topic" js="0">Can remove post recommendations on a topic?</word>
<word key="can_add_item_message_topic" js="0">Can add messages to topics?</word>
<word key="can_edit_item_message_topic" js="0">Can edit messages on topics?</word>
<word key="can_delete_item_message_topic" js="0">Can delete messages on topics?</word>
<word key="forums" js="0">Forums</word>
<word key="forums_sg" js="0">Forum</word>
<word key="forums_add_child" js="0">Create Subforum</word>
@@ -164,6 +172,9 @@
<word key="add_forum" js="0">Add Forum</word>
<word key="edit_forum" js="0">Edit Forum</word>
<word key="node_no_parentf" js="0">No Parent</word>
<word key="forum_use_feature_color" js="0">Use a Feature Color?</word>
<word key="forum_use_feature_color_desc" js="0">A feature color will show the forum title as a badge when used in a description.</word>
<word key="forum_feature_color" js="0">Feature color</word>
<word key="rebuilding_starter_ids" js="0">Rebuilding topic starter IDs</word>
<word key="forums_topic_post" js="0">Forum Posts</word>
<word key="forums_topic" js="0">Forum Topics</word>
@@ -186,6 +197,17 @@
<word key="forums_rss" js="0">Enable RSS feeds?</word>
<word key="forums_rss_desc" js="0"><![CDATA[Only content that is available to guests will be shown. For more options, create a <a href='{internal.app=core&module=discovery&controller=rss}'>Custom RSS Feed</a>]]></word>
<word key="forums_topics_per_page" js="0">Topics per page</word>
<word key="forums_default_view" js="0">Default forum view</word>
<word key="forums_default_view_table" js="0">Table: A traditional forum index table view</word>
<word key="forums_default_view_grid" js="0">Grid: Display forums as cards in a grid</word>
<word key="forums_default_view_fluid" js="0">Fluid: A simpler dynamic listing topics with a forum filter box</word>
<word key="forums_default_view_fluid_desc" js="0">Fluid view works best with fewer forums with less complex hierarchies. The fluid view selector will only display up to three levels deep.</word>
<word key="forums_default_view_choose" js="0">Members can choose?</word>
<word key="forums_default_view_choose_desc" js="0">Select the views you will allow members to choose from</word>
<word key="forums_default_view_choose_none" js="0">Do not allow members to choose</word>
<word key="forums_fluid_pinned" js="0">Honor Pinned Topics</word>
<word key="forums_fluid_pinned_desc" js="0">Show pinned topics from selected forums at the top of the topic list when fluid mode is used</word>
<word key="forums_default_view_choose_error" js="0">You must select at least two views for members to choose from</word>
<word key="archiving" js="0">Archiving</word>
<word key="archiving_blurb" js="0">If you have a very large site, it can be beneficial to reduce the size of the database table storing posts. Archiving topics is an alternative to deleting which allows them to still exist and be viewed as normal, but moves them to a separate database table. Archived topics cannot be posted in or edited, and will not show in search results. You can unarchive topics after they've been archived if you change your mind.</word>
<word key="archive_topics_where" js="0"><![CDATA[Archive topics when <em>all</em> of the following conditions are true...]]></word>
@@ -227,6 +249,7 @@
<word key="archive_on" js="0">Enable Archiving?</word>
<word key="task__archive" js="0">Archives posts.</word>
<word key="task__unarchive" js="0">Unarchives posts.</word>
<word key="remove_archive_exlude" js="0">Allow this topic to be archived</word>
<word key="unarchive" js="0">Unarchive</word>
<word key="unarchive_confirm" js="0">Unarchiving this topic will exclude it from being archived again in the future. After confirming, it will take about {# [1:minute][?:minutes]} until the topic is actually unarchived.</word>
<word key="uanrchive_settings_change" js="0">Some topics that are already archived no longer match your archive settings. Would you like to unarchive them?</word>
@@ -329,7 +352,6 @@
<word key="desc" js="0">Descending (newest first)</word>
<word key="time_frame" js="0">Last Reply</word>
<word key="show_all" js="0">Anytime</word>
<word key="today" js="0">Today</word>
<word key="since_last_visit" js="0">My Last Login (%s)</word>
<word key="forum_home" js="0">Forum Home</word>
<word key="all_questions" js="0">All questions in this forum</word>
@@ -341,7 +363,7 @@
<word key="awaiting_an_answer" js="0">Awaiting an answer</word>
<word key="best_answer_by" js="0">Best answer by %s, %s</word>
<word key="ask_byline" js="0">Asked by %s, %s</word>
<word key="ask_byline_itemprop" js="0"><![CDATA[Asked by <span itemprop='name'>%s</span>, %s]]></word>
<word key="ask_byline_itemprop" js="0">Asked by %s, %s</word>
<word key="ask_byline_no_date" js="0">Asked by %s</word>
<word key="forum_rss_title_topics" js="0">%s Latest Topics</word>
<word key="forum_rss_title_questions" js="0">%s Latest Questions</word>
@@ -392,9 +414,9 @@
<word key="mark_topic_read" js="0">Mark this topic read</word>
<word key="answered" js="0">Has best answer</word>
<word key="awaiting_answer" js="0">Awaiting best answer</word>
<word key="forum_requires_password" js="0">Enter password</word>
<word key="forum_requires_password" js="0">Enter password for %s</word>
<word key="enter_forum" js="0">Enter forum</word>
<word key="enter_forum_password_1" js="0">Viewing this forum requires a password. If you know it, enter it below.</word>
<word key="enter_forum_password_1" js="0">Viewing %s requires a password. If you know it, enter it below.</word>
<word key="forums_comments" js="0">{!# [1:reply][?:replies]}</word>
<word key="forums_num_views" js="0">{!# [1:view][?:views]}</word>
<word key="share_this_post" js="0">Share this post</word>
@@ -501,6 +523,7 @@
<word key="can_use_saved_actions" js="0">Can use saved actions?</word>
<word key="modlog__saved_action" js="0"><![CDATA[Ran "%s" saved action on topic: <a href='%s'>%s</a>]]></word>
<word key="modlog__unarchived_topic" js="0"><![CDATA[Unarchived topic: <a href='%s'>%s</a>]]></word>
<word key="modlog__removed_archive_exclude_topic" js="0"><![CDATA[Removed 'exlude from archive' state from topic: <a href='%s'>%s</a>]]></word>
<word key="task__rssimport" js="0">Checks RSS/Atom feeds for new articles and imports into Forums.</word>
<word key="queue_deleting_legacy_topics" js="0">Deleting legacy topic data</word>
<word key="queue_deleting_legacy_posts" js="0">Deleting legacy post data</word>
@@ -533,6 +556,11 @@
<word key="loc_forums_index" js="0">Viewing Forums Index</word>
<word key="ad_forum_listing" js="0">After the first topic in each forum</word>
<word key="ad_topic_view" js="0">After the first post in each topic</word>
<word key="ad_fluid_index_view" js="0">Fluid view topic listing, between topic rows</word>
<word key="ad_fluid_index_view_number" js="0">Show this advert after every</word>
<word key="ad_fluid_index_view_number_suffix" js="0">topic rows when in fluid view mode</word>
<word key="ad_fluid_index_view_repeat" js="0">Repeated</word>
<word key="ad_fluid_index_view_repeat_suffix" js="0">times</word>
<word key="stats_new_topics" js="0">New Topics</word>
<word key="stats_new_posts" js="0">New Posts</word>
<word key="stats_topics_title" js="0">New topics by time period</word>
@@ -548,9 +576,26 @@
<word key="poll_view_topic" js="0">View topic</word>
<word key="__api_forums_posts" js="0">Posts</word>
<word key="__api_forums_topics" js="0">Topics</word>
<word key="__api_forums_forums" js="0">Forums</word>
<word key="recommend_post" js="0">Recommend Post</word>
<word key="recommended_posts" js="0">Recommended Posts</word>
<word key="forums_simple_name_with_container" js="0"><![CDATA[By %s in <a href='%s'>%s</a>]]></word>
<word key="forums_show_all_forums" js="0">Table view</word>
<word key="forums_show_all_forums_tooltip" js="0">Show a table of categories and forums</word>
<word key="forum_simple_view_last_post" js="0">Last action</word>
<word key="forums_show_fluid_forums" js="0">Fluid View</word>
<word key="forums_show_fluid_forums_tooltip" js="0">Show all topics with a forum filter box</word>
<word key="forums_simple_view_change_tooltip" js="0">Change view</word>
<word key="forums_simple_filter_by" js="0">Filter topics by forum</word>
<word key="forums_simple_dialog_title" js="0">Filter by forum</word>
<word key="done_forum_filtering" js="0">Done</word>
<word key="forums_chosen_forums" js="0">These Forums</word>
<word key="forumMarkedRead" js="1">Forum marked as read</word>
<word key="topicMarkedRead" js="1">Topic marked as read</word>
<word key="js_num_topic_posts" js="1">{# [1:post][?:posts]} in this topic</word>
<word key="votes_no_number" js="1">{!# [-1:vote][1:vote][?:votes]}</word>
<word key="topicsFromAllForums" js="1">Showing topics from all forums</word>
<word key="topicsFromXForums" js="1">Showing topics from {# [1:forum][?:forums]}</word>
<word key="markForumAsReadConfirm" js="1">Are you sure you want to mark all topics in this forum as read?</word>
</app>
</language>
+146 -55
View File
@@ -129,18 +129,18 @@
"zerofill": false
},
"last_title": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 250,
"name": "last_title",
"type": "VARCHAR",
"unsigned": false,
"length": 255,
"decimals": null,
"values": [],
"zerofill": false
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"last_id": {
"allow_null": true,
@@ -603,6 +603,34 @@
"zerofill": false,
"auto_increment": false,
"binary": false
},
"club_id": {
"name": "club_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "The club ID if this forum belongs to a club, or NULL",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"feature_color": {
"name": "feature_color",
"type": "VARCHAR",
"length": 15,
"decimals": null,
"values": null,
"allow_null": true,
"default": null,
"comment": "Feature color",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
@@ -740,18 +768,18 @@
"zerofill": false
},
"title": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 250,
"name": "title",
"type": "VARCHAR",
"unsigned": false,
"length": 255,
"decimals": null,
"values": [],
"zerofill": false
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"state": {
"allow_null": true,
@@ -824,18 +852,18 @@
"zerofill": false
},
"last_post": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "last_post",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
"values": [],
"zerofill": false
},
"starter_name": {
"allow_null": true,
@@ -1062,18 +1090,18 @@
"zerofill": false
},
"title_seo": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 250,
"name": "title_seo",
"type": "VARCHAR",
"unsigned": false,
"length": 255,
"decimals": null,
"values": [],
"zerofill": false
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"moved_on": {
"allow_null": false,
@@ -1174,18 +1202,32 @@
"zerofill": false
},
"topic_hiddenposts": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 10,
"name": "topic_hiddenposts",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"values": [],
"zerofill": false
},
"topic_meta_data": {
"allow_null": false,
"auto_increment": false,
"binary": false
"binary": false,
"comment": "",
"decimals": null,
"default": 0,
"length": 1,
"name": "topic_meta_data",
"type": "BIT",
"unsigned": false,
"values": [],
"zerofill": false
}
},
"indexes": {
@@ -1346,33 +1388,34 @@
"most_recent_post": {
"type": "key",
"name": "most_recent_post",
"columns": [
"forum_id",
"approved",
"last_post"
],
"length": [
null,
null,
null
],
"columns": [
"forum_id",
"approved",
"last_post"
]
},
"last_true_post": {
"type": "key",
"name": "last_true_post",
"columns": [
"forum_id",
"pinned",
"last_post"
],
"length": [
null,
null,
null
],
"columns": [
"forum_id",
"pinned",
"last_post"
]
}
},
"collation": "utf8mb4_unicode_ci",
"engine": "InnoDB",
"inserts": [
{
"tid": "1",
@@ -1800,7 +1843,8 @@
"author_name": "<%ADMIN_NAME%>",
"ip_address": "<%IP_ADDRESS%>",
"post_date": "<%TIME%>",
"post": "<p>Welcome to your new IPS Community Suite!<\/p> <br \/><p> Congratulations on your purchase of our software and setting up your community. Please take some time and read through the Getting Started Guide and Administrator Documentation. The Getting Started Guide will walk you through some of the necessary steps to setting up an IP.Board and starting your community. The Administrator Documentation takes you through the details of the capabilities of IP.Board.<\/p> <br \/><p> You can remove this message, topic, forum or even category at any time.<\/p> <br \/><p><a href='http:\/\/remoteservices.invisionpower.com\/docs\/getting-started' rel='external'>Go to the documentation now...<\/a><br \/><p>Nulled by IPBMafia.ru<\/p>",
"post": "<p>Welcome to your new Invision Community!<\/p> <br \/><p> Congratulations on your purchase of our software and setting up your community. Please take some time and read through the Getting Started Guide and Administrator Documentation. The Getting Started Guide will walk you through some of the necessary steps to setting up an IP.Board and starting your community. The Administrator Documentation takes you through the details of the capabilities of IP.Board.<\/p> <br \/><p> You can remove this message, topic, forum or even category at any time.<\/p> <br \/><p><a href='https:\/\/remoteservices.invisionpower.com\/docs\/getting-started' rel='external'>Go to the documentation now...<\/a><br \/><p>Nulled by IPBMafia.ru<\/p>",
"queued": "0",
"queued": "0",
"topic_id": "1",
"new_topic": "1",
@@ -3126,5 +3170,52 @@
]
}
}
},
"forums_view_method": {
"name": "forums_view_method",
"columns": {
"member_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 20,
"name": "member_id",
"type": "BIGINT",
"unsigned": true,
"values": [],
"zerofill": false
},
"method": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "table",
"length": 10,
"name": "method",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"member_id"
]
}
},
"collation": "utf8mb4_unicode_ci",
"engine": "InnoDB"
}
}
+12
View File
@@ -35,6 +35,18 @@
"key": "forums_answers_downvote",
"default": "1"
},
{
"key": "forums_default_view",
"default": "table"
},
{
"key": "forums_default_view_choose",
"default": "0"
},
{
"key": "forums_fluid_pinned",
"default": "1"
},
{
"key": "forums_new_questions",
"default": "0"
File diff suppressed because it is too large. Load diff
+1 -15
View File
@@ -1,15 +1 @@
[
{
"sc_key": "forum_layout",
"sc_type": "Select",
"sc_multiple": 0,
"sc_content": "[{\"key\":\"grid\",\"value\":\"Grid View\"},{\"key\":\"traditional\",\"value\":\"Traditional List\"}]",
"sc_app": "forums",
"sc_default": "traditional",
"sc_tab_key": "custom",
"sc_show_in_vse": 1,
"sc_title": "themesetting_forum_layout",
"sc_order": 5,
"sc_condition": null
}
]
{}
+22 -1
View File
@@ -138,5 +138,26 @@
"101096": "4.1.19.2",
"101097": "4.1.19.2",
"101098": "4.1.19.3",
"101099": "4.1.19.4"
"101099": "4.1.19.4",
"101100": "4.2.0 Beta 1",
"101101": "4.2.0 Beta 1",
"101102": "4.2.0 Beta 1",
"101103": "4.2.0 Beta 1",
"101104": "4.2.0 Beta 2",
"101105": "4.2.0 Beta 3",
"101106": "4.2.0 Beta 3a",
"101107": "4.2.0 Beta 4",
"101108": "4.2.0 Beta 4",
"101109": "4.2.0 Beta 5",
"101110": "4.2.0 Beta 5a",
"101111": "4.2.0 Beta 6",
"101112": "4.2.0 Beta 6a",
"101113": "4.2.0 Beta 6a",
"101114": "4.2.0 Beta 7",
"101115": "4.2.0 Beta 7a",
"101116": "4.2.0 Beta 8",
"101117": "4.2.0 Beta 8",
"102000": "4.2.0",
"102001": "4.2.0",
"102002": "4.2.0"
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Advertisement locations extension
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 16 Jul 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\AdvertisementLocations;
@@ -0,0 +1,56 @@
<?php
/**
* @brief Advertisement locations extension
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 16 Jul 2014
*/
namespace IPS\forums\extensions\core\AdvertisementLocations;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Advertisement locations extension
*/
class _IndexView
{
/**
* Get the locations and the additional settings
*
* @param array $settings Current setting values
* @return array Array with two elements: 'locations' which should have keys as the location keys and values as the fields to toggle, and 'settings' which are additional fields to add to the form
*/
public function getSettings( $settings )
{
return array(
'locations' => array( 'ad_fluid_index_view' => array( 'ad_fluid_index_view_number', 'ad_fluid_index_view_repeat' ) ),
'settings' => array(
new \IPS\Helpers\Form\Number( 'ad_fluid_index_view_number', ( isset( $settings['ad_fluid_index_view_number'] ) ) ? $settings['ad_fluid_index_view_number'] : 0, FALSE, array(), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('ad_fluid_index_view_number_suffix'), 'ad_fluid_index_view_number' ),
new \IPS\Helpers\Form\Number( 'ad_fluid_index_view_repeat', ( isset( $settings['ad_fluid_index_view_repeat'] ) ) ? $settings['ad_fluid_index_view_repeat'] : 0, FALSE, array( 'unlimited' => -1 ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('ad_fluid_index_view_repeat_suffix'), 'ad_fluid_index_view_repeat' )
)
);
}
/**
* Return an array of setting values to store
*
* @param array $values Values from the form submission
* @return array Array of setting key => value to store
*/
public function parseSettings( $values )
{
return array(
'ad_fluid_index_view_number' => $values['ad_fluid_index_view_number'],
'ad_fluid_index_view_repeat' => $values['ad_fluid_index_view_repeat']
);
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Advertisement locations extension
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 16 Jul 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\AdvertisementLocations;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Announcements Extension : Forums
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 28 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\Announcements;
@@ -1,13 +1,12 @@
<?php
/**
* @brief BBCode Tag
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Feb 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\BBCode;
@@ -1,13 +1,12 @@
<?php
/**
* @brief BBCode Tag
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Feb 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\BBCode;
@@ -1,13 +1,12 @@
<?php
/**
* @brief BBCode Tag
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Feb 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\BBCode;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Moderator Permissions: Topics
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 16 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\ContentModeratorPermissions;
@@ -109,8 +108,8 @@ class _Topics
\IPS\Content\Search\Index::i()->removeClassFromSearchIndex( 'IPS\forums\Topic', $forum->id );
\IPS\Content\Search\Index::i()->removeClassFromSearchIndex( 'IPS\forums\Topic\Post', $forum->id );
}
\IPS\Task::queue( 'core', 'RebuildSearchIndex', array( 'class' => 'IPS\forums\Topic', 'container' => $forum->id ) );
\IPS\Task::queue( 'core', 'RebuildSearchIndex', array( 'class' => 'IPS\forums\Topic\Post', 'container' => $forum->id ) );
\IPS\Task::queue( 'core', 'RebuildSearchIndex', array( 'class' => 'IPS\forums\Topic', 'container' => $forum->id ), 5, 'container' );
\IPS\Task::queue( 'core', 'RebuildSearchIndex', array( 'class' => 'IPS\forums\Topic\Post', 'container' => $forum->id ), 5, 'container' );
}
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Content Router extension: Topics
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 15 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\ContentRouter;
@@ -32,10 +31,10 @@ class _Topics
/**
* Constructor
*
* @param \IPS\Member|NULL $member If checking access, the member to check for, or NULL to not check access
* @param \IPS\Member|IPS\Member\Group|NULL $member If checking access, the member/group to check for, or NULL to not check access
* @return void
*/
public function __construct( \IPS\Member $member = NULL )
public function __construct( $member = NULL )
{
if ( $member === NULL or $member->canAccessModule( \IPS\Application\Module::get( 'forums', 'forums', 'front' ) ) )
{
@@ -1,13 +1,12 @@
<?php
/**
* @brief Create Menu Extension : Topic
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 14 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\CreateMenu;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Editor Extension: Forums
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\EditorLocations;
@@ -167,6 +166,27 @@ class _Forums
return $this->performRebuild( $offset, $max, array( 'IPS\Text\LegacyParser', 'parseStatic' ) );
}
/**
* @brief Store image proxy status ( true = enabled )
*/
protected $_imageProxyStatus = null;
/**
* Rebuild content to add or remove image proxy
*
* @param int|null $offset Offset to start from
* @param int|null $max Maximum to parse
* @param bool $status Enable/Disable Image Proxy
* @return int Number completed
* @note This method is optional and will only be called if it exists
*/
public function rebuildImageProxy( $offset, $max, $status=TRUE )
{
$this->_imageProxyStatus = $status;
return $this->performRebuild( $offset, $max, 'parseImageProxy' );
}
/**
* Perform rebuild - abstracted as the call for rebuildContent() and rebuildAttachmentImages() is nearly identical
*
@@ -186,7 +206,14 @@ class _Forums
try
{
$rebuilt = call_user_func( $callback, $word['word_custom'] );
if( $callback == 'parseImageProxy' )
{
$rebuilt = \IPS\Text\Parser::parseImageProxy( $word['word_custom'], $this->_imageProxyStatus );
}
else
{
$rebuilt = call_user_func( $callback, $word['word_custom'] );
}
}
catch( \InvalidArgumentException $e )
{
@@ -1,13 +1,12 @@
<?php
/**
* @brief File Storage Extension: Icons
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 06 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\FileStorage;
@@ -78,7 +77,7 @@ class _Icons
/**
* Check if a file is valid
*
* @param \IPS\Http\Url $file The file to check
* @param string $file The file path to check
* @return bool
*/
public function isValidFile( $file )
@@ -1,13 +1,12 @@
<?php
/**
* @brief Front Navigation Extension: Forums
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\FrontNavigation;
@@ -71,6 +70,6 @@ class _Forums extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public function active()
{
return \IPS\Dispatcher::i()->application->directory === 'forums';
return !\IPS\core\FrontNavigation::$clubTabActive and \IPS\Dispatcher::i()->application->directory === 'forums';
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief ACP Live Search Extension
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\LiveSearch;
@@ -54,7 +53,7 @@ class _Forums
$forums = \IPS\Db::i()->select(
"*",
'forums_forums',
array( "word_custom LIKE CONCAT( '%', ?, '%' ) AND lang_id=?", $searchTerm, \IPS\Member::loggedIn()->language()->id ),
array( "club_id IS NULL AND word_custom LIKE CONCAT( '%', ?, '%' ) AND lang_id=?", $searchTerm, \IPS\Member::loggedIn()->language()->id ),
NULL,
NULL
)->join(
@@ -1,13 +1,12 @@
<?php
/**
* @brief Member Sync
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 14 Jul 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\MemberSync;
@@ -35,6 +34,7 @@ class _Forums
{
\IPS\Db::i()->update( 'forums_answer_ratings', array( 'member' => $member->member_id ), array( 'member=?', $member2->member_id ), array(), NULL, \IPS\Db::IGNORE );
\IPS\Db::i()->update( 'forums_question_ratings', array( 'member' => $member->member_id ), array( 'member=?', $member2->member_id ), array(), NULL, \IPS\Db::IGNORE );
\IPS\Db::i()->update( 'forums_view_method', array( 'member_id' => $member->member_id ), array( 'member_id=?', $member2->member_id ), array(), NULL, \IPS\Db::IGNORE );
\IPS\Db::i()->update( 'forums_rss_import', array( 'rss_import_mid' => $member->member_id ), array( 'rss_import_mid=?', $member2->member_id ) );
if ( \IPS\Settings::i()->archive_on )
@@ -63,6 +63,7 @@ class _Forums
{
\IPS\Db::i()->delete( 'forums_answer_ratings', array( 'member=?', $member->member_id ) );
\IPS\Db::i()->delete( 'forums_question_ratings', array( 'member=?', $member->member_id ) );
\IPS\Db::i()->delete( 'forums_view_method', array( 'member_id=?', $member->member_id ) );
\IPS\Db::i()->update( 'forums_rss_import', array( 'rss_import_mid' => 0 ), array( 'rss_import_mid=?', $member->member_id ) );
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Permissions
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 16 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\Permissions;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 18 Mar 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 18 Mar 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 18 Mar 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Converter
* @since 26 Feb 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 04 Jan 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief forums
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 07 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\admin\forums;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Feeds
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 04 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\admin\forums;
@@ -48,10 +47,10 @@ class _rss extends \IPS\Node\Controller
public function _getRootButtons()
{
$buttons = parent::_getRootButtons();
if ( isset( $buttons['add'] ) )
if ( isset( \IPS\Output::i()->sidebar['actions']['add'] ) )
{
$buttons['add']['link'] = $buttons['add']['link']->setQueryString( '_new', TRUE );
\IPS\Output::i()->sidebar['actions']['add']['link'] = \IPS\Output::i()->sidebar['actions']['add']['link']->setQueryString( '_new', TRUE );
}
return $buttons;
@@ -1,13 +1,12 @@
<?php
/**
* @brief savedActions
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 30 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\admin\forums;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Settings
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 20 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\admin\forums;
@@ -564,6 +563,32 @@ class _settings extends \IPS\Dispatcher\Controller
$form = new \IPS\Helpers\Form;
$form->addHeader('forum_settings');
$form->add( new \IPS\Helpers\Form\YesNo( 'forums_rss', \IPS\Settings::i()->forums_rss ) );
$form->add( new \IPS\Helpers\Form\Radio( 'forums_default_view', \IPS\Settings::i()->forums_default_view, FALSE, array(
'options' => array(
'table' => 'forums_default_view_table',
'grid' => 'forums_default_view_grid',
'fluid' => 'forums_default_view_fluid'
),
) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'forums_fluid_pinned', \IPS\Settings::i()->forums_fluid_pinned, FALSE, array(), NULL, NULL, NULL, 'forums_fluid_pinned' ) );
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'forums_default_view_choose', \IPS\Settings::i()->forums_default_view_choose ? json_decode( \IPS\Settings::i()->forums_default_view_choose, TRUE ) : NULL, FALSE, array(
'unlimited' => '*',
'unlimitedLang' => 'forums_default_view_choose_none',
'multiple' => true,
'noDefault' => TRUE,
'options' => array(
'table' => 'forums_default_view_table',
'grid' => 'forums_default_view_grid',
'fluid' => 'forums_default_view_fluid'
)
), function( $value ) {
if( $value !== '*' AND count( $value ) !== 0 AND count( $value ) < 2 )
{
throw new \DomainException( 'forums_default_view_choose_error' );
}
} ) );
$form->addHeader('topic_settings');
$form->add( new \IPS\Helpers\Form\Custom( 'forums_popular_now', json_decode( \IPS\Settings::i()->forums_popular_now, TRUE ), FALSE, array(
'getHtml' => function( $obj )
@@ -588,6 +613,11 @@ class _settings extends \IPS\Dispatcher\Controller
{
$values['forums_popular_now'] = json_encode( $values['forums_popular_now'] );
}
if ( isset( $values['forums_default_view_choose'] ) )
{
$values['forums_default_view_choose'] = ( is_array( $values['forums_default_view_choose'] ) AND !count( $values['forums_default_view_choose'] ) ) ? NULL : json_encode( $values['forums_default_view_choose'] );
}
$form->saveAsSettings( $values );
@@ -1,13 +1,12 @@
<?php
/**
* @brief posts
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 18 Aug 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\admin\stats;
@@ -33,10 +32,17 @@ class _posts extends \IPS\Dispatcher\Controller
{
\IPS\Dispatcher::i()->checkAcpPermission( 'posts_manage' );
$chart = new \IPS\Helpers\Chart\Dynamic( \IPS\Http\Url::internal( "app=forums&module=stats&controller=posts" ), 'forums_posts', 'post_date', '', array( 'isStacked' => FALSE ) );
$chart = new \IPS\Helpers\Chart\Database( \IPS\Http\Url::internal( "app=forums&module=stats&controller=posts" ), 'forums_posts', 'post_date', '', array(
'isStacked' => FALSE,
'backgroundColor' => '#ffffff',
'colors' => array( '#10967e' ),
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
'lineWidth' => 1,
'areaOpacity' => 0.4
) );
$chart->addSeries( \IPS\Member::loggedIn()->language()->addToStack( 'stats_new_posts' ), 'number', 'COUNT(*)', FALSE );
$chart->title = \IPS\Member::loggedIn()->language()->addToStack( 'stats_posts_title' );
$chart->availableTypes = array( 'LineChart', 'ColumnChart', 'BarChart' );
$chart->availableTypes = array( 'AreaChart', 'ColumnChart', 'BarChart' );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'menu__forums_stats_posts' );
\IPS\Output::i()->output = (string) $chart;
@@ -1,13 +1,12 @@
<?php
/**
* @brief topics
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 18 Aug 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\admin\stats;
@@ -33,11 +32,18 @@ class _topics extends \IPS\Dispatcher\Controller
{
\IPS\Dispatcher::i()->checkAcpPermission( 'topics_manage' );
$chart = new \IPS\Helpers\Chart\Dynamic( \IPS\Http\Url::internal( "app=forums&module=stats&controller=topics" ), 'forums_topics', 'start_date', '', array( 'isStacked' => FALSE ) );
$chart = new \IPS\Helpers\Chart\Database( \IPS\Http\Url::internal( "app=forums&module=stats&controller=topics" ), 'forums_topics', 'start_date', '', array(
'isStacked' => FALSE,
'backgroundColor' => '#ffffff',
'colors' => array( '#10967e' ),
'hAxis' => array( 'gridlines' => array( 'color' => '#f5f5f5' ) ),
'lineWidth' => 1,
'areaOpacity' => 0.4
) );
$chart->addSeries( \IPS\Member::loggedIn()->language()->addToStack( 'stats_new_topics' ), 'number', 'COUNT(*)', FALSE );
$chart->title = \IPS\Member::loggedIn()->language()->addToStack( 'stats_topics_title' );
$chart->availableTypes = array( 'LineChart', 'ColumnChart', 'BarChart' );
$chart->availableTypes = array( 'AreaChart', 'ColumnChart', 'BarChart' );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'menu__forums_stats_topics' );
\IPS\Output::i()->output = (string) $chart;
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Legacy 3.x findpost
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 09 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\front\forums;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Forum Index
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\front\forums;
@@ -50,11 +49,20 @@ class _forums extends \IPS\Dispatcher\Controller
*/
public function _forum( $forum )
{
/* Is simple mode on? If so, redirect to the index page */
if ( \IPS\forums\Forum::isSimpleView( $forum ) )
{
if ( ! isset( \IPS\Request::i()->url()->hiddenQueryString['rss'] ) )
{
\IPS\Output::i()->redirect( $forum->url(), '', 302 );
}
}
/* Password protected */
if ( $form = $forum->passwordForm() )
{
\IPS\Output::i()->title = $forum->_stripTagsTitle;
\IPS\Output::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'forums', 'forums', 'front' ), 'forumPasswordPopup' ) );
\IPS\Output::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'forums', 'forums', 'front' ), 'forumPasswordPopup' ), $forum );
return;
}
@@ -461,7 +469,20 @@ class _forums extends \IPS\Dispatcher\Controller
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->createTopic( $formTemplate, $forum, $title );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( $title );
if ( !\IPS\forums\Forum::theOnlyForum() )
if ( $club = $forum->club() )
{
\IPS\core\FrontNavigation::$clubTabActive = TRUE;
\IPS\Output::i()->breadcrumb = array();
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=core&module=clubs&controller=directory', 'front', 'clubs_list' ), \IPS\Member::loggedIn()->language()->addToStack('module__core_clubs') );
\IPS\Output::i()->breadcrumb[] = array( $club->url(), $club->name );
\IPS\Output::i()->breadcrumb[] = array( $forum->url(), $forum->_title );
if ( \IPS\Settings::i()->clubs_header == 'sidebar' )
{
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate( 'clubs', 'core' )->header( $club, $forum, 'sidebar' );
}
}
elseif ( !\IPS\forums\Forum::theOnlyForum() )
{
try
{
@@ -1,13 +1,12 @@
<?php
/**
* @brief index
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 28 Jul 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\front\forums;
@@ -31,11 +30,51 @@ class _index extends \IPS\Dispatcher\Controller
*/
public function execute()
{
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_browse.js', 'gallery' ) );
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_forum.js', 'forums' ) );
if ( isset( \IPS\Request::i()->forumId ) and ! \IPS\forums\Forum::isSimpleView() )
{
/* This is a simple view URL, but we're not using simple view, so redirect */
$ids = explode( ',', \IPS\Request::i()->forumId );
$firstId = array_shift( $ids );
if ( $firstId )
{
try
{
$forum = \IPS\forums\Forum::loadAndCheckPerms( $firstId );
\IPS\Output::i()->redirect( $forum->url(), '', 302 );
}
catch( \Exception $ex ) { }
}
}
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_browse.js', 'gallery' ) );
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_forum.js', 'forums' ) );
parent::execute();
}
/**
* Handle forum things that are directed here when simple view is on
*
* @param string $method Desired method
* @param array $args Arguments
* @return void
*/
public function __call( $method, $args )
{
if ( \IPS\forums\Forum::isSimpleView() and isset( \IPS\Request::i()->do ) and isset( \IPS\Request::i()->forumId ) and ! mb_stristr( \IPS\Request::i()->forumId, ',' ) )
{
/* If we have a specific do action that this controller does not handle, then we really want the full forum view to handle it */
try
{
/* Panic not, they are all loaded into memory at this point */
$controller = new \IPS\forums\modules\front\forums\forums( $this->url );
\IPS\Request::i()->id = \IPS\Request::i()->forumId;
$controller->execute();
}
catch( \Exception $ex ) { }
}
}
/**
* Manage
@@ -46,9 +85,9 @@ class _index extends \IPS\Dispatcher\Controller
{
/* Load into memory */
\IPS\forums\Forum::loadIntoMemory();
/* Is there only one forum? */
if ( $theOnlyForum = \IPS\forums\Forum::theOnlyForum() )
/* Is there only one forum? But don't redirect if it's simple view mode... */
if ( $theOnlyForum = \IPS\forums\Forum::theOnlyForum() AND !\IPS\forums\Forum::isSimpleView() )
{
$controller = new \IPS\forums\modules\front\forums\forums( $this->url );
return $controller->_forum( $theOnlyForum );
@@ -67,7 +106,146 @@ class _index extends \IPS\Dispatcher\Controller
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=forums&module=forums&controller=index', 'front', 'forums' ), explode( ',', $permissions['perm_view'] ), 'loc_forums_index' );
/* Display */
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'index' )->index();
}
if ( \IPS\forums\Forum::isSimpleView() )
{
$where = array( 'container' => array( array( 'forums_forums.password IS NULL AND forums_forums.can_view_others=1 AND forums_forums.club_id IS NULL' ) ) );
$forumIds = array();
$parentIds = array();
$map = array();
$ids = array();
if ( isset( \IPS\Request::i()->forumId ) )
{
$ids = explode( ',', \IPS\Request::i()->forumId );
}
else if ( isset( \IPS\Request::i()->cookie['forums_flowIds'] ) )
{
$ids = explode( ',', \IPS\Request::i()->cookie['forums_flowIds'] );
}
/* Inline forum IDs? */
if ( count( $ids ) )
{
foreach( $ids as $id )
{
try
{
/* Panic not, they are all loaded into memory at this point */
$forum = \IPS\forums\Forum::load( $id );
if ( $forum->hasChildren() )
{
/* This is a root category, so fetch all children */
$this->getParentIds( $forum, $parentIds );
$forumIds[] = $forum->id;
}
else
{
$map[ $forum->parent_id ][] = $forum->_id;
$forumIds[] = $forum->id;
}
}
catch( \Exception $ex ) { }
}
/* Now remove all children that are in the same category */
foreach( $map as $parent => $children )
{
if ( in_array( $parent, $parentIds ) )
{
$forumIds = array_diff( $forumIds, $children );
}
}
$or = array();
if ( count( $forumIds ) )
{
$or[] = \IPS\Db::i()->in( 'forums_forums.id', array_filter( $forumIds ) );
}
if ( count( $parentIds ) )
{
$or[] = \IPS\Db::i()->in( 'forums_forums.parent_id', array_filter( $parentIds ) );
}
if ( count( $or ) )
{
$where['container'][] = array( '(' . implode( ' OR ', $or ) . ')' );
}
}
/* Simplified view */
$table = new \IPS\Helpers\Table\Content( 'IPS\forums\Topic', \IPS\Http\Url::internal( 'app=forums&module=forums&controller=index', 'front', 'forums' ), $where, NULL, NULL, 'read' );
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'index' ), 'simplifiedForumTable' );
$table->classes = array( 'cTopicList' );
$table->limit = \IPS\Settings::i()->forums_topics_per_page;
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'index' ), 'simplifiedTopicRow' );
$table->honorPinned = \IPS\Settings::i()->forums_fluid_pinned;
$table->hover = TRUE;
$table->sortOptions['num_replies'] = $table->sortOptions['num_comments'];
unset( $table->sortOptions['num_comments'] );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'index' )->simplifiedView( $table );
if( \IPS\forums\Forum::theOnlyForum() === NULL )
{
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate( 'index' )->simplifiedViewSidebar( $forumIds, $parentIds );
}
if ( isset( $where['container'] ) )
{
$allForumIds = iterator_to_array( \IPS\Db::i()->select( 'id', 'forums_forums', $where['container'] ) );
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack('forums_chosen_forums') ] = array( 'type' => 'forums_topic', 'nodes' => implode( ',', $allForumIds ) );
}
}
else
{
/* Standard view */
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'index' )->index();
}
}
/**
* Recursively collect parents
*
* @param \IPS\forums\Forum $forum Forum object
* @param array $parentIds ParentIds to use
* @return void
*/
protected function getParentIds( $forum, &$parentIds )
{
if ( $forum->hasChildren() )
{
$parentIds[ $forum->id ] = $forum->id;
foreach( $forum->children() as $child )
{
if ( $child->hasChildren() )
{
$parentIds[ $child->id ] = $child->id;
$this->getParentIds( $child, $parentIds );
}
}
}
}
/**
* Set the viewing method
*
* @return void
*/
protected function setMethod()
{
$method = ( isset( \IPS\Request::i()->method ) ) ? \IPS\Request::i()->method : \IPS\Settings::i()->forums_default_view;
\IPS\Request::i()->setCookie( 'forum_view', $method, ( new \IPS\DateTime )->add( new \DateInterval( 'P1Y' ) ) );
if ( \IPS\Member::loggedIn()->member_id )
{
\IPS\Db::i()->replace( 'forums_view_method', array( 'member_id' => \IPS\Member::loggedIn()->member_id, 'method' => $method ) );
}
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=forums&module=forums&controller=index', 'front', 'forums' ) );
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Topic View
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 08 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\modules\front\forums;
@@ -52,7 +51,7 @@ class _topic extends \IPS\Content\Controller
\IPS\Member::loggedIn()->language()->words['submit_comment'] = \IPS\Member::loggedIn()->language()->addToStack( 'submit_reply', FALSE );
/* If there's only one forum we actually don't want the nav */
if ( \IPS\forums\Forum::theOnlyForum() )
if ( \IPS\forums\Forum::theOnlyForum() or \IPS\forums\Forum::isSimpleView() )
{
$topicBreadcrumb = array_pop( \IPS\Output::i()->breadcrumb );
\IPS\Output::i()->breadcrumb = isset( \IPS\Output::i()->breadcrumb['module'] ) ? array( 'module' => \IPS\Output::i()->breadcrumb['module'] ) : array();
@@ -227,7 +226,7 @@ class _topic extends \IPS\Content\Controller
}
$pagination = ( $topic->commentPageCount() > 1 ) ? $topic->commentPagination( array( 'sortby' ) ) : NULL;
}
$comments = $topic->comments( NULL, $offset, $order, $orderDirection, NULL, NULL, NULL, $where );
$comments = $topic->comments( NULL, $offset, $order, $orderDirection, NULL, NULL, NULL, $where, FALSE, ( isset( \IPS\Request::i()->showDeleted ) ) );
$current = current( $comments );
reset( $comments );
@@ -298,6 +297,97 @@ class _topic extends \IPS\Content\Controller
$nextUnread = NULL;
}
/* Add Json-LD */
\IPS\Output::i()->jsonLd['topic'] = array(
'@context' => "http://schema.org",
'@type' => $topic->isQuestion() ? 'Question' : 'DiscussionForumPosting',
'url' => (string) $topic->url(),
'discussionUrl' => (string) $topic->url(),
'name' => htmlspecialchars( $topic->mapped('title'), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'headline' => htmlspecialchars( $topic->mapped('title'), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'text' => strip_tags( $topic->isQuestion() ? $question->truncated() : $current->truncated() ),
'dateCreated' => \IPS\DateTime::ts( $topic->start_date )->format( \IPS\DateTime::ISO8601 ),
'datePublished' => \IPS\DateTime::ts( $topic->start_date )->format( \IPS\DateTime::ISO8601 ),
'pageStart' => 1,
'pageEnd' => $topic->commentPageCount(),
/* Image is required, but we don't have "topic images", so we'll use topic starter's profile photo for now */
'image' => \IPS\Member::load( $topic->starter_id )->get_photo(),
'author' => array(
'@type' => 'Person',
'name' => htmlspecialchars( $topic->starter_name ?: \IPS\Member::load( $topic->starter_id )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'url' => (string) \IPS\Member::load( $topic->starter_id )->url(),
'image' => \IPS\Member::load( $topic->starter_id )->get_photo()
),
'interactionStatistic' => array(
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/ViewAction",
'userInteractionCount' => $topic->views
),
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/CommentAction",
'userInteractionCount' => $topic->posts
),
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/FollowAction",
'userInteractionCount' => \IPS\forums\Topic::containerFollowerCount( $topic->container() )
),
)
);
if( $topic->isQuestion() )
{
\IPS\Output::i()->jsonLd['topic']['answerCount'] = $topic->posts ? $topic->posts - 1 : 0;
\IPS\Output::i()->jsonLd['topic']['upvoteCount'] = intval( $topic->question_rating );
if( $topic->topic_answered_pid )
{
try
{
$answer = \IPS\forums\Topic\Post::load( $topic->topic_answered_pid );
\IPS\Output::i()->jsonLd['topic']['acceptedAnswer'] = array(
'@type' => 'Answer',
'text' => strip_tags( $answer->truncated() ),
'url' => (string) $answer->url(),
'mainEntityOfPage' => (string) $topic->url(),
'dateCreated' => \IPS\DateTime::ts( $answer->post_date )->format( \IPS\DateTime::ISO8601 ),
'upvoteCount' => $answer->post_field_int,
'author' => array(
'@type' => 'Person',
'name' => htmlspecialchars( $answer->author_name ?: \IPS\Member::load( $answer->author_id )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'url' => (string) \IPS\Member::load( $answer->author_id )->url(),
'image' => \IPS\Member::load( $answer->author_id )->get_photo()
),
);
}
catch( \OutOfRangeException $e ){}
}
}
else
{
\IPS\Output::i()->jsonLd['topic']['comment'] = array();
foreach( $comments as $comment )
{
\IPS\Output::i()->jsonLd['topic']['comment'][] = array(
'@type' => 'Comment',
'url' => (string) $comment->url(),
'author' => array(
'@type' => 'Person',
'name' => htmlspecialchars( $comment->author_name ?: \IPS\Member::load( $comment->author_id )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'url' => (string) \IPS\Member::load( $comment->author_id )->url(),
'image' => \IPS\Member::load( $comment->author_id )->get_photo()
),
'dateCreated' => \IPS\DateTime::ts( $comment->post_date )->format( \IPS\DateTime::ISO8601 ),
'text' => strip_tags( $comment->truncated() ),
'mainEntityOfPage' => (string) $topic->url(),
);
}
}
/* Show topic */
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'topics' )->topic( $topic, $comments, $question, $votes, $nextUnread, $pagination, $topicVotes );
}
@@ -403,7 +493,7 @@ class _topic extends \IPS\Content\Controller
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->createTopic( $formTemplate, $forum, $title );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( $title );
if ( !\IPS\forums\Forum::theOnlyForum() )
if ( !\IPS\forums\Forum::theOnlyForum() and ! \IPS\forums\Forum::isSimpleView() )
{
try
{
@@ -450,6 +540,37 @@ class _topic extends \IPS\Content\Controller
\IPS\Output::i()->redirect( $topic->url() );
}
/**
* Remove the archive exclude flag
*
* @return void
*/
public function removeArchiveExclude()
{
\IPS\Session::i()->csrfCheck();
try
{
$topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );
if ( !$topic->canRemoveArchiveExcludeFlag() )
{
throw new \OutOfRangeException;
}
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->error( 'node_error', '2F173/P', 404, '' );
}
$topic->topic_archive_status = \IPS\forums\Topic::ARCHIVE_NOT;
$topic->save();
/* Log */
\IPS\Session::i()->modLog( 'modlog__removed_archive_exclude_topic', array( $topic->url()->__toString() => FALSE, $topic->mapped( 'title' ) => FALSE ), $topic );
\IPS\Output::i()->redirect( $topic->url() );
}
/**
* Rate Question
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 30 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100002;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 12 Dec 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100003;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 RC 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 3 Feb 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100011;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100015;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 RC 5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100018;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 RC6 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 18 Mar 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100020;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100028;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.7 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 27 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100032;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.8 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100033;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.9 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 19 Jun 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_100035;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101000;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.2 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 29 Oct 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101012;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.4 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 06 Nov 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101016;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 23 Nov 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101018;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.7 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 04 Jan 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101023;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.7 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 04 Jan 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101026;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.10 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
{subpackage}
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 12 Apr 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101027;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.11 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
{subpackage}
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 12 Apr 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101028;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.14 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 07 Jul 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101042;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.19 Beta 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 27 Jan 2017
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_101090;
@@ -0,0 +1,52 @@
{
"1": {
"method": "createTable",
"params": [
{
"name": "forums_view_method",
"columns": {
"member_id": {
"name": "member_id",
"type": "BIGINT",
"length": 20,
"decimals": null,
"values": null,
"allow_null": false,
"default": "",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"method": {
"name": "method",
"type": "VARCHAR",
"length": 10,
"decimals": null,
"values": null,
"allow_null": false,
"default": "table",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"columns": [
"member_id"
],
"length": [
null
]
}
}
}
]
}
}
@@ -0,0 +1,109 @@
<?php
/**
* @brief 4.2.0 Beta 1 Upgrade Code
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 12 Apr 2017
*/
namespace IPS\forums\setup\upg_101100;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.2.0 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Adjust some columns - we do it here to combine queries
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array(
array(
'table' => 'forums_topics',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "forums_topics ADD COLUMN topic_meta_data bit(1) NOT NULL DEFAULT b'0',
CHANGE title title VARCHAR(255) COLLATE " . \IPS\Db::i()->collation . " NOT NULL DEFAULT '',
CHANGE title_seo title_seo VARCHAR(255) COLLATE " . \IPS\Db::i()->collation . " NOT NULL DEFAULT ''"
),
array(
'table' => 'forums_forums',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "forums_forums ADD COLUMN club_id BIGINT(20) DEFAULT NULL COMMENT 'The club ID if this forum belongs to a club, or NULL',
ADD COLUMN feature_color VARCHAR(15) COLLATE " . \IPS\Db::i()->collation . " DEFAULT NULL COMMENT 'Feature color',
CHANGE last_title last_title VARCHAR(255) COLLATE " . \IPS\Db::i()->collation . " DEFAULT NULL"
) ) );
if ( count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'forums', 'extra' => array( '_upgradeStep' => 2, '_upgradeData' => 0 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Adjusting topic and forum database tables";
}
/**
* Theme settings clean up
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
/* Remove forum_layout theme setting */
$ids = iterator_to_array( \IPS\Db::i()->select( 'sc_id', 'core_theme_settings_fields', array( 'sc_key=? and sc_app=?', 'forum_layout', 'forums' ) ) );
if( count( $ids ) )
{
\IPS\Db::i()->delete( 'core_theme_settings_values', 'sv_id IN(' . implode( ',', $ids ) . ')' );
\IPS\Db::i()->delete( 'core_theme_settings_fields', 'sc_id IN(' . implode( ',', $ids ) . ')' );
}
/* Then remove it from each theme where it is cached */
foreach( \IPS\Db::i()->select( '*', 'core_themes' ) as $theme )
{
$settings = json_decode( $theme['set_template_settings'], true );
if( isset( $settings['forum_layout'] ) )
{
unset( $settings['forum_layout'] );
\IPS\Db::i()->update( 'core_themes', array( 'set_template_settings' => json_encode( $settings ) ), array( 'set_id=?', $theme['set_id'] ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Removing old theme settings";
}
}
@@ -0,0 +1,13 @@
{
"1": {
"method": "delete",
"params": [
"core_sys_lang_words",
[
"word_app=? AND word_key=?",
"forums",
"today"
]
]
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Upgrader: Custom Upgrade Options
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 5 Jun 2014
* @version SVN_VERSION_NUMBER
*/
$options = array(
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Alpha 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\setup\upg_40000;
@@ -228,7 +227,6 @@ class _Upgrade
{
\IPS\Db::i()->dropColumn( 'forums_forums', array( 'name', 'description', 'rules_text', 'permission_custom_error', 'rules_title' ) );
/* @link https://community.invisionpower.com/4bugtrack/active-reports/348-to-40121-column-last_id-cannot-be-null-r7650/ */
\IPS\Db::i()->changeColumn( 'forums_forums', 'last_id', array(
'name' => 'last_id',
'type' => 'int',
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Feed Import Node
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 4 Fed 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums;
+167 -57
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Forum Node
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 7 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums;
@@ -24,6 +23,9 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
*/
class _Forum extends \IPS\Node\Model implements \IPS\Node\Permissions
{
use \IPS\Content\ClubContainer;
use \IPS\Node\Colorize;
/**
* @brief [ActiveRecord] Multiton Store
*/
@@ -302,7 +304,7 @@ class _Forum extends \IPS\Node\Model implements \IPS\Node\Permissions
public function get__sortBy()
{
return $this->sort_key;
}
}
/**
* Last Poster ID Column
@@ -570,6 +572,7 @@ class _Forum extends \IPS\Node\Model implements \IPS\Node\Permissions
$return[] = 'password';
$return[] = 'password_override';
$return[] = 'min_posts_view';
$return[] = 'club_id';
return $return;
}
@@ -1022,6 +1025,10 @@ class _Forum extends \IPS\Node\Model implements \IPS\Node\Permissions
$form->add( new \IPS\Helpers\Form\Translatable( 'forum_rules_title', NULL, FALSE, array( 'app' => 'forums', 'key' => ( $this->id ? "forums_forum_{$this->id}_rulestitle" : NULL ) ), NULL, NULL, NULL, 'forum_rules_title' ) );
$form->add( new \IPS\Helpers\Form\Translatable( 'forum_rules_text', NULL, FALSE, array( 'app' => 'forums', 'key' => ( $this->id ? "forums_forum_{$this->id}_rules" : NULL ), 'editor' => array( 'app' => 'forums', 'key' => 'Forums', 'autoSaveKey' => ( $this->id ? "forums-rules-{$this->id}" : "forums-new-rules" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'rules' ) : NULL ) ), NULL, NULL, NULL, 'forum_rules_text' ) );
/* Color */
$form->add( new \IPS\Helpers\Form\YesNo( 'forum_use_feature_color', $this->feature_color ? 1 : 0, FALSE, array( 'togglesOn' => array( 'forum_feature_color' ) ), NULL, NULL, NULL, 'forum_use_feature_color' ) );
$form->add( new \IPS\Helpers\Form\Color( 'forum_feature_color', $this->feature_color ?: '', FALSE, array(), NULL, NULL, NULL, 'forum_feature_color' ) );
$form->addHeader( 'forum_display_topic' );
$form->addHeader( 'forum_display_question' );
$form->add( new \IPS\Helpers\Form\YesNo( 'bw_enable_answers_member', $this->id ? $this->forums_bitoptions['bw_enable_answers_member'] : TRUE, FALSE, array(), NULL, NULL, NULL, 'bw_enable_answers_member' ) );
@@ -1217,7 +1224,18 @@ class _Forum extends \IPS\Node\Model implements \IPS\Node\Permissions
$values['preview_posts'] = 0;
}
}
/* Feature color */
if ( isset( $values['use_feature_color'] ) )
{
if ( ! $values['use_feature_color'] )
{
$values['feature_color'] = NULL;
}
unset( $values['use_feature_color'] );
}
if ( !$this->id )
{
$this->save();
@@ -1397,58 +1415,9 @@ class _Forum extends \IPS\Node\Model implements \IPS\Node\Permissions
*/
public static function theOnlyForum()
{
if ( count( \IPS\forums\Forum::roots() ) === 1 )
{
foreach ( \IPS\forums\Forum::roots() as $root )
{
if ( $root->childrenCount() === 1 )
{
foreach ( $root->children() as $forum )
{
if ( !$forum->redirect_url and !$forum->password )
{
return $forum;
}
}
}
}
}
return NULL;
return static::theOnlyNode( array( 'redirect_url' => FALSE, 'password' => FALSE, 'club_id' => 0 ), FALSE );
}
/**
* Search Index Permissions
* Overloaded here so we can discard categories as they should not influence permissions overall.
*
* @return string Comma-delimited values or '*'
* @li Number indicates a group
* @li Number prepended by "m" indicates a member
* @li Number prepended by "s" indicates a social group
*/
public function searchIndexPermissions()
{
/* Compare both read and view */
$result = static::_getPermissions( $this );
/* And then loop up the parents too... */
foreach ( $this->parents() as $parent )
{
$parentResult = static::_getPermissions( $parent );
if( $result == '*' )
{
$result = $parentResult;
}
else if( $parentResult != '*' )
{
$result = implode( ',', array_intersect( explode( ',', $result ), explode( ',', $parentResult ) ) );
}
}
return $result;
}
/**
* Get which permission keys can access all topics in a forum which
* can normally only show topics to the author
@@ -1746,4 +1715,145 @@ class _Forum extends \IPS\Node\Model implements \IPS\Node\Permissions
'url' => (string) $this->url()
);
}
/* !Clubs */
/**
* Set form for creating a node of this type in a club
*
* @param \IPS\Helpers\Form $form Form object
* @return void
*/
public function clubForm( \IPS\Helpers\Form $form )
{
$itemClass = static::$contentItemClass;
$form->add( new \IPS\Helpers\Form\Text( 'club_node_name', $this->_id ? $this->_title : \IPS\Member::loggedIn()->language()->addToStack( $itemClass::$title . '_pl' ), TRUE, array( 'maxLength' => 255 ) ) );
$form->add( new \IPS\Helpers\Form\Editor( 'club_node_description', $this->_id ? \IPS\Member::loggedIn()->language()->get( static::$titleLangPrefix . $this->_id . '_desc' ) : NULL, FALSE, array( 'app' => 'forums', 'key' => 'Forums', 'autoSaveKey' => ( $this->id ? "forums-forum-{$this->id}" : "forums-new-forum" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL, 'minimize' => 'forum_description_placeholder' ) ) );
}
/**
* Class-specific routine when saving club form
*
* @param \IPS\Member\Club $club The club
* @param array $values Values
* @return void
*/
public function _saveClubForm( \IPS\Member\Club $club, $values )
{
if ( $values['club_node_name'] )
{
$this->name_seo = \IPS\Http\Url\Friendly::seoTitle( $values['club_node_name'] );
}
}
/* !Simple view */
/**
* Is simple view one? Calculates admin settings and user's choice
*
* @param \IPS\forums\Forum|NULL $forum The forum objectr
* @return boolean
*/
public static function isSimpleView( $forum=NULL )
{
$simpleView = false;
/* Clubs cannot be simple mode or it breaks out of the club container */
if ( $forum and $forum->club() )
{
return false;
}
/* Guests are locked to the admin choice */
if ( ! \IPS\Member::loggedIn()->member_id )
{
return \IPS\Settings::i()->forums_default_view === 'fluid' ? true : false;
}
if ( \IPS\Settings::i()->forums_default_view === 'fluid' )
{
$simpleView = true;
}
$method = static::getMemberView();
if ( $method !== 'fluid' )
{
$simpleView = false;
}
else if ( $method === 'fluid' )
{
$simpleView = true;
}
return $simpleView;
}
/**
* Get the member's view method
*
* @return string
*/
public static function getMemberView()
{
$method = ( isset( \IPS\Request::i()->cookie['forum_view'] ) ) ? \IPS\Request::i()->cookie['forum_view'] : NULL;
$chooseable = \IPS\Settings::i()->forums_default_view_choose ? json_decode( \IPS\Settings::i()->forums_default_view_choose , TRUE ) : FALSE;
if ( ! $chooseable )
{
return \IPS\Settings::i()->forums_default_view;
}
if ( ! $method )
{
try
{
$method = \IPS\Db::i()->select( 'method', 'forums_view_method', array( 'member_id=?', \IPS\Member::loggedIn()->member_id ) )->first();
/* Attempt to set the cookie again */
\IPS\Request::i()->setCookie( 'forum_view', $method, ( new \IPS\DateTime )->add( new \DateInterval( 'P1Y' ) ) );
}
catch( \UnderFlowException $e ){ }
}
if ( ! $method or ( $chooseable != '*' AND ! in_array( $method, $chooseable ) ) )
{
$method = \IPS\Settings::i()->forums_default_view;
}
return $method;
}
/**
* Get URL
*
* @return \IPS\Http\Url
*/
public function url()
{
if ( static::isSimpleView() and ! $this->club() )
{
return \IPS\Http\Url::internal( 'app=forums&module=forums&controller=index&forumId=' . $this->id, 'front', 'forums' );
}
return parent::url();
}
/**
* Get URL from index data
*
* @param array $indexData Data from the search index
* @param array $itemData Basic data about the item. Only includes columns returned by item::basicDataColumns()
* @param array|NULL $containerData Basic data about the container. Only includes columns returned by container::basicDataColumns()
* @return \IPS\Http\Url
*/
public static function urlFromIndexData( $indexData, $itemData, $containerData )
{
if ( static::isSimpleView() and ! $containerData['club_id'] )
{
return \IPS\Http\Url::internal( 'app=forums&module=forums&controller=index&forumId=' . $indexData['index_container_id'], 'front', 'forums' );
}
return parent::urlFromIndexData( $indexData, $itemData, $containerData );
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Saved Action Node
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 31 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Archived Post Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 24 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\Topic;
@@ -180,14 +179,13 @@ class _ArchivedPost extends Post
}
/**
* Can give reputation?
* Can react?
*
* @note This method is also ran to check if a member can "unrep"
* @param int $type 1 for positive, -1 for negative
* @param \IPS\Member|NULL $member The member to check for (NULL for currently logged in member)
* @return bool
*/
public function canGiveReputation( $type, \IPS\Member $member = NULL )
public function canReact( \IPS\Member $member = NULL )
{
return FALSE;
}
+43 -13
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Post Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 8 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\Topic;
@@ -22,8 +21,10 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
/**
* Post Model
*/
class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \IPS\Content\EditHistory, \IPS\Content\Hideable, \IPS\Content\Reputation, \IPS\Content\Shareable, \IPS\Content\Searchable, \IPS\Content\Embeddable
class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \IPS\Content\EditHistory, \IPS\Content\Hideable, \IPS\Content\Shareable, \IPS\Content\Searchable, \IPS\Content\Embeddable
{
use \IPS\Content\Reactable;
/**
* @brief [ActiveRecord] Multiton Store
*/
@@ -82,11 +83,6 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \
*/
public static $icon = 'comment';
/**
* @brief Reputation Type
*/
public static $reputationType = 'pid';
/**
* @brief [Content\Comment] Comment Template
*/
@@ -227,9 +223,10 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \
* @param bool $asItem Displaying results as items?
* @param bool $canIgnoreComments Can ignore comments in the result stream? Activity stream can, but search results cannot.
* @param array $template Optional custom template
* @param array $reactions Reaction Data
* @return string
*/
public static function searchResult( array $indexData, array $authorData, array $itemData, array $containerData = NULL, array $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments=FALSE, $template=NULL )
public static function searchResult( array $indexData, array $authorData, array $itemData, array $containerData = NULL, array $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments=FALSE, $template=NULL, $reactions=array() )
{
/* Password protected */
if (
@@ -257,10 +254,21 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \
/* Normal */
else
{
return parent::searchResult( $indexData, $authorData, $itemData, $containerData, $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments, $template );
return parent::searchResult( $indexData, $authorData, $itemData, $containerData, $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments, $template, $reactions );
}
}
/**
* Can promote this comment/item?
*
* @param \IPS\Member|NULL $member The member to check for (NULL for currently logged in member)
* @return boolean
*/
public function canPromoteToSocialMedia( $member=NULL )
{
return $this->item()->canPromoteToSocialMedia( $member );
}
/* !Questions & Answers */
/**
@@ -437,4 +445,26 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \
{
return (boolean) $this->post_htmlstate > 0;
}
/**
* Reaction type
*
* @return string
*/
public static function reactionType()
{
return 'pid';
}
/**
* Get content for embed
*
* @param array $params Additional parameters to add to URL
* @return string
*/
public function embedContent( $params )
{
\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 ) );
}
}
+98 -10
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Topic Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 8 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums;
@@ -34,7 +33,8 @@ class _Topic extends \IPS\Content\Item implements
\IPS\Content\Polls, \SplObserver,
\IPS\Content\Ratings,
\IPS\Content\Searchable,
\IPS\Content\Embeddable
\IPS\Content\Embeddable,
\IPS\Content\MetaData
{
const ARCHIVE_NOT = 0;
const ARCHIVE_DONE = 1;
@@ -97,7 +97,8 @@ class _Topic extends \IPS\Content\Item implements
'moved_on' => 'moved_on',
'featured' => 'featured',
'state' => 'state',
'updated' => 'last_post'
'updated' => 'last_post',
'meta_data' => 'topic_meta_data'
);
/**
@@ -1085,6 +1086,17 @@ class _Topic extends \IPS\Content\Item implements
return parent::unhide( $member );
}
/**
* Can promote this comment/item?
*
* @param \IPS\Member|NULL $member The member to check for (NULL for currently logged in member)
* @return boolean
*/
public function canPromoteToSocialMedia( $member=NULL )
{
return parent::canPromoteToSocialMedia( $member ) and $this->container()->can_view_others;
}
/* !Saved Actions */
@@ -1105,10 +1117,11 @@ class _Topic extends \IPS\Content\Item implements
* @param string $action The action
* @param \IPS\Member|NULL $member The member doing the action (NULL for currently logged in member)
* @param string|NULL $reason Reason (for hides)
* @param bool $immedaitely Delete Immediately
* @return void
* @throws \OutOfRangeException|\InvalidArgumentException|\RuntimeException
*/
public function modAction( $action, \IPS\Member $member = NULL, $reason = NULL )
public function modAction( $action, \IPS\Member $member = NULL, $reason = NULL, $immediately = FALSE )
{
if ( mb_substr( $action, 0, 12 ) === 'savedAction-' )
{
@@ -1450,6 +1463,23 @@ class _Topic extends \IPS\Content\Item implements
}
return FALSE;
}
/**
* Should this topic be archived again?
*
* @param \IPS\Member\NULL $member The member (NULL for currently logged in member)
* @return bool
*/
public function canRemoveArchiveExcludeFlag( $member=NULL )
{
$member = $member ?: \IPS\Member::loggedIn();
if ( $member->hasAcpRestriction( 'forums', 'forums', 'archive_manage' ) AND $this->topic_archive_status == static::ARCHIVE_EXCLUDE )
{
return TRUE;
}
return FALSE;
}
/**
* Unarchive confirm message
@@ -1650,6 +1680,41 @@ class _Topic extends \IPS\Content\Item implements
return parent::commentMultimodActions( $member );
}
/**
* Can Feature a Comment
*
* @param \IPS\Member|NULL The member, or NULL for currently logged in
* @return bool
* @note This is a wrapper for the extension so content items can extend and apply their own logic
*/
public function canFeatureComment( \IPS\Member $member = NULL )
{
if ( $this->isArchived() OR $this->isQuestion() )
{
return FALSE;
}
return parent::canFeatureComment( $member );
}
/**
* Can perform an action on a message
*
* @param string The action
* @param \IPS\Member|NULL The member, or NULL for currently logged in
* @return bool
* @note This is a wrapper for the extension so content items can extend and apply their own logic
*/
public function canOnMessage( $action, \IPS\Member $member = NULL )
{
if ( $this->isArchived() )
{
return FALSE;
}
return parent::canOnMessage( $action, $member );
}
/**
* Get comments
*
@@ -1662,9 +1727,10 @@ class _Topic extends \IPS\Content\Item implements
* @param \IPS\DateTime|NULL $cutoff If an \IPS\DateTime object is provided, only comments posted AFTER that date will be included
* @param mixed $extraWhereClause Additional where clause(s) (see \IPS\Db::build for details)
* @param bool|NULL $bypassCache Used in cases where comments may have already been loaded i.e. splitting comments on an item.
* @param bool $includeDeleted Include Deleted Content
* @return array|NULL|\IPS\Content\Comment If $limit is 1, will return \IPS\Content\Comment or NULL for no results. For any other number, will return an array.
*/
public function comments( $limit=NULL, $offset=NULL, $order='date', $orderDirection='asc', $member=NULL, $includeHiddenComments=NULL, $cutoff=NULL, $extraWhereClause=NULL, $bypassCache=FALSE )
public function comments( $limit=NULL, $offset=NULL, $order='date', $orderDirection='asc', $member=NULL, $includeHiddenComments=NULL, $cutoff=NULL, $extraWhereClause=NULL, $bypassCache=FALSE, $includeDeleted=FALSE )
{
static $comments = array();
$idField = static::$databaseColumnId;
@@ -1708,7 +1774,7 @@ class _Topic extends \IPS\Content\Item implements
$class = static::$commentClass;
}
$comments[ $_hash ] = $this->_comments( $class, $limit ?: static::getCommentsPerPage(), $offset, ( isset( $class::$databaseColumnMap[ $order ] ) ? ( $class::$databasePrefix . $class::$databaseColumnMap[ $order ] ) : $order ) . ' ' . $orderDirection, $member, $includeHiddenComments, $cutoff, $includeWarnings, $extraWhereClause );
$comments[ $_hash ] = $this->_comments( $class, $limit ?: static::getCommentsPerPage(), $offset, ( isset( $class::$databaseColumnMap[ $order ] ) ? ( $class::$databasePrefix . $class::$databaseColumnMap[ $order ] ) : $order ) . ' ' . $orderDirection, $member, $includeHiddenComments, $cutoff, $includeWarnings, $extraWhereClause, $includeDeleted );
/* Restore comment class now */
if( $commentClass )
@@ -1873,4 +1939,26 @@ class _Topic extends \IPS\Content\Item implements
$firstComment = $this->firstComment();
return $firstComment ? $firstComment->content() : '';
}
/**
* Supported Meta Data Types
*
* @return array|NULL
*/
public static function supportedMetaDataTypes()
{
return array( 'core_FeaturedComments', 'core_ContentMessages' );
}
/**
* Get content for embed
*
* @param array $params Additional parameters to add to URL
* @return string
*/
public function embedContent( $params )
{
\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' )->embedTopic( $this, $this->url()->setQueryString( $params ) );
}
}
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief archive Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 24 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\tasks;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief rssimport Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 05 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\tasks;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief unarchive Task
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 07 Sep 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\tasks;
@@ -1,13 +1,12 @@
<?php
/**
* @brief forumStatistics Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 27 Mar 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\widgets;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief hotTopics Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 2 Sep 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\widgets;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief poll Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 21 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\widgets;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Topic Feed Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 16 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\widgets;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Topic Feed Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Forums
* @since 16 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\forums\widgets;