Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Delicious share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='https://delicious.com/tools'>Delicious button documentation</a>
|
||||
@@ -47,7 +47,7 @@ class _Delicious
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
@@ -75,7 +75,7 @@ class _Delicious
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$url = \IPS\Http\Url::external( "http://delicious.com/save?jump=close&noui=1&v=5" )->setQueryString( 'provider', urlencode( \IPS\Settings::i()->board_name ) );
|
||||
$url = \IPS\Http\Url::external( "https://del.icio.us/save?jump=close&noui=1&v=5" )->setQueryString( 'provider', urlencode( \IPS\Settings::i()->board_name ) );
|
||||
|
||||
if( $this->url !== NULL )
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Digg share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='http://ftllc.com/articles/social-media-buttons.php'>Digg button</a> (This was the best I could find...Digg has removed most of their button documentation it seems)
|
||||
@@ -48,7 +48,7 @@ class _Digg
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Email share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ class _Email
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Facebook share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='https://developers.facebook.com/docs/reference/plugins/like/'>Facebook like button documentation</a>
|
||||
@@ -46,7 +46,7 @@ class _Facebook
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
@@ -73,7 +73,7 @@ class _Facebook
|
||||
/* If we include a URL, we'll post it as a link to the wall, otherwise we'll just update the user's status */
|
||||
if ( $url !== NULL )
|
||||
{
|
||||
$response = \IPS\Http\Url::external( "https://graph.facebook.com/" . \IPS\Member::loggedIn()->fb_uid . "/links" )->request()->post( array(
|
||||
$response = \IPS\Http\Url::external( "https://graph.facebook.com/" . \IPS\Member::loggedIn()->fb_uid . "/feed" )->request()->post( array(
|
||||
'message' => $content,
|
||||
'link' => (string) $url,
|
||||
'access_token' => \IPS\Member::loggedIn()->fb_token,
|
||||
@@ -99,7 +99,7 @@ class _Facebook
|
||||
}
|
||||
catch( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
IPS\Log::i( LOG_WARNING )->write( \IPS\Member::loggedIn()->id . ': '. $e->getMessage(), 'facebook' );
|
||||
\IPS\Log::log( \IPS\Member::loggedIn()->id . ': '. $e->getMessage(), 'facebook' );
|
||||
|
||||
throw new \InvalidArgumentException( \IPS\Member::loggedIn()->language()->addToStack('facebook_publish_exception') );
|
||||
}
|
||||
@@ -113,12 +113,23 @@ class _Facebook
|
||||
/**
|
||||
* Add any additional form elements to the configuration form. These must be setting keys that the service configuration form can save as a setting.
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form Configuration form for this service
|
||||
* @param \IPS\Helpers\Form $form Configuration form for this service
|
||||
* @param \IPS\core\ShareLinks\Service $service The service
|
||||
* @return void
|
||||
*/
|
||||
public static function modifyForm( \IPS\Helpers\Form &$form )
|
||||
public static function modifyForm( \IPS\Helpers\Form &$form, $service )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'fbc_bot_group', \IPS\Settings::i()->fbc_bot_group, TRUE, array( 'options' => array_combine( array_keys( \IPS\Member\Group::groups() ), array_map( function( $_group ) { return (string) $_group; }, \IPS\Member\Group::groups() ) ) ) ) );
|
||||
|
||||
if ( array_key_exists( 'Facebook', \IPS\Login::handlers( TRUE ) ) )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'share_autoshare_Facebook', $service->autoshare, false ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'share_autoshare_Facebook', FALSE, false, array( 'disabled' => TRUE ) ) );
|
||||
\IPS\Member::loggedIn()->language()->words['share_autoshare_Facebook_desc'] = \IPS\Member::loggedIn()->language()->addToStack('share_autoshare_Facebook_disabled');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Google +1 share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='https://developers.google.com/+/web/+1button/'>Google +1 button documentation</a>
|
||||
@@ -46,7 +46,7 @@ class _Googleplusone
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Linked In share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='http://developer.linkedin.com/plugins/share-plugin-generator'>Linked In button documentation</a>
|
||||
@@ -46,7 +46,7 @@ class _Linkedin
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace IPS\Content\ShareServices;
|
||||
|
||||
|
||||
class _Odnoklassniki
|
||||
{
|
||||
/**
|
||||
* @brief URL to the content item
|
||||
*/
|
||||
protected $url = NULL;
|
||||
|
||||
/**
|
||||
* @brief Title of the content item
|
||||
*/
|
||||
protected $title = NULL;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\Http\Url $url URL to the content [optional - if omitted, some services will figure out on their own]
|
||||
* @param string $title Default text for the content, usually the title [optional - if omitted, some services will figure out on their own]
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Http\Url $url=NULL, $title=NULL )
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add any additional form elements to the configuration form. These must be setting keys that the service configuration form can save as a setting.
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form Configuration form for this service
|
||||
* @return void
|
||||
*/
|
||||
public static function modifyForm( \IPS\Helpers\Form &$form )
|
||||
{
|
||||
}
|
||||
|
||||
static function canAutoshare() {}
|
||||
|
||||
/**
|
||||
* Return the HTML code to show the share link
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return '<a href="http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl='.$this->url.'" class="cShareLink cShareLink_ok" style="background-color:#F4811F;" target="_blank" data-controller="core.front.core.sharelink" data-role="shareLink" _title="Поделиться в Одноклассниках" data-ipstooltip="">
|
||||
<i class="fa fa-odnoklassniki"></i>
|
||||
</a>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Pinterest share link
|
||||
* @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
|
||||
* @since 01 Dec 2016
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\Content\ShareServices;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pinterest share link
|
||||
*/
|
||||
class _Pinterest
|
||||
{
|
||||
/**
|
||||
* @brief URL to the content item
|
||||
*/
|
||||
protected $url = NULL;
|
||||
|
||||
/**
|
||||
* @brief Title of the content item
|
||||
*/
|
||||
protected $title = NULL;
|
||||
|
||||
/**
|
||||
* @brief Ccontent item
|
||||
*/
|
||||
protected $item = NULL;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\Http\Url $url URL to the content [optional - if omitted, some services will figure out on their own]
|
||||
* @param string $title Default text for the content, usually the title [optional - if omitted, some services will figure out on their own]
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Http\Url $url=NULL, $title=NULL, $item=NULL )
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
$this->item = $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function canAutoshare()
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add any additional form elements to the configuration form. These must be setting keys that the service configuration form can save as a setting.
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form Configuration form for this service
|
||||
* @param \IPS\core\ShareLinks\Service $service The service
|
||||
* @return void
|
||||
*/
|
||||
public static function modifyForm( \IPS\Helpers\Form &$form, $service )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the HTML code to show the share link
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if ( $this->item )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'sharelinks', 'core' )->pinterest( \IPS\Http\Url::external( 'http://pinterest.com/pin/create/button/' )->setQueryString( 'url', (string) $this->url )->setQueryString( 'media', (string) $this->item->shareImage() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Reddit share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='http://www.reddit.com/buttons/'>Reddit button documentation</a>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief StumbleUpon share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='http://www.stumbleupon.com/dt/badges/create'>StumbleUpon button documentation</a>
|
||||
@@ -47,7 +47,7 @@ class _Stumble
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Twitter share link
|
||||
* @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
|
||||
* @since 11 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
* @see <a href='https://dev.twitter.com/docs/tweet-button'>Tweet button documentation</a>
|
||||
@@ -46,7 +46,7 @@ class _Twitter
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether the logged in user has the ability to autoshare
|
||||
*
|
||||
@@ -93,7 +93,7 @@ class _Twitter
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
\IPS\Log::i( LOG_WARNING )->write( \IPS\Member::loggedIn()->id . ': '. $e->getMessage(), 'twitter' );
|
||||
\IPS\Log::log( \IPS\Member::loggedIn()->id . ': '. $e->getMessage(), 'twitter' );
|
||||
|
||||
throw new \InvalidArgumentException( \IPS\Member::loggedIn()->language()->addToStack('twitter_publish_exception') );
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class _Twitter
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
\IPS\Log::i( LOG_WARNING )->write( \IPS\Member::loggedIn()->id . ': '. $e->getMessage(), 'twitter' );
|
||||
\IPS\Log::log( \IPS\Member::loggedIn()->id . ': '. $e->getMessage(), 'twitter' );
|
||||
|
||||
throw new \InvalidArgumentException( \IPS\Member::loggedIn()->language()->addToStack('twitter_publish_exception') );
|
||||
}
|
||||
@@ -133,12 +133,23 @@ class _Twitter
|
||||
/**
|
||||
* Add any additional form elements to the configuration form. These must be setting keys that the service configuration form can save as a setting.
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form Configuration form for this service
|
||||
* @param \IPS\Helpers\Form $form Configuration form for this service
|
||||
* @param \IPS\core\ShareLinks\Service $service The service
|
||||
* @return void
|
||||
*/
|
||||
public static function modifyForm( \IPS\Helpers\Form &$form )
|
||||
public static function modifyForm( \IPS\Helpers\Form &$form, $service )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'twitter_hashtag', \IPS\Settings::i()->twitter_hashtag, FALSE ) );
|
||||
|
||||
if ( array_key_exists( 'Twitter', \IPS\Login::handlers( TRUE ) ) )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'share_autoshare_Twitter', $service->autoshare, false ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'share_autoshare_Twitter', FALSE, false, array( 'disabled' => TRUE ) ) );
|
||||
\IPS\Member::loggedIn()->language()->words['share_autoshare_Twitter_desc'] = \IPS\Member::loggedIn()->language()->addToStack('share_autoshare_Twitter_disabled');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,16 +161,27 @@ class _Twitter
|
||||
{
|
||||
try
|
||||
{
|
||||
$url = preg_replace_callback( "{[^0-9a-z_.!~*'();,/?:@&=+$#-]}i",
|
||||
function ( $m )
|
||||
{
|
||||
return sprintf( '%%%02X', ord( $m[0] ) );
|
||||
},
|
||||
$this->url) ;
|
||||
|
||||
$title = $this->title ?: NULL;
|
||||
if ( \IPS\Settings::i()->twitter_hashtag !== '')
|
||||
{
|
||||
$title .= ' ' . \IPS\Settings::i()->twitter_hashtag;
|
||||
}
|
||||
return \IPS\Theme::i()->getTemplate( 'sharelinks', 'core' )->twitter( urlencode( $this->url ), rawurlencode( $title ) );
|
||||
return \IPS\Theme::i()->getTemplate( 'sharelinks', 'core' )->twitter( urlencode( $url ), rawurlencode( $title ) );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
\IPS\IPS::exceptionHandler( $e );
|
||||
}
|
||||
catch ( \Throwable $e )
|
||||
{
|
||||
\IPS\IPS::exceptionHandler( $e );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace IPS\Content\ShareServices;
|
||||
|
||||
|
||||
class _Vkontakte
|
||||
{
|
||||
/**
|
||||
* @brief URL to the content item
|
||||
*/
|
||||
protected $url = NULL;
|
||||
|
||||
/**
|
||||
* @brief Title of the content item
|
||||
*/
|
||||
protected $title = NULL;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\Http\Url $url URL to the content [optional - if omitted, some services will figure out on their own]
|
||||
* @param string $title Default text for the content, usually the title [optional - if omitted, some services will figure out on their own]
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Http\Url $url=NULL, $title=NULL )
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add any additional form elements to the configuration form. These must be setting keys that the service configuration form can save as a setting.
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form Configuration form for this service
|
||||
* @return void
|
||||
*/
|
||||
public static function modifyForm( \IPS\Helpers\Form &$form )
|
||||
{
|
||||
}
|
||||
|
||||
static function canAutoshare() {}
|
||||
|
||||
/**
|
||||
* Return the HTML code to show the share link
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return '<a href="https://vk.com/share.php?url='.$this->url.'&title='.$this->title.'" class="cShareLink cShareLink_vk" style="background-color:#56789C;" target="_blank" data-controller="core.front.core.sharelink" data-role="shareLink" _title="Поделиться в Вконтакте" data-ipstooltip="">
|
||||
<i class="fa fa-vk"></i>
|
||||
</a>';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user