Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -3,7 +3,7 @@
|
||||
* @brief Blog Application Class
|
||||
* @author <a href=''>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2014 Invision Power Services, Inc.
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 3 Mar 2014
|
||||
* @version
|
||||
@@ -51,4 +51,37 @@ class _Application extends \IPS\Application
|
||||
{
|
||||
return 'file-text';
|
||||
}
|
||||
|
||||
/**
|
||||
* Default front navigation
|
||||
*
|
||||
* @code
|
||||
|
||||
// Each item...
|
||||
array(
|
||||
'key' => 'Example', // The extension key
|
||||
'app' => 'core', // [Optional] The extension application. If ommitted, uses this application
|
||||
'config' => array(...), // [Optional] The configuration for the menu item
|
||||
'title' => 'SomeLangKey', // [Optional] If provided, the value of this language key will be copied to menu_item_X
|
||||
'children' => array(...), // [Optional] Array of child menu items for this item. Each has the same format.
|
||||
)
|
||||
|
||||
return array(
|
||||
'rootTabs' => array(), // These go in the top row
|
||||
'browseTabs' => array(), // These go under the Browse tab on a new install or when restoring the default configuraiton; or in the top row if installing the app later (when the Browse tab may not exist)
|
||||
'browseTabsEnd' => array(), // These go under the Browse tab after all other items on a new install or when restoring the default configuraiton; or in the top row if installing the app later (when the Browse tab may not exist)
|
||||
'activityTabs' => array(), // These go under the Activity tab on a new install or when restoring the default configuraiton; or in the top row if installing the app later (when the Activity tab may not exist)
|
||||
)
|
||||
* @endcode
|
||||
* @return array
|
||||
*/
|
||||
public function defaultFrontNavigation()
|
||||
{
|
||||
return array(
|
||||
'rootTabs' => array(),
|
||||
'browseTabs' => array( array( 'key' => 'Blogs' ) ),
|
||||
'browseTabsEnd' => array(),
|
||||
'activityTabs' => array()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Blog Blogs 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
|
||||
* @subpackage Blog
|
||||
* @since 9 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\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 Blog Blogs API
|
||||
*/
|
||||
class _blogs extends \IPS\Api\Controller
|
||||
{
|
||||
/**
|
||||
* GET /blog/blogs
|
||||
* Get list of blogs
|
||||
*
|
||||
* @apiparam string owners Comma-delimited list of member IDs - if provided, only blogs owned by those members are returned (can be used in conjection with groups or set to 0 to exclude member-created blogs)
|
||||
* @apiparam string groups Comma-delimited list of group IDs - if provided, only blogs owned by those groups are returned (can be used in conjection with members or set to 0 to exclude group blogs)
|
||||
* @apiparam int pinned If 1, only blogs which are pinned are returned, if 0 only not pinned
|
||||
* @apiparam string sortBy What to sort by. Can be 'count_entries' for number of entries, 'last_edate' for last entry date or do not specify for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\blog\Entry>
|
||||
*/
|
||||
public function GETindex()
|
||||
{
|
||||
/* Where clause */
|
||||
$where = array();
|
||||
|
||||
/* Owners */
|
||||
if ( isset( \IPS\Request::i()->owners ) and isset( \IPS\Request::i()->groups ) )
|
||||
{
|
||||
$where[] = array( '( ' . \IPS\Db::i()->in( 'blog_member_id', array_filter( explode( ',', \IPS\Request::i()->owners ) ) ) . ' OR ' . \IPS\Db::i()->findInSet( 'blog_groupblog_ids', array_filter( explode( ',', \IPS\Request::i()->groups ) ) ) . ' )' );
|
||||
}
|
||||
elseif ( isset( \IPS\Request::i()->owners ) )
|
||||
{
|
||||
$where[] = array( '( ' . \IPS\Db::i()->in( 'blog_member_id', array_filter( explode( ',', \IPS\Request::i()->owners ) ) ) . ' OR blog_groupblog_ids<>? )', '' );
|
||||
}
|
||||
elseif ( isset( \IPS\Request::i()->groups ) )
|
||||
{
|
||||
$where[] = array( '( blog_member_id>0 OR ' . \IPS\Db::i()->findInSet( 'blog_groupblog_ids', array_filter( explode( ',', \IPS\Request::i()->groups ) ) ) . ' )' );
|
||||
}
|
||||
|
||||
/* Pinned */
|
||||
if ( isset( \IPS\Request::i()->pinned ) )
|
||||
{
|
||||
$where[] = array( 'blog_pinned=?', intval( \IPS\Request::i()->pinned ) );
|
||||
}
|
||||
|
||||
/* Sort */
|
||||
if ( isset( \IPS\Request::i()->sortBy ) and in_array( \IPS\Request::i()->sortBy, array( 'count_entries', 'last_edate' ) ) )
|
||||
{
|
||||
$sortBy = 'blog_' . \IPS\Request::i()->sortBy;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortBy = 'blog_id';
|
||||
}
|
||||
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
|
||||
|
||||
/* Return */
|
||||
return new \IPS\Api\PaginatedResponse(
|
||||
200,
|
||||
\IPS\Db::i()->select( '*', 'blog_blogs', $where, "{$sortBy} {$sortDir}" ),
|
||||
isset( \IPS\Request::i()->page ) ? \IPS\Request::i()->page : 1,
|
||||
'IPS\blog\Blog',
|
||||
\IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', $where )->first()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /blog/blogs/{id}
|
||||
* Get information about a specific blog
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2B302/1 INVALID_ID The blog ID does not exist
|
||||
* @return \IPS\blog\Blog
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
return new \IPS\Api\Response( 200, \IPS\blog\Blog::load( $id )->apiOutput() );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B302/1', 404 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Blog Entry Comments 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
|
||||
* @subpackage Blog
|
||||
* @since 8 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\api;
|
||||
|
||||
/* To prentry 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 Blog Entry Comments API
|
||||
*/
|
||||
class _comments extends \IPS\Content\Api\CommentController
|
||||
{
|
||||
/**
|
||||
* Class
|
||||
*/
|
||||
protected $class = 'IPS\blog\Entry\Comment';
|
||||
|
||||
/**
|
||||
* GET /blog/comments
|
||||
* Get list of comments
|
||||
*
|
||||
* @apiparam string blogs Comma-delimited list of calendar IDs
|
||||
* @apiparam string authors Comma-delimited list of member IDs - if provided, only topics started by those members are returned
|
||||
* @apiparam int locked If 1, only comments from entries which are locked are returned, if 0 only unlocked
|
||||
* @apiparam int hidden If 1, only comments which are hidden are returned, if 0 only not hidden
|
||||
* @apiparam int pinned If 1, only posts from topics which are pinned are returned, if 0 only not pinned
|
||||
* @apiparam int featured If 1, only comments from entries which are featured are returned, if 0 only not featured
|
||||
* @apiparam int draft If 1, only draft entries are returned, if 0 only published
|
||||
* @apiparam string sortBy What to sort by. Can be 'date', 'title' or leave unspecified for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\blog\Entry\Comment>
|
||||
*/
|
||||
public function GETindex()
|
||||
{
|
||||
/* Where clause */
|
||||
$where = array();
|
||||
|
||||
/* Draft */
|
||||
if ( isset( \IPS\Request::i()->draft ) )
|
||||
{
|
||||
$where[] = array( 'entry_status=?', \IPS\Request::i()->draft ? 'draft' : 'published' );
|
||||
}
|
||||
|
||||
/* Return */
|
||||
return $this->_list( $where, 'blogs' );
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /blog/comments/{id}
|
||||
* View information about a specific comment
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2B301/1 INVALID_ID The comment ID does not exist
|
||||
* @return \IPS\blog\Entry\Comment
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
return new \IPS\Api\Response( 200, \IPS\blog\Entry\Comment::load( $id )->apiOutput() );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B301/1', 404 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /blog/comments
|
||||
* Create a comment
|
||||
*
|
||||
* @reqapiparam int entry The ID number of the entry the comment is for
|
||||
* @reqapiparam int author The ID number of the member making the comment (0 for guest)
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
* @reqapiparam string content The comment content as HTML (e.g. "<p>This is a comment.</p>")
|
||||
* @apiparam datetime date The date/time that should be used for the comment date. If not provided, will use the current date/time
|
||||
* @apiparam string ip_address The IP address that should be stored for the comment. If not provided, will use the IP address from the API request
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @throws 2B301/2 INVALID_ID The comment ID does not exist
|
||||
* @throws 1B301/3 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1B301/4 NO_CONTENT No content was supplied
|
||||
* @return \IPS\blog\Entry\Comment
|
||||
*/
|
||||
public function POSTindex()
|
||||
{
|
||||
/* Get topic */
|
||||
try
|
||||
{
|
||||
$entry = \IPS\blog\Entry::load( \IPS\Request::i()->entry );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B301/2', 403 );
|
||||
}
|
||||
|
||||
/* Get author */
|
||||
if ( \IPS\Request::i()->author )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1B301/3', 404 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
}
|
||||
|
||||
/* Check we have a post */
|
||||
if ( !\IPS\Request::i()->content )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_CONTENT', '1B301/4', 403 );
|
||||
}
|
||||
|
||||
/* Do it */
|
||||
return $this->_create( $entry, $author );
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /blog/comments/{id}
|
||||
* Edit a comment
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author The ID number of the member making the comment (0 for guest)
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
* @apiparam string content The comment content as HTML (e.g. "<p>This is a comment.</p>")
|
||||
* @apiparam int hidden 1/0 indicating if the topic should be hidden
|
||||
* @throws 2B301/5 INVALID_ID The comment ID does not exist
|
||||
* @throws 1B301/6 NO_AUTHOR The author ID does not exist
|
||||
* @return \IPS\blog\Entry\Comment
|
||||
*/
|
||||
public function POSTitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
/* Load */
|
||||
$comment = \IPS\blog\Entry\Comment::load( $id );
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
return $this->_edit( $comment );
|
||||
}
|
||||
catch ( \InvalidArgumentException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1B301/6', 400 );
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B301/5', 404 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /blog/comments/{id}
|
||||
* Deletes a comment
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2B301/7 INVALID_ID The comment ID does not exist
|
||||
* @return void
|
||||
*/
|
||||
public function DELETEitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\blog\Entry\Comment::load( $id )->delete();
|
||||
|
||||
return new \IPS\Api\Response( 200, NULL );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B301/7', 404 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Blog Entries 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
|
||||
* @subpackage Blog
|
||||
* @since 9 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\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 Blog Entries API
|
||||
*/
|
||||
class _entries extends \IPS\Content\Api\ItemController
|
||||
{
|
||||
/**
|
||||
* Class
|
||||
*/
|
||||
protected $class = 'IPS\blog\Entry';
|
||||
|
||||
/**
|
||||
* GET /blog/entries
|
||||
* Get list of entries
|
||||
*
|
||||
* @apiparam string blogs Comma-delimited list of blog IDs
|
||||
* @apiparam string authors Comma-delimited list of member IDs - if provided, only entries started by those members are returned
|
||||
* @apiparam int locked If 1, only entries which are locked are returned, if 0 only unlocked
|
||||
* @apiparam int hidden If 1, only entries which are hidden are returned, if 0 only not hidden
|
||||
* @apiparam int pinned If 1, only entries which are pinned are returned, if 0 only not pinned
|
||||
* @apiparam int featured If 1, only entries which are featured are returned, if 0 only not featured
|
||||
* @apiparam int draft If 1, only draft entries are returned, if 0 only published
|
||||
* @apiparam string sortBy What to sort by. Can be 'date' for creation date, 'title' or leave unspecified for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\blog\Entry>
|
||||
*/
|
||||
public function GETindex()
|
||||
{
|
||||
/* Where clause */
|
||||
$where = array();
|
||||
|
||||
/* Draft */
|
||||
if ( isset( \IPS\Request::i()->draft ) )
|
||||
{
|
||||
$where[] = array( 'entry_status=?', \IPS\Request::i()->draft ? 'draft' : 'published' );
|
||||
}
|
||||
|
||||
/* Return */
|
||||
return $this->_list( $where, 'blogs' );
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /blog/entries/{id}
|
||||
* View comments on an entry
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int page Page number
|
||||
* @throws 2B300/1 INVALID_ID The entry ID does not exist
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\blog\Entry\Comment>
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->_comments( $id, 'IPS\blog\Entry\Comment' );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B300/1', 404 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /blog/entries
|
||||
* Create an entry
|
||||
*
|
||||
* @reqapiparam int blog The ID number of the blog the entry should be created in
|
||||
* @reqapiparam int author The ID number of the member creating the entry (0 for guest)
|
||||
* @reqapiparam string title The entry title
|
||||
* @reqapiparam string entry The entry content as HTML (e.g. "<p>This is a blog entry.</p>")
|
||||
* @apiparam bool draft If this is a draft
|
||||
* @apiparam string prefix Prefix tag
|
||||
* @apiparam string tags Comma-separated list of tags (do not include prefix)
|
||||
* @apiparam datetime date The date/time that should be used for the entry date. If not provided, will use the current date/time
|
||||
* @apiparam string ip_address The IP address that should be stored for the entry/post. If not provided, will use the IP address from the API request
|
||||
* @apiparam int locked 1/0 indicating if the entry should be locked
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam int pinned 1/0 indicating if the entry should be pinned
|
||||
* @apiparam int featured 1/0 indicating if the entry should be featured
|
||||
* @throws 1B300/2 NO_BLOG The blog ID does not exist
|
||||
* @throws 1B300/3 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1B300/4 NO_TITLE No title was supplied
|
||||
* @throws 1B300/5 NO_CONTENT No content was supplied
|
||||
* @return \IPS\blog\Entry
|
||||
*/
|
||||
public function POSTindex()
|
||||
{
|
||||
/* Get blog */
|
||||
try
|
||||
{
|
||||
$blog = \IPS\blog\Blog::load( \IPS\Request::i()->blog );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_BLOG', '1B300/2', 400 );
|
||||
}
|
||||
|
||||
/* Get author */
|
||||
if ( \IPS\Request::i()->author )
|
||||
{
|
||||
$author = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$author->member_id )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1B300/3', 400 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
}
|
||||
|
||||
/* Check we have a title and a description */
|
||||
if ( !\IPS\Request::i()->title )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_TITLE', '1B300/4', 400 );
|
||||
}
|
||||
if ( !\IPS\Request::i()->entry )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_CONTENT', '1B300/5', 400 );
|
||||
}
|
||||
|
||||
/* Do it */
|
||||
return new \IPS\Api\Response( 201, $this->_create( $blog, $author )->apiOutput() );
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /blog/entries/{id}
|
||||
* Edit a blog entry
|
||||
*
|
||||
* @reqapiparam int blog The ID number of the blog the entry should be created in
|
||||
* @reqapiparam int author The ID number of the member creating the entry (0 for guest)
|
||||
* @reqapiparam string title The entry title
|
||||
* @reqapiparam string entry The entry content as HTML (e.g. "<p>This is a blog entry.</p>")
|
||||
* @apiparam bool draft If this is a draft
|
||||
* @apiparam string prefix Prefix tag
|
||||
* @apiparam string tags Comma-separated list of tags (do not include prefix)
|
||||
* @apiparam datetime date The date/time that should be used for the entry date. If not provided, will use the current date/time
|
||||
* @apiparam string ip_address The IP address that should be stored for the entry/post. If not provided, will use the IP address from the API request
|
||||
* @apiparam int locked 1/0 indicating if the entry should be locked
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam int pinned 1/0 indicating if the entry should be pinned
|
||||
* @apiparam int featured 1/0 indicating if the entry should be featured
|
||||
* @throws 2B300/6 INVALID_ID The entry ID is invalid
|
||||
* @throws 1B300/7 NO_BLOG The blog ID does not exist
|
||||
* @throws 1B300/8 NO_AUTHOR The author ID does not exist
|
||||
* @return \IPS\blog\Entry
|
||||
*/
|
||||
public function POSTitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
$entry = \IPS\blog\Entry::load( $id );
|
||||
|
||||
/* New blog */
|
||||
if ( isset( \IPS\Request::i()->blog ) and \IPS\Request::i()->blog != $entry->forum_id )
|
||||
{
|
||||
try
|
||||
{
|
||||
$newBlog = \IPS\blog\Blog::load( \IPS\Request::i()->blog );
|
||||
$entry->move( $newBlog );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_BLOG', '1B300/7', 400 );
|
||||
}
|
||||
}
|
||||
|
||||
/* New author */
|
||||
if ( isset( \IPS\Request::i()->author ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$member = \IPS\Member::load( \IPS\Request::i()->author );
|
||||
if ( !$member->member_id )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
|
||||
$entry->changeAuthor( $member );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1B300/8', 400 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Everything else */
|
||||
$this->_createOrUpdate( $entry );
|
||||
|
||||
/* Save and return */
|
||||
$entry->save();
|
||||
return new \IPS\Api\Response( 200, $entry->apiOutput() );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B300/6', 404 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update entry
|
||||
*
|
||||
* @param \IPS\Content\Item $item The item
|
||||
* @return \IPS\Content\Item
|
||||
*/
|
||||
protected function _createOrUpdate( \IPS\Content\Item $item )
|
||||
{
|
||||
/* Is draft */
|
||||
if ( isset( \IPS\Request::i()->draft ) )
|
||||
{
|
||||
$item->status = \IPS\Request::i()->draft ? 'draft' : 'published';
|
||||
}
|
||||
|
||||
/* Content */
|
||||
if ( isset( \IPS\Request::i()->entry ) )
|
||||
{
|
||||
$item->content = \IPS\Request::i()->entry;
|
||||
}
|
||||
|
||||
/* Pass up */
|
||||
return parent::_createOrUpdate( $item );
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /blog/entries/{id}
|
||||
* Delete an entry
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @throws 2B300/9 INVALID_ID The entry ID does not exist
|
||||
* @return void
|
||||
*/
|
||||
public function DELETEitem( $id )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\blog\Entry::load( $id )->delete();
|
||||
|
||||
return new \IPS\Api\Response( 200, NULL );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2B300/9', 404 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1,163 @@
|
||||
{"app=blog&module=blogs&controller=settings&searchResult=form_blog_enable_rating":{"lang_key":"blog_enable_rating","restriction":"settings_manage","keywords":["blog ratings"]},"app=blog&module=blogs&controller=settings&searchResult=form_blog_allow_rssimport":{"lang_key":"blog_allow_rssimport","restriction":"settings_manage","keywords":["blog rss import"]},"app=blog&module=blogs&controller=settings&searchResult=form_blog_allow_rss":{"lang_key":"blog_allow_rss","restriction":"settings_manage","keywords":["blog rss export"]},"app=blog&module=blogs&controller=settings":{"lang_key":"menu__blog_blogs_settings","restriction":"settings_manage","keywords":["blog settings"]},"app=blog&module=blogs&controller=blogs":{"lang_key":"menu__blog_blogs_blogs","restriction":"blogs_manage","keywords":["blogs","manage blogs","group blogs"]}}
|
||||
{
|
||||
"app=blog&module=blogs&controller=blogs": {
|
||||
"lang_key": "menu__blog_blogs_blogs",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blogs",
|
||||
"group blogs",
|
||||
"manage blogs",
|
||||
"блоги",
|
||||
"управление блогами",
|
||||
"групповые блоги"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&do=form": {
|
||||
"lang_key": "menu__blog_blogs_blogs",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"add blog",
|
||||
"создать блог",
|
||||
"добавить блог"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&searchResult=blog_desc_wrap": {
|
||||
"lang_key": "blog_desc",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blog description",
|
||||
"описание блога"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&searchResult=blog_member_id": {
|
||||
"lang_key": "blog_member_id",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blog author",
|
||||
"автор блога"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&searchResult=blog_name": {
|
||||
"lang_key": "blog_name",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blog name",
|
||||
"название блога",
|
||||
"имя блога"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&searchResult=form_1_blog_enable_rss": {
|
||||
"lang_key": "blog_enable_rss",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blog rss feed",
|
||||
"rss лента",
|
||||
"rss лента блога"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&searchResult=form_1_blog_type": {
|
||||
"lang_key": "blog_type",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blog author",
|
||||
"group blog",
|
||||
"автор блога",
|
||||
"блог группы",
|
||||
"групповой блог"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&searchResult=form_new_blog_enable_rss": {
|
||||
"lang_key": "blog_enable_rss",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blog rss feed",
|
||||
"rss feed",
|
||||
"rss лента",
|
||||
"rss лента блога"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=blogs&searchResult=form_new_blog_type": {
|
||||
"lang_key": "blog_type",
|
||||
"restriction": "blogs_manage",
|
||||
"keywords": [
|
||||
"blog type",
|
||||
"group blog",
|
||||
"тип блога",
|
||||
"блог группы",
|
||||
"групповой блог"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=settings": {
|
||||
"lang_key": "menu__blog_blogs_settings",
|
||||
"restriction": "settings_manage",
|
||||
"keywords": [
|
||||
"blog settings",
|
||||
"настройки блога"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=settings&searchResult=form_blog_allow_rss": {
|
||||
"lang_key": "blog_allow_rss",
|
||||
"restriction": "settings_manage",
|
||||
"keywords": [
|
||||
"blog rss export",
|
||||
"rss export",
|
||||
"rss лента",
|
||||
"rss лента блога",
|
||||
"экспорт RSS"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=settings&searchResult=form_blog_allow_rssimport": {
|
||||
"lang_key": "blog_allow_rssimport",
|
||||
"restriction": "settings_manage",
|
||||
"keywords": [
|
||||
"blog rss import",
|
||||
"rss import",
|
||||
"импорт rss",
|
||||
"rss импорт",
|
||||
"rss импорт блога"
|
||||
]
|
||||
},
|
||||
"app=blog&module=blogs&controller=settings&searchResult=form_blog_enable_rating": {
|
||||
"lang_key": "blog_enable_rating",
|
||||
"restriction": "settings_manage",
|
||||
"keywords": [
|
||||
"blog ratings",
|
||||
"ratings",
|
||||
"рейтинги блога",
|
||||
"рейтинг",
|
||||
"рейтинги"
|
||||
]
|
||||
},
|
||||
"app=core&module=members&controller=groups&searchResult=4_g_blog_allowlocal": {
|
||||
"lang_key": "g_blog_allowlocal",
|
||||
"restriction": "groups_manage",
|
||||
"keywords": [
|
||||
"blogs",
|
||||
"blogs permission",
|
||||
"create blogs",
|
||||
"post blogs",
|
||||
"создать блог",
|
||||
"блоги",
|
||||
"создавать блоги"
|
||||
]
|
||||
},
|
||||
"app=core&module=members&controller=groups&searchResult=g_blog_allowdelete": {
|
||||
"lang_key": "g_blog_allowdelete",
|
||||
"restriction": "groups_manage",
|
||||
"keywords": [
|
||||
"delete blogs",
|
||||
"delete own blogs",
|
||||
"удаление блога",
|
||||
"удалять свои блоги",
|
||||
"удалить свой блог"
|
||||
]
|
||||
},
|
||||
"app=core&module=members&controller=groups&searchResult=g_blog_allowprivate": {
|
||||
"lang_key": "g_blog_allowprivate",
|
||||
"restriction": "groups_manage",
|
||||
"keywords": [
|
||||
"private blogs",
|
||||
"приватные блоги",
|
||||
"личные блоги"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<emails><template><template_app>blog</template_app><template_name>digests__item</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td dir='{dir}' width='40' align='center' valign='top' class=' '>
|
||||
<img src='{$entry->author()->photo}' width='32' height='32' style='border: 1px solid #000; vertical-align: middle;'>
|
||||
<img src='{$entry->author()->get_photo( true, true )}' width='32' height='32' style='border: 1px solid #000; vertical-align: middle;'>
|
||||
</td>
|
||||
<td dir='{dir}' align='left'>
|
||||
<p style='font-family: "Helvetica Neue", helvetica, sans-serif; margin: 0; font-size: 13px; font-weight: bold'>
|
||||
@@ -17,7 +17,7 @@
|
||||
<p style='font-family: "Helvetica Neue", helvetica, sans-serif; margin: 0; font-size: 13px; margin-bottom: 15px'>
|
||||
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
{{foreach range( 1, 5 ) as $i}}{{if $i <= $entry->averageRating()}}<img src='{resource="email/rating_on.png" location="interface" app="core"}' width='14' height='13' style='vertical-align: middle; margin-right: 2px'>{{else}}<img src='{resource="email/rating_off.png" location="interface" app="core"}' width='14' height='13' style='vertical-align: middle; margin-right: 2px'>{{endif}}{{endforeach}}
|
||||
{{foreach range( 1, 5 ) as $i}}{{if $i <= $entry->averageRating()}}<img src='{resource="email/rating_on.png" location="interface" app="core"}' width='14' height='13' style='vertical-align: middle; margin-right: 2px'>{{elseif ( $i - 0.5 ) <= $entry->averageRating()}}<img src='{resource="email/rating_half.png" location="interface" app="core"}' width='14' height='13' style='vertical-align: middle; margin-right: 2px'>{{else}}<img src='{resource="email/rating_off.png" location="interface" app="core"}' width='14' height='13' style='vertical-align: middle; margin-right: 2px'>{{endif}}{{endforeach}}
|
||||
|
||||
{{endif}}
|
||||
<strong style='font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 13px;'>
|
||||
@@ -28,7 +28,7 @@
|
||||
</tr>]]></template_content_html><template_data>$entry, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_created_entry_in", FALSE, array( 'sprintf' => array( $entry->author()->name, $entry->container()->_title ) ) )}: {$entry->title} ({$entry->url()})
|
||||
]]></template_content_plaintext></template><template><template_app>blog</template_app><template_name>digests__comment</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td dir='{dir}' width='40' align='center' valign='top' class=' '>
|
||||
<img src='{$comment->author()->photo}' width='32' height='32' style='border: 1px solid #000; vertical-align: middle;'>
|
||||
<img src='{$comment->author()->get_photo( true, true )}' width='32' height='32' style='border: 1px solid #000; vertical-align: middle;'>
|
||||
</td>
|
||||
<td dir='{dir}' align='left'>
|
||||
<p style='font-family: "Helvetica Neue", helvetica, sans-serif; margin: 0; font-size: 13px; font-weight: bold'>
|
||||
@@ -38,7 +38,7 @@
|
||||
<a href='{$comment->item()->url()}' style='text-decoration: none;'>{$comment->item()->name}</a>
|
||||
</h2>
|
||||
<div style='font-family: "Helvetica Neue", helvetica, sans-serif; line-height: 22px; margin-top: 5px; margin-bottom: 5px; border-left: 3px solid #8c8c8c; padding-left: 15px; font-size: 14px; margin-left: 15px'>
|
||||
{$email->parseTextForEmail( $comment->content() )|raw}
|
||||
{$email->parseTextForEmail( $comment->content(), $email->language )|raw}
|
||||
</div>
|
||||
</td>
|
||||
</tr>]]></template_content_html><template_data>$comment, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_commented_entry", FALSE, array( 'sprintf' => array( $comment->author()->name ) ) )}: {$comment->item()->name} ({$comment->url()})
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"friendly": "entry/{#id}-{?}",
|
||||
"real": "app=blog&module=blogs&controller=entry",
|
||||
"verify": "\\IPS\\blog\\Entry",
|
||||
"alias": "blog/{#blogid}/entry-{#id}-{?}"
|
||||
"alias": "blog/{!}/entry-{#id}-{?}"
|
||||
},
|
||||
"blog_submit": {
|
||||
"friendly": "submit",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="blog">
|
||||
<file javascript_app="blog" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="101012" javascript_position="1000050">/**
|
||||
* IPS Social Suite 4
|
||||
<file javascript_app="blog" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="101093" javascript_position="1000050">/**
|
||||
* IPS Community Suite 4
|
||||
* (c) 2013 Invision Power Services - http://www.invisionpower.com
|
||||
*
|
||||
* ips.browse.list.js - Blog browse list controller
|
||||
@@ -30,6 +30,7 @@
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<order app="global" path="/dev/js//framework/">templates
|
||||
common/ips.loader.js
|
||||
common/ui
|
||||
common/utils
|
||||
common
|
||||
@@ -43,6 +44,4 @@ 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//xregexp">xregexp-all.js
|
||||
xregexp-lookbehind.js</order>
|
||||
</javascript>
|
||||
@@ -1,33 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="blog" version="101012">
|
||||
<app key="blog" version="101093">
|
||||
<word key="__app_blog" js="0">Blogs</word>
|
||||
<word key="frontnavigation_blogs" js="0">Blogs</word>
|
||||
<word key="__indefart_blog_entry_comment" js="0">a comment on a blog entry</word>
|
||||
<word key="__indefart_blog_entry" js="0">a blog entry</word>
|
||||
<word key="__defart_blog_entry_comment" js="0">comment on a blog entry</word>
|
||||
<word key="__defart_blog_entry" js="0">blog entry</word>
|
||||
<word key="blog_entry_container" js="0">blog</word>
|
||||
<word key="blog_entry_pl_lc" js="0">blog entries</word>
|
||||
<word key="module__blog_blogs" js="0">Blogs</word>
|
||||
<word key="menu__blog_blogs" js="0">Blogs</word>
|
||||
<word key="menu__blog_blogs_settings" js="0">Settings</word>
|
||||
<word key="menu__blog_blogs_blogs" js="0">Blogs</word>
|
||||
<word key="acp_search_title_blog_Blogs" js="0">Blogs</word>
|
||||
<word key="acplog__entries_published" js="0">Automatically published blog entries (%s published)</word>
|
||||
<word key="filestorage__blog_Entries" js="0">IP.Blog Entries</word>
|
||||
<word key="filestorage__blog_Entries" js="0">Blog Entries</word>
|
||||
<word key="add_blog" js="0">Add Blog</word>
|
||||
<word key="block_blog_Overview" js="0">Blog Overview</word>
|
||||
<word key="editor__blog_Blogs" js="0">Blogs</word>
|
||||
<word key="editor__blog_Entries" js="0">Blog Entries</word>
|
||||
<word key="task__blogrssimport" js="0">Checks RSS/Atom feeds for new articles and imports into Blog.</word>
|
||||
<word key="task__blogrssimport" js="0">Checks RSS/Atom feeds for new articles and imports into Blogs.</word>
|
||||
<word key="filestorage__blog_Blogs" js="0">Blog Cover Photos</word>
|
||||
<word key="entry_blog_id" js="0">Blog</word>
|
||||
<word key="r__blogs" js="0">Blogs</word>
|
||||
<word key="r__blog_settings_manage" js="0">Can edit blog settings?</word>
|
||||
<word key="r__blogs_manage" js="0">Can manage blogs?</word>
|
||||
<word key="blog_member_deleted" js="0">Member has been deleted</word>
|
||||
<word key="rebuilding_blog_entry_images" js="0">Rebuilding blog entry images</word>
|
||||
<word key="acplogs__blog_settings" js="0">Updated blog settings</word>
|
||||
<word key="blog_enable_rating" js="0">Enable blog ratings?</word>
|
||||
<word key="blog_settings_rss" js="0">RSS Settings</word>
|
||||
<word key="blog_allow_rssimport" js="0">Allow RSS imports</word>
|
||||
<word key="blog_allow_rss" js="0">Allow RSS exports</word>
|
||||
<word key="blog_allow_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="blogs" js="0">Blogs</word>
|
||||
<word key="blog_word_custom" js="0">Blog Name</word>
|
||||
<word key="blog_blog_member_id" js="0">Blog Author</word>
|
||||
@@ -41,13 +47,18 @@
|
||||
<word key="add_blog_entry" js="0">Add Blog Entry</word>
|
||||
<word key="entry_pl" js="0">Blog Entries</word>
|
||||
<word key="blog_entry_comment_pl" js="0">Blog Comments</word>
|
||||
<word key="blog_entry_comment_pl_lc" js="0">blog comments</word>
|
||||
<word key="entry_comments" js="0">Comments</word>
|
||||
<word key="blog_num_views" js="0">{!# [1:view][?:views]}</word>
|
||||
<word key="manage_blog" js="0">Manage Blog</word>
|
||||
<word key="select_blog" js="0">Select Blog</word>
|
||||
<word key="search_contextual_item_blogs" js="0">This Blog</word>
|
||||
<word key="search_contextual_item_blog_entry" js="0">This Entry</word>
|
||||
<word key="blog_settings" js="0">Blog Settings</word>
|
||||
<word key="blog_name" js="0">Name</word>
|
||||
<word key="blog_name_group" js="0">Name</word>
|
||||
<word key="blog_desc" js="0">Description</word>
|
||||
<word key="blog_desc_group" js="0">Description</word>
|
||||
<word key="blog_desc_placeholder" js="0">Add a description...</word>
|
||||
<word key="blog_type" js="0">Type</word>
|
||||
<word key="blog_type_normal" js="0">Single author</word>
|
||||
@@ -58,12 +69,14 @@
|
||||
<word key="blog_groupblog_name" js="0">Group Name</word>
|
||||
<word key="blog_groupblog_name_desc" js="0">Used in place of the owner's name when viewing a Group Blog.</word>
|
||||
<word key="edit_blog" js="0">Edit Blog</word>
|
||||
<word key="delete_blog" js="0">Delete</word>
|
||||
<word key="delete_blog" js="0">Delete Blog</word>
|
||||
<word key="blog_privacy" js="0">Privacy</word>
|
||||
<word key="blog_privacy_open" js="0">Everyone can read this blog</word>
|
||||
<word key="blog_privacy_private" js="0">Only the members I choose can read this blog</word>
|
||||
<word key="blog_social_group" js="0">Members allowed to read this blog</word>
|
||||
<word key="no_blog_author_selected" js="0">No Blog Author selected</word>
|
||||
<word key="modlog__action_delete_blog" js="0">Deleted Blog %s</word>
|
||||
<word key="delete_blog_confirm" js="0">Are you sure you want to delete this blog?</word>
|
||||
<word key="submit_entry" js="0">Submit New Blog Entry</word>
|
||||
<word key="blog_entry_title" js="0">Title</word>
|
||||
<word key="blog_entry_tags" js="0">Tags</word>
|
||||
@@ -79,7 +92,7 @@
|
||||
<word key="entry_submit" js="0">Submit Entry</word>
|
||||
<word key="entry_information" js="0">Entry Details</word>
|
||||
<word key="blog_entry__save" js="0">Save</word>
|
||||
<word key="immediately" js="0">Immediately</word>
|
||||
<word key="entry_ip_address" js="0">IP Address</word>
|
||||
<word key="entry_gallery_album" js="0">Album</word>
|
||||
<word key="entry_gallery_album_desc" js="0">You can associate an album from the Gallery with this entry to display images alongside the entry content</word>
|
||||
<word key="block_entryFeed" js="0">Blog Entry Feed</word>
|
||||
@@ -92,6 +105,8 @@
|
||||
<word key="block_blogStatistics_desc" js="0">Shows general blog statistics</word>
|
||||
<word key="total_blogs" js="0">Total Blogs</word>
|
||||
<word key="total_entries" js="0">Total Entries</word>
|
||||
<word key="block_recentEntries" js="0">Recent Entries</word>
|
||||
<word key="block_recentEntries_desc" js="0">Shows recent entries</word>
|
||||
<word key="prev_entry" js="0">Previous entry</word>
|
||||
<word key="next_entry" js="0">Next entry</word>
|
||||
<word key="blog_entry__comment_placeholder" js="0">Add a comment...</word>
|
||||
@@ -135,7 +150,7 @@
|
||||
<word key="this_is_group" js="0">This is a group blog</word>
|
||||
<word key="unread_blog" js="0">This entry is unread</word>
|
||||
<word key="read_blog" js="0">You've read this entry</word>
|
||||
<word key="go_to_blog" js="0">Go to the blog "%s"</word>
|
||||
<word key="go_to_blog" js="0">Go to the blog %s</word>
|
||||
<word key="latest_entry" js="0">Latest Entry</word>
|
||||
<word key="no_entries" js="0">No blog entries have been created</word>
|
||||
<word key="pin_blog" js="0">Pin</word>
|
||||
@@ -172,7 +187,8 @@
|
||||
<word key="most_recent_entry" js="0">Most recent entry</word>
|
||||
<word key="blog_byline_nodate" js="0">A blog by %s</word>
|
||||
<word key="blog_last_entry_date" js="0">Last entry posted %s</word>
|
||||
<word key="digest_area_entry" js="0">Entries</word>
|
||||
<word key="digest_area_blog_blog" js="0">Blogs</word>
|
||||
<word key="digest_area_blog_entry" js="0">Entries</word>
|
||||
<word key="x_created_entry_in" js="0">%s posted a blog entry in %s</word>
|
||||
<word key="x_commented_entry" js="0">%s commented on an entry</word>
|
||||
<word key="loc_blog_viewing_index" js="0">Browsing Blogs</word>
|
||||
@@ -219,5 +235,8 @@
|
||||
<word key="widget__blog_edate" js="0">Last entry date</word>
|
||||
<word key="widget__blog_count_entries" js="0">Number of entries</word>
|
||||
<word key="widget__blog_count_comments" js="0">Number of comments</word>
|
||||
<word key="__api_blog_comments" js="0">Comments</word>
|
||||
<word key="__api_blog_entries" js="0">Entries</word>
|
||||
<word key="__api_blog_blogs" js="0">Blogs</word>
|
||||
</app>
|
||||
</language>
|
||||
@@ -0,0 +1,242 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="blog" version="101093">
|
||||
<word key_rus="Блоги" key="__app_blog" js="0">Blogs</word>
|
||||
<word key_rus="Блоги" key="frontnavigation_blogs" js="0">Blogs</word>
|
||||
<word key_rus="комментарий на запись в блоге" key="__indefart_blog_entry_comment" js="0">a comment on a blog entry</word>
|
||||
<word key_rus="блог" key="blog_entry_container" js="0">blog</word>
|
||||
<word key_rus="записи блога" key="blog_entry_pl_lc" js="0">blog entries</word>
|
||||
<word key_rus="запись в блоге" key="__indefart_blog_entry" js="0">a blog entry</word>
|
||||
<word key_rus="комментарий к записи блога" key="__defart_blog_entry_comment" js="0">comment on a blog entry</word>
|
||||
<word key_rus="запись блога" key="__defart_blog_entry" js="0">blog entry</word>
|
||||
<word key_rus="Блоги" key="module__blog_blogs" js="0">Blogs</word>
|
||||
<word key_rus="Блоги" key="menu__blog_blogs" js="0">Blogs</word>
|
||||
<word key_rus="Настройки" key="menu__blog_blogs_settings" js="0">Settings</word>
|
||||
<word key_rus="Блоги" key="menu__blog_blogs_blogs" js="0">Blogs</word>
|
||||
<word key_rus="Блоги" key="acp_search_title_blog_Blogs" js="0">Blogs</word>
|
||||
<word key_rus="Автоматически опубликованные записи блога (%s опубликовано)" key="acplog__entries_published" js="0">Automatically published blog entries (%s published)</word>
|
||||
<word key_rus="Записи блогов" key="filestorage__blog_Entries" js="0">Blog Entries</word>
|
||||
<word key_rus="Добавить блог" key="add_blog" js="0">Add Blog</word>
|
||||
<word key_rus="Обзор блога" key="block_blog_Overview" js="0">Blog Overview</word>
|
||||
<word key_rus="Блоги" key="editor__blog_Blogs" js="0">Blogs</word>
|
||||
<word key_rus="Записи блога" key="editor__blog_Entries" js="0">Blog Entries</word>
|
||||
<word key_rus="Проверка RSS/Atom лент на новые статьи и импорт в Блоги." key="task__blogrssimport" js="0">Checks RSS/Atom feeds for new articles and imports into Blogs.</word>
|
||||
<word key_rus="Обложки блогов" key="filestorage__blog_Blogs" js="0">Blog Cover Photos</word>
|
||||
<word key_rus="Блог" key="entry_blog_id" js="0">Blog</word>
|
||||
<word key_rus="Блоги" key="r__blogs" js="0">Blogs</word>
|
||||
<word key_rus="Можно редактировать настройки блога?" key="r__blog_settings_manage" js="0">Can edit blog settings?</word>
|
||||
<word key_rus="Можно управлять блогами?" key="r__blogs_manage" js="0">Can manage blogs?</word>
|
||||
<word key_rus="Пользователь был удалён" key="blog_member_deleted" js="0">Member has been deleted</word>
|
||||
<word key_rus="Перестроение изображений записей блога" key="rebuilding_blog_entry_images" js="0">Rebuilding blog entry images</word>
|
||||
<word key_rus="Обновленные настройки блога" key="acplogs__blog_settings" js="0">Updated blog settings</word>
|
||||
<word key_rus="Включить рейтинги блогов?" key="blog_enable_rating" js="0">Enable blog ratings?</word>
|
||||
<word key_rus="Настройки RSS" key="blog_settings_rss" js="0">RSS Settings</word>
|
||||
<word key_rus="Разрешить RSS импорт" key="blog_allow_rssimport" js="0">Allow RSS imports</word>
|
||||
<word key_rus="Разрешить RSS экспорт" key="blog_allow_rss" js="0">Allow RSS exports</word>
|
||||
<word key_rus="Будет отображён контент, доступный для гостей. Для получения дополнительных возможностей, создайте <a href='{internal.app=core&module=discovery&controller=rss}'>Пользовательскую RSS ленту</a>" key="blog_allow_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_rus="Блоги" key="blogs" js="0">Blogs</word>
|
||||
<word key_rus="Название блога" key="blog_word_custom" js="0">Blog Name</word>
|
||||
<word key_rus="Автор блога" key="blog_blog_member_id" js="0">Blog Author</word>
|
||||
<word key_rus="Блог" key="blogs_sg" js="0">Blog</word>
|
||||
<word key_rus="Создать блог" key="create_blog" js="0">Create a blog</word>
|
||||
<word key_rus="Создать новый блог" key="create_new_blog" js="0">Create a new blog</word>
|
||||
<word key_rus="Добавить запись в блог" key="add_entry_to" js="0">Add entry to a blog</word>
|
||||
<word key_rus="Запись блога" key="blog_entry" js="0">Blog Entry</word>
|
||||
<word key_rus="Записи блога" key="blog_entry_pl" js="0">Blog Entries</word>
|
||||
<word key_rus="Комментарии блога" key="blog_entry_comment" js="0">Blog Comment</word>
|
||||
<word key_rus="Добавить запись" key="add_blog_entry" js="0">Add Blog Entry</word>
|
||||
<word key_rus="Записи блога" key="entry_pl" js="0">Blog Entries</word>
|
||||
<word key_rus="Комментарии блога" key="blog_entry_comment_pl" js="0">Blog Comments</word>
|
||||
<word key_rus="комментарии блога" key="blog_entry_comment_pl_lc" js="0">blog comments</word>
|
||||
<word key_rus="Комментарии" key="entry_comments" js="0">Comments</word>
|
||||
<word key_rus="{!# [*1:просмотр][*2:просмотра][*3:просмотра][*4:просмотра][11:просмотров][12:просмотров][13:просмотров][14:просмотров][?:просмотров]}" key="blog_num_views" js="0">{!# [1:view][?:views]}</word>
|
||||
<word key_rus="Управление блогом" key="manage_blog" js="0">Manage Blog</word>
|
||||
<word key_rus="Выбор блога" key="select_blog" js="0">Select Blog</word>
|
||||
<word key_rus="Этот блог" key="search_contextual_item_blogs" js="0">This Blog</word>
|
||||
<word key_rus="Эта запись" key="search_contextual_item_blog_entry" js="0">This Entry</word>
|
||||
<word key_rus="Настройки блога" key="blog_settings" js="0">Blog Settings</word>
|
||||
<word key_rus="Название" key="blog_name" js="0">Name</word>
|
||||
<word key_rus="Название" key="blog_name_group" js="0">Name</word>
|
||||
<word key_rus="Описание" key="blog_desc" js="0">Description</word>
|
||||
<word key_rus="Описание" key="blog_desc_group" js="0">Description</word>
|
||||
<word key_rus="Добавить описание..." key="blog_desc_placeholder" js="0">Add a description...</word>
|
||||
<word key_rus="Тип" key="blog_type" js="0">Type</word>
|
||||
<word key_rus="Один автор" key="blog_type_normal" js="0">Single author</word>
|
||||
<word key_rus="Группа" key="blog_type_group" js="0">Group</word>
|
||||
<word key_rus="Групповые блоги управляются всеми пользователям выбранных групп." key="blog_type_group_desc" js="0">Group blogs are jointly managed by all members in selected groups.</word>
|
||||
<word key_rus="Группы" key="blog_groupblog_ids" js="0">Groups</word>
|
||||
<word key_rus="Автор" key="blog_member_id" js="0">Author</word>
|
||||
<word key_rus="Название группы" key="blog_groupblog_name" js="0">Group Name</word>
|
||||
<word key_rus="Используется вместо имени владельца при просмотре группового блога." key="blog_groupblog_name_desc" js="0">Used in place of the owner's name when viewing a Group Blog.</word>
|
||||
<word key_rus="Изменить блог" key="edit_blog" js="0">Edit Blog</word>
|
||||
<word key_rus="Удалить блог" key="delete_blog" js="0">Delete Blog</word>
|
||||
<word key_rus="Приватность" key="blog_privacy" js="0">Privacy</word>
|
||||
<word key_rus="Все пользователи могут читать этот блог" key="blog_privacy_open" js="0">Everyone can read this blog</word>
|
||||
<word key_rus="Только выбранные мной пользователи могут читать этот блог" key="blog_privacy_private" js="0">Only the members I choose can read this blog</word>
|
||||
<word key_rus="Кто может читать этот блог" key="blog_social_group" js="0">Members allowed to read this blog</word>
|
||||
<word key_rus="Автор блога не выбран" key="no_blog_author_selected" js="0">No Blog Author selected</word>
|
||||
<word key_rus="Удалён блог %s" key="modlog__action_delete_blog" js="0">Deleted Blog %s</word>
|
||||
<word key_rus="Вы уверены, что хотите удалить этот блог?" key="delete_blog_confirm" js="0">Are you sure you want to delete this blog?</word>
|
||||
<word key_rus="Создать новую запись в блоге" key="submit_entry" js="0">Submit New Blog Entry</word>
|
||||
<word key_rus="Название" key="blog_entry_title" js="0">Title</word>
|
||||
<word key_rus="Теги" key="blog_entry_tags" js="0">Tags</word>
|
||||
<word key_rus="Автоподписка" key="blog_entry_auto_follow" js="0">Auto Follow</word>
|
||||
<word key_rus="Сообщить мне при публикации комментариев" key="blog_entry_auto_follow_suffix" js="0">Notify me when other comments are posted</word>
|
||||
<word key_rus="Контент" key="blog_entry_content" js="0">Content</word>
|
||||
<word key_rus="Дата публикации" key="blog_entry_date" js="0">Publish Time</word>
|
||||
<word key_rus="Опубликовать" key="blog_entry_publish" js="0">Publish</word>
|
||||
<word key_rus="Запись блога" key="blog_entry_mainTab" js="0">Blog Entry</word>
|
||||
<word key_rus="Опрос" key="blog_entry_pollTab" js="0">Poll</word>
|
||||
<word key_rus="" key="blog_entry_poll" js="0"></word>
|
||||
<word key_rus="Добавить запись в блог" key="create_blog_entry" js="0">Create Blog Entry</word>
|
||||
<word key_rus="Добавить запись" key="entry_submit" js="0">Submit Entry</word>
|
||||
<word key_rus="Детали записи" key="entry_information" js="0">Entry Details</word>
|
||||
<word key_rus="Сохранить" key="blog_entry__save" js="0">Save</word>
|
||||
<word key_rus="IP-адрес" key="entry_ip_address" js="0">IP Address</word>
|
||||
<word key_rus="Альбом" key="entry_gallery_album" js="0">Album</word>
|
||||
<word key_rus="Вы можете связать альбом из Галереи с этой записью для отображения изображений рядом с содержимым данной записи" key="entry_gallery_album_desc" js="0">You can associate an album from the Gallery with this entry to display images alongside the entry content</word>
|
||||
<word key_rus="Лента записей блогов" key="block_entryFeed" js="0">Blog Entry Feed</word>
|
||||
<word key_rus="Создание ленты записей из блогов" key="block_entryFeed_desc" js="0">Create a feed of blog entries</word>
|
||||
<word key_rus="Блоги" key="widget_feed_container_blog_entry" js="0">Blogs</word>
|
||||
<word key_rus="Последние комментарии из ваших блогов" key="block_latestComments" js="0">Latest Comments From Your Blogs</word>
|
||||
<word key_rus="Отображение списка последних комментариев" key="block_latestComments_desc" js="0">Shows a list of latest comments from the logged in member's blogs</word>
|
||||
<word key_rus="Просмотр записи %s" key="view_this_entry" js="0">View the entry %s</word>
|
||||
<word key_rus="Статистика Блогов" key="block_blogStatistics" js="0">Blog Statistics</word>
|
||||
<word key_rus="Отображение основной статистики блогов" key="block_blogStatistics_desc" js="0">Shows general blog statistics</word>
|
||||
<word key_rus="Всего блогов" key="total_blogs" js="0">Total Blogs</word>
|
||||
<word key_rus="Всего записей" key="total_entries" js="0">Total Entries</word>
|
||||
<word key_rus="Последние записи" key="block_recentEntries" js="0">Recent Entries</word>
|
||||
<word key_rus="Отображение последних записей блогов" key="block_recentEntries_desc" js="0">Shows recent entries</word>
|
||||
<word key_rus="Предыдущая запись" key="prev_entry" js="0">Previous entry</word>
|
||||
<word key_rus="Следующая запись" key="next_entry" js="0">Next entry</word>
|
||||
<word key_rus="Добавить комментарий..." key="blog_entry__comment_placeholder" js="0">Add a comment...</word>
|
||||
<word key_rus="Добавить комментарий" key="blog_entry_submit_comment" js="0">Submit Comment</word>
|
||||
<word key_rus="Действия" key="entry_actions" js="0">Entry Actions</word>
|
||||
<word key_rus="Изменить эту запись" key="edit_title_blog" js="0">Edit this blog entry</word>
|
||||
<word key_rus="Сделать популярной эту запись" key="feature_title_blog" js="0">Feature this blog entry</word>
|
||||
<word key_rus="Сделать эту запись непопулярной" key="unfeature_title_blog" js="0">Unfeature this blog entry</word>
|
||||
<word key_rus="Закрепить эту запись" key="pin_title_blog" js="0">Pin this blog entry</word>
|
||||
<word key_rus="Открепить эту запись" key="unpin_title_blog" js="0">Unpin this blog entry</word>
|
||||
<word key_rus="Скрыть эту запись" key="hide_title_blog" js="0">Hide this blog entry</word>
|
||||
<word key_rus="Показать эту запись" key="unhide_title_blog" js="0">Unhide this blog entry</word>
|
||||
<word key_rus="Заблокировать эту запись" key="blog_lock_title" js="0">Lock this blog entry</word>
|
||||
<word key_rus="Разблокировать эту запись" key="blog_unlock_title" js="0">Unlock this blog entry</word>
|
||||
<word key_rus="Переместить эту запись" key="blog_move_title" js="0">Move this blog entry</word>
|
||||
<word key_rus="Удалить эту запись" key="blog_delete_title" js="0">Delete this blog entry</word>
|
||||
<word key_rus="Одобрить эту запись" key="approve_title_blog" js="0">Approve this blog entry</word>
|
||||
<word key_rus="Жалоба" key="report_entry" js="0">Report Entry</word>
|
||||
<word key_rus="Неопубликовано" key="unpublished" js="0">Unpublished</word>
|
||||
<word key_rus="Эта запись блога заблокирована, но вы можете добавлять новые комментарии к ней." key="blog_entry_locked_can_comment" js="0">This blog entry is locked, but your permissions allow you to add new comments.</word>
|
||||
<word key_rus="Эта запись блога заблокирована для комментирования." key="blog_entry_locked_cannot_comment" js="0">This blog entry is now closed to further comments.</word>
|
||||
<word key_rus="Запись опубликовал %s" key="entry_posted" js="0">Entry posted by %s</word>
|
||||
<word key_rus="%s опубликовует запись" key="entry_future_posted" js="0">Entry by %s publishes on</word>
|
||||
<word key_rus="Изображения" key="entry_images" js="0">Images</word>
|
||||
<word key_rus="{!#[*1:комментарий][*2:комментария][*3:комментария][*4:комментария][11:комментариев][12:комментариев][13:комментариев][14:комментариев][?:комментариев]}" key="blog_comments" js="0">{!#[1:comment][?:comments]}</word>
|
||||
<word key_rus="{!#[*1:запись][*2:записи][*3:записи][*4:записи][11:записей][12:записей][13:записей][14:записей][?:записей]}" key="blog_entries" js="0">{!#[1:entry][?:entries]}</word>
|
||||
<word key_rus="{!#[*1:просмотр][*2:просмотра][*3:просмотра][*4:просмотра][11:просмотров][12:просмотров][13:просмотров][14:просмотров][?:просмотров]}" key="blog_views" js="0">{!#[1:view][?:views]}</word>
|
||||
<word key_rus="Последние записи" key="recent_entries" js="0">Recent Entries</word>
|
||||
<word key_rus="Популярные записи" key="featured_entries" js="0">Featured Entries</word>
|
||||
<word key_rus="Блоги нашего сообщества" key="our_community_blogs" js="0">Our community blogs</word>
|
||||
<word key_rus="Мои блоги" key="my_blogs" js="0">My Blogs</word>
|
||||
<word key_rus="Блоги с записями" key="blogs_with_content" js="0">Blogs With Entries</word>
|
||||
<word key_rus="По последней записи" key="sort_last_edate" js="0">Last Entry</word>
|
||||
<word key_rus="По рейтингу" key="sort_rating_total" js="0">Rating</word>
|
||||
<word key_rus="Из блога" key="from_the_blog" js="0">From the blog</word>
|
||||
<word key_rus="Просмотреть больше записей из %s" key="see_more_entries" js="0">See more entries from %s</word>
|
||||
<word key_rus="В блоге ещё нет записей" key="no_entries_yet" js="0">No blog entries yet</word>
|
||||
<word key_rus="Подробнее о данной записи" key="read_more_entry" js="0">Read more of this entry</word>
|
||||
<word key_rus="Просмотр комментариев этой записи" key="see_comments_on_entry" js="0">See comments for this entry</word>
|
||||
<word key_rus="Добавить новую запись" key="add_entry" js="0">Add new entry</word>
|
||||
<word key_rus="Это групповой блог" key="this_is_group" js="0">This is a group blog</word>
|
||||
<word key_rus="Запись не прочитана" key="unread_blog" js="0">This entry is unread</word>
|
||||
<word key_rus="Вы прочитали эту запись" key="read_blog" js="0">You've read this entry</word>
|
||||
<word key_rus="Перейти в блог %s" key="go_to_blog" js="0">Go to the blog %s</word>
|
||||
<word key_rus="Последняя запись" key="latest_entry" js="0">Latest Entry</word>
|
||||
<word key_rus="Ни одной записи в блоге ещё не создано" key="no_entries" js="0">No blog entries have been created</word>
|
||||
<word key_rus="Закрепить" key="pin_blog" js="0">Pin</word>
|
||||
<word key_rus="Открепить" key="unpin_blog" js="0">Unpin</word>
|
||||
<word key_rus="Блог %s" key="blog_by" js="0">A blog by %s</word>
|
||||
<word key_rus="Групповой блог %s" key="group_blog_by" js="0">A group blog by %s</word>
|
||||
<word key_rus="Авторы этого блога" key="contributors_to_this" js="0">Contributors to this blog</word>
|
||||
<word key_rus="О блоге" key="about_this_blog" js="0">About this blog</word>
|
||||
<word key_rus="Записи в этом блоге" key="entries_in_this_blog" js="0">Entries in this blog</word>
|
||||
<word key_rus="RSS лента отключена" key="blog_rss_offline" js="0">RSS feed disabled</word>
|
||||
<word key_rus="Эта RSS лента отключена, т.к. настройка "Разрешить RSS экспорт" в настоящее время неактивна в админцентре или отключена в настройках блога." key="blog_rss_offline_admin" js="0">This RSS feed is disabled either because the setting "Allow RSS exports" is currently disabled in the ACP or it is disabled in the individual blog settings.</word>
|
||||
<word key_rus="Включить RSS ленту" key="blog_enable_rss" js="0">Enable RSS Feed</word>
|
||||
<word key_rus="Разрешить этому блогу присутствовать в RSS ленте" key="blog_enable_rss_desc" js="0">Allow this blog to be syndicated with others by enabling RSS</word>
|
||||
<word key_rus="Последние записи" key="blog_rss_title" js="0">Latest Entries</word>
|
||||
<word key_rus="Импорт RSS/Atom" key="blog_rss_import" js="0">Atom/RSS Import</word>
|
||||
<word key_rus="URL" key="blog_rss_import_url" js="0">URL</word>
|
||||
<word key_rus="Имя пользователя HTTP авторизации" key="blog_rss_import_auth_user" js="0">HTTP Authorization Username</word>
|
||||
<word key_rus="Большинство лент не запрашивают авторизацию и вы может оставить это поле пустым." key="blog_rss_import_auth_user_desc" js="0">Most feeds do not require authorization and you can leave this blank.</word>
|
||||
<word key_rus="Пароль HTTP авторизации" key="blog_rss_import_auth_pass" js="0">HTTP Authorization Password</word>
|
||||
<word key_rus="Большинство лент не запрашивают авторизацию и вы может оставить это поле пустым." key="blog_rss_import_auth_pass_desc" js="0">Most feeds do not require authorization and you can leave this blank.</word>
|
||||
<word key_rus="Теги" key="blog_rss_import_tags" js="0">Tags</word>
|
||||
<word key_rus="Текст ссылки" key="blog_rss_import_show_link" js="0">Text to use for link</word>
|
||||
<word key_rus="Появится в нижней части сообщения, ссылаясь на оригинал статьи." key="blog_rss_import_show_link_desc" js="0">Will appear at the bottom of the post, linking to the original article.</word>
|
||||
<word key_rus="Посмотреть полный текст статьи" key="blog_rss_import_show_link_default" js="0">View the full article</word>
|
||||
<word key_rus="Включить импорт RSS" key="blog_enable_rss_import" js="0">Enable RSS import</word>
|
||||
<word key_rus="Импорт записей из внешних источников" key="blog_enable_rss_import_desc" js="0">Import entries from an external source using RSS</word>
|
||||
<word key_rus="Запись блога" key="embed_blog_entry" js="0">Blog Entry</word>
|
||||
<word key_rus="Блог" key="embed_blog" js="0">Blog</word>
|
||||
<word key_rus="Посмотреть этот блог" key="view_this_blog" js="0">View this blog</word>
|
||||
<word key_rus="Блоги" key="user_blogs" js="0">Blogs</word>
|
||||
<word key_rus="Блоги" key="profile_blog_blog" js="0">Blogs</word>
|
||||
<word key_rus="Также содействует с:" key="also_contributes" js="0">Also contributes to:</word>
|
||||
<word key_rus="Содействует с" key="contributes_to" js="0">Contributes To</word>
|
||||
<word key_rus="Последняя запись" key="most_recent_entry" js="0">Most recent entry</word>
|
||||
<word key_rus="Блог %s" key="blog_byline_nodate" js="0">A blog by %s</word>
|
||||
<word key_rus="Последняя запись размещена %s" key="blog_last_entry_date" js="0">Last entry posted %s</word>
|
||||
<word key_rus="Блоги" key="digest_area_blog_blog" js="0">Blogs</word>
|
||||
<word key_rus="Записи" key="digest_area_blog_entry" js="0">Entries</word>
|
||||
<word key_rus="%s опубликовал запись блога в %s" key="x_created_entry_in" js="0">%s posted a blog entry in %s</word>
|
||||
<word key_rus="%s прокомментировал запись" key="x_commented_entry" js="0">%s commented on an entry</word>
|
||||
<word key_rus="Просмотр Блогов" key="loc_blog_viewing_index" js="0">Browsing Blogs</word>
|
||||
<word key_rus="Создание блога" key="loc_blog_creating" js="0">Creating a Blog</word>
|
||||
<word key_rus="Просмотр блога: %s" key="loc_blog_viewing_blog" js="0">Viewing Blog: %s</word>
|
||||
<word key_rus="Добавление записи блога в: %s" key="loc_blog_adding_entry" js="0">Adding a Blog Entry in: %s</word>
|
||||
<word key_rus="Просмотр записи: %s" key="loc_blog_viewing_entry" js="0">Viewing Entry: %s</word>
|
||||
<word key_rus="Блоги" key="modperms__core_Content_blog_Entry" js="0">Blogs</word>
|
||||
<word key_rus="Можно закреплять записи?" key="can_pin_blog_entry" js="0">Can pin entries?</word>
|
||||
<word key_rus="Можно откреплять записи?" key="can_unpin_blog_entry" js="0">Can unpin entries?</word>
|
||||
<word key_rus="Можно устанавливать записи популярными?" key="can_feature_blog_entry" js="0">Can feature entries?</word>
|
||||
<word key_rus="Можно устанавливать записи непопулярными?" key="can_unfeature_blog_entry" js="0">Can unfeature entries?</word>
|
||||
<word key_rus="Можно редактировать записи?" key="can_edit_blog_entry" js="0">Can edit entries?</word>
|
||||
<word key_rus="Можно скрывать записи?" key="can_hide_blog_entry" js="0">Can hide entries?</word>
|
||||
<word key_rus="Можно отображать записи?" key="can_unhide_blog_entry" js="0">Can unhide entries?</word>
|
||||
<word key_rus="Можно просматривать скрытые записи?" key="can_view_hidden_blog_entry" js="0">Can view hidden entries?</word>
|
||||
<word key_rus="Можно перемещать записи?" key="can_move_blog_entry" js="0">Can move entries?</word>
|
||||
<word key_rus="Можно блокировать записи?" key="can_lock_blog_entry" js="0">Can lock entries?</word>
|
||||
<word key_rus="Можно разблокировать записи?" key="can_unlock_blog_entry" js="0">Can unlock entries?</word>
|
||||
<word key_rus="Можно отвечать на заблокированные записи?" key="can_reply_to_locked_blog_entry" js="0">Can reply to locked entries?</word>
|
||||
<word key_rus="Можно удалять записи?" key="can_delete_blog_entry" js="0">Can delete entries?</word>
|
||||
<word key_rus="Можно редактировать комментарии?" key="can_edit_blog_entry_comment" js="0">Can edit comments?</word>
|
||||
<word key_rus="Можно скрывать комментарии?" key="can_hide_blog_entry_comment" js="0">Can hide comments?</word>
|
||||
<word key_rus="Можно отображать комментарии?" key="can_unhide_blog_entry_comment" js="0">Can unhide comments?</word>
|
||||
<word key_rus="Можно просматривать скрытые комментарии?" key="can_view_hidden_blog_entry_comment" js="0">Can view hidden comments?</word>
|
||||
<word key_rus="Можно удалять комментарии?" key="can_delete_blog_entry_comment" js="0">Can delete comments?</word>
|
||||
<word key_rus="Можно устанавливать дату будующих публикаций?" key="can_future_publish_blog_entry" js="0">Can set a future publishing date?</word>
|
||||
<word key_rus="Можно просматривать записи блога других пользователей, ожидающие публикации?" key="can_view_future_blog_entry" js="0">Can view pending publishing blog entries authored by other members?</word>
|
||||
<word key_rus="Блог" key="group__blog_Blog" js="0">Blog</word>
|
||||
<word key_rus="Можно создавать блоги?" key="g_blog_allowlocal" js="0">Can create blogs?</word>
|
||||
<word key_rus="Максимальное количество блогов" key="g_blog_maxblogs" js="0">Maximum number of blogs</word>
|
||||
<word key_rus="Можно создавать приватные блоги?" key="g_blog_allowprivate" js="0">Can create private blogs?</word>
|
||||
<word key_rus="Приватные блоги могут просматриваться только выбранными автором пользователями." key="g_blog_allowprivate_desc" js="0">Private blogs can only be seen by the members that the creator chooses.</word>
|
||||
<word key_rus="Можно добавлять опросы к записям блога?" key="g_blog_allowpoll" js="0">Can add polls to blog entries?</word>
|
||||
<word key_rus="Можно комментировать записи блога?" key="g_blog_allowcomment" js="0">Can comment on blog entries?</word>
|
||||
<word key_rus="Можно модерировать записи собственного блога?" key="g_blog_allowownmod" js="0">Can moderate own blog entries?</word>
|
||||
<word key_rus="Пользователь сможет: редактировать комментарии и записи, удалять комментарии и записи, и блокировать записи от комментирования." key="g_blog_allowownmod_desc" js="0">The user will be able to: edit comments and entries, delete comments and entries, and lock entries from further comments.</word>
|
||||
<word key_rus="Можно удалять свои блоги?" key="g_blog_allowdelete" js="0">Can delete own blogs?</word>
|
||||
<word key_rus="Комментарии в блогах" key="block_blogCommentFeed" js="0">Blog Comments</word>
|
||||
<word key_rus="Отображение комментариев из блогов" key="block_blogCommentFeed_desc" js="0">Display comments from blogs.</word>
|
||||
<word key_rus="Блоги" key="block_blogs" js="0">Blogs</word>
|
||||
<word key_rus="Отображение списка блогов" key="block_blogs_desc" js="0">Display a list of blogs.</word>
|
||||
<word key_rus="Последняя запись размещена" key="widget_blog_last_date" js="0">Last entry posted</word>
|
||||
<word key_rus="Дата последней записи" key="widget__blog_edate" js="0">Last entry date</word>
|
||||
<word key_rus="Количество записей" key="widget__blog_count_entries" js="0">Number of entries</word>
|
||||
<word key_rus="Количество комментариев" key="widget__blog_count_comments" js="0">Number of comments</word>
|
||||
<word key_rus="Комментарии" key="__api_blog_comments" js="0">Comments</word>
|
||||
<word key_rus="Записи" key="__api_blog_entries" js="0">Entries</word>
|
||||
<word key_rus="Блоги" key="__api_blog_blogs" js="0">Blogs</word>
|
||||
</app>
|
||||
</language>
|
||||
@@ -23,10 +23,10 @@
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 8,
|
||||
"length": 20,
|
||||
"name": "blog_member_id",
|
||||
"type": "MEDIUMINT",
|
||||
"unsigned": false,
|
||||
"type": "BIGINT",
|
||||
"unsigned": true,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
@@ -184,20 +184,6 @@
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"blog_groupblog": {
|
||||
"allow_null": false,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 1,
|
||||
"name": "blog_groupblog",
|
||||
"type": "INT",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"blog_last_edate": {
|
||||
"allow_null": false,
|
||||
"auto_increment": false,
|
||||
@@ -212,34 +198,6 @@
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"blog_owner_only": {
|
||||
"allow_null": false,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 1,
|
||||
"name": "blog_owner_only",
|
||||
"type": "INT",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"blog_authorized_users": {
|
||||
"allow_null": true,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": null,
|
||||
"length": 255,
|
||||
"name": "blog_authorized_users",
|
||||
"type": "VARCHAR",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"blog_count_entries": {
|
||||
"allow_null": false,
|
||||
"auto_increment": false,
|
||||
@@ -297,18 +255,18 @@
|
||||
"zerofill": false
|
||||
},
|
||||
"blog_rating_average": {
|
||||
"allow_null": false,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 11,
|
||||
"name": "blog_rating_average",
|
||||
"type": "INT",
|
||||
"unsigned": true,
|
||||
"type": "DECIMAL",
|
||||
"length": 11,
|
||||
"decimals": 1,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"blog_cover_photo": {
|
||||
"allow_null": true,
|
||||
@@ -365,6 +323,34 @@
|
||||
"unsigned": true,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"blog_name": {
|
||||
"name": "blog_name",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"blog_desc": {
|
||||
"name": "blog_desc",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
@@ -378,16 +364,6 @@
|
||||
"blog_id"
|
||||
]
|
||||
},
|
||||
"blog_groupblog": {
|
||||
"type": "key",
|
||||
"name": "blog_groupblog",
|
||||
"length": [
|
||||
null
|
||||
],
|
||||
"columns": [
|
||||
"blog_groupblog"
|
||||
]
|
||||
},
|
||||
"blog_grabber": {
|
||||
"type": "key",
|
||||
"name": "blog_grabber",
|
||||
@@ -428,18 +404,6 @@
|
||||
"blog_member_id"
|
||||
]
|
||||
},
|
||||
"auth_user": {
|
||||
"type": "key",
|
||||
"name": "auth_user",
|
||||
"length": [
|
||||
null,
|
||||
190
|
||||
],
|
||||
"columns": [
|
||||
"blog_owner_only",
|
||||
"blog_authorized_users"
|
||||
]
|
||||
},
|
||||
"as_list_view": {
|
||||
"type": "key",
|
||||
"name": "as_list_view",
|
||||
@@ -457,8 +421,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"collation": "utf8mb4_unicode_ci",
|
||||
"engine": "InnoDB"
|
||||
"collation": "utf8mb4_unicode_ci"
|
||||
},
|
||||
"blog_entries": {
|
||||
"name": "blog_entries",
|
||||
@@ -548,18 +511,18 @@
|
||||
"zerofill": false
|
||||
},
|
||||
"entry_content": {
|
||||
"allow_null": true,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": null,
|
||||
"length": 0,
|
||||
"name": "entry_content",
|
||||
"type": "TEXT",
|
||||
"unsigned": false,
|
||||
"type": "MEDIUMTEXT",
|
||||
"length": 0,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"entry_status": {
|
||||
"allow_null": true,
|
||||
@@ -1027,10 +990,10 @@
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": null,
|
||||
"length": 10,
|
||||
"length": 20,
|
||||
"name": "comment_member_id",
|
||||
"type": "INT",
|
||||
"unsigned": false,
|
||||
"type": "BIGINT",
|
||||
"unsigned": true,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
@@ -1319,8 +1282,8 @@
|
||||
},
|
||||
"rss_member": {
|
||||
"name": "rss_member",
|
||||
"type": "MEDIUMINT",
|
||||
"length": 8,
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
|
||||
+111
-100
@@ -4,7 +4,7 @@
|
||||
<div class='ipsBox ipsSpacer_bottom'>
|
||||
<h2 class='ipsType_sectionTitle ipsType_reset'>{lang="featured_entries"}</h2>
|
||||
<div class='ipsClearfix'>
|
||||
<div class="cFeaturedTopics ipsCarousel ipsClearfix" data-ipsCarousel data-ipsCarousel-fullSizeItems data-ipsCarousel-shadows='false'>
|
||||
<div class="cFeaturedTopics ipsCarousel ipsClearfix" data-ipsCarousel data-ipsCarousel-slideshow data-ipsCarousel-fullSizeItems data-ipsCarousel-shadows='false'>
|
||||
<ul class='cTopicCarousel ipsClearfix ipsList_reset' data-role='carouselItems'>
|
||||
{{foreach $featured as $entry}}
|
||||
<li class='ipsCarousel_item ipsAreaBackground_reset ipsClearfix'>
|
||||
@@ -121,14 +121,14 @@
|
||||
<ul class='ipsDataList ipsDataList_reducedSpacing ipsType_medium ipsList_reset ipsType_light'>
|
||||
{{foreach $blog->_recentEntries as $entry}}
|
||||
<li class='ipsDataItem'>
|
||||
<div class='ipsDataItem_main'>
|
||||
<div class='ipsDataItem_main ipsType_break ipsContained'>
|
||||
{{if $entry->unread()}}
|
||||
<a href='{$entry->url()}' title='{lang="view_this_entry" sprintf="$entry->name"}' class=''>
|
||||
<span class='ipsItemStatus ipsItemStatus_tiny'><i class='fa fa-circle'></i></span>
|
||||
</a>
|
||||
{{endif}}
|
||||
<a href='{$entry->url()}' title='{lang="view_this_entry" sprintf="$entry->name"}' class='ipsType_break'>
|
||||
{wordbreak="$entry->name"}
|
||||
<a href='{$entry->url()}' title='{lang="view_this_entry" sprintf="$entry->name"}'>
|
||||
{truncate="$entry->name" length="50"}
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
@@ -148,33 +148,35 @@
|
||||
{template="userPhoto" app="core" params="$blog->latestEntry()->author(), 'mini'" group="global"}
|
||||
<div>
|
||||
<strong class='ipsType_minorHeading'>{lang="latest_entry"}</strong><br>
|
||||
<h3 class='ipsType_reset ipsType_sectionHead ipsType_blendLinks'>
|
||||
{{if $blog->latestEntry()->locked()}}<i class='fa fa-lock'></i> {{endif}}{$blog->latestEntry()->caption}
|
||||
<h3 class='ipsType_reset ipsType_sectionHead ipsType_blendLinks ipsContained_container'>
|
||||
{{if $blog->latestEntry()->locked()}}<span><i class='fa fa-lock'></i></span> {{endif}}{$blog->latestEntry()->caption}
|
||||
{{if $blog->latestEntry()->isFutureDate() || $blog->latestEntry()->mapped('pinned') || $blog->latestEntry()->mapped('featured') || $blog->latestEntry()->hidden() === -1 || $blog->latestEntry()->hidden() === 1 || $blog->latestEntry()->status === 'draft'}}
|
||||
{{if $blog->latestEntry()->isFutureDate()}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$blog->latestEntry()->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$blog->latestEntry()->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span></span>
|
||||
{{elseif $blog->latestEntry()->hidden() === -1}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$blog->latestEntry()->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$blog->latestEntry()->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span>
|
||||
{{elseif $blog->latestEntry()->hidden() === 1}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $blog->latestEntry()->status === 'draft'}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="unpublished"}'><i class='fa fa-pencil-square-o'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="unpublished"}'><i class='fa fa-pencil-square-o'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $blog->latestEntry()->mapped('pinned')}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $blog->latestEntry()->mapped('featured')}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span>
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
|
||||
<a href='{$blog->latestEntry()->url()}' title='{lang="view_this_entry" sprintf="$blog->latestEntry()->name"}'>
|
||||
{{if $blog->latestEntry()->unread()}}
|
||||
<span class='ipsItemStatus' data-ipsTooltip title="{lang="unread_blog"}"><i class="fa fa-circle"></i></span>
|
||||
{{endif}}
|
||||
{wordbreak="$blog->latestEntry()->name"}
|
||||
</a>
|
||||
<div class='ipsType_break ipsContained'>
|
||||
<a href='{$blog->latestEntry()->url()}' title='{lang="view_this_entry" sprintf="$blog->latestEntry()->name"}' class='ipsTruncate ipsTruncate_line'>
|
||||
{{if $blog->latestEntry()->unread()}}
|
||||
<span class='ipsItemStatus' data-ipsTooltip title="{lang="unread_blog"}"><i class="fa fa-circle"></i></span>
|
||||
{{endif}}
|
||||
{$blog->latestEntry()->name}
|
||||
</a>
|
||||
</div>
|
||||
</h3>
|
||||
{{if !( $blog->owner() instanceof \IPS\Member )}}
|
||||
<p class='ipsType_medium ipsType_reset ipsType_light'>{lang="byline" htmlsprintf="trim( $blog->latestEntry()->author()->link() )"} {datetime="$blog->latestEntry()->date"}</p>
|
||||
@@ -189,7 +191,7 @@
|
||||
<strong><a href='{$blog->latestEntry()->url()}' title='{lang="read_more_entry"}'>{lang="read_more"}</a></strong>
|
||||
</li>
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
<li>{template="rating" app="core" params="'small', $blog->latestEntry()->averageRating()" group="global"}</li>
|
||||
<li>{template="rating" app="core" params="'small', $blog->latestEntry()->averageRating(), 5, $blog->latestEntry()->memberRating()" group="global"}</li>
|
||||
{{endif}}
|
||||
{{if !$blog->latestEntry()->num_comments}}
|
||||
<li class='ipsType_light'>{lang="num_comments" pluralize="$blog->latestEntry()->num_comments"}</li>
|
||||
@@ -249,7 +251,7 @@
|
||||
</div>
|
||||
|
||||
<div class='ipsEmbedded_content'>
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_mini ipsClearfix ipsType_medium'>
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_notPhone ipsPhotoPanel_mini ipsClearfix ipsType_medium'>
|
||||
{{if $blog->owner() instanceof \IPS\Member}}
|
||||
{template="userPhoto" group="global" app="core" params="$blog->owner(), 'mini', NULL, '', FALSE"}
|
||||
{{endif}}
|
||||
@@ -281,7 +283,7 @@
|
||||
<div class='ipsColumns ipsColumns_collapsePhone'>
|
||||
<div class='ipsColumn ipsColumn_fluid'>
|
||||
<h3 class='ipsType_sectionHead ipsType_break ipsTruncate ipsTruncate_line'>
|
||||
<a href='{$blog->url()}'>{lang="blogs_blog_{$blog->id}" wordbreak="true"}</a> {{if $showSmall && !($blog->owner() instanceof \IPS\Member)}} <span class='ipsType_light ipsType_medium' data-ipsTooltip title='{lang="this_is_group"}'><i class='fa fa-users'></i> {lang="byline_nodate" sprintf="\IPS\Member::loggedIn()->language()->addToStack( 'blogs_groupblog_name_' . $blog->id )"}</span>{{endif}}
|
||||
<a href='{$blog->url()}'>{{if $blog->member_id}}{$blog->_title}{{else}}{lang="blogs_blog_{$blog->id}"}{{endif}}</a> {{if $showSmall && !($blog->owner() instanceof \IPS\Member)}} <span class='ipsType_light ipsType_medium' data-ipsTooltip title='{lang="this_is_group"}'><i class='fa fa-users'></i> {lang="byline_nodate" sprintf="\IPS\Member::loggedIn()->language()->addToStack( 'blogs_groupblog_name_' . $blog->id )"}</span>{{endif}}
|
||||
</h3>
|
||||
<ul class='ipsGrid cProfileBlog_stats'>
|
||||
<li class='ipsGrid_span4'><strong class='ipsType_normal'>{$blog->_items}</strong><br>{lang="blog_entries" pluralize="$blog->_items"}</li>
|
||||
@@ -296,12 +298,12 @@
|
||||
{{if $blog->latestEntry()->unread()}}
|
||||
<span class='ipsItemStatus' data-ipsTooltip title="{lang="unread_blog"}"><i class="fa fa-circle"></i></span>
|
||||
{{endif}}
|
||||
{wordbreak="$blog->latestEntry()->name"}
|
||||
{$blog->latestEntry()->name}
|
||||
</a>
|
||||
<ul class='ipsList_inline ipsType_medium ipsType_light'>
|
||||
<li>{datetime="$blog->latestEntry()->date"}</li>
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
<li>{template="rating" app="core" params="'small', $blog->latestEntry()->averageRating()" group="global"}</li>
|
||||
<li>{template="rating" app="core" params="'small', $blog->latestEntry()->averageRating(), 5, $blog->latestEntry()->memberRating()" group="global"}</li>
|
||||
{{endif}}
|
||||
{{if !$blog->latestEntry()->num_comments}}
|
||||
<li class='ipsType_light'>{lang="num_comments" pluralize="$blog->latestEntry()->num_comments"}</li>
|
||||
@@ -357,8 +359,7 @@
|
||||
{template="pageHeader" if="!\IPS\Request::i()->isAjax()" group="global" app="core" params="\IPS\Member::loggedIn()->language()->addToStack( 'create_blog_entry' )"}
|
||||
{$form|raw}
|
||||
]]></template>
|
||||
<template template_group="submit" template_name="submitFormTemplate" template_data="$id, $action, $elements, $hiddenValues, $actionButtons, $uploadField, $class=''" template_location="front" template_app="blog"><![CDATA[{{$modOptions=array('blog_entry_date');}}
|
||||
<form accept-charset='utf-8' class="ipsForm {$class}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} data-ipsForm>
|
||||
<template template_group="submit" template_name="submitFormTemplate" template_data="$id, $action, $elements, $hiddenValues, $actionButtons, $uploadField, $class=''" template_location="front" template_app="blog"><![CDATA[<form accept-charset='utf-8' class="ipsForm {$class}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} data-ipsForm>
|
||||
<input type="hidden" name="{$id}_submitted" value="1">
|
||||
{{foreach $hiddenValues as $k => $v}}
|
||||
<input type="hidden" name="{$k}" value="{$v}">
|
||||
@@ -386,7 +387,7 @@
|
||||
<div id='ipsTabs_tabs_{$id}_{$id}_tab_{$name}_panel' class="ipsTabs_panel ipsPad" aria-labelledby="{$id}_tab_{$name}" aria-hidden="false">
|
||||
<ul class='ipsForm ipsForm_vertical'>
|
||||
{{foreach $contents as $inputName => $input}}
|
||||
{$input|raw}
|
||||
{$input|raw}
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -396,9 +397,7 @@
|
||||
<ul class='ipsForm ipsForm_vertical'>
|
||||
{{foreach $elements as $collection}}
|
||||
{{foreach $collection as $inputName => $input}}
|
||||
{{if !in_array( $inputName, $modOptions )}}
|
||||
{$input|raw}
|
||||
{{endif}}
|
||||
{$input|raw}
|
||||
{{endforeach}}
|
||||
{{endforeach}}
|
||||
</ul>
|
||||
@@ -432,7 +431,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{if !( $blog->owner() instanceof \IPS\Member )}}
|
||||
{{if !( $blog->owner() instanceof \IPS\Member ) and count( $blog->contributors() )}}
|
||||
<div class='cBlogContributors ipsClearfix ipsResponsive_hidePhone'>
|
||||
<h2 class='ipsType_minorHeading'>{lang="contributors_to_this"}</h2>
|
||||
<ul class='cBlogView_contributors'>
|
||||
@@ -523,7 +522,7 @@
|
||||
{{endif}}
|
||||
|
||||
{{if $table->canModerate()}}
|
||||
<form action="{$table->baseUrl}" method="post" data-role='moderationTools' data-ipsPageAction>
|
||||
<form action="{$table->baseUrl->csrf()}" method="post" data-role='moderationTools' data-ipsPageAction>
|
||||
<div class='ipsClear ipsPad {{foreach $table->classes as $class}}{$class} {{endforeach}}' id='elTable_{$table->uniqueId}' data-role="tableRows" data-controller='blog.front.browse.list'>
|
||||
{template="$table->rowsTemplate[1]" params="$table, $headers, $rows" object="$table->rowsTemplate[0]"}
|
||||
</div>
|
||||
@@ -611,7 +610,7 @@
|
||||
{{endif}}
|
||||
</div>]]></template>
|
||||
<template template_group="view" template_name="blogViewLarge" template_data="$entry, $table, $first = FALSE" template_location="front" template_app="blog"><![CDATA[
|
||||
<article class='cBlogView_entry ipsContained {{if $entry->hidden()}}ipsModerated{{endif}}' data-controller="core.front.core.lightboxedImages">
|
||||
<article class='cBlogView_entry ipsContained ipsType_break {{if $entry->hidden()}}ipsModerated{{endif}}' data-controller="core.front.core.lightboxedImages">
|
||||
<header class='ipsPhotoPanel ipsPhotoPanel_notPhone ipsPhotoPanel_small ipsSpacer_bottom'>
|
||||
{template="userPhoto" app="core" params="$entry->author()" group="global"}
|
||||
<div>
|
||||
@@ -639,11 +638,11 @@
|
||||
{{if $entry->prefix()}}
|
||||
{template="prefix" group="global" app="core" params="$entry->prefix( TRUE ), $entry->prefix()"}
|
||||
{{endif}}
|
||||
<a href="{$entry->url()}" class='ipsType_blendLinks' title="{lang="read_more_about" sprintf="$entry->name"}" {{if $entry->canEdit()}}data-role="editableTitle"{{endif}}>
|
||||
<a href="{$entry->url()}" class='ipsType_blendLinks' title="{lang="read_more_about" sprintf="$entry->name"} {{if $entry->canEdit()}}{lang="click_hold_edit"}{{endif}}" {{if $entry->canEdit()}}data-role="editableTitle"{{endif}}>
|
||||
{{if $entry->unread()}}
|
||||
<span class='ipsItemStatus' data-ipsTooltip title="{lang="unread_blog"}"><i class="fa fa-circle"></i></span>
|
||||
{{endif}}
|
||||
{{if $entry->canEdit()}}<span data-role="editableTitle">{wordbreak="$entry->name"}</span>{{else}}{wordbreak="$entry->name"}{{endif}}
|
||||
{{if $entry->canEdit()}}<span data-role="editableTitle">{$entry->name}</span>{{else}}{$entry->name}{{endif}}
|
||||
</a>
|
||||
</h2>
|
||||
<p class='ipsType_light ipsType_reset ipsType_blendLinks'>
|
||||
@@ -653,7 +652,7 @@
|
||||
</header>
|
||||
|
||||
<section class='ipsType_normal ipsType_richText ipsType_break ipsSpacer_both' data-ipsTruncate {{if $first}}data-ipsTruncate-size='20 lines'{{else}}data-ipsTruncate-size='7 lines'{{endif}}>
|
||||
{$entry->content|raw}
|
||||
{$entry->content()|raw}
|
||||
</section>
|
||||
{{if count( $entry->tags() )}}
|
||||
<div class='ipsSpacer_top'>
|
||||
@@ -670,47 +669,49 @@
|
||||
{{endif}}
|
||||
<li><strong><a href='{$entry->url()}' title="{lang="read_more_about" sprintf="$entry->name"}">{lang="read_more"}</a></strong></li>
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
<li>{template="rating" app="core" params="'small', $entry->averageRating()" group="global"}</li>
|
||||
<li>{template="rating" app="core" params="'small', $entry->averageRating(), 5, $entry->memberRating()" group="global"}</li>
|
||||
{{endif}}
|
||||
<li><a href='{$entry->url()}#comments' title='{lang="view_comments"}' class='ipsType_light'>{lang="num_comments" pluralize="$entry->num_comments"}</a></li>
|
||||
<li class='ipsType_light'>{lang="num_views_with_number" pluralize="$entry->views"}</li>
|
||||
</ul>
|
||||
</article>]]></template>
|
||||
<template template_group="view" template_name="blogViewMedium" template_data="$entry, $table" template_location="front" template_app="blog"><![CDATA[
|
||||
<article class='cBlogView_entry ipsContained {{if $entry->hidden()}}ipsModerated{{endif}}' data-controller="core.front.core.lightboxedImages">
|
||||
<article class='cBlogView_entry {{if $entry->hidden()}}ipsModerated{{endif}}' data-controller="core.front.core.lightboxedImages">
|
||||
<header class='ipsPhotoPanel ipsPhotoPanel_mini ipsPhotoPanel_notPhone'>
|
||||
{template="userPhoto" app="core" params="$entry->author(), 'mini'" group="global"}
|
||||
<div>
|
||||
<h2 class='ipsType_sectionHead ipsType_blendLinks ipsTruncate ipsTruncate_line'>
|
||||
<h2 class='ipsType_sectionHead ipsType_blendLinks ipsContained_container'>
|
||||
{{if $entry->isFutureDate() || $entry->mapped('pinned') || $entry->mapped('featured') || $entry->hidden() === -1 || $entry->hidden() === 1}}
|
||||
{{if $entry->isFutureDate() and $entry->status !== 'draft'}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$entry->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$entry->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span></span>
|
||||
{{elseif $entry->hidden() === 1}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $entry->mapped('pinned')}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $entry->mapped('featured')}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span>
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
|
||||
{{if $entry->prefix()}}
|
||||
{template="prefix" group="global" app="core" params="$entry->prefix( TRUE ), $entry->prefix()"}
|
||||
<span>{template="prefix" group="global" app="core" params="$entry->prefix( TRUE ), $entry->prefix()"}</span>
|
||||
{{endif}}
|
||||
<a href="{$entry->url()}" title="{lang="read_more_about" sprintf="$entry->name"}" {{if $entry->canEdit()}}data-role="editableTitle"{{endif}}>
|
||||
{{if $entry->unread()}}
|
||||
<span class='ipsItemStatus' data-ipsTooltip title="{lang="unread_blog"}"><i class="fa fa-circle"></i></span>
|
||||
{{endif}}
|
||||
{wordbreak="$entry->name"}
|
||||
</a>
|
||||
<div class='ipsContained ipsType_break'>
|
||||
<a href="{$entry->url()}" title="{lang="read_more_about" sprintf="$entry->name"} {{if $entry->canEdit()}}{lang="click_hold_edit"}{{endif}}" {{if $entry->canEdit()}}data-role="editableTitle"{{endif}}>
|
||||
{{if $entry->unread()}}
|
||||
<span class='ipsItemStatus' data-ipsTooltip title="{lang="unread_blog"}"><i class="fa fa-circle"></i></span>
|
||||
{{endif}}
|
||||
{$entry->name}
|
||||
</a>
|
||||
</div>
|
||||
</h2>
|
||||
<p class='ipsType_light ipsType_reset ipsType_blendLinks'>
|
||||
{lang="byline" htmlsprintf="$entry->author()->link()"}{datetime="$entry->date"}
|
||||
</p>
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
{template="rating" app="core" params="'large', $entry->averageRating()" group="global"}
|
||||
{template="rating" app="core" params="'large', $entry->averageRating(), 5, $entry->memberRating()" group="global"}
|
||||
{{endif}}
|
||||
</div>
|
||||
</header>
|
||||
@@ -732,12 +733,12 @@
|
||||
</ul>
|
||||
</article>]]></template>
|
||||
<template template_group="view" template_name="comments" template_data="$entry" template_location="front" template_app="blog"><![CDATA[<div class='ipsBox'>
|
||||
<div data-controller='core.front.core.commentFeed' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-baseURL='{$entry->url()}' data-feedID='entry-{$entry->id}' id='comments'>
|
||||
<div data-controller='core.front.core.commentFeed, core.front.core.ignoredComments' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-baseURL='{$entry->url()}' data-feedID='entry-{$entry->id}' id='comments'>
|
||||
<div class='ipsPad'>
|
||||
<h2 class='ipsType_sectionHead' data-role="comment_count">{lang="num_comments_uc" pluralize="$entry->num_comments"}</h2>
|
||||
<hr class='ipsHr'>
|
||||
{{if $entry->commentPageCount() > 1}}
|
||||
{$entry->commentPagination()|raw}
|
||||
{$entry->commentPagination( array('tab') )|raw}
|
||||
<br><br>
|
||||
{{endif}}
|
||||
<div data-role='commentFeed' data-controller='core.front.core.moderation'>
|
||||
@@ -761,7 +762,7 @@
|
||||
</div>
|
||||
{{if $entry->commentPageCount() > 1}}
|
||||
<hr class='ipsHr'>
|
||||
{$entry->commentPagination()|raw}
|
||||
{$entry->commentPagination( array('tab') )|raw}
|
||||
{{endif}}
|
||||
{{if $entry->commentForm() || $entry->locked() || \IPS\Member::loggedin()->restrict_post || \IPS\Member::loggedIn()->members_bitoptions['unacknowledged_warnings']}}
|
||||
<div class='ipsAreaBackground ipsPad ipsClear ipsSpacer_top' data-role='replyArea'>
|
||||
@@ -783,7 +784,8 @@
|
||||
{{endif}}
|
||||
</div>
|
||||
</div>
|
||||
</div>]]></template>
|
||||
</div>
|
||||
]]></template>
|
||||
<template template_group="view" template_name="coverPhotoOverlay" template_data="$blog" template_location="front" template_app="blog"><![CDATA[{{if ( $blog->owner() instanceof \IPS\Member ) && \IPS\Request::i()->module == 'view'}}
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_mini'>
|
||||
{template="userPhoto" group="global" app="core" params="$blog->owner(), 'mini'"}
|
||||
@@ -814,33 +816,40 @@
|
||||
{template="blogHeader" group="view" app="blog" params="$entry->container()"}
|
||||
</header>
|
||||
|
||||
<article class='ipsBox ipsPad ipsSpacer_top'>
|
||||
<article class='ipsBox ipsPad ipsSpacer_top ipsType_break'>
|
||||
<header>
|
||||
<h1 class='ipsType_pageTitle ipsType_largeTitle ipsType_break'>
|
||||
<h1 class='ipsType_pageTitle ipsType_largeTitle ipsContained_container'>
|
||||
{{if $entry->isFutureDate() || $entry->mapped('pinned') || $entry->mapped('featured') || $entry->hidden() === -1 || $entry->hidden() === 1 || $entry->status === 'draft'}}
|
||||
{{if $entry->isFutureDate() and $entry->status !== 'draft'}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$entry->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$entry->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span></span>
|
||||
{{elseif $entry->hidden() === -1}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$entry->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$entry->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span>
|
||||
{{elseif $entry->hidden() === 1}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $entry->status === 'draft'}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="unpublished"}'><i class='fa fa-pencil-square-o'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="unpublished"}'><i class='fa fa-pencil-square-o'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $entry->mapped('pinned')}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span></span>
|
||||
{{endif}}
|
||||
{{if $entry->mapped('featured')}}
|
||||
<span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
|
||||
<span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span>
|
||||
{{endif}}
|
||||
{{endif}}
|
||||
|
||||
{{if $entry->prefix()}}
|
||||
{template="prefix" group="global" app="core" params="$entry->prefix( TRUE ), $entry->prefix()"}
|
||||
{{if $entry->prefix() OR ( $entry->canEdit() AND $entry::canTag() AND $entry::canPrefix() )}}
|
||||
<span {{if !$entry->prefix()}}class='ipsHide'{{endif}} {{if ( $entry->canEdit() AND $entry::canTag() AND $entry::canPrefix() )}}data-editablePrefix{{endif}}>
|
||||
{template="prefix" group="global" app="core" params="$entry->prefix( TRUE ), $entry->prefix()"}
|
||||
</span>
|
||||
{{endif}}
|
||||
{{if $entry->canEdit()}}
|
||||
<div class='ipsType_break ipsContained' data-controller="core.front.core.moderation">
|
||||
{{if $entry->locked()}}<i class='fa fa-lock'></i> {{endif}}<span data-role="editableTitle" title='{lang="click_hold_edit"}'>{$entry->name}</span>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='ipsType_break ipsContained'>{{if $entry->locked()}}<i class='fa fa-lock'></i> {{endif}}{$entry->name}</div>
|
||||
{{endif}}
|
||||
{wordbreak="$entry->name"}
|
||||
{{if $entry->locked()}}<i class='fa fa-lock'></i> {{endif}}{$entry->caption}
|
||||
</h1>
|
||||
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_tiny ipsSpacer_top'>
|
||||
@@ -854,8 +863,8 @@
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
{$entry->rating()|raw}
|
||||
{{endif}}
|
||||
{{if count( $entry->tags() )}}
|
||||
{template="tags" group="global" app="core" params="$entry->tags()"}
|
||||
{{if count( $entry->tags() ) OR ( $entry->canEdit() AND $entry::canTag() )}}
|
||||
{template="tags" group="global" app="core" params="$entry->tags(), FALSE, FALSE, ( $entry->canEdit() AND $entry::canTag() ) ? $entry->url() : NULL"}
|
||||
{{endif}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -867,7 +876,7 @@
|
||||
{$poll|raw}
|
||||
{{endif}}
|
||||
|
||||
{$entry->content|raw}
|
||||
{$entry->content()|raw}
|
||||
</div>
|
||||
|
||||
{{if $entry->_album}}
|
||||
@@ -929,7 +938,7 @@
|
||||
{{endif}}
|
||||
</ul>
|
||||
{{endif}}
|
||||
{{if !\IPS\Member::loggedIn()->group['gbw_no_report'] }}
|
||||
{{if ! $entry->container()->social_group and !\IPS\Member::loggedIn()->group['gbw_no_report'] }}
|
||||
<a href='{$entry->url('report')}' data-ipsDialog data-ipsDialog-size='medium' data-ipsDialog-title="{lang="report_entry"}" data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="report_submit_success"}" title="{lang="report_entry"}">{lang="report_entry"}</a>
|
||||
{{endif}}
|
||||
|
||||
@@ -942,21 +951,21 @@
|
||||
|
||||
{{if $previous or $next}}
|
||||
<nav class="ipsPager ipsGrid ipsClearFix ipsList_inline">
|
||||
<div class="ipsGrid_span6 ipsPager_prev">
|
||||
{{if $previous}}
|
||||
<a href="{$previous->url()}" title="{lang="prev_entry"}" rel="prev">
|
||||
<span class="ipsPager_type">{lang="prev_entry"}</span>
|
||||
<span class="ipsPager_title ipsType_break">{wordbreak="$previous->name"}</span>
|
||||
</a>
|
||||
<div class="ipsGrid_span6 ipsPager_prev">
|
||||
<a href="{$previous->url()}" title="{lang="prev_entry"}">
|
||||
<span class="ipsPager_type">{lang="prev_entry"}</span>
|
||||
<span class="ipsPager_title ipsTruncate ipsTruncate_line">{$previous->name}</span>
|
||||
</a>
|
||||
</div>
|
||||
{{endif}}
|
||||
</div>
|
||||
{{if $next}}
|
||||
<div class="ipsGrid_span6 ipsType_right ipsPager_next">
|
||||
<a href="{$next->url()}" title="{lang="next_entry"}" rel="next">
|
||||
<span class="ipsPager_type">{lang="next_entry"}</span>
|
||||
<span class="ipsPager_title ipsType_break">{wordbreak="$next->name"}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ipsGrid_span6 ipsType_right ipsPager_next">
|
||||
<a href="{$next->url()}" title="{lang="next_entry"}">
|
||||
<span class="ipsPager_type">{lang="next_entry"}</span>
|
||||
<span class="ipsPager_title ipsTruncate ipsTruncate_line">{$next->name}</span>
|
||||
</a>
|
||||
</div>
|
||||
{{endif}}
|
||||
</nav>
|
||||
<hr class='ipsHr'>
|
||||
@@ -976,7 +985,7 @@
|
||||
<div class='ipsType_center'>
|
||||
<p class='ipsType_large'>{lang="no_entries"}</p>
|
||||
{{if $container->can('add')}}
|
||||
<a href='{url="app=blog&module=blog&controller=submit&id={$container->_id}" seoTemplate="blog_submit"}' class='ipsButton ipsButton_primary ipsButton_medium'>{lang="submit_entry"}</a>
|
||||
<a href='{url="app=blog&module=blogs&controller=submit&id={$container->_id}" seoTemplate="blog_submit"}' class='ipsButton ipsButton_primary ipsButton_medium'>{lang="submit_entry"}</a>
|
||||
{{endif}}
|
||||
</div>]]></template>
|
||||
<template template_group="view" template_name="rows" template_data="$table, $headers, $entries" template_location="front" template_app="blog"><![CDATA[{{if count( $entries ) > 0}}
|
||||
@@ -1035,7 +1044,7 @@
|
||||
<a href='#elBlogManage_menu' id='elBlogManage' data-ipsMenu class='ipsButton ipsButton_link ipsButton_medium ipsButton_fullWidth'>{lang="manage_blog"} <i class='fa fa-caret-down'></i></a>
|
||||
<ul id='elBlogManage_menu' class='ipsMenu ipsMenu_normal ipsHide'>
|
||||
|
||||
{{if $blog->canEdit() }}
|
||||
{{if $blog->canEdit() AND !$blog->groupblog_ids}}
|
||||
<li class='ipsMenu_item'>
|
||||
<a href='{$blog->url()->setQueryString( array( 'do' => 'editBlog', 'csrfKey' => \IPS\Session::i()->csrfKey ) )}' title="{lang="edit_blog"}" data-ipsDialog data-ipsDialog-title="{lang="edit_blog"}">{lang="edit_blog"}</a>
|
||||
</li>
|
||||
@@ -1059,7 +1068,7 @@
|
||||
|
||||
{{if $blog->canDelete() }}
|
||||
<li class='ipsMenu_item'>
|
||||
<a href='{$blog->url()->setQueryString( array( 'do' => 'deleteBlog', 'csrfKey' => \IPS\Session::i()->csrfKey ) )}' data-confirm title="{lang="delete_blog"}">{lang="delete_blog"}</a>
|
||||
<a href='{$blog->url()->setQueryString( array( 'do' => 'deleteBlog', 'csrfKey' => \IPS\Session::i()->csrfKey ) )}' data-confirm title="{lang="delete_blog"}" data-confirmMessage="{lang="delete_blog_confirm"}" >{lang="delete_blog"}</a>
|
||||
</li>
|
||||
{{endif}}
|
||||
</ul>
|
||||
@@ -1084,7 +1093,7 @@
|
||||
{template="userPhoto" group="global" app="core" params="$comment->author(), 'tiny'"}
|
||||
</div>
|
||||
<div class='ipsDataItem_main'>
|
||||
<a href="{$comment->url()}" class='ipsType_medium ipsType_break'>{wordbreak="$comment->item()->name"}</a><br>
|
||||
<div class='ipsType_break ipsContained'><a href="{$comment->url()}" class='ipsType_medium ipsTruncate ipsTruncate_line'>{$comment->item()->name}</a></div>
|
||||
<p class='ipsType_reset ipsType_medium ipsType_light ipsType_blendLinks'>{lang="byline_nodate" htmlsprintf="$comment->author()->link()"} · <a href="{$comment->url()}" class='ipsDataItem_title ipsType_break ipsType_blendLinks'>{$comment->dateLine()|raw}</a></p>
|
||||
<div class='ipsType_medium ipsType_textBlock ipsType_richText ipsType_break ipsContained ipsSpacer_top ipsSpacer_half' data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='{{if $orientation == 'vertical'}}6 lines{{else}}2 lines{{endif}}'>
|
||||
{$comment->truncated( true )|raw}
|
||||
@@ -1110,7 +1119,7 @@
|
||||
{template="reputationBadge" group="global" app="core" params="$comment->author()"}
|
||||
</h3>
|
||||
<p class='ipsComment_meta ipsType_light ipsType_medium'>
|
||||
<a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findComment', 'comment' => $comment->id ) )}' class='ipsType_blendLinks' title='{lang="share_this_comment"}'>{$comment->dateLine()|raw}</a>
|
||||
<a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findComment', 'comment' => $comment->id ) )}' class='ipsType_blendLinks'>{$comment->dateLine()|raw}</a>
|
||||
{{if $comment->editLine()}}
|
||||
({lang="edited_lc"})
|
||||
{{endif}}
|
||||
@@ -1129,10 +1138,10 @@
|
||||
</div>
|
||||
|
||||
<div class='ipsPad ipsClearfix'>
|
||||
{{if in_array( 'IPS\Content\Reputation', class_implements( $comment ) ) and settings.reputation_highlight and $comment->reputation() >= settings.reputation_highlight}}
|
||||
{{if in_array( 'IPS\Content\Reputation', class_implements( $comment ) ) and settings.reputation_highlight and $comment->reputation() >= settings.reputation_highlight and settings.reputation_enabled}}
|
||||
<strong class='ipsComment_popularFlag' data-ipsTooltip title='{lang="this_is_a_popular_comment"}'><i class='fa fa-star'></i></strong>
|
||||
{{endif}}
|
||||
<a href="{$comment->url()}" class='ipsDataItem_title ipsType_break'>{wordbreak="$comment->item()->name"}</a><br>
|
||||
<div class='ipsType_break ipsContained'><a href="{$comment->url()}" class='ipsDataItem_title ipsTruncate ipsTruncate_line'>{$comment->item()->name}</a></div><br>
|
||||
<div data-role='commentContent' class='ipsType_normal ipsType_richText ipsType_break ipsContained' data-controller='core.front.core.lightboxedImages'>
|
||||
{{if $comment->hidden() === 1 && $comment->author()->member_id == \IPS\Member::loggedIn()->member_id}}
|
||||
<strong class='ipsType_medium ipsType_warning'><i class='fa fa-info-circle'></i> {lang="comment_awaiting_approval"}</strong>
|
||||
@@ -1162,7 +1171,7 @@
|
||||
{{foreach $blogs as $blog}}
|
||||
<li class='ipsDataItem'>
|
||||
<div class='ipsColumns ipsColumns_collapsePhone'>
|
||||
<h4 class='ipsType_large ipsType_reset'>{$blog->_title}</h4>
|
||||
<h4 class='ipsSpacer_top ipsSpacer_half ipsType_reset ipsTruncate ipsTruncate_line'><a href="{$blog->url()}" title='{lang="view_this_blog" sprintf="$blog->_title"}'>{$blog->_title}</a></h4>
|
||||
<div>
|
||||
<ul class='ipsGrid'>
|
||||
<li class='ipsGrid_span4'><strong class='ipsType_normal'>{$blog->_items}</strong><br>{lang="blog_entries" pluralize="$blog->_items"}</li>
|
||||
@@ -1199,9 +1208,11 @@
|
||||
<span class='ipsItemStatus ipsItemStatus_tiny'><i class='fa fa-circle'></i></span>
|
||||
</a>
|
||||
{{endif}}
|
||||
<a href='{$entry->url()}' title='{lang="view_this_entry" sprintf="$entry->name"}' class='ipsType_break'>
|
||||
{wordbreak="$entry->name"}
|
||||
</a>
|
||||
<div class='ipsContained ipsType_break'>
|
||||
<a href='{$entry->url()}' title='{lang="view_this_entry" sprintf="$entry->name"}' class='ipsType_break'>
|
||||
{$entry->name}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{endforeach}}
|
||||
@@ -1216,12 +1227,12 @@
|
||||
<div>
|
||||
<strong class='ipsType_minorHeading'>{lang="latest_entry"}</strong><br>
|
||||
<h3 class='ipsType_reset ipsType_sectionHead ipsType_blendLinks'>
|
||||
<a href='{$blog->latestEntry()->url()}' title='{lang="view_this_entry" sprintf="$blog->latestEntry()->name"}'>
|
||||
<div class='ipsType_break ipsContained'><a href='{$blog->latestEntry()->url()}' title='{lang="view_this_entry" sprintf="$blog->latestEntry()->name"}'>
|
||||
{{if $blog->latestEntry()->unread()}}
|
||||
<span class='ipsItemStatus' data-ipsTooltip title="{lang="unread_blog"}"><i class="fa fa-circle"></i></span>
|
||||
{{endif}}
|
||||
{wordbreak="$blog->latestEntry()->name"}
|
||||
</a>
|
||||
{$blog->latestEntry()->name}
|
||||
</a></div>
|
||||
{{if $blog->latestEntry()->locked()}}<i class='fa fa-lock'></i> {{endif}}{$blog->latestEntry()->caption}
|
||||
{{if $blog->latestEntry()->isFutureDate() || $blog->latestEntry()->mapped('pinned') || $blog->latestEntry()->mapped('featured') || $blog->latestEntry()->hidden() === -1 || $blog->latestEntry()->hidden() === 1 || $blog->latestEntry()->status === 'draft'}}
|
||||
{{if $blog->latestEntry()->isFutureDate()}}
|
||||
@@ -1255,7 +1266,7 @@
|
||||
<strong><a href='{$blog->latestEntry()->url()}' title='{lang="read_more_entry"}'>{lang="read_more"}</a></strong>
|
||||
</li>
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
<li>{template="rating" app="core" params="'small', $blog->latestEntry()->averageRating()" group="global"}</li>
|
||||
<li>{template="rating" app="core" params="'small', $blog->latestEntry()->averageRating(), 5, $blog->latestEntry()->memberRating()" group="global"}</li>
|
||||
{{endif}}
|
||||
{{if !$blog->latestEntry()->num_comments}}
|
||||
<li class='ipsType_light'>{lang="num_comments" pluralize="$blog->latestEntry()->num_comments"}</li>
|
||||
@@ -1324,10 +1335,10 @@
|
||||
{template="userPhoto" app="core" params="$entry->author(), 'tiny'" group="global"}
|
||||
</div>
|
||||
<div class='ipsDataItem_main'>
|
||||
<a href="{$entry->url('getLastComment')}" title='{lang="view_this_entry" sprintf="$entry->_title"}' class='ipsType_medium ipsType_break'>{wordbreak="$entry->name"}</a><br>
|
||||
<span class='ipsType_blendLinks ipsType_light ipsType_medium ipsType_break ipsContained'>{lang="byline_nodate" htmlsprintf="$entry->author()->link()"} {lang="in"} <a href='{$entry->container()->url()}' class='ipsType_blendLinks'>{$entry->container()->_title}</a></span>
|
||||
<div class='ipsContained ipsType_break'><a href="{$entry->url('getLastComment')}" title='{lang="view_this_entry" sprintf="$entry->_title"}' class='ipsType_medium ipsTruncate ipsTruncate_line'>{$entry->name}</a></div>
|
||||
<span class='ipsType_blendLinks ipsType_light ipsType_medium ipsType_break ipsContained'>{lang="byline_nodate" htmlsprintf="$entry->author()->link()"} {lang="in"} <a href='{$entry->container()->url()}' class='ipsType_blendLinks ipsTruncate ipsTruncate_line'>{$entry->container()->_title}</a></span>
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
{template="rating" group="global" location="front" app="core" params="'small', $entry->averageRating()"}
|
||||
{template="rating" group="global" location="front" app="core" params="'small', $entry->averageRating(), 5, $entry->memberRating()"}
|
||||
{{endif}}
|
||||
<span class='ipsType_medium ipsType_reset'>{{if !$entry->num_comments}}<span class='ipsType_light'>{{endif}}<i class='fa fa-comment'></i> {number="$entry->num_comments"}{{if !$entry->num_comments}}</span>{{endif}}</span>
|
||||
{{if $orientation == 'horizontal'}}
|
||||
|
||||
@@ -97,5 +97,79 @@
|
||||
"101009": "4.1.0 Beta 10",
|
||||
"101010": "4.1.0",
|
||||
"101011": "4.1.1",
|
||||
"101012": "4.1.2"
|
||||
"101012": "4.1.2",
|
||||
"101013": "4.1.3",
|
||||
"101014": "4.1.3.1",
|
||||
"101015": "4.1.3.2",
|
||||
"101016": "4.1.4",
|
||||
"101017": "4.1.4.1",
|
||||
"101018": "4.1.5",
|
||||
"101019": "4.1.5.1",
|
||||
"101020": "4.1.5.2",
|
||||
"101021": "4.1.6",
|
||||
"101022": "4.1.6.1",
|
||||
"101023": "4.1.7",
|
||||
"101024": "4.1.8",
|
||||
"101025": "4.1.8.1",
|
||||
"101026": "4.1.9",
|
||||
"101027": "4.1.10",
|
||||
"101028": "4.1.11",
|
||||
"101029": "4.1.11.1",
|
||||
"101030": "4.1.12",
|
||||
"101031": "4.1.12.1",
|
||||
"101032": "4.1.12.2",
|
||||
"101033": "4.1.12.3",
|
||||
"101034": "4.1.13 Beta 1",
|
||||
"101035": "4.1.13 Beta 2",
|
||||
"101036": "4.1.13",
|
||||
"101037": "4.1.13",
|
||||
"101038": "4.1.13.1",
|
||||
"101040": "4.1.13.2",
|
||||
"101041": "4.1.13.2",
|
||||
"101042": "4.1.14 Beta 1",
|
||||
"101043": "4.1.14 Beta 2",
|
||||
"101044": "4.1.14 Beta 3",
|
||||
"101045": "4.1.14 Beta 4",
|
||||
"101046": "4.1.14 Beta 5",
|
||||
"101049": "4.1.14 Beta 6",
|
||||
"101050": "4.1.14 Beta 7",
|
||||
"101051": "4.1.14 RC",
|
||||
"101052": "4.1.14",
|
||||
"101053": "4.1.14.1",
|
||||
"101054": "4.1.14.2",
|
||||
"101055": "4.1.14.3",
|
||||
"101056": "4.1.15",
|
||||
"101057": "4.1.15 Beta 1",
|
||||
"101058": "4.1.15 Beta 2",
|
||||
"101059": "4.1.15 Beta 2a",
|
||||
"101060": "4.1.15 Beta 3",
|
||||
"101061": "4.1.15",
|
||||
"101062": "4.1.15",
|
||||
"101063": "4.1.15",
|
||||
"101064": "4.1.16 Beta 1",
|
||||
"101065": "4.1.16 Beta 2",
|
||||
"101066": "4.1.16 Beta 3",
|
||||
"101067": "4.1.16 Beta 4",
|
||||
"101068": "4.1.16 Beta 5",
|
||||
"101069": "4.1.16",
|
||||
"101070": "4.1.16.1",
|
||||
"101071": "4.1.17 Beta 1",
|
||||
"101072": "4.1.17 Beta 1a",
|
||||
"101073": "4.1.17 Beta 1b",
|
||||
"101074": "4.1.17 Beta 2",
|
||||
"101075": "4.1.17 Beta 3",
|
||||
"101076": "4.1.17 Beta 3",
|
||||
"101077": "4.1.17",
|
||||
"101078": "4.1.17.1",
|
||||
"101079": "4.1.18 Beta 1",
|
||||
"101082": "4.1.18 Beta 1b",
|
||||
"101083": "4.1.18 Beta 2",
|
||||
"101084": "4.1.18 Beta 3",
|
||||
"101085": "4.1.18",
|
||||
"101088": "4.1.18.1",
|
||||
"101089": "4.1.18.2",
|
||||
"101090": "4.1.19 Beta 1",
|
||||
"101091": "4.1.19 Beta 2",
|
||||
"101092": "4.1.19 Beta 3",
|
||||
"101093": "4.1.19"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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
|
||||
* @subpackage Blogs
|
||||
* @since 05 Feb 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\BBCode;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* BBCode Tag
|
||||
*/
|
||||
class _blog
|
||||
{
|
||||
/**
|
||||
* Permission Check
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param string $area The Editor area
|
||||
* @return bool
|
||||
*/
|
||||
public function permissionCheck( \IPS\Member $member, $area )
|
||||
{
|
||||
return \IPS\Text\Parser::canUse( $member, 'ipsLink', $area );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Configuration
|
||||
*
|
||||
* @code
|
||||
return array(
|
||||
'tag' => 'span', // The HTML tag to use
|
||||
'attributes' => array( ... ) // Key/Value pairs of attributes to use (optional) - can use {option} to get the [tag=option] value
|
||||
'callback' => function( $node, $matches, $document ) // A callback to modify the DOMNode object
|
||||
{
|
||||
...
|
||||
},
|
||||
'block' => FALSE, // If this is a block-level tag (optional, default false)
|
||||
'single' => FALSE, // If this is a single tag, with no content (optional, default false)
|
||||
)
|
||||
* @endcode
|
||||
* @return array
|
||||
*/
|
||||
public function getConfiguration()
|
||||
{
|
||||
return array(
|
||||
'tag' => 'a',
|
||||
'callback' => function( \DOMElement $node, $matches, \DOMDocument $document )
|
||||
{
|
||||
try
|
||||
{
|
||||
$node->setAttribute( 'href', (string) \IPS\blog\Blog::load( intval( $matches[2] ) )->url() );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
return $node;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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
|
||||
* @subpackage Blogs
|
||||
* @since 08 Feb 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\BBCode;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* BBCode Tag
|
||||
*/
|
||||
class _entry
|
||||
{
|
||||
/**
|
||||
* Permission Check
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param string $area The Editor area
|
||||
* @return bool
|
||||
*/
|
||||
public function permissionCheck( \IPS\Member $member, $area )
|
||||
{
|
||||
return \IPS\Text\Parser::canUse( $member, 'ipsLink', $area );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Configuration
|
||||
*
|
||||
* @code
|
||||
return array(
|
||||
'tag' => 'span', // The HTML tag to use
|
||||
'attributes' => array( ... ) // Key/Value pairs of attributes to use (optional) - can use {option} to get the [tag=option] value
|
||||
'callback' => function( $node, $matches, $document ) // A callback to modify the DOMNode object
|
||||
{
|
||||
...
|
||||
},
|
||||
'block' => FALSE, // If this is a block-level tag (optional, default false)
|
||||
'single' => FALSE, // If this is a single tag, with no content (optional, default false)
|
||||
)
|
||||
* @endcode
|
||||
* @return array
|
||||
*/
|
||||
public function getConfiguration()
|
||||
{
|
||||
return array(
|
||||
'tag' => 'a',
|
||||
'callback' => function( \DOMElement $node, $matches, \DOMDocument $document )
|
||||
{
|
||||
try
|
||||
{
|
||||
$node->setAttribute( 'href', (string) \IPS\blog\Entry::load( intval( $matches[2] ) )->url() );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
return $node;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Content Router extension: Blog
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 04 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Create Menu Extension : Entry
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 10 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Dashboard extension: Overview
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 20 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Editor Extension: Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 04 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -54,11 +54,20 @@ class _Blogs
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3 )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
{
|
||||
return \IPS\blog\Blog::load( $id1 )->can( 'view', $member );
|
||||
/* The attachment is attached to a comment */
|
||||
if ( $id2 )
|
||||
{
|
||||
return \IPS\blog\Entry\Comment::load( $id2 )->canView( $member );
|
||||
}
|
||||
else
|
||||
{
|
||||
return \IPS\blog\Blog::load( $id1 )->can( 'view', $member );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +81,15 @@ class _Blogs
|
||||
*/
|
||||
public function attachmentLookup( $id1, $id2, $id3 )
|
||||
{
|
||||
return \IPS\blog\Blog::load( $id1 );
|
||||
/* The attachment is attached to a comment */
|
||||
if ( $id2 )
|
||||
{
|
||||
return \IPS\blog\Entry\Comment::load( $id2 )->canView( $member );
|
||||
}
|
||||
else
|
||||
{
|
||||
return \IPS\blog\Blog::load( $id1 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Editor Extension: Blog Entries
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 10 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ class _Entries
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
@@ -54,9 +54,10 @@ class _Entries
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3 )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
{
|
||||
return \IPS\blog\Entry::load( $id1 )->canView( $member );
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief File Storage Extension: Blogs (cover photos)
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 16 Jun 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief File Storage Extension: Blog Entries (cover photos)
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 30 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Front Navigation Extension: Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -35,13 +35,13 @@ class _Blogs extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
}
|
||||
|
||||
/**
|
||||
* Can access?
|
||||
* Can the currently logged in user access the content this item links to?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canView()
|
||||
public function canAccessContent()
|
||||
{
|
||||
return parent::canView() and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'blog', 'blogs' ) );
|
||||
return \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'blog', 'blogs' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Admin CP Group Form
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 11 Jul 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -56,11 +56,12 @@ class _Blog
|
||||
{
|
||||
if( $group->g_id != \IPS\Settings::i()->guest_group )
|
||||
{
|
||||
$group->g_blog_allowlocal = $values['g_blog_allowlocal'];
|
||||
$group->g_blog_maxblogs = $values['g_blog_maxblogs'];
|
||||
$group->g_blog_allowprivate = $values['g_blog_allowprivate'];
|
||||
$group->g_blog_allowownmod = $values['g_blog_allowownmod'];
|
||||
$group->g_blog_allowdelete = $values['g_blog_allowdelete'];
|
||||
/* We intval here because (some of) the columns do not accept null values, but these are null when creating a new group */
|
||||
$group->g_blog_allowlocal = (int) $values['g_blog_allowlocal'];
|
||||
$group->g_blog_maxblogs = (int) $values['g_blog_maxblogs'];
|
||||
$group->g_blog_allowprivate = (int) $values['g_blog_allowprivate'];
|
||||
$group->g_blog_allowownmod = (int) $values['g_blog_allowownmod'];
|
||||
$group->g_blog_allowdelete = (int) $values['g_blog_allowdelete'];
|
||||
}
|
||||
|
||||
$group->g_blog_allowcomment = $values['g_blog_allowcomment'];
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief ACP Live Search Extension
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 20 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -73,4 +73,14 @@ class _Blogs
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is default for current page?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isDefault()
|
||||
{
|
||||
return \IPS\Dispatcher::i()->application->directory == 'blog';
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Member Sync
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 20 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -55,8 +55,12 @@ class _Blog
|
||||
|
||||
foreach( \IPS\blog\Blog::loadByOwner( $member ) as $blog )
|
||||
{
|
||||
$blog->member_id = 0;
|
||||
$blog->save();
|
||||
/* We only want to do this if the blog is owned by the member - loadByOwner() also returns Blogs that are assigned to member groups */
|
||||
if ( !$blog->groupblog_ids )
|
||||
{
|
||||
/* Delete blog entries & blog */
|
||||
\IPS\Task::queue( 'core', 'DeleteOrMoveContent', array( 'class' => 'IPS\blog\Blog', 'id' => $blog->id, 'deleteWhenDone' => TRUE ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Profile extension: Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 02 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<?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
|
||||
* @subpackage Blogs
|
||||
* @since 12 Apr 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\Queue;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Background Task
|
||||
*/
|
||||
class _RebuildEntryImages
|
||||
{
|
||||
/**
|
||||
* @brief Number of entry images to rebuild per cycle
|
||||
*/
|
||||
public $rebuild = 10;
|
||||
|
||||
/**
|
||||
* Parse data before queuing
|
||||
*
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function preQueueData( $data )
|
||||
{
|
||||
$data['count'] = (int) \IPS\Db::i()->select( 'count(*)', 'blog_entries', "entry_image<>''" )->first();
|
||||
|
||||
if( $data['count'] == 0 )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run Background Task
|
||||
*
|
||||
* @param mixed $data Data as it was passed to \IPS\Task::queue()
|
||||
* @param int $offset Offset
|
||||
* @return int New offset
|
||||
* @throws \IPS\Task\Queue\OutOfRangeException Indicates offset doesn't exist and thus task is complete
|
||||
*/
|
||||
public function run( $data, $offset )
|
||||
{
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_entries', "entry_image<>''", 'entry_id ASC', array( $offset, $this->rebuild ) );
|
||||
|
||||
if ( !$select->count() )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
foreach ( $select as $entry )
|
||||
{
|
||||
try
|
||||
{
|
||||
$filePath = \IPS\ROOT_PATH . '/uploads/' . $entry['entry_image'];
|
||||
|
||||
if ( ! file_exists( $filePath ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Have we processed this before? It's a bit crude but it is accurate */
|
||||
if ( mb_substr( trim( $entry['entry_content'] ), 0, 37 ) === '<a href="<fileStore.core_Attachment>/' and mb_stristr( $entry['entry_content'], '/' . $entry['entry_image'] . '.' ) and mb_stristr( $entry['entry_content'], 'data-fileid="' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$file = \IPS\File::create( 'core_Attachment', $entry['entry_image'], NULL, NULL, FALSE, $filePath );
|
||||
$attachment = $file->makeAttachment('', \IPS\Member::load( $entry['entry_author_id'] ) );
|
||||
$fileName = htmlspecialchars( $attachment['attach_file'], \IPS\HTMLENTITIES, 'UTF-8', TRUE );
|
||||
|
||||
$image = <<<IMAGE
|
||||
<a href="<fileStore.core_Attachment>/{$file}" class="ipsAttachLink ipsAttachLink_image" style="float:left;"><img data-fileid="{$attachment['attach_id']}" src="<fileStore.core_Attachment>/{$file}" class="ipsImage ipsImage_thumbnailed" style="margin:10px;" alt="{$fileName}"></a>
|
||||
IMAGE;
|
||||
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_content' => $image . $entry['entry_content'] ), array( 'entry_id=?', $entry['entry_id'] ) );
|
||||
|
||||
$map = array(
|
||||
'attachment_id' => $attachment['attach_id'],
|
||||
'location_key' => 'blog_Entries',
|
||||
'id1' => $entry['entry_id'],
|
||||
'id2' => NULL,
|
||||
'id3' => NULL,
|
||||
'temp' => NULL,
|
||||
);
|
||||
|
||||
\IPS\Db::i()->replace( 'core_attachments_map', $map );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
|
||||
return $offset + $this->rebuild;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Progress
|
||||
*
|
||||
* @param mixed $data Data as it was passed to \IPS\Task::queue()
|
||||
* @param int $offset Offset
|
||||
* @return array( 'text' => 'Doing something...', 'complete' => 50 ) Text explaining task and percentage complete
|
||||
* @throws \OutOfRangeException Indicates offset doesn't exist and thus task is complete
|
||||
*/
|
||||
public function getProgress( $data, $offset )
|
||||
{
|
||||
return array(
|
||||
'text' => \IPS\Member::loggedIn()->language()->addToStack( 'rebuilding_blog_entry_images', FALSE ),
|
||||
'complete' => ( isset( $data['count'] ) AND $data['count'] )
|
||||
? ( round( 100 / $data['count'] * $offset, 2 ) )
|
||||
: 100
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Group Blogs Controller
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -56,7 +56,7 @@ class _blogs extends \IPS\Node\Controller
|
||||
$table->mainColumn = 'word_custom';
|
||||
|
||||
$table->joins = array(
|
||||
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'blogs_blog_', blog_blogs.blog_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
|
||||
array( 'select' => 'CASE WHEN blog_blogs.blog_member_id THEN blog_blogs.blog_name ELSE w.word_custom END as word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'blogs_blog_', blog_blogs.blog_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
|
||||
);
|
||||
|
||||
/* Sort stuff */
|
||||
@@ -71,9 +71,30 @@ class _blogs extends \IPS\Node\Controller
|
||||
);
|
||||
|
||||
$table->parsers = array(
|
||||
'blog_member_id' => function( $val, $row )
|
||||
'blog_member_id' => function( $val, $row )
|
||||
{
|
||||
return \IPS\Member::load( $val )->link();
|
||||
try
|
||||
{
|
||||
return \IPS\Member::load( $val )->link();
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
},
|
||||
'word_custom' => function( $val, $row )
|
||||
{
|
||||
if ( ! $val )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack('blog_member_deleted');
|
||||
}
|
||||
|
||||
if( $row['blog_member_id'] )
|
||||
{
|
||||
$val = htmlspecialchars( $val, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
|
||||
}
|
||||
|
||||
return $val;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Blog Settings
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -31,7 +31,7 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'blog_settings_manage' );
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'settings_manage', 'blog' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief All Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -24,16 +24,6 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _browse extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Create Blog
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 24 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief View Blog Entry Controller
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -44,10 +44,10 @@ class _entry extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2B202/1', 403, '' );
|
||||
}
|
||||
|
||||
if ( $this->entry->cover_photo )
|
||||
|
||||
if ( $this->entry->container()->cover_photo )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['og:image'] = $this->entry->cover_photo;
|
||||
\IPS\Output::i()->metaTags['og:image'] = \IPS\File::get( 'blog_Blogs', $this->entry->container()->cover_photo )->url;
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
@@ -79,7 +79,7 @@ class _entry extends \IPS\Content\Controller
|
||||
$previous = \IPS\Db::i()->select(
|
||||
'*',
|
||||
'blog_entries',
|
||||
array( 'entry_blog_id=? AND entry_date<?', $this->entry->blog_id, $this->entry->date ),
|
||||
array( 'entry_blog_id=? AND entry_date<? AND entry_status=? AND entry_is_future_entry=0', $this->entry->blog_id, $this->entry->date, "published" ),
|
||||
'entry_date DESC'
|
||||
,1
|
||||
)->first();
|
||||
@@ -94,7 +94,7 @@ class _entry extends \IPS\Content\Controller
|
||||
$next = \IPS\Db::i()->select(
|
||||
'*',
|
||||
'blog_entries',
|
||||
array( 'entry_blog_id=? AND entry_date>?', $this->entry->blog_id, $this->entry->date ),
|
||||
array( 'entry_blog_id=? AND entry_date>? AND entry_status=? AND entry_is_future_entry=0', $this->entry->blog_id, $this->entry->date, "published" ),
|
||||
'entry_date ASC'
|
||||
,1
|
||||
)->first();
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Submit
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 10 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -55,7 +55,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$form = \IPS\blog\Entry::create( $blog );
|
||||
$formTemplate = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'submit', 'blog' ) ), 'submitFormTemplate' ) );
|
||||
|
||||
\IPS\Session::i()->setLocation( $blog->url(), array(), 'loc_blog_adding_entry', array( "blogs_blog_{$blog->id}" => TRUE ) );
|
||||
\IPS\Session::i()->setLocation( $blog->url(), array(), 'loc_blog_adding_entry', $blog->member_id ? array( $blog->_title => FALSE ) : array( "blogs_blog_{$blog->id}" => TRUE ) );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $blog->url(), $blog->_title );
|
||||
\IPS\Output::i()->sidebar['enabled'] = FALSE;
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->submit( $formTemplate );
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief View Blog Entry Controller
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -46,6 +46,11 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2B201/1', 404, '' );
|
||||
}
|
||||
|
||||
if ( $this->blog->cover_photo )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['og:image'] = \IPS\File::get( $this->_coverPhotoStorageExtension(), $this->blog->cover_photo )->url;
|
||||
}
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
@@ -81,7 +86,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
);
|
||||
|
||||
/* Online User Location */
|
||||
\IPS\Session::i()->setLocation( $this->blog->url(), array(), 'loc_blog_viewing_blog', array( "blogs_blog_{$this->blog->id}" => TRUE ) );
|
||||
\IPS\Session::i()->setLocation( $this->blog->url(), array(), 'loc_blog_viewing_blog', $this->blog->member_id ? array( $this->blog->_title => FALSE ) : array( "blogs_blog_{$this->blog->id}" => TRUE ) );
|
||||
|
||||
/* Output */
|
||||
\IPS\Output::i()->title = $this->blog->_title;
|
||||
@@ -93,7 +98,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
\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', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( 'blog' ) ) ) ) ] = array( 'type' => 'blog_entry', 'nodes' => $this->blog->_id );
|
||||
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item_blogs' ) ] = array( 'type' => 'blog_entry', 'nodes' => $this->blog->_id );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,7 +108,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
*/
|
||||
protected function editBlog()
|
||||
{
|
||||
if( !$this->blog->canEdit() )
|
||||
if( !$this->blog->canEdit() OR $this->blog->groupblog_ids )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2B201/2', 403, '' );
|
||||
}
|
||||
@@ -151,10 +156,16 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2B201/3', 403, '' );
|
||||
}
|
||||
|
||||
/* Make sure the user confirmed the deletion */
|
||||
\IPS\Request::i()->confirmedDelete();
|
||||
|
||||
$this->blog->disabled = TRUE;
|
||||
$this->blog->save();
|
||||
|
||||
|
||||
/* Log */
|
||||
\IPS\Session::i()->modLog( 'modlog__action_delete_blog', array( $this->blog->name => FALSE ) );
|
||||
|
||||
\IPS\Task::queue( 'core', 'DeleteOrMoveContent', array( 'class' => 'IPS\blog\Blog', 'id' => $this->blog->id, 'deleteWhenDone' => TRUE ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=browse', 'front', 'blogs' ) );
|
||||
}
|
||||
@@ -199,10 +210,13 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
\IPS\Output::i()->error( 'blog_rss_offline', '2B201/5', 403, 'blog_rss_offline_admin' );
|
||||
}
|
||||
|
||||
$document = \IPS\Xml\Rss::newDocument( $this->blog->url(), \IPS\Member::loggedIn()->language()->get("blogs_blog_{$this->blog->id}"), \IPS\Member::loggedIn()->language()->get("blogs_blog_{$this->blog->id}_desc") );
|
||||
|
||||
/* We have to use get() to ensure CDATA tags wrap the blog title properly */
|
||||
$title = $this->blog->member_id ? $this->blog->name : \IPS\Member::loggedIn()->language()->get( "blogs_blog_{$this->blog->id}" );
|
||||
|
||||
$document = \IPS\Xml\Rss::newDocument( $this->blog->url(), $title, $this->blog->description );
|
||||
|
||||
foreach ( \IPS\blog\Entry::getItemsWithPermission( array( array( 'entry_blog_id=?', $this->blog->id ), array( 'entry_status!=?', 'draft' ) ), 'entry_date DESC', 25, 'read', FALSE, 0, new \IPS\Member ) as $entry )
|
||||
foreach ( \IPS\blog\Entry::getItemsWithPermission( array( array( 'entry_blog_id=?', $this->blog->id ), array( 'entry_status!=?', 'draft' ) ), 'entry_date DESC', 25, 'read', \IPS\Content\Hideable::FILTER_PUBLIC_ONLY, 0, new \IPS\Member ) as $entry )
|
||||
{
|
||||
$document->addItem( $entry->name, $entry->url(), $entry->content, \IPS\DateTime::ts( $entry->date ), $entry->id );
|
||||
}
|
||||
@@ -244,10 +258,10 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'blog_enable_rss_import', $feed->url ? TRUE : FALSE, FALSE, array( 'togglesOn' => array( 'blog_rss_import_url', 'blog_rss_import_auth_user', 'blog_rss_import_auth_pass', 'blog_rss_import_show_link', 'blog_rss_import_tags' ) ) ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Url( 'blog_rss_import_url', $feed ? $feed->url : NULL, TRUE, array(), NULL, NULL, NULL, 'blog_rss_import_url' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_auth_user', $feed ? $feed->rss_auth_user : NULL, FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_auth_user' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_auth_pass', $feed ? $feed->rss_auth_pass : NULL, FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_auth_pass' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_show_link', $feed->rss_import_show_link ?: \IPS\Member::loggedIn()->language()->addToStack('blog_rss_import_show_link_default' ), FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_show_link' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_auth_user', $feed ? $feed->auth_user : NULL, FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_auth_user' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_auth_pass', $feed ? $feed->auth_pass : NULL, FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_auth_pass' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_show_link', $feed->import_show_link ?: \IPS\Member::loggedIn()->language()->addToStack('blog_rss_import_show_link_default' ), FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_show_link' ) );
|
||||
|
||||
$options = array( 'autocomplete' => array( 'unique' => TRUE, 'source' => \IPS\Content\Item::definedTags( $this->blog ), 'freeChoice' => ( \IPS\Settings::i()->tags_open_system ? TRUE : FALSE ) ) );
|
||||
if ( \IPS\Settings::i()->tags_force_lower )
|
||||
{
|
||||
@@ -275,7 +289,8 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
|
||||
$options['autocomplete']['prefix'] = \IPS\Content\Item::canPrefix( NULL, $this->blog );
|
||||
|
||||
$options['autocomplete']['disallowedCharacters'] = array( '#' ); // @todo Pending \IPS\Http\Url rework, hashes cannot be used in URLs
|
||||
|
||||
/* Language strings for tags description */
|
||||
if ( \IPS\Settings::i()->tags_open_system )
|
||||
{
|
||||
@@ -351,7 +366,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$feed->save();
|
||||
$feed->run();
|
||||
|
||||
\IPS\DB::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'blogrssimport' ) );
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'blogrssimport' ) );
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( $this->blog->url() );
|
||||
@@ -399,7 +414,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
protected function _coverPhotoSet( \IPS\Helpers\CoverPhoto $photo )
|
||||
{
|
||||
$this->blog->cover_photo = (string) $photo->file;
|
||||
$this->blog->cover_photo_offset = $photo->offset;
|
||||
$this->blog->cover_photo_offset = (int) $photo->offset;
|
||||
$this->blog->save();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 30 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -148,8 +148,6 @@ class _Upgrade
|
||||
|
||||
unset( $poll['poll_id'] );
|
||||
$poll['choices'] = $result;
|
||||
$poll['tid'] = 0;
|
||||
$poll['forum_id'] = 0;
|
||||
$poll['poll_only'] = 0;
|
||||
$poll['poll_view_voters'] = 0;
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 15 Jan 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 24 Feb 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 RC 5 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 15 Mar 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.4 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -24,63 +24,17 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
|
||||
/**
|
||||
* Convert entry images
|
||||
* Finish - This is run after all apps have been upgraded
|
||||
*
|
||||
* @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)
|
||||
* @return mixed 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)
|
||||
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? intval( \IPS\Request::i()->extra ) : 0;
|
||||
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_entries', "entry_image<>''", 'entry_id ASC', array( $limit, 1000 ) );
|
||||
|
||||
if ( !$select->count() )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
foreach ( $select as $entry )
|
||||
{
|
||||
try
|
||||
{
|
||||
$filePath = \IPS\ROOT_PATH . '/uploads/' . $entry['entry_image'];
|
||||
|
||||
$file = \IPS\File::create( 'core_Attachment', $entry['entry_image'], NULL, NULL, FALSE, $filePath );
|
||||
$attachment = $file->makeAttachment('');
|
||||
$fileName = htmlspecialchars( $attachment['attach_file'], \IPS\HTMLENTITIES, 'UTF-8', TRUE );
|
||||
|
||||
$image = <<<IMAGE
|
||||
<a href="<fileStore.core_Attachment>/{$file}" class="ipsAttachLink ipsAttachLink_image" style="float:left;"><img data-fileid="{$attachment['attach_id']}" src="<fileStore.core_Attachment>/{$file}" class="ipsImage ipsImage_thumbnailed" style="margin:10px;" alt="{$fileName}"></a>
|
||||
IMAGE;
|
||||
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_content' => $image . $entry['entry_content'] ), array( 'entry_id=?', $entry['entry_id'] ) );
|
||||
public function finish()
|
||||
{
|
||||
/* Rebuild old blog entry images as attachments */
|
||||
\IPS\Task::queue( 'blog', 'RebuildEntryImages', NULL, 2 );
|
||||
|
||||
$map = array(
|
||||
'attachment_id' => $attachment['attach_id'],
|
||||
'location_key' => 'blog_Entries',
|
||||
'id1' => $entry['entry_id'],
|
||||
'id2' => NULL,
|
||||
'id3' => NULL,
|
||||
'temp' => NULL,
|
||||
);
|
||||
|
||||
\IPS\Db::i()->replace( 'core_attachments_map', $map );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
|
||||
return $limit + 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Converting entry images";
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.5 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.9 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 19 Jun 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief 4.0.10 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blogs
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 07 Jul 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
* Update future entry flag
|
||||
*
|
||||
* @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)
|
||||
*/
|
||||
@@ -49,6 +49,13 @@ class _Upgrade
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// You can create as many additional methods (step2, step3, etc.) as is necessary.
|
||||
// Each step will be executed in a new HTTP request
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Updating blog future entry flag";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
{
|
||||
"name": "blog_name",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
{
|
||||
"name": "blog_desc",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_groupblog"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"auth_user"
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_authorized_users"
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_owner_only"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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
|
||||
* @subpackage Blog
|
||||
* @since 05 Nov 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_101016;
|
||||
|
||||
/* 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.1.4 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Convert user blog name/desc to database
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Some init */
|
||||
$did = 0;
|
||||
$limit = 0;
|
||||
|
||||
if( isset( \IPS\Request::i()->extra ) )
|
||||
{
|
||||
$limit = \IPS\Request::i()->extra;
|
||||
}
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
/* Get owned blogs - group blogs are still translatable */
|
||||
foreach( \IPS\Db::i()->select( '*', 'blog_blogs', "blog_member_id > 0", 'blog_id ASC', array( $limit, 500 ) ) as $blog )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
$blog = \IPS\blog\Blog::constructFromData( $blog );
|
||||
|
||||
try
|
||||
{
|
||||
$language = \IPS\Lang::load( \IPS\Member::load( $blog->member_id )->language ?: \IPS\Lang::defaultLanguage() );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
$language = \IPS\Lang::load( \IPS\Lang::defaultLanguage() );
|
||||
}
|
||||
|
||||
/* We will now store the name and desc in the blog_blogs table */
|
||||
$blog->name = $language->get( 'blogs_blog_' . $blog->_id );
|
||||
$blog->desc = $language->get( 'blogs_blog_' . $blog->_id . '_desc' );
|
||||
|
||||
$blog->save();
|
||||
|
||||
/* Remove the translatable language strings */
|
||||
\IPS\Lang::deleteCustom( 'blog', 'blogs_blog_' . $blog->_id );
|
||||
\IPS\Lang::deleteCustom( 'blog', 'blogs_blog_' . $blog->_id . '_desc' );
|
||||
}
|
||||
|
||||
if( $did )
|
||||
{
|
||||
return $limit + $did;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $_SESSION['_step1Count'] );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step1Count'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', "blog_member_id > 0" )->first();
|
||||
}
|
||||
|
||||
return "Converting blog names (Updated so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_content",
|
||||
{
|
||||
"name": "entry_content",
|
||||
"type": "MEDIUMTEXT",
|
||||
"length": 0,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.6 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 Blog
|
||||
* @since 14 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_101021;
|
||||
|
||||
/* 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.1.6 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Fix Blog RSS Feed Imports
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$perCycle = 1000;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'blog_rss_import', array( "rss_member=?", 0 ), 'rss_id ASC', array( $limit, $perCycle ) ) as $rss )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
try
|
||||
{
|
||||
$blog = \IPS\blog\Blog::load( $rss['rss_blog_id'] );
|
||||
|
||||
\IPS\Db::i()->update( 'blog_rss_import', array( 'rss_member' => $blog->member_id ), array( "rss_id=?", $rss['rss_id'] ) );
|
||||
}
|
||||
catch( \Exception $e ){}
|
||||
}
|
||||
|
||||
if ( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $_SESSION['_step1Count'] );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step1Count'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'blog_rss_import', array( "rss_member=?", 0 ) )->first();
|
||||
}
|
||||
|
||||
return "Fixing Blog RSS Imports (Upgraded so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_rating_average",
|
||||
{
|
||||
"name": "blog_rating_average",
|
||||
"type": "DECIMAL",
|
||||
"length": 11,
|
||||
"decimals": 1,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_lang_words",
|
||||
"word_app='blog' AND word_key='immediately'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key IN('blog_use_friendlyurls', 'blog_friendly_url', 'blog_friendlyurl_path', 'blog_boardindex_path')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN('blog_use_friendlyurls', 'blog_friendly_url', 'blog_friendlyurl_path', 'blog_boardindex_path');";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_22000;
|
||||
|
||||
/* 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.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 22000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_lastinfo",
|
||||
"blog_tag_cloud",
|
||||
{
|
||||
"name": "blog_tag_cloud",
|
||||
"type": "MEDIUMTEXT",
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_lastinfo",
|
||||
{
|
||||
"blog_tag_cloud": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_lastinfo CHANGE blog_tag_cloud blog_tag_cloud MEDIUMTEXT;";
|
||||
$SQL[] = "UPDATE blog_lastinfo SET blog_tag_cloud='';";
|
||||
|
||||
if( ! \IPS\Db::i()->checkForColumn( 'blog_themes', 'theme_css_overwrite' ) )
|
||||
{
|
||||
$SQL[] = "ALTER TABLE blog_themes ADD theme_css_overwrite TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -31,7 +31,10 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 22002 );
|
||||
if( ! \IPS\Db::i()->checkForColumn( 'blog_themes', 'theme_css_overwrite' ) )
|
||||
{
|
||||
\IPS\Db::i()->addColumn( 'blog_themes', array( 'name' => 'theme_css_overwrite', 'type' => 'tinyint', 'length' => 1, 'allow_null' => false, 'default' => 0 ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"name": "comment_approved",
|
||||
"type": "int",
|
||||
"length": 1,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"comment_approved": 1
|
||||
},
|
||||
[
|
||||
"comment_queued=?",
|
||||
"0"
|
||||
]
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"comment_approved": 0
|
||||
},
|
||||
[
|
||||
"comment_queued=?",
|
||||
"1"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Add comment_approved for new comments functionality:
|
||||
$SQL[] = "ALTER TABLE blog_comments ADD comment_approved INT(1) DEFAULT '0'";
|
||||
$SQL[] = "UPDATE blog_comments SET comment_approved = 1 WHERE comment_queued = 0";
|
||||
$SQL[] = "UPDATE blog_comments SET comment_approved = 0 WHERE comment_queued = 1";
|
||||
|
||||
// Get DB prefix:
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
|
||||
// Convert tracker to like:
|
||||
if ( \IPS\Db::i()->checkForTable('blog_tracker') )
|
||||
{
|
||||
if( \IPS\Db::i()->checkForTable('core_like') )
|
||||
{
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), MD5(CONCAT('blog;blog;', blog_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`";
|
||||
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), MD5(CONCAT('blog;entries;', entry_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL";
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`";
|
||||
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL";
|
||||
}
|
||||
|
||||
$SQL[] = "DROP TABLE blog_tracker";
|
||||
$SQL[] = "DROP TABLE blog_tracker_queue";
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -31,7 +31,42 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 23000 );
|
||||
$queries = array();
|
||||
|
||||
if ( \IPS\Db::i()->checkForTable('blog_tracker') )
|
||||
{
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
|
||||
if( \IPS\Db::i()->checkForTable('core_like') )
|
||||
{
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), MD5(CONCAT('blog;blog;', blog_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`" );
|
||||
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), MD5(CONCAT('blog;entries;', entry_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`" );
|
||||
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL" );
|
||||
}
|
||||
|
||||
$queries[] = array( 'table' => 'blog_tracker', 'query' => "DROP TABLE {$PRE}blog_tracker" );
|
||||
|
||||
if( \IPS\Db::i()->checkForTable( 'blog_tracker_queue' ) )
|
||||
{
|
||||
\IPS\Db::i()->dropTable( 'blog_tracker_queue' );
|
||||
}
|
||||
}
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'blog', 'extra' => array( '_upgradeStep' => 2 ) ) );
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"blog_views",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "blog_id",
|
||||
"columns": [
|
||||
"blog_id"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key='blog_exturl_newwindow'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Add indexs on blog_views
|
||||
$SQL[] = "ALTER TABLE blog_views ADD INDEX ( blog_id );";
|
||||
|
||||
// Remove unused settings
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key='blog_exturl_newwindow';";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_23002;
|
||||
|
||||
/* 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.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 23002 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"comment_queued"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_trackback",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_trackback_spamlogs",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_voters",
|
||||
"ip_address",
|
||||
{
|
||||
"name": "ip_address",
|
||||
"type": "varchar",
|
||||
"length": 46,
|
||||
"default": null,
|
||||
"allow_null": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_akismet_logs",
|
||||
"log_date",
|
||||
{
|
||||
"name": "log_date",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"default": 0,
|
||||
"allow_null": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
[
|
||||
"comment_use_sig",
|
||||
"comment_use_emo",
|
||||
"comment_html_state",
|
||||
"comment_append_edit",
|
||||
"comment_edit_name"
|
||||
]
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"comment_entry_id"
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "entry_id",
|
||||
"columns": [
|
||||
"entry_id",
|
||||
"comment_approved"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_status",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "entry_status",
|
||||
"columns": [
|
||||
"entry_status",
|
||||
"entry_last_update"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"11": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
{
|
||||
"blog_skin_id": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
/* Get DB functions/prefix */
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
$DB = \IPS\Db::i();
|
||||
|
||||
// Remove unused column - sometimes we don't have it thought...
|
||||
if ( $DB->checkForColumn( 'blog_comments', 'comment_queued' ) )
|
||||
{
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP comment_queued;";
|
||||
}
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_comments CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_trackback CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_trackback_spamlogs CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_voters CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_akismet_logs CHANGE log_date log_date INT( 10 ) NOT NULL DEFAULT '0';";
|
||||
|
||||
/* Drop unused fields */
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP comment_use_sig, DROP comment_use_emo, DROP comment_html_state, DROP comment_append_edit,
|
||||
DROP comment_edit_name, DROP INDEX comment_entry_id, ADD INDEX ( entry_id, comment_approved );";
|
||||
|
||||
/* Mess up indexes */
|
||||
$SQL[] = "ALTER TABLE blog_entries DROP INDEX entry_status, ADD INDEX entry_status ( entry_status, entry_last_update );";
|
||||
|
||||
|
||||
/* Remove custom skin choice */
|
||||
$SQL[] = "UPDATE blog_blogs SET blog_skin_id=0;";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_24000;
|
||||
|
||||
/* 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.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 24000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"blog_blogs",
|
||||
"blog_header_id"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_headers"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key IN ('blog_enable_dheader','blog_cache_dheader','blog_headers')"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"name": "entry_image",
|
||||
"type": "varchar",
|
||||
"length": 255,
|
||||
"allow_null": false,
|
||||
"default": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"name": "entry_views",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_views",
|
||||
{
|
||||
"name": "entry_id",
|
||||
"type": "int",
|
||||
"length": 10,
|
||||
"allow_null": false,
|
||||
"default": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_blogs DROP COLUMN blog_header_id;";
|
||||
$SQL[] = "DROP TABLE blog_headers;";
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN ('blog_enable_dheader','blog_cache_dheader','blog_headers');";
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_entries ADD COLUMN entry_image VARCHAR(255) NOT NULL DEFAULT '', ADD COLUMN entry_views INT(10) NOT NULL DEFAULT 0;";
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_views ADD COLUMN entry_id INT(10) NOT NULL DEFAULT 0;";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_25000;
|
||||
|
||||
/* 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.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 25000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
"conf_key='blog_masks'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Some installs may still have this old (hidden) settings group installed
|
||||
$SQL[] = "DELETE FROM core_sys_settings_titles WHERE conf_title_keyword='blog_masks';";
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_25004;
|
||||
|
||||
/* 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.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 25004 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"entry_short": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"comment_member_id",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "comment_member_id",
|
||||
"columns": [
|
||||
"member_id",
|
||||
"comment_date"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"blog_category_mapping",
|
||||
"map_entry_id",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "map_blog_id",
|
||||
"columns": [
|
||||
"map_blog_id",
|
||||
"map_entry_id"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Reset short entries (#35240)
|
||||
$SQL[] = "UPDATE blog_entries SET entry_short='';";
|
||||
|
||||
|
||||
# New indexes, to avoid filesorts & full table scans
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP INDEX comment_member_id, ADD INDEX comment_member_id ( member_id, comment_date );";
|
||||
$SQL[] = "ALTER TABLE blog_category_mapping DROP INDEX map_entry_id, ADD INDEX map_blog_id ( map_blog_id, map_entry_id );";
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_25005;
|
||||
|
||||
/* 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.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 25005 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -129,8 +129,8 @@ class _Upgrade
|
||||
*/
|
||||
public function step2()
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_ratings',
|
||||
\IPS\Db::i()->select( "NULL, 'IPS\\blog\\Entry', entry_id, member_id, rating, ''", 'blog_ratings', NULL, NULL, NULL, array( 'entry_id', 'member_id' ) )
|
||||
\IPS\Db::i()->replace( 'core_ratings',
|
||||
\IPS\Db::i()->select( "NULL, 'IPS\\blog\\Entry', entry_id, member_id, rating, ''", 'blog_ratings' )
|
||||
);
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Blog Node
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 3 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -101,7 +101,20 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
* @brief Cover Photo Storage Extension
|
||||
*/
|
||||
public static $coverPhotoStorageExtension = 'blog_Blogs';
|
||||
|
||||
|
||||
/**
|
||||
* Columns needed to query for search result / stream view
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function basicDataColumns()
|
||||
{
|
||||
$return = parent::basicDataColumns();
|
||||
$return[] = 'blog_name';
|
||||
$return[] = 'blog_member_id';
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get template for content tables
|
||||
*
|
||||
@@ -134,7 +147,20 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get title 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 author. Only includes columns returned by container::basicDataColumns()
|
||||
* @return \IPS\Http\Url
|
||||
*/
|
||||
public static function titleFromIndexData( $indexData, $itemData, $containerData )
|
||||
{
|
||||
return ( $containerData['blog_member_id'] ) ? $containerData['blog_name'] : parent::titleFromIndexData( $indexData, $itemData, $containerData );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permissions
|
||||
*
|
||||
@@ -145,18 +171,24 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
*/
|
||||
public function can( $permission, $member=NULL )
|
||||
{
|
||||
/* Load member */
|
||||
if ( $member === NULL )
|
||||
{
|
||||
$member = \IPS\Member::loggedIn();
|
||||
}
|
||||
|
||||
if ( $this->social_group )
|
||||
{
|
||||
if ( !\IPS\Member::loggedIn()->member_id )
|
||||
if ( !$member->member_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->member_id !== $this->member_id )
|
||||
if ( $member->member_id !== $this->member_id )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Db::i()->select( '*', 'core_sys_social_group_members', array( 'group_id=? AND member_id=?', $this->social_group, \IPS\Member::loggedIn()->member_id ) )->first();
|
||||
\IPS\Db::i()->select( '*', 'core_sys_social_group_members', array( 'group_id=? AND member_id=?', $this->social_group, $member->member_id ) )->first();
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
@@ -167,11 +199,11 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
|
||||
if ( $permission === 'add' )
|
||||
{
|
||||
if ( !\IPS\Member::loggedIn()->member_id )
|
||||
if ( !$member->member_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
elseif ( \IPS\Member::loggedIn()->member_id === $this->member_id )
|
||||
elseif ( $member->member_id === $this->member_id )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -179,7 +211,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
{
|
||||
if ( $this->groupblog_ids )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->inGroup( explode( ',', $this->groupblog_ids ) );
|
||||
return $member->inGroup( explode( ',', $this->groupblog_ids ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,14 +299,30 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
{
|
||||
if( $public )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_name', $this->id ? $this->_title : NULL, TRUE ) );
|
||||
$form->add( new \IPS\Helpers\Form\Editor( 'blog_desc', $this->id ? $this->description : NULL, FALSE, array( 'app' => 'blog', 'key' => 'Blogs', 'autoSaveKey' => ( $this->id ? "blogs-blog-{$this->id}" : "blogs-new-blog" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL, 'minimize' => 'blog_desc_placeholder' ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_name', $this->id ? $this->_title : NULL, TRUE, array(), NULL, NULL, NULL, 'blog_name' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Editor( 'blog_desc', $this->id ? $this->description : NULL, FALSE, array( 'app' => 'blog', 'key' => 'Blogs', 'autoSaveKey' => ( $this->id ? "blogs-blog-{$this->id}" : "blogs-new-blog" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL, 'minimize' => 'blog_desc_placeholder' ), NULL, NULL, NULL, 'blog_desc_wrap' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->addHeader( 'blog_settings' );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'blog_name', NULL, TRUE, array( 'app' => 'blog', 'key' => ( $this->id ? "blogs_blog_{$this->id}" : NULL ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'blog_desc', NULL, FALSE, array( 'app' => 'blog', 'key' => ( $this->id ? "blogs_blog_{$this->id}_desc" : NULL ), 'editor' => array( 'app' => 'blog', 'key' => 'Blogs', 'autoSaveKey' => ( $this->id ? "blogs-blog-{$this->id}" : "blogs-new-blog" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL, 'minimize' => 'blog_desc_placeholder' ) ) ) );
|
||||
|
||||
/* Owned blogs */
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_name', $this->id ? $this->_title : NULL, FALSE, array(), function( $value ) {
|
||||
if ( \IPS\Request::i()->blog_type === 'member' AND !$value )
|
||||
{
|
||||
throw new \InvalidArgumentException( 'form_required' );
|
||||
}
|
||||
}, NULL, NULL, 'blog_name' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Editor( 'blog_desc', $this->id ? $this->desc : NULL, FALSE, array( 'app' => 'blog', 'key' => 'Blogs', 'autoSaveKey' => ( $this->id ? "blogs-blog-{$this->id}m" : "blogs-new-blog" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL, 'minimize' => 'blog_desc_placeholder' ), NULL, NULL, NULL, 'blog_desc_wrap' ) );
|
||||
|
||||
/* Group blogs - only one or the other will show at any given time */
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'blog_name_group', ( $this->id AND !$this->groupblog_ids ) ? $this->_title : NULL, FALSE, array( 'app' => 'blog', 'key' => ( $this->id ? "blogs_blog_{$this->id}" : NULL ) ), function( $value ) {
|
||||
if ( \IPS\Request::i()->blog_type !== 'member' AND !$value )
|
||||
{
|
||||
throw new \InvalidArgumentException( 'form_required' );
|
||||
}
|
||||
}, NULL, NULL, 'blog_name_group' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'blog_desc_group', NULL, FALSE, array( 'app' => 'blog', 'key' => ( $this->id ? "blogs_blog_{$this->id}_desc" : NULL ), 'editor' => array( 'app' => 'blog', 'key' => 'Blogs', 'autoSaveKey' => ( $this->id ? "blogs-blog-{$this->id}-group" : "blogs-new-blog-group" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL, 'minimize' => 'blog_desc_placeholder' ) ), NULL, NULL, NULL, 'blog_desc_group_wrap' ) );
|
||||
|
||||
$groups = array();
|
||||
foreach ( \IPS\Member\Group::groups() as $k => $v )
|
||||
@@ -299,8 +347,8 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
'group' => 'blog_type_group'
|
||||
),
|
||||
'toggles' => array(
|
||||
'member' => array( 'blog_member_id' ),
|
||||
'group' => array( 'blog_groupblog_ids', 'blog_groupblog_name' )
|
||||
'member' => array( 'blog_member_id', 'blog_name', 'blog_desc_wrap' ),
|
||||
'group' => array( 'blog_groupblog_ids', 'blog_groupblog_name', 'blog_name_group', 'blog_desc_group_wrap' )
|
||||
)
|
||||
) ) );
|
||||
|
||||
@@ -348,21 +396,25 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
*/
|
||||
public function formatFormValues( $values )
|
||||
{
|
||||
$this->member_id = 0;
|
||||
if( isset( $values['blog_type'] ) and $values['blog_type'] == 'member' and isset( $values['blog_member_id'] ) and is_object( $values['blog_member_id'] ) )
|
||||
{
|
||||
$values['blog_member_id']->create_menu = NULL;
|
||||
$values['blog_member_id']->save();
|
||||
$values['blog_member_id'] = $values['blog_member_id']->member_id;
|
||||
$this->member_id = $values['blog_member_id'];
|
||||
$values['blog_member_id'] = $values['blog_member_id']->member_id;
|
||||
$values['blog_groupblog_ids'] = '';
|
||||
$this->member_id = $values['blog_member_id'];
|
||||
}
|
||||
else if ( !isset( $values['blog_type'] ) )
|
||||
else if ( !$this->id and !isset( $values['blog_type'] ) )
|
||||
{
|
||||
$values['blog_member_id'] = \IPS\Member::loggedIn()->member_id;
|
||||
\IPS\Member::loggedIn()->create_menu = NULL;
|
||||
\IPS\Member::loggedIn()->save();
|
||||
$this->member_id = $values['blog_member_id'];
|
||||
}
|
||||
else if ( isset( $values['blog_type'] ) )
|
||||
{
|
||||
$this->member_id = 0;
|
||||
}
|
||||
|
||||
if( isset( $values['blog_type'] ) )
|
||||
{
|
||||
@@ -398,39 +450,129 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
if ( !$this->id )
|
||||
{
|
||||
$this->save();
|
||||
\IPS\File::claimAttachments( 'blogs-new-blog', $this->id, NULL, 'description', TRUE );
|
||||
}
|
||||
|
||||
foreach ( array( 'blog_name' => "blogs_blog_{$this->id}", 'blog_desc' => "blogs_blog_{$this->id}_desc", 'blog_groupblog_name' => "blogs_groupblog_name_{$this->id}" ) as $fieldKey => $langKey )
|
||||
{
|
||||
if ( isset( $values[ $fieldKey ] ) )
|
||||
if( $values['blog_member_id'] )
|
||||
{
|
||||
\IPS\Lang::saveCustom( 'blog', $langKey, $values[ $fieldKey ] );
|
||||
|
||||
if ( $fieldKey === 'blog_name' )
|
||||
{
|
||||
$values['seo_name'] = \IPS\Http\Url::seoTitle( ( is_array( $values[ $fieldKey ] ) ) ? $values[ $fieldKey ][ \IPS\Lang::defaultLanguage() ] : $values[ $fieldKey ] );
|
||||
}
|
||||
|
||||
unset( $values[ $fieldKey ] );
|
||||
\IPS\File::claimAttachments( 'blogs-new-blog', $this->id, NULL, 'description', TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\File::claimAttachments( 'blogs-new-blog-group', $this->id, NULL, 'description', TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
if( isset( $values['blog_enable_rss'] ) )
|
||||
/* If this is not a member blog we store the languages in the language system */
|
||||
if( !$this->member_id )
|
||||
{
|
||||
foreach ( array( 'blog_name_group' => "blogs_blog_{$this->id}", 'blog_desc_group' => "blogs_blog_{$this->id}_desc", 'blog_groupblog_name' => "blogs_groupblog_name_{$this->id}" ) as $fieldKey => $langKey )
|
||||
{
|
||||
if ( isset( $values[ $fieldKey ] ) )
|
||||
{
|
||||
\IPS\Lang::saveCustom( 'blog', $langKey, $values[ $fieldKey ] );
|
||||
|
||||
if ( $fieldKey === 'blog_name' )
|
||||
{
|
||||
$values['seo_name'] = \IPS\Http\Url\Friendly::seoTitle( ( is_array( $values[ $fieldKey ] ) ) ? $values[ $fieldKey ][ \IPS\Lang::defaultLanguage() ] : $values[ $fieldKey ] );
|
||||
}
|
||||
|
||||
unset( $values[ $fieldKey ] );
|
||||
}
|
||||
}
|
||||
|
||||
if( array_key_exists( 'blog_name', $values ) )
|
||||
{
|
||||
unset( $values['blog_name'] );
|
||||
}
|
||||
|
||||
if( array_key_exists( 'blog_desc', $values ) )
|
||||
{
|
||||
unset( $values['blog_desc'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If we're changing the author of the blog update the feed */
|
||||
if( isset( $values['blog_member_id'] ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$feed = \IPS\blog\Blog\Feed::constructFromData( \IPS\Db::i()->select( '*', 'blog_rss_import', array( 'rss_blog_id=?', $this->id ) )->first() );
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
$feed = NULL;
|
||||
}
|
||||
|
||||
if( $feed )
|
||||
{
|
||||
$feed->member = $values['blog_member_id'];
|
||||
$feed->save();
|
||||
}
|
||||
}
|
||||
|
||||
/* This is here in case an admin changes a group blog to a member blog */
|
||||
\IPS\Lang::deleteCustom( 'blog', "blogs_blog_{$this->id}" );
|
||||
\IPS\Lang::deleteCustom( 'blog', "blogs_blog_{$this->id}_desc" );
|
||||
\IPS\Lang::deleteCustom( 'blog', "blogs_groupblog_name_{$this->id}" );
|
||||
|
||||
$values['seo_name'] = \IPS\Http\Url\Friendly::seoTitle( $values['blog_name'] );
|
||||
}
|
||||
|
||||
if( array_key_exists( 'blog_name_group', $values ) )
|
||||
{
|
||||
unset( $values['blog_name_group'] );
|
||||
}
|
||||
|
||||
if( array_key_exists( 'blog_desc_group', $values ) )
|
||||
{
|
||||
unset( $values['blog_desc_group'] );
|
||||
}
|
||||
|
||||
if( array_key_exists( 'blog_groupblog_name', $values ) )
|
||||
{
|
||||
unset( $values['blog_groupblog_name'] );
|
||||
}
|
||||
|
||||
if( array_key_exists( 'blog_enable_rss', $values ) )
|
||||
{
|
||||
$values['settings'] = array( 'allowrss' => $values['blog_enable_rss'] );
|
||||
unset( $values['blog_enable_rss'] );
|
||||
}
|
||||
|
||||
/* Send to parent */
|
||||
if( isset( $values['blog_member_id'] ) )
|
||||
if( array_key_exists( 'blog_member_id', $values ) )
|
||||
{
|
||||
unset( $values['blog_member_id'] );
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [Node] Get the title to store in the log
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function titleForLog()
|
||||
{
|
||||
if ( !$this->member_id )
|
||||
{
|
||||
try
|
||||
{
|
||||
return \IPS\Lang::load( \IPS\Lang::defaultLanguage() )->get( static::$titleLangPrefix . $this->_id );
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
/* If we're changing from a member blog to a group blog, the language string won't exist yet */
|
||||
return $this->_title;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_title;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Mass update search index after changes
|
||||
*/
|
||||
@@ -463,13 +605,20 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
*/
|
||||
public function get_seo_name()
|
||||
{
|
||||
if( !$this->_data['seo_name'] )
|
||||
/* If we have the seo_name, just return it - don't query the language string */
|
||||
if( $this->_data['seo_name'] )
|
||||
{
|
||||
$this->seo_name = \IPS\Http\Url::seoTitle( \IPS\Lang::load( \IPS\Lang::defaultLanguage() )->get( 'blogs_blog_' . $this->id ) );
|
||||
$this->save();
|
||||
return $this->_data['seo_name'];
|
||||
}
|
||||
|
||||
return $this->_data['seo_name'] ?: \IPS\Http\Url::seoTitle( \IPS\Lang::load( \IPS\Lang::defaultLanguage() )->get( 'blogs_blog_' . $this->id ) );
|
||||
/* The seo_name isn't set, so let's fix that real quick and return it */
|
||||
$title = $this->member_id ? $this->name : \IPS\Lang::load( \IPS\Lang::defaultLanguage() )->get( 'blogs_blog_' . $this->id );
|
||||
|
||||
$seoTitle = \IPS\Http\Url::seoTitle( $title );
|
||||
$this->seo_name = $seoTitle;
|
||||
$this->save();
|
||||
|
||||
return $seoTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -491,6 +640,29 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
* @brief Cached latest entry
|
||||
*/
|
||||
protected $latestEntry = NULL;
|
||||
|
||||
/**
|
||||
* Set last comment
|
||||
*
|
||||
* @param \IPS\Content\Comment|NULL $comment The latest comment or NULL to work it out
|
||||
* @return void
|
||||
* @note Like Gallery, we actually want to set this to the last entry rather than comment. As such $comment is ignored.
|
||||
*/
|
||||
public function setLastComment( \IPS\Content\Comment $comment=NULL )
|
||||
{
|
||||
$lastUpdateColumn = static::$databaseColumnMap['date'];
|
||||
|
||||
if ( $latestEntry = $this->latestEntry() )
|
||||
{
|
||||
$this->$lastUpdateColumn = $latestEntry->date;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->$lastUpdateColumn = 0;
|
||||
}
|
||||
|
||||
$this->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get latest entry
|
||||
@@ -527,22 +699,37 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
|
||||
try
|
||||
{
|
||||
/* Get member IDs and contributions count */
|
||||
$select = \IPS\Db::i()->select(
|
||||
"core_members.*, count( blog_entries.entry_id ) as contributions",
|
||||
"entry_author_id, count( entry_id ) as contributions",
|
||||
'blog_entries',
|
||||
array( "entry_blog_id=?", $this->id ),
|
||||
array( "entry_blog_id=? AND entry_author_id !=?", $this->id, 0 ),
|
||||
"contributions DESC",
|
||||
NULL,
|
||||
array( 'member_id' )
|
||||
)->join(
|
||||
'core_members',
|
||||
"blog_entries.entry_author_id=core_members.member_id"
|
||||
);
|
||||
|
||||
/* Get em! */
|
||||
foreach( $select as $row )
|
||||
array( 'entry_author_id' )
|
||||
)->setKeyField( 'entry_author_id' )->setValueField( 'contributions' );
|
||||
|
||||
/* Get the member ids to load them in one query */
|
||||
$memberIds = array();
|
||||
$members = array();
|
||||
|
||||
foreach( $select as $member => $contributions )
|
||||
{
|
||||
$contributors[] = array ( 'member' => \IPS\Member::constructFromData( $row ), 'contributions' => $row['contributions'] );
|
||||
$memberIds[] = $member;
|
||||
}
|
||||
|
||||
if( count( $memberIds ) )
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_members', 'member_id IN(' . implode( ',', $memberIds ) . ')' ) as $member )
|
||||
{
|
||||
$members[ $member['member_id'] ] = \IPS\Member::constructFromData( $member );
|
||||
}
|
||||
}
|
||||
|
||||
/* Get em! */
|
||||
foreach( $select as $member => $contributions )
|
||||
{
|
||||
$contributors[] = array( 'member' => $members[ $member ], 'contributions' => $contributions );
|
||||
}
|
||||
}
|
||||
catch ( \UnderflowException $e ) {}
|
||||
@@ -672,7 +859,34 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
*/
|
||||
protected function get__title()
|
||||
{
|
||||
return htmlspecialchars( \IPS\Member::loggedIn()->language()->get( static::$titleLangPrefix . $this->_id ), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
|
||||
return $this->member_id ? $this->name : \IPS\Member::loggedIn()->language()->addToStack( static::$titleLangPrefix . $this->_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Node titles can contain HTML. Apparently.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get__stripTagsTitle()
|
||||
{
|
||||
if ( $this->member_id )
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( static::$titleLangPrefix . $this->_id, NULL, array( 'striptags' => true ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function get_description()
|
||||
{
|
||||
return $this->member_id ? $this->desc : \IPS\Member::loggedIn()->language()->addToStack( static::$titleLangPrefix . $this->_id . static::$descriptionLangSuffix );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -721,7 +935,7 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
\IPS\Log::i( LOG_ERR )->write( $e->getMessage() );
|
||||
\IPS\Log::log( $e, 'pingomatic' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -742,19 +956,30 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
/* Delete RSS Imports */
|
||||
\IPS\Db::i()->delete( 'blog_rss_import', array( "rss_blog_id=?", $this->_id ) );
|
||||
|
||||
|
||||
/* Delete Language Strings */
|
||||
foreach ( array( 'blog_groupblog_name' => "blogs_groupblog_name_{$this->id}" ) as $fieldKey => $langKey )
|
||||
{
|
||||
\IPS\Lang::deleteCustom( 'blog', $langKey );
|
||||
}
|
||||
|
||||
/* Reset create menu */
|
||||
$member = \IPS\Member::load( $this->member_id );
|
||||
$member->create_menu = NULL;
|
||||
$member->save();
|
||||
|
||||
|
||||
/* Unclaim Attachments */
|
||||
\IPS\File::unclaimAttachments( 'blog_Blogs', $this->id );
|
||||
|
||||
|
||||
/* Delete Cover Photo -specifically call parent otherwise deleteOrMoveContent process cannot run within the AdminCP */
|
||||
$photo = parent::coverPhoto();
|
||||
$photo->delete();
|
||||
|
||||
/* Delete Follows */
|
||||
\IPS\Db::i()->delete( 'core_follow', array( "follow_app=? AND follow_area=? AND follow_rel_id=?", 'blog', 'blog', $this->_id ) );
|
||||
|
||||
return parent::delete();
|
||||
}
|
||||
|
||||
@@ -782,31 +1007,69 @@ class _Blog extends \IPS\Node\Model implements \IPS\Node\Ratings, \IPS\Content\E
|
||||
}
|
||||
|
||||
/**
|
||||
* Set last comment
|
||||
* [Node] Get content table meta description
|
||||
*
|
||||
* @param \IPS\Content\Comment $comment The latest comment or NULL to work it out
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function setLastComment( \IPS\Content\Comment $comment=NULL )
|
||||
public function metaDescription()
|
||||
{
|
||||
if ( $comment === NULL )
|
||||
if( $this->member_id )
|
||||
{
|
||||
try
|
||||
{
|
||||
/* @note entry_hidden is flipped to map to "approved" */
|
||||
$entry = \IPS\blog\Entry::constructFromData( \IPS\Db::i()->select( '*', 'blog_entries', array( 'entry_blog_id=? AND entry_status=? AND entry_hidden=1 and entry_is_future_entry=0', $this->id, 'published' ), 'entry_date DESC', 1 )->first() );
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
$this->last_edate = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$entry = $comment->item();
|
||||
return strip_tags( $this->desc );
|
||||
}
|
||||
|
||||
$this->last_edate = $entry->mapped('date');
|
||||
return parent::metaDescription();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @return array
|
||||
* @apiresponse int id ID number
|
||||
* @apiresponse string name Name
|
||||
* @apiresponse string description Description
|
||||
* @apiresponse \IPS\Member owner If the blog is owned by a single member, the member
|
||||
* @apiresponse [\IPS\Member\Group] groups If the blog is owned by groups, an array of the groups
|
||||
* @apiresponse bool pinned If the blog is pinned
|
||||
* @apiresponse int entries Number of entries
|
||||
* @apiresponse int comments Number of comments
|
||||
* @apiresponse string url URL
|
||||
*/
|
||||
public function apiOutput()
|
||||
{
|
||||
$groups = array();
|
||||
if ( $this->groupblog_ids )
|
||||
{
|
||||
foreach ( array_filter( explode( ',', $this->groupblog_ids ) ) as $groupId )
|
||||
{
|
||||
try
|
||||
{
|
||||
$groups[] = \IPS\Member\Group::load( $groupId )->apiOutput();
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'id' => $this->id,
|
||||
'name' => $this->_title,
|
||||
'description' => $this->member_id ? $this->desc : \IPS\Member::loggedIn()->language()->addToStack("blogs_blog_{$this->id}_desc"),
|
||||
'owner' => $this->member_id ? $this->owner()->apiOutput() : null,
|
||||
'groups' => $groups,
|
||||
'pinned' => (bool) $this->pinned,
|
||||
'entries' => $this->count_entries,
|
||||
'comments' => $this->count_comments,
|
||||
'url' => (string) $this->url()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Permission Types
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function permissionTypes()
|
||||
{
|
||||
return array( 'view' => 'view', 'add' => 'add' );
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Blog RSS/Atom feed active record
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 02 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -43,10 +43,16 @@ class _Feed extends \IPS\Patterns\ActiveRecord
|
||||
* Run
|
||||
*
|
||||
* @return void
|
||||
* @throws \UnexpectedValueException
|
||||
* @throws \IPS\Http\Url\Exception|\RuntimeException
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
/* Skip this if the member is restricted from posting */
|
||||
if( \IPS\Member::load( $this->member )->restrict_post or \IPS\Member::load( $this->member )->members_bitoptions['unacknowledged_warnings'] )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$previouslyImportedGuids = iterator_to_array( \IPS\Db::i()->select( 'rss_imported_guid', 'blog_rss_imported', array( 'rss_imported_impid=?', $this->id ) ) );
|
||||
|
||||
$request = \IPS\Http\Url::external( $this->url )->request();
|
||||
@@ -60,18 +66,43 @@ class _Feed extends \IPS\Patterns\ActiveRecord
|
||||
|
||||
$inserts=array();
|
||||
$i = 0;
|
||||
foreach ( $request->decodeXml()->articles( $this->id ) as $guid => $article )
|
||||
$request = $request->decodeXml();
|
||||
|
||||
if( !( $request instanceof \IPS\Xml\RssOne ) AND !( $request instanceof \IPS\Xml\Rss ) AND !( $request instanceof \IPS\Xml\Atom ) )
|
||||
{
|
||||
throw new \RuntimeException( 'rss_import_invalid' );
|
||||
}
|
||||
|
||||
foreach ( $request->articles( $this->id ) as $guid => $article )
|
||||
{
|
||||
if ( !in_array( $guid, $previouslyImportedGuids ) )
|
||||
{
|
||||
$entry = \IPS\blog\Entry::createItem( \IPS\Member::load( $this->member ), NULL, $article['date'], $container );
|
||||
$entry->name = $article['title'];
|
||||
$entry->content = \IPS\Text\Parser::parseStatic( $article['content'] );
|
||||
$entry->content = \IPS\Text\Parser::parseStatic( $article['content'], TRUE );
|
||||
|
||||
if ( $article['link'] )
|
||||
{
|
||||
$rel = array();
|
||||
|
||||
if( \IPS\Settings::i()->posts_add_nofollow )
|
||||
{
|
||||
$rel['nofollow'] = 'nofollow';
|
||||
}
|
||||
|
||||
if( \IPS\Settings::i()->links_external )
|
||||
{
|
||||
$rel['external'] = 'external';
|
||||
}
|
||||
|
||||
$linkRelPart = '';
|
||||
if ( count ( $rel ) )
|
||||
{
|
||||
$linkRelPart = 'rel="' . implode($rel, ' ') . '"';
|
||||
}
|
||||
|
||||
$link = htmlspecialchars( $this->import_show_link, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
|
||||
$entry->content .= "<br><p><a href='{$article['link']}'>{$link}</a></p>";
|
||||
$entry->content .= "<br><p><a href='{$article['link']}' {$linkRelPart}>{$link}</a></p>";
|
||||
}
|
||||
|
||||
$entry->status = 'published';
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Blog Profile Table Helper
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 18 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Blog Table Helper
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 18 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Blog Entry Comment Model
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 3 Mar 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -92,7 +92,7 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory,
|
||||
* @param string $order MySQL ORDER BY clause (NULL to order by date)
|
||||
* @param int|array $limit Limit clause
|
||||
* @param string $permissionKey A key which has a value in the permission map (either of the container or of this class) matching a column ID in core_permission_index
|
||||
* @param bool|NULL $includeHiddenItems Include hidden files? Boolean or NULL to detect if currently logged member has permission
|
||||
* @param mixed $includeHiddenItems Include hidden comments? NULL to detect if currently logged in member has permission, -1 to return public content only, TRUE to return unapproved content and FALSE to only return unapproved content the viewing member submitted
|
||||
* @param int $queryFlags Select bitwise flags
|
||||
* @param \IPS\Member $member The member (NULL to use currently logged in member)
|
||||
* @param bool $joinContainer If true, will join container data (set to TRUE if your $where clause depends on this data)
|
||||
@@ -100,7 +100,7 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory,
|
||||
* @param bool $joinReviews If true, will join review data (set to TRUE if your $where clause depends on this data)
|
||||
* @return \IPS\Patterns\ActiveRecordIterator|int
|
||||
*/
|
||||
public static function getItemsWithPermission( $where=array(), $order=NULL, $limit=10, $permissionKey='read', $includeHiddenItems=NULL, $queryFlags=0, \IPS\Member $member=NULL, $joinContainer=FALSE, $joinComments=FALSE, $joinReviews=FALSE, $countOnly=FALSE, $joins=NULL )
|
||||
public static function getItemsWithPermission( $where=array(), $order=NULL, $limit=10, $permissionKey='read', $includeHiddenItems=\IPS\Content\Hideable::FILTER_AUTOMATIC, $queryFlags=0, \IPS\Member $member=NULL, $joinContainer=FALSE, $joinComments=FALSE, $joinReviews=FALSE, $countOnly=FALSE, $joins=NULL )
|
||||
{
|
||||
if ( in_array( $permissionKey, array( 'view', 'read' ) ) )
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Entry Model
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 3 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -89,7 +89,8 @@ class _Entry extends \IPS\Content\Item implements
|
||||
'cover_photo' => 'cover_photo',
|
||||
'cover_photo_offset' => 'cover_offset',
|
||||
'is_future_entry' => 'is_future_entry',
|
||||
'future_date' => 'publish_date'
|
||||
'future_date' => 'publish_date',
|
||||
'status' => 'status',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -151,7 +152,7 @@ class _Entry extends \IPS\Content\Item implements
|
||||
public function set_name( $name )
|
||||
{
|
||||
$this->_data['name'] = $name;
|
||||
$this->_data['name_seo'] = \IPS\Http\Url::seoTitle( $name );
|
||||
$this->_data['name_seo'] = \IPS\Http\Url\Friendly::seoTitle( $name );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -163,11 +164,11 @@ class _Entry extends \IPS\Content\Item implements
|
||||
{
|
||||
if( !$this->_data['name_seo'] )
|
||||
{
|
||||
$this->name_seo = \IPS\Http\Url::seoTitle( $this->name );
|
||||
$this->name_seo = \IPS\Http\Url\Friendly::seoTitle( $this->name );
|
||||
$this->save();
|
||||
}
|
||||
|
||||
return $this->_data['name_seo'] ?: \IPS\Http\Url::seoTitle( $this->name );
|
||||
return $this->_data['name_seo'] ?: \IPS\Http\Url\Friendly::seoTitle( $this->name );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,6 +249,11 @@ class _Entry extends \IPS\Content\Item implements
|
||||
/* This will throw an exception of the row does not exist */
|
||||
try
|
||||
{
|
||||
if( !$member->member_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$member = \IPS\Db::i()->select( '*', 'core_sys_social_group_members', array( 'group_id=? AND member_id=?', $this->container()->social_group, $member->member_id ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
@@ -266,7 +272,7 @@ class _Entry extends \IPS\Content\Item implements
|
||||
* @param string $order MySQL ORDER BY clause (NULL to order by date)
|
||||
* @param int|array $limit Limit clause
|
||||
* @param string|NULL $permissionKey A key which has a value in the permission map (either of the container or of this class) matching a column ID in core_permission_index or NULL to ignore permissions
|
||||
* @param bool|NULL $includeHiddenItems Include hidden files? Boolean or NULL to detect if currently logged member has permission
|
||||
* @param mixed $includeHiddenItems Include hidden items? NULL to detect if currently logged in member has permission, -1 to return public content only, TRUE to return unapproved content and FALSE to only return unapproved content the viewing member submitted
|
||||
* @param int $queryFlags Select bitwise flags
|
||||
* @param \IPS\Member $member The member (NULL to use currently logged in member)
|
||||
* @param bool $joinContainer If true, will join container data (set to TRUE if your $where clause depends on this data)
|
||||
@@ -278,9 +284,10 @@ class _Entry extends \IPS\Content\Item implements
|
||||
* @param bool $joinTags If true, will join the tags table
|
||||
* @param bool $joinAuthor If true, will join the members table for the author
|
||||
* @param bool $joinLastCommenter If true, will join the members table for the last commenter
|
||||
* @param bool $showMovedLinks If true, moved item links are included in the results
|
||||
* @return \IPS\Patterns\ActiveRecordIterator|int
|
||||
*/
|
||||
public static function getItemsWithPermission( $where=array(), $order=NULL, $limit=10, $permissionKey='read', $includeHiddenItems=NULL, $queryFlags=0, \IPS\Member $member=NULL, $joinContainer=FALSE, $joinComments=FALSE, $joinReviews=FALSE, $countOnly=FALSE, $joins=NULL, $skipPermission=FALSE, $joinTags=TRUE, $joinAuthor=TRUE, $joinLastCommenter=TRUE )
|
||||
public static function getItemsWithPermission( $where=array(), $order=NULL, $limit=10, $permissionKey='read', $includeHiddenItems=\IPS\Content\Hideable::FILTER_AUTOMATIC, $queryFlags=0, \IPS\Member $member=NULL, $joinContainer=FALSE, $joinComments=FALSE, $joinReviews=FALSE, $countOnly=FALSE, $joins=NULL, $skipPermission=FALSE, $joinTags=TRUE, $joinAuthor=TRUE, $joinLastCommenter=TRUE, $showMovedLinks=FALSE )
|
||||
{
|
||||
if ( in_array( $permissionKey, array( 'view', 'read' ) ) )
|
||||
{
|
||||
@@ -295,7 +302,7 @@ class _Entry extends \IPS\Content\Item implements
|
||||
$where[] = array( "(" . \IPS\Content::socialGroupGetItemsWithPermissionWhere( 'blog_blogs.blog_social_group', $member ) . " OR blog_blogs.blog_social_group IS NULL )" );
|
||||
}
|
||||
}
|
||||
return parent::getItemsWithPermission( $where, $order, $limit, $permissionKey, $includeHiddenItems, $queryFlags, $member, $joinContainer, $joinComments, $joinReviews, $countOnly, $joins, $skipPermission, $joinTags, $joinAuthor, $joinLastCommenter );
|
||||
return parent::getItemsWithPermission( $where, $order, $limit, $permissionKey, $includeHiddenItems, $queryFlags, $member, $joinContainer, $joinComments, $joinReviews, $countOnly, $joins, $skipPermission, $joinTags, $joinAuthor, $joinLastCommenter, $showMovedLinks );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -330,7 +337,7 @@ class _Entry extends \IPS\Content\Item implements
|
||||
public static function formElements( $item=NULL, \IPS\Node\Model $container=NULL )
|
||||
{
|
||||
$return = parent::formElements( $item, $container );
|
||||
$return['entry'] = new \IPS\Helpers\Form\Editor( 'blog_entry_content', $item ? $item->content : NULL, TRUE, array( 'app' => 'blog', 'key' => 'Entries', 'autoSaveKey' => 'blog-entry-' . $container->id, 'attachIds' => ( $item === NULL ? NULL : array( $item->id ) ) ) );
|
||||
$return['entry'] = new \IPS\Helpers\Form\Editor( 'blog_entry_content', $item ? $item->content : NULL, TRUE, array( 'app' => 'blog', 'key' => 'Entries', 'autoSaveKey' => ( $item === NULL ) ? 'blog-entry-' . $container->id : 'blog-edit-' . $item->id, 'attachIds' => ( $item === NULL ? NULL : array( $item->id ) ) ) );
|
||||
|
||||
/* Gallery album association */
|
||||
if( \IPS\Application::appIsEnabled( 'gallery' ) )
|
||||
@@ -483,31 +490,43 @@ class _Entry extends \IPS\Content\Item implements
|
||||
$blog->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Syncing to run when publishing something previously pending publishing
|
||||
*
|
||||
* @param \IPS\Member|NULL|FALSE $member The member doing the action (NULL for currently logged in member, FALSE for no member)
|
||||
* @return void
|
||||
*/
|
||||
public function onPublish()
|
||||
public function onPublish( $member )
|
||||
{
|
||||
$this->status = 'published';
|
||||
$this->save();
|
||||
|
||||
parent::onPublish();
|
||||
parent::onPublish( $member );
|
||||
|
||||
/* The blog system is slightly different from the \Content future entry stuff. Future entries are treated as drafts,
|
||||
so do count towards entries but parent::onPublish will try and increment item count again after publish */
|
||||
$this->container()->resetCommentCounts();
|
||||
$this->container()->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Syncing to run when unpublishing an item (making it a future dated entry when it was already published)
|
||||
*
|
||||
* @param \IPS\Member|NULL|FALSE $member The member doing the action (NULL for currently logged in member, FALSE for no member)
|
||||
* @return void
|
||||
*/
|
||||
public function onUnpublish()
|
||||
public function onUnpublish( $member )
|
||||
{
|
||||
$this->status = 'draft';
|
||||
$this->save();
|
||||
|
||||
parent::onUnpublish();
|
||||
parent::onUnpublish( $member );
|
||||
|
||||
/* The blog system is slightly different from the \Content future entry stuff. Future entries are treated as drafts,
|
||||
so do count towards entries but parent::onUnpublish will try and decrement item count after unpublish */
|
||||
$this->container()->resetCommentCounts();
|
||||
$this->container()->save();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -586,4 +605,63 @@ class _Entry extends \IPS\Content\Item implements
|
||||
|
||||
return parent::searchIndexPermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* WHERE clause for getting items for sitemap (permissions are already accounted for)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function sitemapWhere()
|
||||
{
|
||||
return array( array( 'blog_entries.entry_is_future_entry=0 AND blog_entries.entry_status!=?', 'draft' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @return array
|
||||
* @apiresponse int id ID number
|
||||
* @apiresponse string title Title
|
||||
* @apiresponse \IPS\blog\Blog blog Blog
|
||||
* @apiresponse \IPS\Member author The member that created the entry
|
||||
* @apiresponse bool draft If this entry is a draft
|
||||
* @apiresponse datetime date Date
|
||||
* @apiresponse string entry Entry content
|
||||
* @apiresponse int comments Number of comments
|
||||
* @apiresponse int views Number of posts
|
||||
* @apiresponse string prefix The prefix tag, if there is one
|
||||
* @apiresponse [string] tags The tags
|
||||
* @apiresponse bool locked Entry is locked
|
||||
* @apiresponse bool hidden Entry is hidden
|
||||
* @apiresponse bool future Will be published at a future date?
|
||||
* @apiresponse bool pinned Entry is pinned
|
||||
* @apiresponse bool featured Entry is featured
|
||||
* @apiresponse \IPS\Poll poll Poll data, if there is one
|
||||
* @apiresponse string url URL
|
||||
* @apiresponse float rating Average Rating
|
||||
*/
|
||||
public function apiOutput()
|
||||
{
|
||||
return array(
|
||||
'id' => $this->id,
|
||||
'title' => $this->name,
|
||||
'blog' => $this->container()->apiOutput(),
|
||||
'author' => $this->author()->apiOutput(),
|
||||
'draft' => $this->status == 'draft',
|
||||
'date' => \IPS\DateTime::ts( $this->date )->rfc3339(),
|
||||
'entry' => $this->content(),
|
||||
'comments' => $this->num_comments,
|
||||
'views' => $this->views,
|
||||
'prefix' => $this->prefix(),
|
||||
'tags' => $this->tags(),
|
||||
'locked' => (bool) $this->locked(),
|
||||
'hidden' => (bool) $this->hidden(),
|
||||
'future' => $this->isFutureDate(),
|
||||
'pinned' => (bool) $this->mapped('pinned'),
|
||||
'featured' => (bool) $this->mapped('featured'),
|
||||
'poll' => $this->poll_state ? \IPS\Poll::load( $this->poll_state )->apiOutput() : null,
|
||||
'url' => (string) $this->url(),
|
||||
'rating' => $this->averageRating(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief blogrssimport Task
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage blog
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 02 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -45,11 +45,18 @@ class _blogrssimport extends \IPS\Task
|
||||
/* UnderflowException means there's no feed, so we can disable the task */
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
\IPS\DB::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 'blogrssimport' ) );
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 'blogrssimport' ) );
|
||||
}
|
||||
/* Any other exception means an error which should be logged */
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
/* If there is an error, we need to log it but the error should not prevent other feeds from importing */
|
||||
if ( isset( $feed ) AND ( $feed instanceof \IPS\blog\Blog\Feed ) )
|
||||
{
|
||||
$feed->last_import = time();
|
||||
$feed->save();
|
||||
}
|
||||
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief blogCommentFeed Widget
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage blog
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 13 Jul 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -43,6 +43,11 @@ class _blogCommentFeed extends \IPS\Content\WidgetComment
|
||||
* Class
|
||||
*/
|
||||
protected static $class = 'IPS\blog\Entry\Comment';
|
||||
|
||||
/**
|
||||
* @brief Moderator permission to generate caches on [optional]
|
||||
*/
|
||||
protected $moderatorPermissions = array( 'can_view_hidden_content', 'can_view_hidden_blog_entry_comment' );
|
||||
|
||||
/**
|
||||
* Get where clause
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief blogStatistics Widget
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage blog
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 14 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief blogs Widget
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage blog
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 13 Jul 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -39,6 +39,18 @@ class _blogs extends \IPS\Widget\PermissionCache
|
||||
*/
|
||||
public $plugin = '';
|
||||
|
||||
/**
|
||||
* Initialize this widget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'blog.css', 'blog' ) );
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify widget configuration
|
||||
*
|
||||
@@ -68,7 +80,7 @@ class _blogs extends \IPS\Widget\PermissionCache
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $ex ) { }
|
||||
$form->add( new \IPS\Helpers\Form\Member( 'widget_feed_author', $author, FALSE, array( 'multiple' => true ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Member( 'widget_feed_author', $author, FALSE, array( 'multiple' => null ) ) );
|
||||
|
||||
|
||||
|
||||
@@ -92,10 +104,10 @@ class _blogs extends \IPS\Widget\PermissionCache
|
||||
/* Number to show */
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'widget_feed_show', isset( $this->configuration['widget_feed_show'] ) ? $this->configuration['widget_feed_show'] : 5, TRUE ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'widget_feed_sort_on', isset( $this->configuration['widget_feed_sort_on'] ) ? $this->configuration['widget_feed_sort_on'] : 'blog_edate', FALSE, array( 'options' => array(
|
||||
'blog_edate' => 'widget__blog_edate',
|
||||
'blog_entries' => 'widget__blog_count_entries',
|
||||
'blog_comments' => 'widget__blog_count_comments'
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'widget_feed_sort_on', isset( $this->configuration['widget_feed_sort_on'] ) ? $this->configuration['widget_feed_sort_on'] : 'blog_last_edate', FALSE, array( 'options' => array(
|
||||
'blog_last_edate' => 'widget__blog_edate',
|
||||
'blog_count_entries' => 'widget__blog_count_entries',
|
||||
'blog_count_comments' => 'widget__blog_count_comments'
|
||||
) ) ), NULL, NULL, NULL, 'widget_feed_sort_on' );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'widget_feed_sort_dir', isset( $this->configuration['widget_feed_sort_dir'] ) ? $this->configuration['widget_feed_sort_dir'] : 'desc', FALSE, array(
|
||||
@@ -104,7 +116,29 @@ class _blogs extends \IPS\Widget\PermissionCache
|
||||
'asc' => 'ascending'
|
||||
)
|
||||
) ) );
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ran before saving widget configuration
|
||||
*
|
||||
* @param array $values Values from form
|
||||
* @return array
|
||||
*/
|
||||
public function preConfig( $values )
|
||||
{
|
||||
if ( is_array( $values['widget_feed_author'] ) )
|
||||
{
|
||||
$members = array();
|
||||
foreach( $values['widget_feed_author'] as $member )
|
||||
{
|
||||
$members[] = $member->member_id;
|
||||
}
|
||||
|
||||
$values['widget_feed_author'] = $members;
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,7 +152,7 @@ class _blogs extends \IPS\Widget\PermissionCache
|
||||
$sortBy = ( isset( $this->configuration['widget_feed_sort_on'] ) and isset( $this->configuration['widget_feed_sort_dir'] ) ) ? ( $this->configuration['widget_feed_sort_on'] . ' ' . $this->configuration['widget_feed_sort_dir'] ) : NULL;
|
||||
$limit = isset( $this->configuration['widget_feed_show'] ) ? $this->configuration['widget_feed_show'] : 5;
|
||||
|
||||
if ( isset( $this->configuration['widget_feed_author'] ) and is_array( $this->configuration['widget_feed_author'] ) )
|
||||
if ( isset( $this->configuration['widget_feed_author'] ) and is_array( $this->configuration['widget_feed_author'] ) and count( $this->configuration['widget_feed_author'] ) )
|
||||
{
|
||||
$where[] = array( \IPS\Db::i()->in( 'blog_member_id', $this->configuration['widget_feed_author'] ) );
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Blog Entry Feed Widget
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage forums
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 22 Jun 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Recent Entries Widget
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage blog
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Blog
|
||||
* @since 10 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -63,7 +63,7 @@ class _recentEntries extends \IPS\Widget\PermissionCache
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$entries = \IPS\blog\Entry::getItemsWithPermission( array( array( 'entry_status!=?', 'draft' ) ), NULL, isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 5 );
|
||||
$entries = \IPS\blog\Entry::getItemsWithPermission( array( array( 'entry_status!=?', 'draft' ) ), NULL, isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 5, 'read', \IPS\Content\Hideable::FILTER_PUBLIC_ONLY );
|
||||
if ( count( $entries ) )
|
||||
{
|
||||
return $this->output( $entries );
|
||||
|
||||
Reference in new issue
Block a user