mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Removed bit.ly
This commit is contained in:
@@ -1376,54 +1376,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
return $regname;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_bitly_link()
|
||||
{
|
||||
|
||||
$registry = registry::get_instance();
|
||||
|
||||
if ($this->bitly_link !== null)
|
||||
return $this->bitly_link;
|
||||
|
||||
$this->bitly_link = false;
|
||||
|
||||
if (trim($registry->get('GV_bitly_user')) == ''
|
||||
&& trim($registry->get('GV_bitly_key')) == '')
|
||||
return $this->bitly_link;
|
||||
|
||||
try
|
||||
{
|
||||
$short = new PHPShortener();
|
||||
$bitly = $short->encode($url . 'view/', 'bit.ly', $registry);
|
||||
|
||||
if (preg_match('/^(http:\/\/)?(www\.)?([^\/]*)\/(.*)$/', $bitly, $results))
|
||||
{
|
||||
if ($results[3] && $results[4])
|
||||
{
|
||||
$hash = 'http://bit.ly/' . $results[4];
|
||||
$sql = 'UPDATE record SET bitly = :hash WHERE record_id = :record_id';
|
||||
|
||||
$connbas = connection::getPDOConnection($this->get_sbas_id());
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute(array(':hash' => $hash, ':record_id' => $this->get_record_id()));
|
||||
$stmt->closeCursor();
|
||||
|
||||
$this->bitly_link = 'http://bit.ly/' . $hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
unset($e);
|
||||
}
|
||||
$this->delete_data_from_cache();
|
||||
|
||||
return $this->bitly_link;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param collection $collection
|
||||
|
Reference in New Issue
Block a user