Tuesday, January 1, 2013

Insert smileys and Thanks button for SharePoint Discussion List


Some days ago, after I worked on my forum (sharepointvietnam.net) I found the Mod that is very useful. It called Thank Mod. If you read a topic or reply a post and it helped you somehow to solve a problem, you will say “Thank you” and on community or forum you may click on Thank button an you only can say thank for one time on the post.
SharePoint Discussion List has the functioning similar to forum of vBulletin or phpforum. However, SharePoint Discussion List just limited the functioning on creating the topic and other users can reply on the topic. To expand or plug into this list much more features it’s not easy and if you need it to be have fully features like others forum, let build a project then add the existed featured from my topic and from others on the internet. In my topic, just there are 2 small features: insert smileys and thank button, just ask Mr/Mss Google to get more functionalities.
Two features in this topic are here:

Please read carefully my topic before deploy or install:
  • Backup these files in HIVE\14\Templates\Layouts\XSL: main.xsl, thread.xsl, vwstyles.xsl and internal.xsl because these files will be replaced the original after installed. If this feature or solution is removed then these files will also be removed out of the folder. Now, just restore them from a backup folder.
  • After install/deploy, run the command iisreset and create the new discussion list to get the effected.
To insert smiley:
Click on the editor area then the contextual ribbon would appear and click on Insert tab


Click on Smileys button, the popup will show on top:

Click on the icons to pick-up one or more icons which would be inserted into the topic.
There is a thing you should pay attention for the upgrading in future: you could see 4 tabs on the popup window, that is because there are 4 emotion folders in Emotion Project folder. You could find them in HIVE\14\Features\EmotionProject

For now, think about how to install or remove one or more emotion categories and the answer is so easy, just create a folder as category and copy all emotion files to the folder. Then, re-open the popup window smileys it would be updated immediately.
Notice: do not click on the checkbox, just click on the icon, the checkbox will be changed the status automatically.
In addition, you can say thank to the owner of topic by click on Thanks button:

If you have never click on Thanks button for the post, you will see Thanks button and other people say thank to the owner of the post. Ater click Thanks button, your friendly display name will appear under the line and you could not say Thanks again for that post, and you also could not remove your thanks in the thanks list, so let pay more attention or think much more about the post to say Thanks or not. It may have a difference thought from Facebook like button, you can remove (unlike) a status if you have a difference mind.
Thanks button will only appear on both Flat view and Thread view. If you need the thanks button appear on your customize view, please add the code to your xsl file render:

In the project, I used the jQuery library and if there is any conflict with your product, please remove my jQuery library and used yours, that’s not important and work as well.
Good luck to you.

2 comments:

Anonymous said...

It's asking for permissions when accesing the website.

NSUT Hải Bánh Xèo said...

contact me via email to get the code. the website is stopped now.