1
0

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:
Jason Hardin 2012-09-01 20:21:31 -07:00
parent 1cd9f66665
commit f87cc87ebd
4 changed files with 18 additions and 17 deletions

View File

@ -27,6 +27,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
$form = $this->_get_form();
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_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);
@ -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"))
->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->checkbox("facebook_share_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "facebook_share_enabled", false) == 1);
@ -81,7 +82,8 @@ class Admin_Social_Share_Controller extends Admin_Controller {
->selected(module::get_var("social_share", "facebook_share_layout"));
$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"));
/// Facebook like 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"))
->checked(module::get_var("social_share", "facebook_like_enabled", false) == 1);

View File

@ -17,7 +17,6 @@ if (module::get_var("social_share", "facebook_like_send")) {
$send = "false";
}
?>
<div class="g-social_share-facebook_like">
<?php if ($codeType == 'iframe'){ ?>
@ -28,14 +27,13 @@ if (module::get_var("social_share", "facebook_like_send")) {
&amp;show_faces=<?= $show_faces ?>
&amp;width=180
&amp;locale=<?= locales::cookie_locale(); ?>
&amp;action=<?= $layout ?>
&amp;action=<?= $action ?>
&amp;colorscheme=light&amp;height=<?= $hite; ?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:<?= $hite; ?>px;" allowTransparency="true">
</iframe>
<?php } else { ?>
<div id="fb-root"></div>
<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];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
@ -45,11 +43,11 @@ if (module::get_var("social_share", "facebook_like_send")) {
<?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 { ?>
<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 }
}

View File

@ -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">
<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>
</div>

View File

@ -1,13 +1,14 @@
<?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()) {
$url = urlencode(url::abs_current(true));
$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>
<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" />
</a>
<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") ?>">
<img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
</a>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
</div>
<?php } ?>