Actually the vote/digg feature, which allows registered users to vote for your blog posts, was supported from Ultimate DNN Blog Module – SunBlogNuke v4.0 but it is not active in default. It requires some customizations to integrate with. Today we would like to share you how to apply the awesome feature into your dnn blog.
<%@ Register TagPrefix="uc" TagName="Vote" Src="~/DesktopModules/SunBlog/Shared/Vote.ascx" %> <uc:Vote ID="widgetVote" runat="server" EnableViewState="false"/>
/* DIGG */ .diggbox{position:relative;height:100px;width:60px;background-color:#fff;} .vote{ background:url(images/up_down.png) no-repeat scroll 0 -30px #CCCCCC; border:0 none; height:30px; left:0; position:absolute; text-indent:-9999px; width:60px; cursor:pointer; } .diggit{top:0;} .buryit{background-position:0 -60px;bottom:0;} .diggbox .diggit:hover, .diggbox .diggit:focus {background-color:#8fd910; background-position:0 0;} .diggbox .buryit:hover, .diggbox .buryit:focus {background-color:#d52810; background-position:0 -90px;} .diggbox .result{ display:block; padding-top:30px; font:bold 25px/40px 'Myriad Pro',sans-serif; letter-spacing:-0.05em; text-align:center; } span.burynum,span.diggnum { color:#075DB3; display:block; font-size:12px; text-align:center; width:40px; } .votecount{display:none;}
That is all, the vote feature will work like a charm in the detail view of your blog posts like the screenshot below:
In the basic sample, we knew that the vote control is placed in the folder SunBlog/Shared and is named 'Vote.ascx'. Now you may like to develop a customized vote widget like the one below and is applied in our team blog . How to get start? Okey, let us go through the magic process:
<%@ Control Language="vb" AutoEventWireup="false" Inherits="SunBlogNuke.Toolkit.UserControls.Vote" %> <div id="digg_<%=Entry.EntryID%>" class="diggbox"> <div id="do_you_like"> </div> <a class="vote diggit" title="Thumb Up" rel="nofollow"> </a> <a class="vote buryit" title="Thumb Down" rel="nofollow"> </a> <div id="votes_count"> <strong class="diggnum votecount"><%=Entry.DiggNum%></strong> Thumbs Up, <strong class="burynum votecount"><%=Entry.BuryNum%></strong> Thumbs Down </div> <br /> <span class="diggtip"></span> <span class="diggedType" style="display: none;"><%=VerifyDigg()%></span> </div>
<%@ Register TagPrefix="uc" TagName="Vote" Src="~/DesktopModules/SunBlog/Themes/Customized/Vote.ascx" %> <uc:Vote ID="widgetVote" runat="server" EnableViewState="false"/>
/* VOTE */ #feedbackC{border-top:1px dotted #666666;border-bottom:1px dotted #666666;padding: 14px 0;} .diggbox{ /*float: left; width: 344px;*/ margin-right: 10px; padding-left: 16px; } #do_you_like { background: url(images/vote.png) no-repeat scroll -18px -14px transparent; height: 23px; margin: 0 0 2px 2px; width: 154px; } a.vote { background:transparent url(images/vote.png) no-repeat scroll 0 0; display: block; float: left; height: 32px; width: 58px; } a.vote:hover{text-decoration: none;} a.diggit { background-position: -420px -60px; margin-left: -6px; margin-right: 3px; } a.buryit { background-position: -420px -10px; margin-right: 15px; } a.diggit:hover {background-position: -345px -60px;} a.buryit:hover {background-position: -345px -10px;} #votes_count{color: #424242;margin-top: 10px;}
Code Explanation: Basically, in the develop process you just need to know well those required elements as follows:
Hi Baldwin, is there a way to implement this vote feature without requiring the user to login? Thanks.
Hi Kelly, Now our blogging module doesn't support vote without authenticated, which means that the anonymous users can not vote post. We may support it in future. BTW, the anonymous users are able to use the rating feature. Hope it makes sense. Kind regards Baldwin
Senior developer for dnn solution & founder of ultimate dnn blog module - SunBlogNuke, which is the best publishing tool for DotNetNuke (DNN) websites, with a focus on simplicity, ease of extensibility, web standards and usability. It includes a great suite of modules for blogging on your DNN site.
Re: DNN7 Blog Integrated with ModuleSearchBase
B- please FIX the bugs...driving me nuts!!!! Error: Edit blog entry is currently unavailable. DotNet...
-- kkuhns
Re: Fighting DNN Bugs Ⅱ: Why Can't Remove Google Analytics
Thanks a lot for your reference and it should be helpful for community guys. :)
-- Baldwin
please ensure you log any bugs to http://support.dnnsoftware.com - i searched and couldnt see this one...
-- Cathal
Re: Build DNN Rotator with GalleryPlus
How do you place the gallery within a blog entry. I saw in the below demo that a token was used ([SL...
-- Mary
Re: Enhance DNN Article Footers with Author Profiles
Please make sure that the bio field of this current host user is visual to public(you should find it...
I'm trying to get the bio to show up for a host user but it comes up blank. Can you replicate this issue...
-- Lucas
Re: [Kudos]DotNetNuke Blog Module In Depth Review
Yes, the latest package is absolutely compatible well with DNN7 and the performance was enhanced a lot...
Is it compatible with DNN 7
-- swayam
Re: SunBlogNuke 6.0 Technology Preview
No, actually the v6.0 had been available to downlaod for upgrade - http://www.sunblognuke.com/blog/entryid...
this article says that version 6.0 is not for production use. the article is from may 2013... is sun...
-- pekai
The opinions expressed here in are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2009 - 2024