Fixed pinerest to work and facebook like. THere were mistakes in facebook that it was not using action. In general settings i was not storing the page setting.
This commit is contained in:
parent
1cd9f66665
commit
f87cc87ebd
@ -27,6 +27,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
|
|||||||
|
|
||||||
$form = $this->_get_form();
|
$form = $this->_get_form();
|
||||||
if ($form->validate()) {
|
if ($form->validate()) {
|
||||||
|
module::set_var("social_share", "general_impage_only", $form->general_settings->general_impage_only->value);
|
||||||
module::set_var("social_share", "facebook_share_enabled", $form->facebook_share_settings->facebook_share_enabled->value);
|
module::set_var("social_share", "facebook_share_enabled", $form->facebook_share_settings->facebook_share_enabled->value);
|
||||||
module::set_var("social_share", "facebook_share_layout", $form->facebook_share_settings->facebook_share_layout->value);
|
module::set_var("social_share", "facebook_share_layout", $form->facebook_share_settings->facebook_share_layout->value);
|
||||||
module::set_var("social_share", "facebook_share_link_text", $form->facebook_share_settings->facebook_share_link_text->value);
|
module::set_var("social_share", "facebook_share_link_text", $form->facebook_share_settings->facebook_share_link_text->value);
|
||||||
@ -69,7 +70,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
|
|||||||
$group_general->checkbox("general_impage_only")->label(t("Display the enabled buttons on image and movie pages only"))
|
$group_general->checkbox("general_impage_only")->label(t("Display the enabled buttons on image and movie pages only"))
|
||||||
->checked(module::get_var("social_share", "general_impage_only", true) == 1);
|
->checked(module::get_var("social_share", "general_impage_only", true) == 1);
|
||||||
|
|
||||||
/// Facebook settings
|
/// Facebook share settings
|
||||||
$group_facebook_share = $form->group("facebook_share_settings")->label(t("Facebook Share Button Settings"));
|
$group_facebook_share = $form->group("facebook_share_settings")->label(t("Facebook Share Button Settings"));
|
||||||
$group_facebook_share->checkbox("facebook_share_enabled")->label(t("Display the button"))
|
$group_facebook_share->checkbox("facebook_share_enabled")->label(t("Display the button"))
|
||||||
->checked(module::get_var("social_share", "facebook_share_enabled", false) == 1);
|
->checked(module::get_var("social_share", "facebook_share_enabled", false) == 1);
|
||||||
@ -82,6 +83,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
|
|||||||
$group_facebook_share->input("facebook_share_link_text")->label(t('Enter the text to place next to the Facebook icon.'))
|
$group_facebook_share->input("facebook_share_link_text")->label(t('Enter the text to place next to the Facebook icon.'))
|
||||||
->value(module::get_var("social_share", "facebook_share_link_text", "Share"));
|
->value(module::get_var("social_share", "facebook_share_link_text", "Share"));
|
||||||
|
|
||||||
|
/// Facebook like settings
|
||||||
$group_facebook_like = $form->group("facebook_like_settings")->label(t("Facebook Like Button Settings"));
|
$group_facebook_like = $form->group("facebook_like_settings")->label(t("Facebook Like Button Settings"));
|
||||||
$group_facebook_like->checkbox("facebook_like_enabled")->label(t("Display the button"))
|
$group_facebook_like->checkbox("facebook_like_enabled")->label(t("Display the button"))
|
||||||
->checked(module::get_var("social_share", "facebook_like_enabled", false) == 1);
|
->checked(module::get_var("social_share", "facebook_like_enabled", false) == 1);
|
||||||
|
@ -17,7 +17,6 @@ if (module::get_var("social_share", "facebook_like_send")) {
|
|||||||
$send = "false";
|
$send = "false";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="g-social_share-facebook_like">
|
<div class="g-social_share-facebook_like">
|
||||||
<?php if ($codeType == 'iframe'){ ?>
|
<?php if ($codeType == 'iframe'){ ?>
|
||||||
|
|
||||||
@ -28,14 +27,13 @@ if (module::get_var("social_share", "facebook_like_send")) {
|
|||||||
&show_faces=<?= $show_faces ?>
|
&show_faces=<?= $show_faces ?>
|
||||||
&width=180
|
&width=180
|
||||||
&locale=<?= locales::cookie_locale(); ?>
|
&locale=<?= locales::cookie_locale(); ?>
|
||||||
&action=<?= $layout ?>
|
&action=<?= $action ?>
|
||||||
&colorscheme=light&height=<?= $hite; ?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:<?= $hite; ?>px;" allowTransparency="true">
|
&colorscheme=light&height=<?= $hite; ?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:<?= $hite; ?>px;" allowTransparency="true">
|
||||||
</iframe>
|
</iframe>
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<div id="fb-root"></div>
|
<div id="fb-root"></div>
|
||||||
<script>(function(d, s, id) {
|
<script>(function(d, s, id) {
|
||||||
window.FB = null;FB=null;// this is needed for the facebook share button being on.
|
|
||||||
var js, fjs = d.getElementsByTagName(s)[0];
|
var js, fjs = d.getElementsByTagName(s)[0];
|
||||||
if (d.getElementById(id)) return;
|
if (d.getElementById(id)) return;
|
||||||
js = d.createElement(s); js.id = id;
|
js = d.createElement(s); js.id = id;
|
||||||
@ -45,11 +43,11 @@ if (module::get_var("social_share", "facebook_like_send")) {
|
|||||||
|
|
||||||
<?php if($codeType == 'xfbml'){?>
|
<?php if($codeType == 'xfbml'){?>
|
||||||
|
|
||||||
<fb:like href="<?= $selfURL; ?>" send="<?= $send ?>" width="180" show_faces="<?= $show_faces ?>" layout="<?= $layout?>" action="<?= $layout ?>"></fb:like>
|
<fb:like href="<?= $selfURL; ?>" send="<?= $send ?>" width="180" show_faces="<?= $show_faces ?>" layout="<?= $layout?>" action="<?= $action ?>"></fb:like>
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<div class="fb-like" data-href="<?= $selfURL; ?>" data-send="<?= $send ?>" data-layout="<?= $layout?>" data-width="180" data-show-faces="<?= $show_faces ?>" data-action="<?= $layout ?>"></div>
|
<div class="fb-like" data-href="<?= $selfURL; ?>" data-send="<?= $send ?>" data-layout="<?= $layout?>" data-width="180" data-show-faces="<?= $show_faces ?>" data-action="<?= $action ?>"></div>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
<?php defined("SYSPATH") or die("No direct script access.")?>
|
||||||
<div class="g-social_share-facebook_share">
|
<div class="g-social_share-facebook_share">
|
||||||
<a id="facebookicon" name="fb_share" type="<?= module::get_var("social_share", "facebook_share_layout") ?>"><?= module::get_var("social_share", "facebook_share_link_text") ?></a>
|
<a id="facebookicon" name="fb_share" type="<?= module::get_var("social_share", "facebook_share_layout") ?>"></a>
|
||||||
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
|
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
|
||||||
</div>
|
</div>
|
@ -1,13 +1,14 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.");
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
|
||||||
$url = url::abs_current(true);
|
|
||||||
$description="need to find out how to get this";
|
|
||||||
if ($theme->item()) {
|
if ($theme->item()) {
|
||||||
|
$url = urlencode(url::abs_current(true));
|
||||||
$item = $theme->item();
|
$item = $theme->item();
|
||||||
$media = $item->thumb_url(true);
|
$media = urlencode($item->thumb_url(true));
|
||||||
|
$description=urlencode($item->description);
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
|
<div class="g-social_share-pinterest_pinit">
|
||||||
<a href="http://pinterest.com/pin/create/button/?url=<?= $url; ?>&media=<?= $media; ?>&description=<?= $description; ?>" class="pin-it-button" count-layout="<?= module::get_var("social_share", "pinterest_count_location") ?>">
|
<a href="http://pinterest.com/pin/create/button/?url=<?= $url; ?>&media=<?= $media; ?>&description=<?= $description; ?>" class="pin-it-button" count-layout="<?= module::get_var("social_share", "pinterest_count_location") ?>">
|
||||||
<img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
|
<img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
|
||||||
</a>
|
</a>
|
||||||
|
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
|
||||||
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
Reference in New Issue
Block a user