Skip to content

Commit

Permalink
Merge pull request #51 from DanielnetoDotCom/master
Browse files Browse the repository at this point in the history
update unstable
  • Loading branch information
Vinzenz Hersche authored Apr 14, 2018
2 parents eddd366 + c4bd4c9 commit 4ad8d33
Show file tree
Hide file tree
Showing 44 changed files with 1,286 additions and 298 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@
/plugin/SignUpAgreement/
/plugin/PromoteVideos/
/plugin/Livesearch/
/plugin/AudioVisualizer/
/plugin/AudioVisualizer/
/plugin/Notifications/
/plugin/DIY/
542 changes: 542 additions & 0 deletions locale/tr.php

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions locale/us.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
$t['Default'] = "Default";
$t['Delete'] = "Delete";
$t['Description'] = "Description";
$t['Direct upload'] = "Direct upload";
$t['Disable YouPHPTube Google Analytics'] = "Disable YouPHPTube Google Analytics";
$t['Do not forget to save after choose your theme'] = "Do not forget to save after choose your theme";
$t['Don´t like this video? Sign in to make your opinion count.'] = "Don´t like this video? Sign in to make your opinion count.";
Expand Down Expand Up @@ -154,6 +155,7 @@
$t['Like this video? Sign in to make your opinion count.'] = "Like this video? Sign in to make your opinion count.";
$t['Listed Transmition'] = "Listed Transmition";
$t['Live'] = "Live";
$t['Live Chat'] = "Live Chat";
$t['Local File'] = "Local File";
$t['Login'] = "Login";
$t['Logoff'] = "Logoff";
Expand All @@ -180,6 +182,8 @@
$t['New User Groups'] = "New User Groups";
$t['No'] = "No";
$t['Notify Subscribers'] = "Notify Subscribers";
$t['Off'] = "Off";
$t['On'] = "On";
$t['Opacity'] = "Opacity";
$t['Original words found'] = "Original words found";
$t['Page'] = "Page";
Expand All @@ -196,6 +200,7 @@
$t['Plugin Form'] = "Plugin Form";
$t['Plugins'] = "Plugins";
$t['Position'] = "Position";
$t['Preview'] = "Preview";
$t['Prints'] = "Prints";
$t['Public'] = "Public";
$t['Public Video'] = "Public Video";
Expand Down Expand Up @@ -275,6 +280,7 @@
$t['Theme for Style:'] = "Theme for Style:";
$t['Themes'] = "Themes";
$t['There is missing data to recover your password'] = "There is missing data to recover your password";
$t['There is no streaming now'] = "There is no streaming now";
$t['This e-mail will be used for this web site notifications'] = "This e-mail will be used for this web site notifications";
$t['This help us to track and dettect errors'] = "This help us to track and dettect errors";
$t['This page works only with a MP4 File, if you have or need any other format, try to install your own <a href=\'https://github.com/DanielnetoDotCom/YouPHPTube-Encoder\' class=\'btn btn-warning btn-xs\'>encoder</a> or use the <a href=\'https://encoder.youphptube.com/\' class=\'btn btn-warning btn-xs\'>public</a> one'] = "This page works only with a MP4 File, if you have or need any other format, try to install your own <a href='https://github.com/DanielnetoDotCom/YouPHPTube-Encoder' class='btn btn-warning btn-xs'>encoder</a> or use the <a href='https://encoder.youphptube.com/' class='btn btn-warning btn-xs'>public</a> one";
Expand Down Expand Up @@ -305,7 +311,9 @@
$t['Total Views (Today)'] = "Total Views (Today)";
$t['Total Views Today'] = "Total Views Today";
$t['Translated Array'] = "Translated Array";
$t['Trying to establish a chat server connection'] = "Trying to establish a chat server connection";
$t['Type the code'] = "Type the code";
$t['Type your message...'] = "Type your message...";
$t['URL'] = "URL";
$t['UUID can\'t be blank'] = "UUID can't be blank";
$t['Unable to open file!'] = "Unable to open file!";
Expand Down Expand Up @@ -378,6 +386,7 @@
$t['Yes, delete it!'] = "Yes, delete it!";
$t['You already support this video'] = "You already support this video";
$t['You are hosting %d minutes and %d seconds of video'] = "You are hosting %d minutes and %d seconds of video";
$t['You are not allowed see this streaming'] = "You are not allowed see this streaming";
$t['You are not logged'] = "You are not logged";
$t['You are running YouPHPTube version %s!'] = "You are running YouPHPTube version %s!";
$t['You asked for a recover link, click on the provided link'] = "You asked for a recover link, click on the provided link";
Expand Down
20 changes: 20 additions & 0 deletions objects/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ function setComments_id_pai($comments_id_pai) {
$this->comments_id_pai = $comments_id_pai;
}

function getComments_id_pai() {
return $this->comments_id_pai;
}

function getUsers_id() {
return $this->users_id;
}

function setComment($comment) {
$this->comment = $comment;
}
Expand Down Expand Up @@ -83,6 +91,18 @@ function save() {
if(empty($resp)){
die('Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
if (empty($this->id)) {
$id = $global['mysqli']->insert_id;
$this->id = $id;
} else {
$id = $this->id;
}
if(empty($this->comments_id_pai) || $this->comments_id_pai== 'NULL'){
YouPHPTubePlugin::afterNewComment($this->id);
}else{
YouPHPTubePlugin::afterNewResponse($this->id);
}

return $resp;
}

Expand Down
47 changes: 34 additions & 13 deletions objects/hybridauth/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
use Hybridauth\HttpClient\HttpClientInterface;
use Hybridauth\HttpClient\Curl as HttpClient;
use Hybridauth\Data;
use Hybridauth\Deprecated\DeprecatedAdapterTrait;

/**
*
* Class AbstractAdapter
*/
abstract class AbstractAdapter implements AdapterInterface
{
Expand Down Expand Up @@ -77,9 +76,9 @@ abstract class AbstractAdapter implements AdapterInterface
public $logger;

/**
* Wheteher to validate API status codes of http responses
* Whether to validate API status codes of http responses
*
* @var validateApiResponseHttpCode
* @var boolean
*/
protected $validateApiResponseHttpCode = true;

Expand All @@ -97,7 +96,7 @@ public function __construct(
StorageInterface $storage = null,
LoggerInterface $logger = null
) {
$this->providerId = str_replace('Hybridauth\\Provider\\', '', get_class($this));
$this->providerId = (new \ReflectionClass($this))->getShortName();

$this->config = new Data\Collection($config);

Expand Down Expand Up @@ -151,7 +150,7 @@ public function getUserContacts()
/**
* {@inheritdoc}
*/
public function setUserStatus($status)
public function getUserPages()
{
throw new NotImplementedException('Provider does not support this feature.');
}
Expand All @@ -164,6 +163,22 @@ public function getUserActivity($stream)
throw new NotImplementedException('Provider does not support this feature.');
}

/**
* {@inheritdoc}
*/
public function setUserStatus($status)
{
throw new NotImplementedException('Provider does not support this feature.');
}

/**
* {@inheritdoc}
*/
public function setPageStatus($status, $pageId)
{
throw new NotImplementedException('Provider does not support this feature.');
}

/**
* {@inheritdoc}
*
Expand All @@ -180,8 +195,6 @@ public function isConnected()
public function disconnect()
{
$this->clearStoredData();

return true;
}

/**
Expand Down Expand Up @@ -219,6 +232,9 @@ public function setAccessToken($tokens = [])
foreach ($tokens as $token => $value) {
$this->storeData($token, $value);
}

// Re-initialize token parameters.
$this->initialize();
}

/**
Expand Down Expand Up @@ -263,7 +279,8 @@ public function getStorage()
public function setLogger(LoggerInterface $logger = null)
{
$this->logger = $logger ?: new Logger(
$this->config->get('debug_mode'), $this->config->get('debug_file')
$this->config->get('debug_mode'),
$this->config->get('debug_file')
);

if (method_exists($this->httpClient, 'setLogger')) {
Expand All @@ -281,8 +298,10 @@ public function getLogger()

/**
* Set Adapter's API callback url
*
* @throws InvalidArgumentException
*
* @param string $callback
*
* @throws InvalidArgumentException
*/
protected function setCallback($callback)
{
Expand All @@ -295,8 +314,10 @@ protected function setCallback($callback)

/**
* Overwrite Adapter's API endpoints
*
* @param Data\Collection $endpoints
*/
protected function setApiEndpoints($endpoints)
protected function setApiEndpoints(Data\Collection $endpoints = null)
{
if (empty($endpoints)) {
return;
Expand Down Expand Up @@ -335,7 +356,7 @@ protected function validateApiResponse($error = '')

$status = $this->httpClient->getResponseHttpCode();

if ($status < 200 || $status > 299 ) {
if ($status < 200 || $status > 299) {
throw new HttpRequestFailedException(
$error . 'HTTP error '.$this->httpClient->getResponseHttpCode().
'. Raw Provider API response: '.$this->httpClient->getResponseBody().'.'
Expand Down
102 changes: 65 additions & 37 deletions objects/hybridauth/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,68 +12,88 @@
use Hybridauth\Logger\LoggerInterface;

/**
*
* Interface AdapterInterface
*/
interface AdapterInterface
{
/**
* Initiate the appropriate protocol and process/automate the authentication or authorization flow.
*
* @return boolean|null
*/
* Initiate the appropriate protocol and process/automate the authentication or authorization flow.
*
* @return boolean|null
*/
public function authenticate();

/**
* Returns TRUE if the user is connected
*
* @return boolean
*/
* Returns TRUE if the user is connected
*
* @return boolean
*/
public function isConnected();

/**
* Clear all access token in storage
*
* @return boolean
*/
* Clear all access token in storage
*/
public function disconnect();

/**
* Retrieve the connected user profile
*
* @return \Hybridauth\User\Profile
*/
* Retrieve the connected user profile
*
* @return \Hybridauth\User\Profile
*/
public function getUserProfile();

/**
* Retrieve the connected user contacts list
*
* @return array of \Hybridauth\User\Contact
*/
* Retrieve the connected user contacts list
*
* @return \Hybridauth\User\Contact[]
*/
public function getUserContacts();

/**
* return the user activity stream
*
* @param string $stream
*
* @return array of \Hybridauth\User\Activity
*/
* Retrieve the connected user pages|companies|groups list
*
* @return array
*/
public function getUserPages();

/**
* Retrieve the user activity stream
*
* @param string $stream
*
* @return \Hybridauth\User\Activity[]
*/
public function getUserActivity($stream);

/**
* Post a status on user wall|timeline|blog|website|etc.
*
* @param string|array $status
*
* @return mixed API response
*/
* Post a status on user wall|timeline|blog|website|etc.
*
* @param string|array $status
*
* @return mixed API response
*/
public function setUserStatus($status);

/**
* Send a signed request to provider API
*
* @return mixed
*/
* Post a status on page|company|group wall.
*
* @param string|array $status
* @param string $pageId
*
* @return mixed API response
*/
public function setPageStatus($status, $pageId);

/**
* Send a signed request to provider API
*
* @param string $url
* @param string $method
* @param array $parameters
* @param array $headers
*
* @return mixed
*/
public function apiRequest($url, $method = 'GET', $parameters = [], $headers = []);

/**
Expand All @@ -85,11 +105,15 @@ public function getAccessToken();

/**
* Set oauth access tokens.
*
* @param array $tokens
*/
public function setAccessToken($tokens = []);

/**
* Set http client instance.
*
* @param HttpClientInterface $httpClient
*/
public function setHttpClient(HttpClientInterface $httpClient = null);

Expand All @@ -100,6 +124,8 @@ public function getHttpClient();

/**
* Set storage instance.
*
* @param StorageInterface $storage
*/
public function setStorage(StorageInterface $storage = null);

Expand All @@ -110,6 +136,8 @@ public function getStorage();

/**
* Set Logger instance.
*
* @param LoggerInterface $logger
*/
public function setLogger(LoggerInterface $logger = null);

Expand Down
Loading

0 comments on commit 4ad8d33

Please sign in to comment.