[TUTs] zzVotePlus - Chức năng bỏ phiếu với giao diện google+

  Bài viết hay nhất1
First topic message reminder :

zzVotePlus - Chức năng bỏ phiếu với giao diện Google plus


Giao diện chức năng vote làm theo mẫu của google plus, vì thế mình chỉ dùng nút vote +, còn nút vote - thì bỏ đi. Nếu diễn đàn bạn từng dùng cả 2 loại trước đây cũng sẽ không bị lỗi khi chuyển sang dùng zzVotePlus.
Ngoài ra, chức năng gửi thông báo lên tường cũng được tích hợp sẵn.


Demo

[TUTs] zzVotePlus - Chức năng bỏ phiếu với giao diện google+ - Page 2 325u61u


Hướng dẫn


Bước 1

Thêm vào CSS:

Code:
/* zzVotePlus by Zzbaivong - devs.forumvi.com */
div.vote-zzvote{float:left;margin-left:2em}
div.vote-zzvote > a.vote-plus{background:none no-repeat center #FFF;color:#444;cursor:pointer;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.05);box-shadow:0 1px 0 rgba(0,0,0,.05);border:1px solid #d9d9d9;border-radius:3px;font-size:11px;font-weight:700;display:inline-block;float:left;height:22px;line-height:20px;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s;padding:0 7px}
div.vote-zzvote > a.vote-plus:hover{border-color:#666}
div.vote-zzvote > a.vote-plus[href=""]{border:0 none;line-height:22px;background-color:#dd4b39;cursor:default;color:#FFF}
div.vote-zzvote > a.vote-plus.dis{background-color:#FFF;color:#CCC}
div.vote-zzvote > a.vote-plus.dis:hover{border-color:#d9d9d9;cursor:not-allowed}

Bước 2

Sửa temp viewtopic_body

Xóa code Temp nút vote mặc định
Code:
<!-- BEGIN switch_vote_active -->
...
<!-- END switch_vote_active -->

Đặt code Temp này ở trong div.post-options
Code:
<!-- zzVotePlus by Zzbaivong - devs.forumvi.com -->
<div class="vote-zzvote">
   <!-- BEGIN switch_vote_active -->
   <a class="vote-plus" href="<!-- BEGIN switch_vote -->{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}<!-- END switch_vote -->">
      +<span class="vote-time" data-vote="<!-- BEGIN switch_bar -->{postrow.displayed.switch_vote_active.L_VOTE_TITLE}<!-- END switch_bar --><!-- BEGIN switch_no_bar -->{postrow.displayed.switch_vote_active.L_VOTE_TITLE}<!-- END switch_no_bar -->">1</span>
   </a>
   <!-- END switch_vote_active -->
</div>

Đặt code javascript này ở trước div.main-foot hoặc cuối template viewtopic_body:
Code:
<!-- zzVotePlus by Zzbaivong - devs.forumvi.com -->
<script type="text/javascript">
   //<![CDATA[
   $(".vote-zzvote:empty").html('<a class="vote-plus dis" href="javascript:;">+<span class="vote-time" data-vote="Message not voted">1</span></a>');
   $(".vote-time").text(function() {
      var a = $(this).data("vote");
      if ("Message not voted" == a) return $(this).data("vote", 0), 1;
      a = a.split(/\W/);
      time = parseInt(a[7], 10);
      percent = parseInt(a[4], 10);
      plus = Math.round(percent / 100 * time);
      $(this).data("vote", plus);
      if (0 !== plus) return plus
   });
   $(".vote-plus").on("click", function(a) {
      a.preventDefault();
      var b = $(this),
         c = $(".vote-time", b); - 1 != this.href.indexOf("eval=plus&p_vote") && (b.css("background-image", "url(http://i57.servimg.com/u/f57/17/05/17/70/preloa10.gif)"), $.post(this.href, function() {
            c.text(parseInt(c.data("vote"), 10) + 1);
            $post = b.closest(".post");
            $user = $post.find(".user a[href^='/u']:not(:has(img)):first");
            $.post("/privmsg", {
               subject: "Bài viết hay",
               message: "Mình thích bài viết của bạn tại [url=" +
                  $post.find(".posthead a[href^='/t'][href*='#']")[0].href + "]" + document.title + "[/url]",
               username: $.trim($user.text()),
               u: $user.attr("href").replace(/.*\/u(\d+).*/, "$1"),
               mode: "post_profile",
               folder: "profile",
               post: "Send"
            }, function() {
               b.removeAttr("style")
            })
         }), this.href = "")
   });
   //]]>
</script>
Chú ý: Nếu bạn nhấn vote mà kết quả trả về là NaN thì ở code javascript, dòng 7 và dòng 12, bạn sửa:
Code:
data("vote"
...thành:
Code:
attr("data-vote"


Nguồn

Zzbaivong (devs.forumvi.com)
  Bài viết hay nhất26
Lỗi 1: Load mãi không ngừng

Lỗi 2: đổi cái +1 thành +3 giúp em :D
  Bài viết hay nhất27

Mr.Bean wrote:Lỗi 1:  Load mãi không ngừng

Lỗi 2: đổi cái +1 thành +3 giúp em :D

1. Load mãi là do bạn chưa thay thế đúng phần tử, cái này dựa trên view mặc định
2. Đó không phải là lỗi.
3. Nếu ko biết làm cái 1 thì send link forum đây.
  Bài viết hay nhất28
Hiện nút vote nhưng bị mờ và click vote ko đc
Demo: http://gamepro.forum.st/t5-topic
Nck test: Bee nut - acctest
  Bài viết hay nhất29
Chưa kích hoạt Points system.
  Bài viết hay nhất30
Có mà ad, Lúa đo :3
  Bài viết hay nhất31
Chụp ảnh chỗ thiết lập Points system xem.
  Bài viết hay nhất32
https://i.imgur.com/QRKorPW.jpg
  Bài viết hay nhất33
Chưa bật Reputation phải ko?
  Bài viết hay nhất34
Rồi đc rùi, vừa mới vào bật lên thì đc
  Bài viết hay nhất35

dang0123 wrote:Đã biết cách sửa, dành cho ai không biết

trong đoạn js tìm
Code:
$user = $post.find(".user a[href^='/u']:not(:has(img)):first");
thay .user thành cái class bao quanh user của bạn ạ

class bao quanh là sao hả bác, cho ví dụ dc ko
  Bài viết hay nhất36
Xin lỗi, nhưng mình cũng gặp tình trạng như các bạn trên là bấm vào cứ load mãi và không post lên tường được. Mình sử dụng skin Plumotion nên mình rất hy vọng sử dụng được tiện ích này, xin được giúp đỡ.
Đây là view-topic-body của mình:
Code:
{JAVASCRIPT}
<script type="text/javascript">//<![CDATA[
var multiquote_img_off = '{JS_MULTIQUOTE_IMG_OFF}', multiquote_img_on = '{JS_MULTIQUOTE_IMG_ON}', _atr = '{JS_DIR}addthis/', _ati = '{PATH_IMG_FA}addthis/'{ADDTHIS_LANG}, addthis_localize = { share_caption: "{L_SHARE_CAPTION}", email: "{L_EMAIL}", email_caption: "{L_EMAIL_CAPTION}", favorites: "{L_SHARE_BOOKMARKS}", print: "{L_PRINT}", more: "{L_MORE}" };
$(function(){
   _atc.cwait = 0;
   $('.addthis_button').mouseup(function(){
      if ($('#at15s').css('display') == 'block') {
         addthis_close();
      }
   });
});

var hiddenMsgLabel = { visible:'{JS_HIDE_HIDDEN_MESSAGE}', hidden:'{JS_SHOW_HIDDEN_MESSAGE}' };
showHiddenMessage = function(id)
{
    try
    {
        var regId = parseInt(id, 10);
        if( isNaN(regId) ) { regId = 0; }
       
        if( regId > 0)
        {
            $('.post--' + id).toggle(0, function()
         {
            if( $(this).is(":visible") )
            {
               $('#hidden-title--' + id).html(hiddenMsgLabel.visible);
            }
            else
            {
               $('#hidden-title--' + id).html(hiddenMsgLabel.hidden);
            }
         });
        }
    }
    catch(e) { }
   
   return false;
};

//]]>
</script>
   <script type="text/javascript">
   $(document).ready(function(){
      var topic_title = '{TOPIC_TITLE}';
             var topic_url = '{TOPIC_URL}';
      $('#n-site_infom h1').html('<a href="'+topic_url+'">'+topic_title+'</a>');
             $('#n-site_infom p').html('<a class="button flat blue" href="#goto_comment">Bình luận về bài viết này ngay!</a>');
   });
   </script>
<!-- BEGIN switch_user_logged_in -->
<div id="pun-visit" class="clearfix">
   <ul>
      <!-- BEGIN switch_plus_menu -->
      <li>
         <script type="text/javascript">//<![CDATA[
            var url_favourite = '{switch_user_logged_in.U_FAVOURITE_JS_PLUS_MENU}';
            var url_newposts = '{U_NEWPOSTS_JS_PLUS_MENU}';
            var url_egosearch = '{U_EGOSEARCH_JS_PLUS_MENU}';
            var url_unanswered = '{U_UNANSWERED_JS_PLUS_MENU}';
            var url_watchsearch = '{U_WATCHSEARCH_JS_PLUS_MENU}';
            var url_tellfriend = '{U_TELLFRIEND_JS_PLUS_MENU}';
            insert_plus_menu_new('f{FORUM_ID}&amp;t={TOPIC_ID}','{JS_SESSION_ID}', {JS_AUTH_FAVOURITES});
         //]]>
         </script>
      </li>
      <!-- END switch_plus_menu -->
      <li><a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pub=forumotion">{L_SHARE}</a></li>
      <li><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a></li>
      <li><a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></li>
      <!-- BEGIN watchtopic -->
      <li>{S_WATCH_TOPIC}</li>
      <!-- END watchtopic -->
   </ul>
   <p>{LOGGED_AS}. {LAST_VISIT_DATE}</p>
</div>
<!-- END switch_user_logged_in -->
<!-- BEGIN switch_user_logged_out -->
<div id="pun-visit">
   <p>{L_NOT_CONNECTED} {L_LOGIN_REGISTER}</p>
</div>
<!-- END switch_user_logged_out -->
<div class="pun-crumbs noprint">
   <p class="crumbs">
      <a href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}&nbsp;»&nbsp;
      <strong><a href="{TOPIC_URL}">{TOPIC_TITLE}</a></strong>
      <!-- BEGIN switch_twitter_btn -->
      <span id="twitter_btn" style="margin-left: 6px; ">
         <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a>
         <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
      </span>
      <!-- END switch_twitter_btn -->
      <!-- BEGIN switch_fb_likebtn -->
      <span id="fb_likebtn" style="margin-left: 6px; ">
         <iframe src="http://www.facebook.com/plugins/like.php?href={FORUM_URL}{TOPIC_URL}&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:auto; height:21px;" allowTransparency="true"></iframe>
      </span>
      <!-- END switch_fb_likebtn -->
   </p>
 
 
 
 
 
 
 
 
 
 
</div>

<div class="boxes post_boxes paged">
   <div class="paged-head clearfix">
      <!-- BEGIN topicpagination -->
      <p class="paging">{PAGINATION}</p>
      <!-- END topicpagination -->
        </div>
   <h1 id="boxes_title">
                 <p class="right">
                <!-- BEGIN switch_user_authpost -->
                <a href="{U_POST_NEW_TOPIC}" class="button flat red">Tạo mới</a>&nbsp;
      <!-- END switch_user_authpost -->
      <!-- BEGIN switch_user_authreply -->
                <a href="{U_POST_REPLY_TOPIC}" class="button flat blue">Trả lời</a>
      <!-- END switch_user_authreply -->
                </p>
             <span>
                 <p class="h2" direction="#goto_comment">
         <a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a>&nbsp;<a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a>&nbsp;<a href="#bottom">{L_GOTO_DOWN}</a>&nbsp;&nbsp;
         {L_MESSAGE} [{PAGE_NUMBER}]
      </p>
                </span>
   </h1>
     <div id="gpoll_display">
   {POLL_DISPLAY}
     </div>

   <div id="all_boxes">
      <!-- BEGIN postrow -->
         <!-- BEGIN hidden -->
            <p class="p-hidden">{postrow.hidden.MESSAGE}</p>
         <!-- END hidden -->
         
         <!-- BEGIN displayed -->
         <!-- BEGIN first_post_br -->
      </div>
      <hr id="first-post-br" />
      <div class="main-content topic">
         <!-- END first_post_br -->
         <div class="a_box post-{postrow.displayed.U_POST_ID}"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
            <a name="{postrow.displayed.U_POST_ID}" class="fake_pos"></a>
            <div id="a_box_padding"{postrow.displayed.THANK_BGCOLOR}>
               <p id="abhead_title">
                                        <strong class="right gbp_count" id="p{postrow.displayed.U_POST_ID}">{postrow.displayed.COUNT_POSTS}</strong>
                  {postrow.displayed.ICON} <a href="{postrow.displayed.POST_URL}">{postrow.displayed.POST_SUBJECT}</a> {postrow.displayed.POST_DATE_NEW}
               </p>
               <div id="abox_head">
                  <span id="abox_img">{postrow.displayed.POSTER_AVATAR}</span>
                  <h4>
                     <span id="profile_username">
                        {postrow.displayed.POSTER_NAME}
                        <div class="profile_box">
                           <span id="online_stt">{postrow.displayed.ONLINE_IMG}</span>
                           <div id="pcover_box" style="background-image: url(img/header.jpg);"></div>
                           <span id="puavtar">{postrow.displayed.POSTER_AVATAR}</span>
                           <h2>{postrow.displayed.POSTER_NAME}</h2>
                           <!-- BEGIN profile_field -->
                           <p>{postrow.displayed.profile_field.LABEL}{postrow.displayed.profile_field.CONTENT}</p>
                           <!-- END profile_field -->
                           <p>{postrow.displayed.POSTER_RPG}</p>
                           <div id="link_box">
                              {postrow.displayed.PROFILE_IMG} {postrow.displayed.PM_IMG} {postrow.displayed.EMAIL_IMG}<!-- BEGIN contact_field --> {postrow.displayed.contact_field.CONTENT}<!-- END contact_field -->
                           </div>
                        </div>
                     </span><br/>
                     <small>{postrow.displayed.POSTER_RANK_NEW}</small>
                  </h4>
                  <div class="sub_n_rank rank_img">
                     {postrow.displayed.RANK_IMAGE}
                                                     <b></b>
                  </div>
               </div>
                                 
                                 

 
               <div id="abox_descript" class="post-entry_content"{postrow.displayed.THANK_BGCOLOR} style="
    padding-top: 20px;
    margin-left: 50px;
">
                  
 
 
 
                  <div>
                     <div>{postrow.displayed.MESSAGE}</div>
                     <!-- BEGIN switch_attachments -->
                     <dl class="attachbox">
                        <dt>{postrow.displayed.switch_attachments.L_ATTACHMENTS}</dt>
                        <dd>
                        <!-- BEGIN switch_post_attachments -->
                           <dl class="file">
                              <dt>
                                 <img src="{postrow.displayed.switch_attachments.switch_post_attachments.U_IMG}" />

                                 <!-- BEGIN switch_dl_att -->
                                 <a class="postlink" href="{postrow.displayed.switch_attachments.switch_post_attachments.switch_dl_att.U_ATTACHMENT}">{postrow.displayed.switch_attachments.switch_post_attachments.switch_dl_att.ATTACHMENT}</a> {postrow.displayed.switch_attachments.switch_post_attachments.switch_dl_att.ATTACHMENT_DEL}
                                 <!-- END switch_dl_att -->

                                 <!-- BEGIN switch_no_dl_att -->
                                 {postrow.displayed.switch_attachments.switch_post_attachments.switch_no_dl_att.ATTACHMENT} {postrow.displayed.switch_attachments.switch_post_attachments.switch_no_dl_att.ATTACHMENT_DEL}
                                 <!-- END switch_no_dl_att -->
                              </dt>

                              <!-- BEGIN switch_no_comment -->
                              <dd>
                                 <em>{postrow.displayed.switch_attachments.switch_post_attachments.switch_no_comment.ATTACHMENT_COMMENT}</em>
                              </dd>
                              <!-- END switch_no_comment -->

                              <!-- BEGIN switch_no_dl_att -->
                              <dd>
                                 <em><strong>{postrow.displayed.switch_attachments.switch_post_attachments.switch_no_dl_att.TEXT_NO_DL}</strong></em>
                              </dd>
                              <!-- END switch_no_dl_att -->

                              <dd>({postrow.displayed.switch_attachments.switch_post_attachments.FILE_SIZE}) {postrow.displayed.switch_attachments.switch_post_attachments.NB_DL}</dd>
                           </dl>
                           <!-- END switch_post_attachments -->
                        </dd>
                     </dl>
                     <!-- END switch_attachments -->
                     <div class="clear"></div>
                  </div>
                  <p style="color:#999;"><small><i>
                     {postrow.displayed.EDITED_MESSAGE}
                  </i></small></p>
                  <!-- BEGIN switch_signature -->
                  <div class="post_singature">
                     {postrow.displayed.SIGNATURE_NEW}
                  </div>
                  <!-- END switch_signature -->
               </div>
                                                                 
 
 
 
 <!-- zzVotePlus by Zzbaivong - devs.forumvi.com -->
<div class="vote-zzvote">
  <!-- BEGIN switch_vote_active -->
  <a class="vote-plus" href="<!-- BEGIN switch_vote -->{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}<!-- END switch_vote -->">
      +<span class="vote-time" data-vote="<!-- BEGIN switch_bar -->{postrow.displayed.switch_vote_active.L_VOTE_TITLE}<!-- END switch_bar --><!-- BEGIN switch_no_bar -->{postrow.displayed.switch_vote_active.L_VOTE_TITLE}<!-- END switch_no_bar -->">1</span>
  </a>
  <!-- END switch_vote_active -->
</div>
 
 
 
               <div id="post_tools">
                  
  {postrow.displayed.THANK_IMG} {postrow.displayed.MULTIQUOTE_IMG} {postrow.displayed.QUOTE_IMG} {postrow.displayed.EDIT_IMG} {postrow.displayed.DELETE_IMG} {postrow.displayed.IP_IMG} {postrow.displayed.REPORT_IMG}
               </div>
            </div>
         </div>
         <!-- END displayed -->
      <!-- END postrow -->
   </div>
 
 
   <div class="main-foot clearfix">
      <p class="options">
         <input type="hidden" name="t" value="{TOPIC_ID}" />

         <!-- <input type="hidden" name="sid" value="{S_SID}" /> -->
         <input type="hidden" name="{SECURE_ID_NAME}" value="{SECURE_ID_VALUE}" />

         <!-- BEGIN viewtopic_bottom -->
         {S_TOPIC_ADMIN}
         <!-- END viewtopic_bottom -->
      </p>
   </div>

   <a name="bottomtitle"></a>
   <h1 id="boxes_title">
                 <p class="right">
                <!-- BEGIN switch_user_authpost -->
                <a href="{U_POST_NEW_TOPIC}" class="button flat red">Tạo mới</a>&nbsp;
      <!-- END switch_user_authpost -->
      <!-- BEGIN switch_user_authreply -->
                <a href="{U_POST_REPLY_TOPIC}" class="button flat blue">Trả lời</a>
      <!-- END switch_user_authreply -->
                </p>
             <span>
                 <p class="h2">
         <a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a>&nbsp;<a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a>&nbsp;<a href="#bottom">{L_GOTO_DOWN}</a>&nbsp;&nbsp;
         {L_MESSAGE} [{PAGE_NUMBER}]
      </p>
                </span>
   </h1>
   <div class="paged-foot clearfix">
      <!-- BEGIN topicpagination -->
      <p class="paging">{PAGINATION}</p>
      <!-- END topicpagination -->
   </div>

</div>

<div class="pun-crumbs">
   <p class="crumbs">
      <a href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}&nbsp;»&nbsp;
      <strong><a href="{TOPIC_URL}">{TOPIC_TITLE}</a></strong>
   </p>
</div>

<!-- BEGIN promot_trafic -->
<div class="main" id="ptrafic_close" style="display:none">
   <div class="main-head clearfix">
      <h1 id="boxes_title"><span><p class="h2">{PROMOT_TRAFIC_TITLE}</p></span></h1>
      <p class="options"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><img src="{TABS_MORE_IMG}" alt="+" align="" border="0" /></a></p>
   </div>
</div>
<div class="main" id="ptrafic_open" style="display:''">
   <div class="main-head clearfix">
          <h2 id="boxes_title">  <span>{PROMOT_TRAFIC_TITLE}</span></h2>
      <p class="options"><a href="javascript:ShowHideLayer('ptrafic_open','ptrafic_close');"><img src="{TABS_LESS_IMG}" alt="-" align="" border="0" /></a></p>
   </div>
   <div class="main-content clearfix">
      <!-- BEGIN link -->
      »&nbsp;<a href="{promot_trafic.link.U_HREF}" target="_blank" title="{promot_trafic.link.TITLE}">{promot_trafic.link.TITLE}</a><br />
      <!-- END link -->
   </div>
</div>
<!-- END promot_trafic -->

<!-- BEGIN switch_forum_rules -->
<div class="main" id="forum_rules">
   <div class="main-head clearfix">
          <h2 id="boxes_title">  <span>{L_FORUM_RULES}</span></h2>
   </div>
   <table class="main-content frm">
      <tr>
         <!-- BEGIN switch_forum_rule_image -->
         <td class="logo">
            <img src="{RULE_IMG_URL}" />
         </td>
         <!-- END switch_forum_rule_image -->
         <td class="rules entry-content">
            {RULE_MSG}
         </td>
      </tr>
   </table>
</div>
<!-- END switch_forum_rules -->

<!-- BEGIN switch_user_logged_in -->
<div id="gquickreply">
  <a name="quickreply" id="goto_comment" class="fake_pos"></a>
{QUICK_REPLY_FORM}
</div>
<!-- END switch_user_logged_in -->

<div id="pun-info" class="main">
   <div class="main-content">
      <div id="stats">
         <p>{L_TABS_PERMISSIONS} <br />{S_AUTH_LIST}</p>
      </div>
   </div>
</div>

<!-- BEGIN switch_image_resize -->
<script type="text/javascript">
//<![CDATA[
$(resize_images({ 'selector' : '.post-entry .entry-content', 'max_width' : {switch_image_resize.IMG_RESIZE_WIDTH}, 'max_height' : {switch_image_resize.IMG_RESIZE_HEIGHT} }));
//]]>
</script>
<!-- END switch_image_resize -->

<script src="{JS_DIR}addthis/addthis_widget.js" type="text/javascript"></script>
<!-- zzVotePlus by Zzbaivong - devs.forumvi.com -->
<script type="text/javascript">
  //<![CDATA[
  $(".vote-zzvote:empty").html('<a class="vote-plus dis" href="javascript:;">+<span class="vote-time" data-vote="Message not voted">1</span></a>');
  $(".vote-time").text(function() {
      var a = $(this).data("vote");
      if ("Message not voted" == a) return $(this).data("vote", 0), 1;
      a = a.split(/\W/);
      time = parseInt(a[7], 10);
      percent = parseInt(a[4], 10);
      plus = Math.round(percent / 100 * time);
      $(this).data("vote", plus);
      if (0 !== plus) return plus
  });
  $(".vote-plus").on("click", function(a) {
      a.preventDefault();
      var b = $(this),
        c = $(".vote-time", b); - 1 != this.href.indexOf("eval=plus&p_vote") && (b.css("background-image", "url(http://i57.servimg.com/u/f57/17/05/17/70/preloa10.gif)"), $.post(this.href, function() {
            c.text(parseInt(c.data("vote"), 10) + 1);
            $post = b.closest(".post");
            $user = $post.find(".user a[href^='/u']:not(:has(img)):first");
            $.post("/privmsg", {
              subject: "Bài viết hay",
              message: "Mình thích bài viết của bạn tại [url=" +
                  $post.find(".posthead a[href^='/t'][href*='#']")[0].href + "]" + document.title + "[/url]",
              username: $.trim($user.text()),
              u: $user.attr("href").replace(/.*\/u(\d+).*/, "$1"),
              mode: "post_profile",
              folder: "profile",
              post: "Send"
            }, function() {
              b.removeAttr("style")
            })
        }), this.href = "")
  });
  //]]>
</script>

Link forum: vnfish.forumotion.com
ID: demo
Pass: demo123

Rất mong được hỗ trợ. Xin cảm ơn :)
  Bài viết hay nhất37
Viewtopic này có lỗi là lạm dụng id, dùng với css thì không sao, nhưng trong js có 2 id giống nhau là lỗi ngay.
Bạn thay hết những cái id trong viewtopic thành class rồi sửa tương ứng trong css.
Sau đó, xóa phần script của zzVotePlus ở cuối.
  Bài viết hay nhất38
à, có nghĩ là mình phải thay chữ "id" bằng chữ "class" và trong css mình thay dấu "#" thành dấu "." đúng không?
Mà thay xong thì xóa phần script zzvote vậy là đâu còn là tuts zzvote plus nữa bác????
  Bài viết hay nhất39
Xóa nó đi để mình test code ấy mà.
  Bài viết hay nhất40
cho mình hỏi khi like nó sẽ gởi thông báo bài viết về trang wall người đó
nếu muốn nó chỉ gởi ở 1 mình /u1wall thì làm sao ?
  Bài viết hay nhất41

arxgaming wrote:cho mình hỏi khi like nó sẽ gởi thông báo bài viết về trang wall người đó
nếu muốn nó chỉ gởi ở 1 mình /u1wall thì làm sao ?

Dòng 26, 27 sửa thành:
Code:
username: "admin",
u: 1,

Nếu bạn định lấy ra danh sách bài vừa được like thì mình khuyên nên bỏ đi. Vì sau 1 thời gian sử dụng số bài viết trên wall lên đến vài nghìn thì việc tải nội dung sẽ cực kỳ chậm.
  Bài viết hay nhất42
Ai mà bị lỗi click vô mà load mãi không ngừng thì đến đoạn javascript tìm dòng
Code:
"background-image", "url(http://i57.servimg.com/u/f57/17/05/17/70/preloa10.gif)"
rồi xóa đường link https://i.servimg.com/u/f57/17/05/17/70/preloa10.gif đi bảo đảm 101% fix được lỗi đó , khỏi kiểm tra hay sửa phần tử làm chi cho hại não .
  Bài viết hay nhất43

dang0123 wrote:Đã biết cách sửa, dành cho ai không biết

trong đoạn js tìm
Code:
$user = $post.find(".user a[href^='/u']:not(:has(img)):first");
thay .user thành cái class bao quanh user của bạn ạ


Class bao quanh user mà bạn nói là chủ post hay tài khoản người bấm like?

Bác nào sửa cho mình với! Cũng bị lỗi load quay quay mãi không zừng. 
Forum http://learn.forumvi.com/forum
Acc: Testaccount
Pass: test1234
  Bài viết hay nhất44
You cannot reply to topics in this forum