Current status of the Ning Platform is always available on the Ning Status Blog.

Move follow links

 

This script moves the "follow" links to the top of the page and make them more noticeable. Try them. Post screenshots of them in use. Give me feedback and tell me about bugs, and follow this blog for updates. The latest version will always be in this description.

 

 

Set your options in the script where indicated.

Add this script code to your "custom code" as the LAST thing.

 

<script type="text/javascript">
/* chris's "move the follow link" code v0.9.2 *//*all options*/
/* latest version https://creators.ning.com/profiles/blogs/move-follow-links */
/* choose your options here */

/* Include extra text? Choices: "yes", "no" */
var c_xtra_txt="yes";

/* If it's too long to fit do what? Choices: "down", "shrink" */
var c_too_long="shrink";

/* If it's forced down, align it left or right? Choices: "left", "right" */
var c_align="right"; 

if (typeof(x$)!="undefined") {function c_move_follow_link() {var c_follow_link= x$('.xg_sprite.xg_sprite-follow-add, .xg_sprite.xg_sprite-follow-remove');if (c_follow_link.length){if (x$(c_follow_link[0]).attr('_removeurl').indexOf('stopFollowingMembership') > -1) {var c_new_follow_link=c_follow_link[1];} else {var c_new_follow_link=c_follow_link[0];}var c_follow_span=x$(c_new_follow_link).parent().children()[1];if (c_xtra_txt=="no") {var c_span_style="display:none;"; } else { var c_span_style="font-size:0.8em;font-weight:400;";}var c_new_follow_li='<li id="newFollowLi" title="'+ c_follow_span.innerHTML+'" class="right xg_lightborder navbutton" style="list-style:none;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" onmouseover="this.title=x$(\'#followSpan\').text();"><span id="followSpan" style="'+c_span_style+'"></span></li>';if(x$('.navigation.easyclear').length){x$(c_new_follow_li).appendTo('.navigation.easyclear');var cnfli_in_place = x$('#newFollowLi');var e_top=cnfli_in_place.offset().top;var c_prev_height=cnfli_in_place.prev().height();x$('#followSpan').html(c_follow_span.innerHTML);cnfli_in_place.prepend(c_new_follow_link);if (cnfli_in_place.prev().hasClass('right') && (cnfli_in_place.height() > c_prev_height || cnfli_in_place.offset().top != e_top)) {if (c_too_long=="down") {cnfli_in_place.height(c_prev_height);cnfli_in_place.css({'white-space':'nowrap'});cnfli_in_place.width('auto');if (c_align=="left") {cnfli_in_place.before('<p><br /></p>');cnfli_in_place.removeClass('right');cnfli_in_place.addClass('left');} else {cnfli_in_place.before('<p>&nbsp;</p><p>&nbsp;</p>');}} else {cnfli_in_place.height(c_prev_height);var safetyctr=0;while (safetyctr < 15 && cnfli_in_place.offset().top > e_top) {safetyctr++;cnfli_in_place.width(cnfli_in_place.width()-30);}}} }else{x$(c_new_follow_li).appendTo('.xg_module.module_searchbar');var cnfli_in_place = x$('#newFollowLi');cnfli_in_place.prepend(c_new_follow_link);if (c_align=="left") {cnfli_in_place.removeClass('right');cnfli_in_place.addClass('left');cnfli_in_place.css({'margin': '5px 0px !important'});}}x$(c_follow_span).html('(follow at <a href="#">top</a>)');}}x$().ready(function() {setTimeout('c_move_follow_link();', 500);} );}</script>

 

 

 

If you use this script, do the right thing... Donate towards my web hosting bill!

 

 

This will not create "follow" links where there aren't any (blogs, notes etc.). All options *should* now work in Firefox, Safari, Chrome and IE8, but I haven't tested thoroughly - that's your job!

 

Known issues:

  • When there's no "follow" link on the page to start with, this script will not create one. It's not possible. I've noticed that sometimes pages that should have them load without them. Nothing I can do about that, except file a ticket with Ning. If you think you should see a link at the top but don't, check to see if there's one at the bottom. If there is, then this script has failed to move it. If there are no follow links anywhere on the page then it's nothing to do with this script. It moves follow links. It doesn't create or delete them.
  • There are no "follow" links to be moved on NotesBlog lists pages, The All Blogs page, or on Group Discussion pages if you're not a member of that group. This script will not create them. Try removing this code. Do you see a follow link? If not, then this script won't do anything on that page. There has to already be a "follow" link there to be moved.
  • Firefox doesn't support the css ellipsis ("...") as in "email me whe..." so the text runs right to the edge of the button if you're using "shrink". This does work in safari, chrome and also in IE8, oddly.
  • If a button is clicked and it grows, it may move on the page. Being worked on.

 

 

Changelog:

16 jul 11: v0.9.2 fixed for firefox.

15 Jul 11: v:0.9 multiple options in one script. added align left option. fixed group bug.

10 jul 11: v0.7 "Title" now updates. In navigationeasyclear by default now. Created two versions.

E-mail me when people leave their comments –

You need to be a member of Ning Creators Social Network to add comments!

Join Ning Creators Social Network

Comments

  • Hi Chris. Would it be easy to leave the Follow in the bottom (exactly where it was) but display it as button? I mean the same format of the +ADD and OPTION buttons.

     

    I figured out that the only place the follow button is useful on the top is in the forum and forum categories. but I don't need it on the rest. Is there a way to display it on the top only on forum categories?

     

    Also, Could you move in the same way the " <- Back To *Group* Discussions? "  I'd love that to be on the top..

     

    Thank you. I appreciate your help.

     

  •  

    Good stuff!

    I was just replying to your previous comments about it vanishing in html mode. I was saying there shouldn't be html / non-html sides to the custom code box. You had me mighty confused...! You are adding it to http://atheistuniverse.net/main/admin/tracking aren't you? Do you have a regular text box there, or do you have the text editor with buttons etc?

    Let me know if it works where you expect it, and any requests...

     

  • Chris, you are right.

    I was missing two var statement.

    Duh!.

     

    It now works fine. Thanks for taking the time.

  • This text editor is really getting on my wick. It's arbitrarily removed newlines!
  • Atheist, I've just had a peek at your network. You need to use the whole code, including the option settings. You have to set them to something. Otherwise it will fail. Use everything in the box. Looks like the formatting got a bit screwed up in the reply above, try copying it from the blogpost itself.

     

     

  • I should add that V0.9.2 does not work in any browser, and even if I set var c_xtra_txt="yes" no button shows up.
  • The latest version worked for me... all good. thank you for this update
  • Well, I tried v0.9.2 and it doesn't work. More, the FOLLOW buttons have disappeared altogether.

    And I did not (as I though I had done yesterday) back-up my Custom Code =(.

    As a result, I cannot roll-back to an earlier version of the script that worked.

  • Ok, try this version. I'll update the original blog too, but as it may not be approved immediately I've included it here so hopefully you get it in an email in the meantime.

     

    Known issues:

    When there's no "follow" link on the page to start with, this script won't create one. It's not possible. I've noticed that sometimes pages that should have them load without them. Nothing I can do about that, except file a ticket with Ning. If you think you should see a link at the top but don't, check to see if there's one at the bottom. If there is, then this script has failed to move it. If there are no follow links anywhere on the page then it's nothing to do with this script. It moves follow links. It doesn't create or delete them.

    There are no "follow" links to be moved on NotesBlog lists pages, The All Blogs page, or on Group Discussion pages if you're not a member of that group. This script will not create them. Try removing this code. Do you see a follow link? If not, then this script won't do anything on that page. There has to already be a "follow" link there to be moved.

    Firefox doesn't support the css ellipsis ("...") as in "email me whe..." so the text runs right to the edge of the button if you're using "shrink". This does work in safari, chrome and also in IE8, oddly.

    If a button is clicked and it grows, it may move on the page. Being worked on.

     

    Fixed:

    All options should now work in Firefox, Safari, Chrome and IE8. Haven't tested thoroughly - that's your job!

    The "follow comments" link is now always picked on group pages.

     

     


     

    <script type="text/javascript">/* chris's "move the follow link" code v0.9.2 *//*all options*//* latest version https://creators.ning.com/profiles/blogs/move-follow-links */
    /* choose your options here */

    /* Include extra text? Choices: "yes", "no" */var c_xtra_txt="yes";

    /* If it's too long to fit do what? Choices: "down", "shrink" */var c_too_long="shrink";

    /* If it's forced down, align it left or right? Choices: "left", "right" */var c_align="right"; 

    if (typeof(x$)!="undefined") {function c_move_follow_link() {var c_follow_link= x$('.xg_sprite.xg_sprite-follow-add, .xg_sprite.xg_sprite-follow-remove');if (c_follow_link.length){if (x$(c_follow_link[0]).attr('_removeurl').indexOf('stopFollowingMembership') > -1) {var c_new_follow_link=c_follow_link[1];} else {var c_new_follow_link=c_follow_link[0];}var c_follow_span=x$(c_new_follow_link).parent().children()[1];if (c_xtra_txt=="no") {var c_span_style="display:none;"; } else { var c_span_style="font-size:0.8em;font-weight:400;";}var c_new_follow_li='<li id="newFollowLi" title="'+ c_follow_span.innerHTML+'" class="right xg_lightborder navbutton" style="list-style:none;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" onmouseover="this.title=x$(\'#followSpan\').text();"><span id="followSpan" style="'+c_span_style+'"></span></li>';if(x$('.navigation.easyclear').length){x$(c_new_follow_li).appendTo('.navigation.easyclear');var cnfli_in_place = x$('#newFollowLi');var e_top=cnfli_in_place.offset().top;var c_prev_height=cnfli_in_place.prev().height();x$('#followSpan').html(c_follow_span.innerHTML);cnfli_in_place.prepend(c_new_follow_link);if (cnfli_in_place.prev().hasClass('right') && (cnfli_in_place.height() > c_prev_height || cnfli_in_place

  • Thanks Spyro. Looks like FF is being a little bitch, I'll come back with an update when I've figured it out.

     

    I'll think about exceptions, I can see how that would be useful, but it might make it unwieldy.

This reply was deleted.

Meanwhile, you can check our social media channels