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

+60 -9
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief View Blog Entry Controller
* @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 Blog
* @since 03 Mar 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\blog\modules\front\blogs;
@@ -96,6 +95,58 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
\IPS\Output::i()->rssFeeds['blog_rss_title'] = \IPS\Http\Url::internal( "app=blog&module=blogs&controller=view&id={$this->blog->_id}", 'front', 'blogs_rss', array( $this->blog->seo_name ) );
}
/* Add JSON-ld */
\IPS\Output::i()->jsonLd['blog'] = array(
'@context' => "http://schema.org",
'@type' => "Blog",
'url' => (string) $this->blog->url(),
'name' => htmlspecialchars( $this->blog->_title, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'description' => strip_tags( $this->blog->description ),
'commentCount' => $this->blog->_comments,
'interactionStatistic' => array(
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/ViewAction",
'userInteractionCount' => $this->blog->num_views
),
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/FollowAction",
'userInteractionCount' => \IPS\blog\Entry::containerFollowerCount( $this->blog )
),
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/CommentAction",
'userInteractionCount' => $this->blog->_comments
),
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/WriteAction",
'userInteractionCount' => $this->blog->_items
)
)
);
if( $this->blog->coverPhoto()->file )
{
\IPS\Output::i()->jsonLd['blog']['image'] = (string) $this->blog->coverPhoto()->file->url;
}
if( $this->blog->member_id )
{
\IPS\Output::i()->jsonLd['blog']['author'] = array(
'@type' => 'Person',
'name' => htmlspecialchars( \IPS\Member::load( $this->blog->member_id )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'url' => (string) \IPS\Member::load( $this->blog->member_id )->url(),
'image' => \IPS\Member::load( $this->blog->member_id )->get_photo()
);
}
if( \IPS\Settings::i()->blog_enable_sidebar and $this->blog->sidebar )
{
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate('view')->blogSidebar( $this->blog->sidebar );
}
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_browse.js', 'blog', 'front' ) );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'view' )->view( $this->blog, (string) $table );
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item_blogs' ) ] = array( 'type' => 'blog_entry', 'nodes' => $this->blog->_id );
@@ -108,7 +159,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
*/
protected function editBlog()
{
if( !$this->blog->canEdit() OR $this->blog->groupblog_ids )
if( !$this->blog->canEdit() OR $this->blog->groupblog_ids or $this->blog->club_id )
{
\IPS\Output::i()->error( 'no_module_permission', '2B201/2', 403, '' );
}
@@ -116,7 +167,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
\IPS\Session::i()->csrfCheck();
/* Build form */
$form = new \IPS\Helpers\Form;
$form = new \IPS\Helpers\Form( 'form', 'save', $this->blog->url()->setQueryString( array( 'do' => 'editBlog' ) )->csrf() );
$form->class .= 'ipsForm_vertical';
$this->blog->form( $form, TRUE );
@@ -152,7 +203,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
{
\IPS\Session::i()->csrfCheck();
if( !$this->blog->canDelete() )
if( !$this->blog->canDelete() or $this->blog->club_id )
{
\IPS\Output::i()->error( 'no_module_permission', '2B201/3', 403, '' );
}
@@ -180,7 +231,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
\IPS\Session::i()->csrfCheck();
/* Do we have permission */
if ( ( $this->blog->pinned and !\IPS\Member::loggedIn()->modPermission('can_unpin_content') ) or ( !$this->blog->pinned and !\IPS\Member::loggedIn()->modPermission('can_pin_content') ) )
if ( ( $this->blog->pinned and !\IPS\Member::loggedIn()->modPermission('can_unpin_content') ) or ( !$this->blog->pinned and !\IPS\Member::loggedIn()->modPermission('can_pin_content') ) or $this->blog->club_id )
{
\IPS\Output::i()->error( 'no_module_permission', '2B201/4', 403, '' );
}