Kynetx plugin vs Site Tags -- How can I tell the difference? - krl

My application has a homepage where you can download and install the plugins. It also uses site tags to call the same ruleset to show potential users what the app does.
I'd like to hide the plugins and replace that div with one that says 'Thanks for installing the plugin.' How can I tell the difference between KRL called from the site tags and KRL called from the plugin?
Here's my ideas, but perhaps there is a better way?
Option 1: Use page parameter, maybe the plugin won't see it.
Option 2: Use a second ruleset that calls into my primary ruleset. The plugin ruleset will hide the plugin div and unhide the 'thank you' div. I just have to have the primary ruleset support explicit events.

I think your best option is to use a page parameter, as you said. This will only be sent to the ruleset from your site tags--not from the browser extension--so that should solve your problem. Your site tags will look something like this:
<script type="text/javascript">
var KOBJ_config = {
"rids" : ["a999x99"]
"called_from_site_tags" : "true"
};
</script>
<script type="text/javascript" src="http://init.kobj.net/js/shared/kobj-static.js">
</script>
Then in your app you just have to check the page:param and do whatever you want with it:
is_site_tags = page:param("called_from_site_tags");
See here in the docs for more information. Hope that helps!

Related

Inserting facebook share button on personal website

I want to put a button on my website that will open a popup for the user to share the url on its profile.
I followed the steps shown here, after click on 'get code':
1. Include the Javascript SDK on your page once, ideally right after the opening <body> tag.
2. Place the code for your plugin wherever you want the plugin to appear on your page.
but I get a blank div without the button. What's missing? Do I need to register on facebook developers? Do I need to include some javascript src in the <head>?
On twitter is very simple, you just need to get the code from here
Edit: I want something like youtube facebook share.
As noted in the comments, somehow the default method as suggested by Facebook is not working, or rather the way the share button documentation suggests is not clear enough. This answer as suggested appears to work. Note that you will need a Facebook App ID.
Alternatively, this answer allows for a simple link, which you then have to style yourself with CSS, this alternative has the benefit of making share buttons that are consistent in design with your website, if you just want the vanilla blue Facebook button then continue with this answer.
Squarespace also details the default way of adding a facebook like button, my attempts to get it to work in a jsFiddle were not successful.
Get an AppID and embed the Facebook script in your website.
This step is explained in detail in the official documentation, where you just generate your own AppID then copy paste the script code (usually after the <body> tag.
Add a jQuery library for the next bit of code as explained in this answer.
The share dialog box script:
-
<script type="text/javascript">
$(document).ready(function(){
$('#share_button').click(function(e){
e.preventDefault();
FB.ui(
{
method: 'feed',
name: 'This is the content of the "name" field.',
link: 'Your-blog-link',
picture: ‘http://yourpicture-here’,
caption: 'yourCaption',
description: short-description-here
message: ''
});
});
});
</script>
More parameters can also be added to customize the button.
Lastly, add the image/element you want to be the share-button:
Something like: <img src = "share_button.png" id = "share_button">

Use feedburner email subscription without Popup

For my selfhosted Wordpress blog, i wish to add Feedburner email subscription form.
Embed code from feedburner site:
<form action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=[BLOGNAME]', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
My issue is, i dont want the popup window to show up. That thing is so 80's stuff.
Instead, is it possible to show the popup contents inline? Using JS or PHP or something?
Check out how div contents change over click here using JS: http://www.willmaster.com/library/web-development/replace-div-content.php
Would be great if something similar could be worked out.
I guess this is easy to do but i have limited knowledge on web designs and php/js/forms.
Thanks in advance.
PS: Please do not suggest plugins. I hate installing plugins unless absolutely necessary.
You can change target="popupwindow" to target="_self" or target="_blank", it can load in current page or go to a new page.

Addthis ads a hashtag and id to URL - how to remove it

In our CMS the developer added an "addthis.com" script which appends a hashtag and a tracking id to the browser address bar URL, for example http://www.site.com/about/#.UX6e2j7mK30
There is a solution how to get rid of this tracking but we are limited with CMS which only allows us to add javascripts to page header. The addthis script executes within page body and I need somehow to run the fix script after the default script has run. When I add the below script then the fix doesn't work. Is there any solution? Many thanks
<script type="text/javascript">
$(document).ready(function() {
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
});
</script>
Remove the $(document).ready and just declare addthis_config. Since this is just defining the configuration values for AddThis, there's no need to wait for the document to fully load. Because you're waiting for the document to load and then setting addthis_config, the AddThis code has already run and appended the addressbar tracking hash.

Fb.Share does not work

Till yesterday everything was working fine.
In my website's head there was
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
and links like
<a name="fb_share" share_url="http://mysite.com/url"></a>
were transformed to facebook share plugins.
But now there is a problem - i can't see count of shares in plugin. I sniffed requests a little and the error is:
fb_sharepro_render({"error_code":104,"error_msg":"Requires valid signature","request_args":[{"key":"v","value":"1.0"}
I did not change anything on website and problem still occurs. Any hints?
Edit (probably an answer):
This bug is described here: http://bugs.developers.facebook.net/show_bug.cgi?id=19471
Facebook team response:
Thanks for the report. We are looking into this.
We recommend to use the like button instead as we are going to deprecate the
share button soon. The like button provides you with the same functionality and
more ...
http://developers.facebook.com/docs/reference/plugins/like/
Also, works solution with request to http://graph.facebook.com/?ids=*.
For example, while issue is not fixed by facebook, you can use a little modified facebook share widget script, it use a graph.facebook.com instead of api.facebook.com/restserver.php.
You have to introduce access_token also as a parameter. Find what facebook says
GET /fql?q=SELECT+uid2+FROM+friend+WHERE+uid1=me()&access_token=...

Facebook Comment Plugin is not working with smarty template

The facebook comment plug in is not working with smarty template. The code I am using is given below
<div id="fb-root"></div> {literal}<script src="http://connect.facebook.net/en_US/all.js#appId=APP_ID&xfbml=1"></script>{/literal} <fb:comments width="425"></fb:comments>
Please check this and let me know if there is any solution for this
Thanks In Advance
Rose
The issue is most likely because of the order in which this template loads on the page. You are most likely going to need to manually initialize the XFBML on your page for the tag to render. This is probably beyond what a template engine is going to be able to do. You are going to need to call FB.init(xfbml:true); after the template has loaded on the page. Also, change the script reference to
<script src="http://connect.facebook.net/en_US/all.js"></script>
The initilization call should occur only after the above script is loaded.
<script>
FB.init({xfbml:true});
</script?