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

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 Social Network to add comments!

Join Ning Creators Social Network

Votes: 0
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.
 

Some interesting articles related to community management, digital marketing etc. could be found in our digest. Don't hesitate to leave a feedback so we would know that we should continue :-)

Latest Activity

Aase Lillian and ⚡JFarrow⌁ are now friends
NC for Hire
2 minutes ago
⚡JFarrow⌁ updated their profile photo
8 hours ago
⚡JFarrow⌁ replied to Aase Lillian's discussion
Community - activity page
"Yes you can add emojis to your community pretty much anywhere you like.
If you need some help…"
8 hours ago
Aase Lillian updated their profile
8 hours ago
Aase Lillian posted a discussion
Hi all. Is it possible to add emojis to the community? I also wish the activity page to include…
8 hours ago
Donna MacShoe updated their profile photo
Mar 6
Adul Rodri is now friends with ANGE.L LUAR and Margarida Maria Madruga
Feb 14
Shweta Sharma updated their profile
Jan 26
catherine martin updated their profile
Jan 16
Donna MacShoe updated their profile photo
Jan 15
⚡JFarrow⌁ replied to ⚡JFarrow⌁'s discussion
For Creators and Admins: Easy Way to Create a Community Status Report
"This is still one of the best posts for RSS feeds"
Jan 8
brahim jounh updated their profile
Dec 28, 2023
More…

Meanwhile, you can check our social media channels