Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -204,42 +204,46 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \
|
||||
/**
|
||||
* Get HTML for search result display
|
||||
*
|
||||
* @return callable
|
||||
* @param array $indexData Data from the search index
|
||||
* @param array $authorData Basic data about the author. Only includes columns returned by \IPS\Member::columnsForPhoto()
|
||||
* @param array $itemData Basic data about the item. Only includes columns returned by item::basicDataColumns()
|
||||
* @param array|NULL $containerData Basic data about the author. Only includes columns returned by container::basicDataColumns()
|
||||
* @param array $reputationData Array of people who have given reputation and the reputation they gave
|
||||
* @param int|NULL $reviewRating If this is a review, the rating
|
||||
* @param bool $iPostedIn If the user has posted in the item
|
||||
* @param string $view 'expanded' or 'condensed'
|
||||
* @param bool $asItem Displaying results as items?
|
||||
* @return string
|
||||
*/
|
||||
public function searchResultHtml()
|
||||
{
|
||||
if ( $this->item()->container()->password and !\IPS\Member::loggedIn()->inGroup( explode( ',', $this->item()->container()->password_override ) ) and !( isset( \IPS\Request::i()->cookie[ 'ipbforumpass_' . $this->item()->container()->id ] ) and md5( $this->item()->container()->password ) === \IPS\Request::i()->cookie[ 'ipbforumpass_' . $this->item()->container()->id ] ) )
|
||||
public static function searchResult( array $indexData, array $authorData, array $itemData, array $containerData = NULL, array $reputationData, $reviewRating, $iPostedIn, $view, $asItem )
|
||||
{
|
||||
/* Password protected */
|
||||
if (
|
||||
$containerData['password'] // There is a password
|
||||
and !\IPS\Member::loggedIn()->inGroup( explode( ',', $containerData['password_override'] ) ) // We can't bypass it
|
||||
and (
|
||||
!isset( \IPS\Request::i()->cookie[ 'ipbforumpass_' . $indexData['index_container_id'] ] )
|
||||
or
|
||||
md5( $containerData['password'] ) !== \IPS\Request::i()->cookie[ 'ipbforumpass_' . $indexData['index_container_id'] ]
|
||||
) // We don't have the correct password
|
||||
)
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->searchNoPermission( $this, \IPS\Member::loggedIn()->language()->addToStack('no_perm_post_password'), $this->item()->container()->url()->setQueryString( 'topic', $this->item()->tid ) );
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->searchNoPermission(
|
||||
\IPS\Member::loggedIn()->language()->addToStack('no_perm_post_password'),
|
||||
\IPS\Http\Url::internal( \IPS\forums\Forum::$urlBase . $indexData['index_container_id'], 'front', \IPS\forums\Forum::$urlTemplate, array( $containerData[ \IPS\forums\Forum::$databasePrefix . \IPS\forums\Forum::$seoTitleColumn ] ) )->setQueryString( 'topic', $indexData['index_item_id'] )
|
||||
);
|
||||
}
|
||||
elseif ( $this->item()->container()->min_posts_view and $this->item()->container()->min_posts_view >= \IPS\Member::loggedIn()->member_posts )
|
||||
|
||||
/* Minimum posts */
|
||||
elseif ( $containerData['min_posts_view'] and $containerData['min_posts_view'] >= \IPS\Member::loggedIn()->member_po )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->searchNoPermission( $this, \IPS\Member::loggedIn()->language()->addToStack( 'no_perm_post_min_posts', FALSE, array( 'pluralize' => array( $this->item()->container()->min_posts_view ) ) ) );
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->searchNoPermission( \IPS\Member::loggedIn()->language()->addToStack( 'no_perm_post_min_posts', FALSE, array( 'pluralize' => array( $containerData['min_posts_view'] ) ) ) );
|
||||
}
|
||||
|
||||
/* Normal */
|
||||
else
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'search', 'core', 'front' )->contentComment( $this );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML for search result display
|
||||
*
|
||||
* @return callable
|
||||
*/
|
||||
public function activityStreamHtml()
|
||||
{
|
||||
if ( $this->item()->container()->password and !\IPS\Member::loggedIn()->inGroup( explode( ',', $this->item()->container()->password_override ) ) and !( isset( \IPS\Request::i()->cookie[ 'ipbforumpass_' . $this->item()->container()->id ] ) and md5( $this->item()->container()->password ) === \IPS\Request::i()->cookie[ 'ipbforumpass_' . $this->item()->container()->id ] ) )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->searchNoPermission( $this, \IPS\Member::loggedIn()->language()->addToStack('no_perm_post_password'), $this->item()->container()->url()->setQueryString( 'topic', $this->item()->tid ) );
|
||||
}
|
||||
elseif ( $this->item()->container()->min_posts_view and $this->item()->container()->min_posts_view >= \IPS\Member::loggedIn()->member_posts )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->searchNoPermission( $this, \IPS\Member::loggedIn()->language()->addToStack( 'no_perm_post_min_posts', FALSE, array( 'pluralize' => array( $this->item()->container()->min_posts_view ) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'system', 'core', 'front' )->activityStreamResult( $this );
|
||||
return parent::searchResult( $indexData, $authorData, $itemData, $containerData, $reputationData, $reviewRating, $iPostedIn, $view, $asItem );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,17 +326,18 @@ class _Post extends \IPS\Content\Comment implements \IPS\Content\ReportCenter, \
|
||||
* @param \IPS\Lang|NULL $language The language to use, or NULL for the language of the currently logged in member
|
||||
* @return string
|
||||
*/
|
||||
public function indefiniteArticle( \IPS\Lang $lang = NULL )
|
||||
public static function _indefiniteArticle( array $containerData = NULL, \IPS\Lang $lang = NULL )
|
||||
{
|
||||
if ( $this->item()->isQuestion() )
|
||||
$bitOptions = ( $containerData['forums_bitoptions'] instanceof \IPS\Patterns\Bitwise ) ? $containerData['forums_bitoptions'] : new \IPS\Patterns\Bitwise( array( 'forums_bitoptions' => $containerData['forums_bitoptions'] ), \IPS\forums\Forum::$bitOptions['forums_bitoptions'] );
|
||||
|
||||
if ( $bitOptions['bw_enable_answers'] )
|
||||
{
|
||||
$lang = $lang ?: \IPS\Member::loggedIn()->language();
|
||||
|
||||
return ( $this->isFirst() ) ? $lang->get( '__indefart_question', FALSE ) : $lang->get( '__indefart_answer', FALSE );
|
||||
return $lang->addToStack( '__indefart_answer', FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::indefiniteArticle( $lang );
|
||||
return parent::_indefiniteArticle( $containerData, $lang );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user