Sugarpapz1 [Share] code Quick Vote ko switch Sun Dec 30, 2012 12:46 pm
- Member
First topic message reminder:
Demo: How to do it:
Title: Vote not redirect
Placement: In the topics
Javascript Code *:
Advantages: Quick Vote, do not move trang.Dem Number immediately Cons: no Dislike button |
Step 1: Go viewtopic_body
find:
- Code:
[color=#161514][font=monospace]<! - BEGIN switch_vote_active -> [/font][/color]
[color=#161514][font=monospace] <div class="vote gensmall"> [/font][/color]
[color=#161514][font=monospace] <! - BEGIN switch_vote -> [/font][/color]
[color=#161514][font=monospace] <div class="vote-button"> <a href = "{postrow.displayed.switch_vote_active.switch_vote . U_VOTE_PLUS} "> + </ a> </ div> [/font][/color]
[color=#161514][font=monospace] <! - END switch_vote -> <! - BEGIN switch_bar -> <div class = "vote-bar" title = "{postrow.displayed.switch_vote_active . L_VOTE_TITLE} "> <! - BEGIN switch_vote_plus -> <div class = "vote-bar-plus" END switch_vote_plus -> <! - BEGIN switch_vote_minus -> <div class = "vote-bar-minus" END switch_vote_minus -> </ div> <! - END switch_bar -> <! - BEGIN switch_no_bar -> <div title = "{postrow.displayed.switch_vote_active.L_VOTE_TITLE}" class = "vote-no-bar "> ---- </ div> <! - END switch_no_bar -> <! - BEGIN switch_vote -> <div class="vote-button"> <a href = "{postrow.displayed.switch_vote_active. switch_vote.U_VOTE_MINUS} "> - </ a> </ div> <! - END switch_vote -> </ div> <! - END switch_vote_active ->[/font][/color]
Delete and search
- Code:
[color=#161514][font=monospace]<div class="post-options">[/font][/color]
add this code under it
- Code:
[color=#161514][font=monospace] <div class="votene" style=" float: left;display:none; text-align: left; width: 20em; margin-left: 20px;"> [/font][/color]
[color=#161514][font=monospace] <! - BEGIN switch_vote_active -> <table width = " 170px "border =" 0 "cellspacing =" 0 "cellpadding =" 0 "> <tr valign="MIDDLE"> <iframe name="vote{postrow.displayed.U_POST_ID}" style="display:none"> </ iframe> <td style="padding-left:5px" valign="middle" nowrap="nowrap" class="genmed gensmall"> <div class="vote vote-button"> <! - BEGIN switch_vote -> <a target="vote{postrow.displayed.U_POST_ID}" href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}" alt="plus" class="plus giet"> <img src = "http:// i43.servimg.com/u/f43/16/03/04/56/like-f10.png "/> Like </ a> <! - END switch_vote -> </ div> </ td> <td style = "text-align: center; width: 90px; height: 20px! important;" class = "smallfont"> <! - BEGIN switch_no_bar -> <div width = "90px" style = "position: relative;" class = "votesta"> <span class="dialog"> </ span> <span class="dosat vote{postrow.displayed.U_POST_ID}" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}"> <script </ Span> </ div> <! - END switch_no_bar -> <! - BEGIN switch_bar -> <div width="90px" style="position: relative;" class="votesta"> <span class = "dialog"> </ span> <span class="dosat vote{postrow.displayed.U_POST_ID}" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}"> <script </ Span> </ div> <! - END switch_bar -> </ td> </ tr> </ table> <! - END switch_vote_active -> </ div>[/font][/color]
Step 2: In Css add this to the
- Code:
[color=#161514][font=monospace] . Dialog { [/font][/color]
[color=#161514][font=monospace] background: url (http://i43.servimg.com/u/f43/17/43/09/69/icon-810.png) no-repeat; [/font][/color]
[color=#161514][font=monospace] position: absolute; [/font][/color]
[color=#161514][font=monospace] display: block; [/font][/color]
[color=#161514][font=monospace] width: 10px ; [/font][/color]
[color=#161514][font=monospace] height: 10px; [/font][/color]
[color=#161514][font=monospace] background-position:-3px 3px; [/font][/color]
[color=#161514][font=monospace] left: 9px; [/font][/color]
[color=#161514][font=monospace] top: # ECEEF5; border: 1px solid black;-webkit-border-radius: 3px; -webkit-border-radius: 3px; color: # 3B5998! important; border-color: # CAD4E7;-webkit-box-shadow: 0 1px 0 3px 4px 0px 4px;} . votesta { background-color: white; border: 1px solid # D0D0D0; padding: 5px; font-size: 11px; position: relative; }[/font][/color]
Step 3: MODULES >> HTML & JAVASCRIPT >> Javascript codes management >> Create a new Javascripts
Title: Vote not redirect
Placement: In the topics
Javascript Code *:
- Code:
[color=#161514][font=monospace]$ (Function () { [/font][/color]
[color=#161514][font=monospace] $ (". kill"). click (function () { [/font][/color]
[color=#161514][font=monospace] $ (this). hide (). sau ('Voted!'); [/font][/color]
[color=#161514][font=monospace] $ ("." + $ (this). attr ( "target")). html (dulieukpi ($ ("." + $ (this). attr ("target")). attr ("title"))); [/font][/color]
[color=#161514][font=monospace] $ ("." + $ (this). attr ("target")). removeAttr ("title"); [/font][/color]
[color=#161514][font=monospace] }); [/font][/color]
[color=#161514][font=monospace] }); [/font][/color]
[color=#161514][font=monospace] function dulieukpi (vote) { [/font][/color]
[color=#161514][font=monospace] if (vote == "Message not voted") vote = "0% (0 vote)"; [/font][/color]
[color=#161514][font=monospace] var a = parseInt (vote.split ("") [0], 10) / 100; [/font][/color]
[color=#161514][font=monospace] var b = parseInt (vote.split ("") [1]. substr (1), 10); [/font][/color]
[color=#161514][font=monospace] a = (a * b + 1) / (b + 1); [/font][/color]
[color=#161514][font=monospace] vote = "Message reputation:" + Math.round (a * 100) + "(" + (b + 1) + "vote)"; [/font][/color]
[color=#161514][font=monospace] return votekpi (vote) [/font][/color]
[color=#161514][font=monospace] }; function votekpi (vote) { if (vote == "Message not voted") return '0 like '; var a = parseInt (vote.split ("") [3], 10) / 100; var b = parseInt (vote . split ("") [4]. substr (1), 10); return Math.round (a * b) + 'likes' };[/font][/color]