Social Web Directory :: Social Network Directory :: Ning Tips and Ning Support
Warning: I don't think this will return correct results on a Private site, since Google has to crawl your site for the search. It's doubtful.
How to replace your NingBar Search with a custom Google Search.
Prepare a Page for your Google Search results.
<div id="cse-search-results"></div>
<script type="text/javascript">
var googleSearchIframeName = "cse-search-results"; var googleSearchFormName = "cse-search-box"; var googleSearchFrameWidth = 600; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse";
</script>
<script src="http://www.google.com/afsonline/show_afs_search.js" type="text/javascript"></script>
Create Your Custom Google Search Code, go here:
http://www.google.com/cse/
Edit/Add Special Script to Custom Code Box:
<!-- Replace NingBar Search with Google Search -->
<script type="text/javascript">
xg.addOnRequire(function() {
document.getElementById('xn_bar_menu_search').action = 'http://yoursite.ning.com/page/search-results';
var cx = document.createElement('input');
cx.setAttribute('name', 'cx');
cx.setAttribute('value', '001999399379599247143:kvoos9-d1w4');
cx.setAttribute('type', 'hidden');
document.getElementById('xn_bar_menu_search').appendChild(cx);
var ie = document.createElement('input');
ie.setAttribute('name', 'ie');
ie.setAttribute('type', 'hidden');
ie.setAttribute('value', 'UTF-8');
document.getElementById('xn_bar_menu_search').appendChild(ie);
var cof = document.createElement('input');
cof.setAttribute('name', 'cof');
cof.setAttribute('type', 'hidden');
cof.setAttribute('value', 'FORID:11;NB:1');
document.getElementById('xn_bar_menu_search').appendChild(cof);
var sa = document.createElement('input');
sa.setAttribute('name', 'sa');
sa.setAttribute('type', 'hidden');
sa.setAttribute('value', 'Search');
document.getElementById('xn_bar_menu_search').appendChild(sa);
});
</script>
NOT ENOUGH ROOM IN CUSTOM CODE BOX?
I had this problem, too.
Instructions on how to move "Custom Code Box" code above, to a js file:
Credits:
Thank you to TJ of http://jqueryhelp.ning.com/, and Ning Creators. TJ reviewed and helped test this code. The original js code came from Ning Creators.
Enjoy!
Jen
Tags:
Finally it works for me. Thanks Jen.
thanks for the tip
1 question : Adsense rules make it clear that we should not modify codes - doesnt this go against this rule? as we are not putting the code exactly as given by adsense
thanks
Hi Joe,
Of course I can't make any guarantees when it come to Google. But, I definitely don't think this code affects any adsense rules. You're just replacing Ning's search with a custom Google Search. Ning Creators uses this as well.
Happy Holidays,
Jen
Welcome to
JenSocial: Social Web Directory and Ning Tips
Posted by JenSocial on May 7, 2018 at 8:35pm 9 Comments 1 Favorite
Posted by JenSocial on January 6, 2017 at 4:00pm 10 Comments 1 Favorite
Posted by JenSocial on October 22, 2016 at 1:05am 0 Comments 0 Favorites
Posted by JenSocial on September 17, 2016 at 12:00am 26 Comments 1 Favorite
Posted by JenSocial on August 31, 2016 at 3:30pm 13 Comments 0 Favorites
Ning 3.0 Tip - Add Buttons/Links Below Status Update (Quick Links to Add Photos, Posts, Discussions)
Started by Ning.spruz.com in Ning 3.0 Feb 19. 0 Replies 0 Favorites
Started by Evelina in Ning 3.0 Aug 30, 2023. 0 Replies 0 Favorites
Started by Evelina in Ning 3.0 Aug 27, 2023. 0 Replies 0 Favorites
© 2024 Created by JenSocial. Powered by
© Copyright JenSocial.