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

Join Ning Creators Social 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.
 

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

Thisisbully replied to Brandyn Shepherd's discussion
NING - Mobile App!
"AppgyserHere"
2 hours ago
Brandyn Shepherd replied to Brandyn Shepherd's discussion
NING - Mobile App!
"How do you do that? Know of any apps that make it easy? Will my applet be able to exists on sites t…"
2 hours ago
Ceddy J replied to Brandyn Shepherd's discussion
NING - Mobile App!
"I understand Brandyn, which is why you do an applet instead which gives a conveinent icon to click…"
4 hours ago
Brandyn Shepherd replied to Brandyn Shepherd's discussion
NING - Mobile App!
"Some people would rather click an app icon than open a browser and open up a website..."
6 hours ago
Ning via Facebook

So, you`ve created your content for efficient outreach. Where are you going to place it? How to…

Thiago Santos de Moraes replied to Brandyn Shepherd's discussion
NING - Mobile App!
"I think that to the extent that communities are responsive this is unnecessary."
8 hours ago
Ning via Facebook

Your Instagram is not just about photos and mentioning people. Let it bring real money for you!…

Fabricio Giugni replied to Fabricio Giugni's discussion
Please limit the Photo upload per day
"This would be a hard solution. We need also some thing to make the pictures small when someone uplo…"
12 hours ago
Annabel Gregory replied to Annabel Gregory's discussion
Failure to create links or embed images
"Ok, thanks.
 "
12 hours ago
Kyryl_Ning_Support replied to Fabricio Giugni's discussion
Please limit the Photo upload per day
"Hi Tom,
As you are able to set content approval and also you can remove the photos uploaded by the…"
15 hours ago
Kyryl_Ning_Support replied to Annabel Gregory's discussion
Failure to create links or embed images
"Hi Annabel,
Yep, sorry it seems that the new text editor button to embed the photo etc. provoking t…"
15 hours ago
Elizaveta, Laura Beatriz Alves Dornel, Denise Lopes and 5 more joined Ning Creators Social Network
17 hours ago
More…

Meanwhile, you can check our social media channels