In Russia, there are some very popular social networks, which, unfortunately, not yet integrated into the Ning. It is inconvenient not only for Russians, because Ning offers integration only with Facebook and Twitter. However, there are public services that allow you to share the contents of your site, for example, Addthis.сom, addtoany.com,sharethis.com With these services, you can share your content on dozens of other social networks.

I wanted to add into my Ning community the button, provided by russian service "Yandex.ru", but this applies to other services. They provide their buttons in the form of code, such as:

<script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script>
<div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="button" data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir,lj,moikrug"></div>

The script must be, in theory, between the tags <head> and </ head>, but we can only insert it into the block "Analitics". Another problem is more complicated: how to insert a div-container in the right location on the page? Of course, manual insertion is not an option.

I'm not a great expert in JavaScript, but I was able to write a little script that can be placed in the Analitics block, whichinserts the "Share"-button on the pages of your community. This script replaces the usual Ning buttons, located in the element <p class="share-links clear">, by the new button.

Here is my script:

<script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script>
<script type="text/javascript">
var vsep=document.getElementsByTagName("p");
for (var count = 0; count < vsep.length; count++)
{
if (vsep[count].className=="share-links clear") {  vsep[count].innerHTML='<div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="button" data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir,lj,moikrug"></div>'; break;
}
}

</script>

The first line is the line of the script, which should be between the tags <head> and </ head>. Because the div-container is inserted after it, it does not matter that it is in the foot of the page. The second script searches for the p-element of the class "share-links clear" and replaces its content. In this case, howeverthe original "Share"-buttonof Ning is lost, but the thing is worth the effort. At least as a temporary solution.

Views: 159

Reply to This

Replies to This Discussion

nice

In my network I use only AddThis because my members interact much more by Orkut and by Tumblr than by Facebook or Twitter.

RSS

Latest Activity

Kos replied to SweetPotato's discussion 'Simple, Responsive Slider for Ning 3.0'
"Hey SP is your slide still running alright?  Came back from dinner and saw this.  idk if…"
1 hour ago
FedMedic replied to soaringeagle's discussion '3.0 feature request'
"+1"
3 hours ago
Kos replied to John Bizley's discussion 'File Manager NO DELETION option anymore ? Plus can you expand the file name size box.' in the group The Sandbox
"It's a glitch on Ning's end; plain and simple"
4 hours ago
John Bizley replied to John Bizley's discussion 'File Manager NO DELETION option anymore ? Plus can you expand the file name size box.' in the group The Sandbox
"Thanks Riccardo, it took a bit of moving the mouse about to find it but my mouse does change to the…"
4 hours ago
Riccardo Rossini replied to John Bizley's discussion 'File Manager NO DELETION option anymore ? Plus can you expand the file name size box.' in the group The Sandbox
"John, actually the button is only hidden, more or less you'll find it here your pointer will…"
4 hours ago
Kos replied to John Bizley's discussion 'File Manager NO DELETION option anymore ? Plus can you expand the file name size box.' in the group The Sandbox
"Even a photo preview would be wonderful so we're certain we're selecting the right…"
5 hours ago
Jordon McGee (Jords) replied to soaringeagle's discussion '3.0 feature request'
"+1"
6 hours ago

NC for Hire
JFarrow replied to JFarrow's discussion 'Become a Youtube Master with These 4 Tricks'
"apparently ning strips that.."
6 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service