Help with jQuery Mods and Hacks for your Ning Network!
NOTE: This is a way to allow members to ADD TAGS from a Drop Down List, On Ning.
--------------------------------------
I am working on a mod for Blogs that lets you assign a New Blog into one of several "Categories" that you can select from a drop-down list under the tags textbox.
Then you can go to the All Blogs or My Blogs pages and select one of those "Categories" from the drop down list which is to the right of the search box, and all blogs from that category will be displayed.
This work is in response to this post on Creators Forum:
http://creators.ning.com/forum/topics/ningwe-need-a-new-and-improved
Any comments, suggestions, questions - reply below! 
(Oh, By The Way! Signatures now appear in Original Forum Posts here, as well as in all comments and replies, see below!)
(Now works for Videos too!)
Best wishes!
"TJ"
'TJ' is the Owner of jQueryHelp.
Please Visit http://YouTubeStars.com - Thanks!

Tags: blog, blogs, categories, hack, jQuery, javascript, mod, tags, video, videos
Permalink Reply by TJ @ jQueryHelp on July 11, 2011 at 5:55pm There needs to be a first choice of [select tag].
Right now, the first choice, and the one that shows by default, is "About Me".
Since it is the first choice, there's no way to select it in the Tag drop down list.
I'll fix this soon! 
Edit: FIXED! 

Permalink Reply by Obsessedtwibrarian (OTB) on July 11, 2011 at 7:43pm
Permalink Reply by TJ @ jQueryHelp on July 12, 2011 at 2:48am
Well, the version I put out on Creators is free, that's the same one running here now. I might do one more upgrade for free to add the ability to set it to allow multiple tags/categories. If I have to spend a lot more time on it, I may decide to charge something, but I think its pretty much done and ready to use right now!
If you want to use it, grab the code I uploaded at Creators. I hope it helps you out! 
http://creators.ning.com/forum/topics/ningwe-need-a-new-and-improved
Obsessedtwibrarian (OTB) said:
Are you going to charge for this hack, TJ? Just curious!

Permalink Reply by TJ @ jQueryHelp on July 12, 2011 at 6:02am NEW Version - BlogTags1C.js
This version lets you add multiple tags when you are Adding a New Blog post.
I attached the js code to this reply. It is in a file named BlogTags1C.js
You can download it, open it in Notepad, and copy it into your Custom Code box, inside a script tag. You may want to change the options to make the drop down choices suit your site. Put it in the custom code box like this:
<script type="text/javascript">
THE CODE
</script>

Permalink Reply by Obsessedtwibrarian (OTB) on July 12, 2011 at 8:29am Gosh, you're going to hate me, TJ, but I'm not good at this stuff unless I have the code right there in front of my face and can copy and paste it where it goes. This Attachment (BlogTags1C.js) is that the code I'm supposed to grab?? It downloads to a file and won't let me look at it. I don't know how to work with js files.
Could you possibly give me some more detailed instructions? Sorry to be so high-maintenance. 
Permalink Reply by TJ @ jQueryHelp on July 13, 2011 at 2:51am
No problem, js files can be tricky to view! Here is the code. Just copy it and paste it into your Custom Code box - but I always recommend making a copy of what is currently in there, just in case anything goes wrong you can set it back to how it was if you keep a copy in a txt file. By the way, you can change the option values, they are what shows as choices in the drop down list. The ones in this code are from your post at Creators and are the ones I use here at the moment.
NOTE! There is a line near the end of the code that needs to be changed to point to the URL of whoever uses this code. Change this line:
window.location = 'http://jqueryhelp.ning.com/profiles/blog/list?tag=' + selTag;
Change the jqueryhelp.ning.com part to your Site's URL:
window.location = 'http://YOUR-URL/profiles/blog/list?tag=' + selTag;
<script type="text/javascript">
// BlogTags v1B - 7/11/11 - Adding a first choice of [Select Tag] to the Blog Tags List.
Obsessedtwibrarian (OTB) said:
Gosh, you're going to hate me, TJ, but I'm not good at this stuff unless I have the code right there in front of my face and can copy and paste it where it goes. This Attachment (BlogTags1C.js) is that the code I'm supposed to grab?? It downloads to a file and won't let me look at it. I don't know how to work with js files.
Could you possibly give me some more detailed instructions? Sorry to be so high-maintenance.

Permalink Reply by Obsessedtwibrarian (OTB) on July 13, 2011 at 9:41am Okay, I added this and it's working beautifully!! I LOVE it and it makes so much more sense that these idiotic tags I have now.
One thing I tested was a member posting a blog without tagging it. When I go in to add a tag, that drop down menu is missing. Is that expected? I had to manually type the tag in, but my browser gave me some choices to choose from.
I can't remember...can NC's edit other members' blog tags?? Our blogs aren't that active and I haven't had much experience messing with them. Seems to me I remember something about us not being able to edit their tags.
I'd like to see some kind of option to FORCE them to choose a tag before the blog will publish. Is there a way you could code it to do that? Maybe a pop up message? Idk...maybe I'm asking for the moon. LOL I appreciate what you've done with this soooooooooo much and I'm going to post my success on the Creator's thread. 
By the way...I noticed we don't have a "sobbing/crying smiley". LOL Sometimes we just feel like crying and there's no smiley to express that. I didn't know if you had the ability to add smileys to those. 
Permalink Reply by Obsessedtwibrarian (OTB) on July 13, 2011 at 9:55am Okay, I found a glitch. LOL
When I click on one of the tags from the drop down, I get directed to HERE! As much as I love you TJ, I want to keep my members on my site!
Was that an accidental redirect?
Anyway, when they click on the tags in the right-hand column (Blog Topics by Tags) they're taken to the blogs on MY site. But if they click on a tag category from the drop down menu, they're taken to YOUR site. Can you fix that? 
Permalink Reply by TJ @ jQueryHelp on July 13, 2011 at 2:49pm
Thanks for finding that! Yeah its easy to fix. Look in the code and down near the bottom is a line:
window.location = 'http://jqueryhelp.ning.com/profiles/blog/list?tag=' + selTag;
Change the http://jqueryhelp.ning.com part to your network's URL, leave the rest of the line the same.
I'll reply to your other reply later!
Obsessedtwibrarian (OTB) said:
Okay, I found a glitch. LOL
When I click on one of the tags from the drop down, I get directed to HERE! As much as I love you TJ, I want to keep my members on my site!
Was that an accidental redirect?
Anyway, when they click on the tags in the right-hand column (Blog Topics by Tags) they're taken to the blogs on MY site. But if they click on a tag category from the drop down menu, they're taken to YOUR site. Can you fix that?

Permalink Reply by Obsessedtwibrarian (OTB) on July 13, 2011 at 3:18pm 

Permalink Reply by TJ @ jQueryHelp on July 13, 2011 at 11:27pm
Answers! 
If you select "Edit Blog Posts" from Options, then click "edit" next to the post you want to edit, the mod does not appear. I can probably make it so that it does appear, when I get a chance. 
An NC, and probably the original poster, can choose "Edit Your Tags" from Options - but that is done by Ning using javascript, and I can't change their javascript with my own javascript, as far as I know. So no drop down list there, any time soon!
I could hide the "Publish Post" button and only show it once a tag is selected from the list. Some instruction somewhere can be added to let members know that they have to choose a tag from the list before the post can be published. Again, I can add this once I get a chance. 
If you find a good cry smiley that is free to use, let me know and I can add it to our collection. 
Obsessedtwibrarian (OTB) said:
Okay, I added this and it's working beautifully!! I LOVE it and it makes so much more sense that these idiotic tags I have now.
One thing I tested was a member posting a blog without tagging it. When I go in to add a tag, that drop down menu is missing. Is that expected? I had to manually type the tag in, but my browser gave me some choices to choose from.
I can't remember...can NC's edit other members' blog tags?? Our blogs aren't that active and I haven't had much experience messing with them. Seems to me I remember something about us not being able to edit their tags.
I'd like to see some kind of option to FORCE them to choose a tag before the blog will publish. Is there a way you could code it to do that? Maybe a pop up message? Idk...maybe I'm asking for the moon. LOL I appreciate what you've done with this soooooooooo much and I'm going to post my success on the Creator's thread.
By the way...I noticed we don't have a "sobbing/crying smiley". LOL Sometimes we just feel like crying and there's no smiley to express that. I didn't know if you had the ability to add smileys to those.

Permalink Reply by TJ @ jQueryHelp on July 14, 2011 at 4:42am NOTE! There is a line near the end of the code that needs to be changed to point to the URL of whoever uses this code. Change this line:
window.location = 'http://jqueryhelp.ning.com/video/video/listTagged?tag=' + selTag;
Change the jqueryhelp.ning.com part to your Site's URL:
window.location = 'http://YOUR-URL/video/video/listTagged?tag=' + selTag;
<script type="text/javascript">
// VideoTags v1C - 7/11/11 - Based on BlogTags1C.js.
// VideoTags v1A - 7/10/11 - Use a drop down list to Enter Video Tags and Search for Videos.
// For more information, visit http://jQueryHelp.ning.com/forum/topics/blog-hack-categories or email TJ at TJ@BKServ.com
var gVT_Status = ' VideoTags Status...'; // Global VideoTags status message.
// Pre-determined Video Tags List:
var gVT_Options = '<option>[Select Tag]</option><option>Music</option><option>Comedy</option><option>Vlog</option><option>Animals</option><option>Tutorial</option>';
var gVT_Location = window.location.href + '';
// Add Selection from the Pre-determined Video Tags List to Tags:
if (gVT_Location.indexOf('video/video/editMultiple') > 0) {
var TJVideoTagsList = '<div id="TJVideoTagsWrapper"><select id="TJVideoTags">' + gVT_Options + '</select></div>';
x$("input#video0_tags").parent().append(TJVideoTagsList);
x$("#TJVideoTags").change(function() {
var selTag = x$("#TJVideoTags option:selected").text() + '';
if (selTag != '[Select Tag]') {
// If tag has a space in it, it is a multi word tag and must be inside quotes.
if (selTag.indexOf(' ') > -1) selTag = '"' + selTag + '"';
var current_val = x$("input#video0_tags").val();
if (current_val.length > 0) current_val += ", " + selTag; else current_val = selTag;
x$("input#video0_tags").val(current_val);
}
});
}
// Search for Videos with tag equal to the Selection from the Pre-determined Video Tags List:
if (gVT_Location.indexOf('/video') > 0) {
var TJVideoTagsSearchList = '<span id="TJVideoTagsSearchWrapper"><select id="TJVideoTagsSearch">' + gVT_Options + '</select></span>';
x$("a.xg_icon-search").after(' ' + TJVideoTagsSearchList);
x$("#TJVideoTagsSearch").change(function() {
var selTag = x$("#TJVideoTagsSearch option:selected").text();
if (selTag != '[Select Tag]') {
window.location = 'http://jqueryhelp.ning.com/video/video/listTagged?tag=' + selTag;
}
});
}
</script>

© 2013 Created by TJ @ jQueryHelp.