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

Forum

NC for Hire

So I made a change to my network this week that I think could be very beneficial to other creators.  I noticed that some of my forum posts have between 5k-7k views but not very many replies, so with a little investigation, i realized that these posts where ones with uploaded attachments such as manuals and guides.

I wrote some javascript to require non-members to be forced to sign up in order to download files from my surveyors network.

Here is the code, which must be placed inside your custom code section at the bottom under all of your other scripts.

<script>
x$('.attachments li a').click(function () {
if (x$('#xn_signout').html() != "Sign Out" || x$('#xn_signout').html() == null) {
x$(window.location).attr('href', 'http://yournetwork.com/main/authorization/signUp');
return false;
}
});
</script>

What happens when yo are not signed in and try to download an attachment is it automatically redirects members to the signup page.  Take a look at this post and try to download the attachment and you'll see what I mean.  Tell me what you think!

By the way my network just crossed the 8200 member mark this week!  Hoo-Ray!  I am very picky about my members...

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

Join Ning Creators Network

Email me when people reply –

Replies

    • NC for Hire

      Thank you "Where Women Blog".... if you need any help with your network, just give a shout!

  • NC for Hire

    Should also work with Ning 3.0 when the language editor is running at full speed...

  • NC for Hire

    TJ helped me catch a flaw in the code... should be fixed now.. thanks TJ

  • Hi everyone, I was trying this tip and put the code in my end of page custom code - but I'm still able to dowload attachments. Guess I'm doing something wrong. :/

    <script>
    x$('.attachments li a').click(function () {
    if (x$('#xn_signout').html() != "Sign Out" || x$('#xn_signout').html() == null) {
    x$(window.location).attr('href', 'http://www.community.collengworld.com/main/authorization/signUp');
    return false;
    }
    });
    </script>


    • this is what I use. But it will prompt to login on any page visit but still allows pages to be crawled by search engines unlike using your privacy settings.

       


      • hi David, did you attach something?
        • Yes, but it doesn't seem to recognize the code on the page. Let me try with backtick.

          ```

          <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
          <script type="text/javascript">
          x$(document).ready(function() {
          if (window.location.pathname != "/" && window.location.pathname != "/index.php") {
          if (navigator.userAgent.toLowerCase() == "googlebot"
          || navigator.userAgent.toLowerCase() == "googlebot-image"
          || navigator.userAgent.toLowerCase() == "googlebot-video"
          || navigator.userAgent.toLowerCase() == "yahoo slurp"
          || navigator.userAgent.toLowerCase() == "yahoo! slurp"
          || navigator.userAgent.toLowerCase() == "bingbot"
          || navigator.userAgent.toLowerCase() == "slurp"
          || navigator.userAgent.toLowerCase() == "msnbot") {
          //Do nothing. Open for search engines
          }
          else {
          var lsCookieValue = getCookie('xn_id_eflclassroom');
          if(lsCookieValue == '' || lsCookieValue == 'undefined' || lsCookieValue == null)
          {
          window.location="http://community.eflclassroom.com/main/authorization/signUp?" + "?target=" + window.location;
          }
          }
          }
          });
          function getCookie(name) {
          var value = "; " + document.cookie;
          var parts = value.split("; " + name + "=");
          if (parts.length == 2) return parts.pop().split(";").shift();
          }
          </script>

          ```

          • NC for Hire

            this tip was written 5 years ago... seems to still work fine on my site, but Ning has been having quite a few javascript bugs lately..

            • Thanks, i see. I'll try to figure out a way to make it work.

          • Oh thank you, anyway i'd like to leave the content still viewable, i would only prevent the download action, or link opening (eg. google drive folder) without being a member. 

This reply was deleted.

Search the Creators Network

Latest Activity

Kyryl_Ning_Support replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi John,
You shouldn't have, but I should admit that it will be easier for the management to look t…"
37 minutes ago
Beatriz Martín replied to Dan Porter's discussion Multiple Group Hubs
"thx, kos! :)"
41 minutes ago
Tony Rosa is now a member of Ning Creators Network
1 hour ago
Kos replied to Dan Porter's discussion Multiple Group Hubs
"Beatriz if you need something special designed beyond the ordinary, I would recommend you post your…"
9 hours ago
Garfield Archivist replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Thank you. I appreciate the response and understand you needed to discuss with developers.
I find i…"
9 hours ago
Beatriz Martín replied to Dan Porter's discussion Multiple Group Hubs
"Hello.
I would like to know how this feature is done or which creator could help me.
Thx!!"
15 hours ago
Bizz ( John ) replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Thanks Pat :-)
Yes it is a nice addition but I do wish a little more QA was done before releasing f…"
15 hours ago
Bizz ( John ) replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"I have re-uploaded this video so you can see it showing the green screen in the list page and also…"
16 hours ago
Bizz ( John ) replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Thanks for the reply Kyryl. I have addressed all the issues in a single post for you to look at her…"
16 hours ago
Danny Lynn replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
""
17 hours ago
Danny Lynn replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"Thank you ning team,  I Am not a owner at Media Center just member 4 years, i do link that page to…"
17 hours ago
Pat Howlett replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Great addition Ning Team and I appreciate Bizz John taking the time to jump in and assist in findin…"
18 hours ago
Kyryl_Ning_Support replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"Hi Daniel,
We do apologise for the inconveniences at this moment developers are working under the i…"
21 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi John,
Regarding the video resolution, after the video has been uploaded, all of them are convert…"
21 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"XDD"
22 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi there,
Sorry for delayed reply, it was necessary to take a hold of developers to find out the an…"
22 hours ago
Kyryl_Ning_Support replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi John,
About the video that had only green screen background instead of the video itself. we have…"
23 hours ago
Irvin Carrero, Alison Pert and Shanelle Reed-Keahi joined Ning Creators Network
yesterday
Ian replied to Ian's discussion Side Backgound Image keeps shrinking and orienting left & animated gif header isn't working
"And now our 'space invaders' top nav bar gif crapped out!  Here's the original:"
yesterday
More…