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:
@@ -97,8 +97,6 @@ interface record_Interface
|
|||||||
|
|
||||||
public function get_reg_name();
|
public function get_reg_name();
|
||||||
|
|
||||||
public function get_bitly_link();
|
|
||||||
|
|
||||||
public function get_hd_file();
|
public function get_hd_file();
|
||||||
|
|
||||||
public function delete();
|
public function delete();
|
||||||
|
@@ -1376,54 +1376,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
return $regname;
|
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
|
* @param collection $collection
|
||||||
|
2
lib/vendor/symfony
vendored
2
lib/vendor/symfony
vendored
Submodule lib/vendor/symfony updated: 6924e63587...4316595dbb
@@ -1,12 +1,4 @@
|
|||||||
|
|
||||||
{% if record.get_bitly_link() and user.ACL().has_right_on_base(record.get_base_id(), 'canreport') %}
|
|
||||||
<div>
|
|
||||||
{% trans 'preview::statistiques pour le lien' %}
|
|
||||||
<a class="bitly_link bitly_link_{{record.get_bitly_link()}}"
|
|
||||||
href="http://bit.ly/info/{{record.get_bitly_link()}}" target="_blank">
|
|
||||||
http://bit.ly/{{record.get_bitly_link()}}</a></div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if record.get_view_popularity() %}
|
{% if record.get_view_popularity() %}
|
||||||
<br>
|
<br>
|
||||||
{% trans 'preview::statistiques de visualisation pour le lien' %}
|
{% trans 'preview::statistiques de visualisation pour le lien' %}
|
||||||
|
@@ -67,7 +67,6 @@ if (!$right)
|
|||||||
|
|
||||||
$sha256 = $record->get_sha256();
|
$sha256 = $record->get_sha256();
|
||||||
$type = $record->get_type();
|
$type = $record->get_type();
|
||||||
$bitly = $record->get_bitly_link();
|
|
||||||
|
|
||||||
$url = '';
|
$url = '';
|
||||||
|
|
||||||
@@ -114,7 +113,7 @@ if ($url != '')
|
|||||||
?>
|
?>
|
||||||
<div class="boxCloser" onclick="parent.hideDwnl();"><?php echo _('boutton::fermer') ?></div>
|
<div class="boxCloser" onclick="parent.hideDwnl();"><?php echo _('boutton::fermer') ?></div>
|
||||||
<div id="tweet">
|
<div id="tweet">
|
||||||
<div style="margin-left:20px;padding:10px 0 5px;"><a href="http://www.twitter.com/home/?status=<?php echo $bitly ?>" target="_blank"><img src="/skins/icons/twitter.ico" title="share this on twitter" style="vertical-align:middle;padding:0 5px;"/> Send to Twitter</a></div>
|
<div style="margin-left:20px;padding:10px 0 5px;"><a href="http://www.twitter.com/home/?status=<?php echo $url . 'view/' ?>" target="_blank"><img src="/skins/icons/twitter.ico" title="share this on twitter" style="vertical-align:middle;padding:0 5px;"/> Send to Twitter</a></div>
|
||||||
<div style="margin-left:20px;padding:5px 0 10px;"><a href="http://www.facebook.com/sharer.php?u=<?php echo $url . 'view/' ?>" target="_blank"><img src="/skins/icons/facebook.ico" title="share on facebook" style="vertical-align:middle;padding:0 5px;"/> Send to Facebook</a></div>
|
<div style="margin-left:20px;padding:5px 0 10px;"><a href="http://www.facebook.com/sharer.php?u=<?php echo $url . 'view/' ?>" target="_blank"><img src="/skins/icons/facebook.ico" title="share on facebook" style="vertical-align:middle;padding:0 5px;"/> Send to Facebook</a></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="embed" style="text-align:center;padding:10px 0;">
|
<div id="embed" style="text-align:center;padding:10px 0;">
|
||||||
|
Reference in New Issue
Block a user