Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -196,6 +196,7 @@ class _Stream extends \IPS\Node\Model
|
||||
$stream->date_type = 'relative';
|
||||
$stream->default_view = 'expanded';
|
||||
$stream->baseUrl = \IPS\Http\Url::internal( "app=core&module=discover&controller=streams", 'front', 'discover_all' );
|
||||
$stream->read = "all";
|
||||
return $stream;
|
||||
}
|
||||
|
||||
@@ -394,7 +395,7 @@ class _Stream extends \IPS\Node\Model
|
||||
$nodeClass = $class::$containerNodeClass;
|
||||
$value = isset( $containers->$class ) ? $containers->$class : 0;
|
||||
|
||||
$field = new \IPS\Helpers\Form\Node( 'stream_containers_' . $class::$title, $value, FALSE, array( 'class' => $nodeClass, 'clubs' => TRUE, 'multiple' => TRUE, 'zeroVal' => 'all', 'permissionCheck' => $nodeClass::searchableNodesPermission(), 'forceOwner' => FALSE, 'subnodes' => FALSE ), NULL, NULL, NULL, 'stream_containers_' . $class::$title );
|
||||
$field = new \IPS\Helpers\Form\Node( 'stream_containers_' . $class::$title, $value, FALSE, array( 'class' => $nodeClass, 'clubs' => TRUE, 'multiple' => TRUE, 'zeroVal' => 'all', 'forceOwner' => FALSE, 'subnodes' => FALSE ), NULL, NULL, NULL, 'stream_containers_' . $class::$title );
|
||||
$field->label = \IPS\Member::loggedIn()->language()->addToStack( $nodeClass::$nodeTitle );
|
||||
$form->add( $field );
|
||||
}
|
||||
@@ -560,6 +561,12 @@ class _Stream extends \IPS\Node\Model
|
||||
*/
|
||||
protected function _getOurClubs()
|
||||
{
|
||||
/* If we're in the ACP, just return all clubs */
|
||||
if( \IPS\Dispatcher::hasInstance() and \IPS\Dispatcher::i()->controllerLocation === 'admin' )
|
||||
{
|
||||
return iterator_to_array( \IPS\Member\Club::clubs( NULL, NULL, 'name' ) );
|
||||
}
|
||||
|
||||
if( static::$ourClubs === NULL )
|
||||
{
|
||||
static::$ourClubs = \IPS\Member\Club::clubs( \IPS\Member::loggedIn(), NULL, 'name', TRUE, array(), \IPS\Settings::i()->clubs_require_approval ? array( 'approved=1' ) : NULL );
|
||||
@@ -871,7 +878,7 @@ class _Stream extends \IPS\Node\Model
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->tags )
|
||||
if ( $this->tags and \IPS\Settings::i()->tags_enabled )
|
||||
{
|
||||
$terms[] = \IPS\Member::loggedIn()->language()->addToStack( 'stream_includes_tags', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( array_map( function( $val ){
|
||||
return '\'' . $val . '\'';
|
||||
@@ -1098,7 +1105,7 @@ class _Stream extends \IPS\Node\Model
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
if( $this->tags )
|
||||
if( $this->tags and \IPS\Settings::i()->tags_enabled )
|
||||
{
|
||||
$config['stream_tags'] = $this->tags;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ class _Subscription extends \IPS\Patterns\ActiveRecord
|
||||
*/
|
||||
public static function sendBatch( $frequency = 'daily', $numberToSend = 25 )
|
||||
{
|
||||
/* @note SELECT_FROM_WRITE_SERVER to prevent further cycles from having data on the write but not read servers */
|
||||
$subscriptions = iterator_to_array(
|
||||
\IPS\Db::i()->select( 'core_stream_subscriptions.*, core_members.last_visit', 'core_stream_subscriptions', array('frequency = ? AND sent < ? and last_visit > ?', $frequency, ( $frequency == 'daily' ) ? time() - 86400 : time() - 604800, time() - \IPS\Settings::i()->activity_stream_subscriptions_inactive_limit * 86400), 'sent ASC', array(0, $numberToSend), NULL, NULL, \IPS\Db::SELECT_DISTINCT | \IPS\Db::SELECT_FROM_WRITE_SERVER )
|
||||
->join( 'core_members', 'core_stream_subscriptions.member_id=core_members.member_id') );
|
||||
@@ -174,7 +175,9 @@ class _Subscription extends \IPS\Patterns\ActiveRecord
|
||||
$containerUrl = $containerClass::urlFromIndexData( $data['indexData'], $data['itemData'], $data['containerData'] );
|
||||
}
|
||||
|
||||
$items[] = array_merge($data, [
|
||||
try
|
||||
{
|
||||
$items[] = array_merge($data, [
|
||||
'title' => $object instanceof \IPS\Content\Comment ? $object->item()->searchIndexTitle() : $object->searchIndexTitle(),
|
||||
'url' => $object->url(),
|
||||
'content' => $object->content(),
|
||||
@@ -183,7 +186,13 @@ class _Subscription extends \IPS\Patterns\ActiveRecord
|
||||
'itemClass' => $itemClass,
|
||||
'containerUrl' => $containerUrl,
|
||||
'containerTitle' => $containerTitle
|
||||
]);
|
||||
]);
|
||||
}
|
||||
catch( \OutOfRangeException|\BadMethodCallException $e )
|
||||
{
|
||||
/* If the item is no longer available, we'll just skip it */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $items;
|
||||
|
||||
Reference in new issue
Block a user