mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
Allow you to choose what social media button will show
This commit is contained in:
parent
f00eb9c021
commit
8f2776d771
3 changed files with 123 additions and 36 deletions
|
@ -156,6 +156,11 @@ class CustomizeAdvanced extends PluginAbstract {
|
||||||
$obj->doNotDisplayPluginsTags = false;
|
$obj->doNotDisplayPluginsTags = false;
|
||||||
$obj->showNotRatedLabel = false;
|
$obj->showNotRatedLabel = false;
|
||||||
$obj->showShareMenuOpenByDefault = false;
|
$obj->showShareMenuOpenByDefault = false;
|
||||||
|
|
||||||
|
foreach ($global['social_medias'] as $key => $value) {
|
||||||
|
eval("\$obj->showShareButton_{$key} = true;");
|
||||||
|
}
|
||||||
|
|
||||||
$obj->askRRatingConfirmationBeforePlay_G = false;
|
$obj->askRRatingConfirmationBeforePlay_G = false;
|
||||||
$obj->askRRatingConfirmationBeforePlay_PG = false;
|
$obj->askRRatingConfirmationBeforePlay_PG = false;
|
||||||
$obj->askRRatingConfirmationBeforePlay_PG13 = false;
|
$obj->askRRatingConfirmationBeforePlay_PG13 = false;
|
||||||
|
@ -430,3 +435,81 @@ Allow: .css";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class SocialMedias{
|
||||||
|
public $href;
|
||||||
|
public $class;
|
||||||
|
public $title;
|
||||||
|
public $iclass;
|
||||||
|
public $img;
|
||||||
|
public $onclick;
|
||||||
|
|
||||||
|
function __construct($iclass, $img='') {
|
||||||
|
$this->iclass = $iclass;
|
||||||
|
$this->img = $img;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getHref() {
|
||||||
|
return $this->href;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getClass() {
|
||||||
|
return $this->class;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTitle() {
|
||||||
|
return $this->title;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getIclass() {
|
||||||
|
return $this->iclass;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getImg() {
|
||||||
|
return $this->img;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getOnclick() {
|
||||||
|
return $this->onclick;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setHref($href): void {
|
||||||
|
$this->href = $href;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setClass($class): void {
|
||||||
|
$this->class = $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTitle($title): void {
|
||||||
|
$this->title = $title;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setIclass($iclass): void {
|
||||||
|
$this->iclass = $iclass;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setImg($img): void {
|
||||||
|
$this->img = $img;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setOnclick($onclick): void {
|
||||||
|
$this->onclick = $onclick;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$global['social_medias'] = array(
|
||||||
|
'Facebook'=>new SocialMedias('fab fa-facebook-square', ''),
|
||||||
|
'Twitter'=>new SocialMedias('fab fa-twitter', ''),
|
||||||
|
'Tumblr'=>new SocialMedias('fab fa-tumblr', ''),
|
||||||
|
'Pinterest'=>new SocialMedias('fab fa-pinterest-p', ''),
|
||||||
|
'Reddit'=>new SocialMedias('fab fa-reddit-alien', ''),
|
||||||
|
'LinkedIn'=>new SocialMedias('fab fa-linkedin-in', ''),
|
||||||
|
'Wordpress'=>new SocialMedias('fab fa-wordpress-simple', ''),
|
||||||
|
'Pinboard'=>new SocialMedias('fas fa-thumbtack', ''),
|
||||||
|
'Gab'=>new SocialMedias('', getURL('view/img/gab.png')),
|
||||||
|
'CloutHub'=>new SocialMedias('', getURL('view/img/cloutHub.png')),
|
||||||
|
);
|
|
@ -30,7 +30,7 @@ ul.social-network li {
|
||||||
.social-network a.icoVimeo:hover {
|
.social-network a.icoVimeo:hover {
|
||||||
background-color: #0590B8;
|
background-color: #0590B8;
|
||||||
}
|
}
|
||||||
.social-network a.icoLinkedin:hover {
|
.social-network a.icoLinkedIn:hover {
|
||||||
background-color: #007bb7;
|
background-color: #007bb7;
|
||||||
}
|
}
|
||||||
.social-network a.icoTumblr:hover {
|
.social-network a.icoTumblr:hover {
|
||||||
|
@ -62,7 +62,7 @@ ul.social-network li {
|
||||||
.social-network a.icoTwitter:hover i,
|
.social-network a.icoTwitter:hover i,
|
||||||
.social-network a.icoGoogle:hover i,
|
.social-network a.icoGoogle:hover i,
|
||||||
.social-network a.icoVimeo:hover i,
|
.social-network a.icoVimeo:hover i,
|
||||||
.social-network a.icoLinkedin:hover i ,
|
.social-network a.icoLinkedIn:hover i ,
|
||||||
.social-network a.icoTumblr:hover i ,
|
.social-network a.icoTumblr:hover i ,
|
||||||
.social-network a.icoPinterest:hover i ,
|
.social-network a.icoPinterest:hover i ,
|
||||||
.social-network a.icoReddit:hover i ,
|
.social-network a.icoReddit:hover i ,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
global $socialAdded;
|
global $socialAdded, $global;
|
||||||
$titleSocial = @$title;
|
$titleSocial = @$title;
|
||||||
if (!empty($video['id'])) {
|
if (!empty($video['id'])) {
|
||||||
$url = Video::getLinkToVideo($video['id']);
|
$url = Video::getLinkToVideo($video['id']);
|
||||||
|
@ -10,21 +10,27 @@ if (!empty($video['id'])) {
|
||||||
$titleSocial = $video->getTitle();
|
$titleSocial = $video->getTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($advancedCustom)) {
|
||||||
|
$advancedCustom = AVideoPlugin::getObjectData("CustomizeAdvanced");
|
||||||
|
}
|
||||||
|
|
||||||
$removeChars = array('|');
|
$removeChars = array('|');
|
||||||
$titleSocial = str_replace($removeChars, '-', $titleSocial);
|
$titleSocial = str_replace($removeChars, '-', $titleSocial);
|
||||||
//$originalURL = $urlSocial;
|
//$originalURL = $urlSocial;
|
||||||
$urlSocial = urlencode($url);
|
$urlSocial = urlencode($url);
|
||||||
//set the $urlSocial and the $titleSocial before include this
|
//set the $urlSocial and the $titleSocial before include this
|
||||||
$facebookURL = "https://www.facebook.com/sharer.php?u={$urlSocial}&title={$titleSocial}";
|
|
||||||
$twitterURL = "http://twitter.com/intent/tweet?text={$titleSocial}+{$urlSocial}";
|
$global['social_medias_Facebook'] = "https://www.facebook.com/sharer.php?u={$urlSocial}&title={$titleSocial}";
|
||||||
$tumblr = "http://www.tumblr.com/share?v=3&u=$urlSocial"e=$titleSocial&s=";
|
$global['social_medias_Twitter'] = "http://twitter.com/intent/tweet?text={$titleSocial}+{$urlSocial}";
|
||||||
$pinterest = "http://pinterest.com/pin/create/button/?url=$urlSocial&description=";
|
$global['social_medias_Tumblr'] = "http://www.tumblr.com/share?v=3&u=$urlSocial"e=$titleSocial&s=";
|
||||||
$reddit = "http://www.reddit.com/submit?url=$urlSocial&title=$titleSocial";
|
$global['social_medias_Pinterest'] = "http://pinterest.com/pin/create/button/?url=$urlSocial&description=";
|
||||||
$linkedin = "http://www.linkedin.com/shareArticle?mini=true&url=$urlSocial&title=$titleSocial&summary=&source=$urlSocial";
|
$global['social_medias_Reddit'] = "http://www.reddit.com/submit?url=$urlSocial&title=$titleSocial";
|
||||||
$wordpress = "http://wordpress.com/press-this.php?u=$urlSocial"e=$titleSocial&s=";
|
$global['social_medias_LinkedIn'] = "http://www.linkedin.com/shareArticle?mini=true&url=$urlSocial&title=$titleSocial&summary=&source=$urlSocial";
|
||||||
$pinboard = "https://pinboard.in/popup_login/?url=$urlSocial&title=$titleSocial&description=";
|
$global['social_medias_Wordpress'] = "http://wordpress.com/press-this.php?u=$urlSocial"e=$titleSocial&s=";
|
||||||
$gabURL = "https://gab.com/compose?url={$urlSocial}&text={$titleSocial}";
|
$global['social_medias_Pinboard'] = "https://pinboard.in/popup_login/?url=$urlSocial&title=$titleSocial&description=";
|
||||||
$cloutHubURL = "https://app.clouthub.com/share?url={$urlSocial}&text={$titleSocial}";
|
$global['social_medias_Gab'] = "https://gab.com/compose?url={$urlSocial}&text={$titleSocial}";
|
||||||
|
$global['social_medias_CloutHub'] = "https://app.clouthub.com/share?url={$urlSocial}&text={$titleSocial}";
|
||||||
|
|
||||||
if (empty($socialAdded)) { // do not add the CSS more then once
|
if (empty($socialAdded)) { // do not add the CSS more then once
|
||||||
?>
|
?>
|
||||||
|
@ -32,32 +38,30 @@ if (empty($socialAdded)) { // do not add the CSS more then once
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
$socialAdded = 1;
|
$socialAdded = 1;
|
||||||
|
|
||||||
|
$social_medias = array(
|
||||||
|
new SocialMedias($href, $class, $title, $iclass, $img, $onclick)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<ul class="social-network social-circle">
|
<ul class="social-network social-circle">
|
||||||
<li><a href="<?php echo $facebookURL; ?>" target="_blank" class="icoFacebook" title="Facebook" data-toggle="tooltip" ><i class="fab fa-facebook-square"></i></a></li>
|
<?php
|
||||||
<li><a href="<?php echo $twitterURL; ?>" target="_blank" class="icoTwitter" title="Twitter" data-toggle="tooltip" ><i class="fab fa-twitter"></i></a></li>
|
foreach ($global['social_medias'] as $key => $value) {
|
||||||
<li><a href="<?php echo $tumblr; ?>" target="_blank" class="icoTumblr" title="Tumblr" data-toggle="tooltip" ><i class="fab fa-tumblr"></i></a></li>
|
eval("\$show = \$advancedCustom->showShareButton_{$key};");
|
||||||
<li><a href="<?php echo $pinterest; ?>" target="_blank" class="icoPinterest" title="Pinterest" data-toggle="tooltip" ><i class="fab fa-pinterest-p"></i></a></li>
|
if(empty($show)){
|
||||||
<li><a href="<?php echo $reddit; ?>" target="_blank" class="icoReddit" title="Reddit" data-toggle="tooltip" ><i class="fab fa-reddit-alien"></i></a></li>
|
continue;
|
||||||
<li><a href="<?php echo $linkedin; ?>" target="_blank" class="icoLinkedin" title="LinkedIn" data-toggle="tooltip" ><i class="fab fa-linkedin-in"></i></a></li>
|
}
|
||||||
<li><a href="<?php echo $wordpress; ?>" target="_blank" class="icoWordpress" title="Wordpress" data-toggle="tooltip" ><i class="fab fa-wordpress-simple"></i></a></li>
|
$url = $global['social_medias_'.$key];
|
||||||
<li><a href="<?php echo $pinboard; ?>" target="_blank" class="icoPinboard" title="Pinboard" data-toggle="tooltip" ><i class="fas fa-thumbtack"></i></a></li>
|
if(empty($value->img)){
|
||||||
|
echo '<li><a href="'.$url.'" target="_blank" class="ico'.$key.'" title="'.$key.'" data-toggle="tooltip" ><i class="'.$value->iclass.'"></i></a></li>';
|
||||||
|
}else{
|
||||||
|
echo '<li><a href="'.$url.'" style="" target="_blank" class="ico'.$key.'" title="'.$key.'" data-toggle="tooltip" ><i class="fas"><img src="'.$value->img.'" title="'.$key.'" style="height: 30px;"/></i></a></li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo $gabURL; ?>" style="" target="_blank" class="icoGab" title="Gab" data-toggle="tooltip" >
|
<a href="#" class="icoCopy" title="<?php echo __('Copy to Clipboard'); ?>" data-toggle="tooltip" onclick="copyToClipboard('<?php echo urldecode($urlSocial); ?>');$(this).closest('.modal').modal('hide');return false;" >
|
||||||
<i class="fas">
|
|
||||||
<img src="<?php echo getURL('view/img/gab.png'); ?>" title="gab" style="height: 30px;"/>
|
|
||||||
</i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="<?php echo $cloutHubURL; ?>" style="" target="_blank" class="icoCloutHub" title="CloutHub" data-toggle="tooltip" >
|
|
||||||
<i class="fas">
|
|
||||||
<img src="<?php echo getURL('view/img/cloutHub.png'); ?>" title="CloutHub" style="height: 30px;"/>
|
|
||||||
</i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="icoCopy" title="<?php echo __('Copy to Clipboard'); ?>" data-toggle="tooltip" onclick="copyToClipboard('<?php echo urldecode($urlSocial); ?>');$(this).closest('.modal').modal('hide');" >
|
|
||||||
<i class="far fa-copy"></i>
|
<i class="far fa-copy"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue