• About
  • Policy
  • Contact

Phan Anh Buổi Sáng

  • Home
  • Kiến thức IT
    • PSD
    • Blogger
  • Translate
Google
Custom Search
Trang chủ » Blogger » [ Blogger ] Hướng Dẫn Thêm Button Vào Blogspot

[ Blogger ] Hướng Dẫn Thêm Button Vào Blogspot

Unknown Labels: Blogger Leave A Comment 00:54

Bước 1 : Đầu tiên, bạn cần thêm thư viện jQuery vào blog bằng cách thêm đoạn sau vào phía dưới thẻ<head>
1
<script src='http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'/>
Nếu bạn nào đã từng thêm thư viện jQuery vào blog rồi thì có thể bỏ qua bước này
Bước 2 : Tiếp theo, hãy thêm đoạn code dưới đây vào phía trên thẻ đóng </body>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script type='text/javascript'>
  //<![CDATA[
  /* Facebook */
  (function(d, s, id){
       var js, fjs = d.getElementsByTagName(s)[0];
       if (d.getElementById(id)) {return;}
       js = d.createElement(s); js.id = id;
       js.src = "//connect.facebook.net/en_US/all.js";
       fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
  window.fbAsyncInit = function() {
      // init the FB JS SDK
      FB.init({
        status     : true,                            
        xfbml      : true                              
      });
      FB.Event.subscribe('edge.create', function(href, widget) {
          $.event.trigger({
              type: "pageShared",
              url: href
          });
      });
  };
  /* Twitter */
    window.twttr = (function (d,s,id) {
    var t, js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
    js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
    return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
  }(document, "script", "twitter-wjs"));
  twttr.ready(function (twttr) {
      twttr.events.bind('tweet', function (event) {
          $.event.trigger({
              type: "pageShared",
              url: event.target.baseURI
          });
      });
  });
  /* Google Plus */
  (function() {
      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
      po.src = 'https://apis.google.com/js/plusone.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
  function plusOned(obj){
      console.log(obj);
      $.event.trigger({
          type: "pageShared",
          url: obj.href
      });
  }
  /* Listen for the pageShared event */
  $(document).on('pageShared',function(e){
      if(e.url == window.location.href){
          $(".hide").show();
          $(".show").hide();
      }
  });
  //]]>
</script>
Bước 3 : Thêm đoạn code dưới đây vào phía trên thẻ  ]]></b:skin>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.hide {
  display: none;
  background: #f9f9f9;
  color: #111;
  border-radius: 5px;
  border-bottom: 4px solid #f1f1f1;
  padding: 20px;
}
.show {
  padding: 20px;
  background: #f9f9f9;
  color: #111;
  border-radius: 5px;
  border-bottom: 4px solid #f1f1f1;
  text-align: center;
 
}
.show .fb-like {
  margin-top: 0;
  top: -7px;
  position: relative;
}
.show .twitter-share-button {
  margin-right: 25px;
}

Làm sao để sử dụng ?

Để thêm button “Like to Unlock” vào bài viết, đầu tiên hãy chuyển sang chế độ soạn thảo HTML
1
Tiếp đó, điền đoạn code dưới đây vào vị trí muốn sử dụng
1
2
3
4
5
6
7
<div class="hide">
..........
</div>
<div class="show">
To unlock the content, use one of the social buttons below. Thank you for your support and love.
<span class="fb-like" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90" expr:data-href="data:post.url" style="margin-right: 25px;"></span><a class="twitter-share-button" data-count="horizontal" data-related="" data-via="doiguocmoc"
    expr:data-text="data:post.title" expr:data-url="data:post.url" href="http://twitter.com/share">Tweet</a><span class="g-plusone" data-callback="plusOned" data-count="true" data-size="medium" expr:data-href="data:post.url"></span></div>
trong đó : …….. là phần nội dung sẽ bị ẩn đi
Cuối cùng, hãy xuất bản bài viết. Bây giờ, để xem phần nội dung bị ẩn đi, người dùng sẽ buộc phải like, twitter, +1 bài viết của bạn.
Chúc các bạn thành công

Bài viết liên quan

← Bài đăng mới hơn Bài đăng cũ hơn → Trang chủ
Powered by Blogger.

Các Bình Luận Gần Đây

Bài đăng phổ biến

  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • Symlink ALL Config
    Yêu cầu server chạy perl shell và ko dis hàm symljnk. tặng thêm con shell mới sau khi cat /etc/passwd xong copy hết bỏ vào file go.pl nó sẽ ...
  • [xHydra] BruteForcing FTP - Website - Router con 14 Millones de Password
    INTRODUCCIÓN : Según  OWASP  el Brute Forcing consiste en enumerar sistemáticamente todos los posibles candidatos para la solución y compr...
  • PhpFox 3.0.1 Cross Site Scripting
    Google Dork: Intext:"Powered By phpFox Version 3.0.1" Vendor Home : http://www.phpfox.com/  There are lots of parametrs Vulnerab...
  • vBulletin vBay <=1.1.9 Error-Based SQL Injection
    #!/usr/bin/env python -W ignore::DeprecationWarning """ VBay <= 1.1.9 - Remote Error based SQL Injection ...
  • Bandicam Full Crack - Duy Ripper
     
  • Server Jumping Finder Version 1.0
    Server Jumping Finder Version 1.0 srverdeki sitelerin dizinlerini bulmaya yarar Ok, Let's Begin ... ************************** ? ******...
  • özel bir shell
    Code: <?php $fdownload=$_GET['fdownload']; if ($fdownload <> "" ){ $path_parts = pathinfo("$fdownload")...
  • FAQ: Các câu hỏi liên quan về việc sử dụng extension của Juno_okyo
    Cài đặt add-on/extension như thế nào? Bạn có thể tìm và cài đặt extension của tớ bằng cách tìm theo từ khóa juno_okyo hoặc j2team trên Ch...
  • Joomla Shell Upload Vulnerability
    requirements: 1.mind use this google dork to find vulnerable joomla sites ##  google dork : inurl:index.php?option=com_fabrik after open the...

Pageviews from the past week

Chuyên mục

Bài đăng phổ biến

  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • Symlink ALL Config
    Symlink ALL Config
    Yêu cầu server chạy perl shell và ko dis hàm symljnk. tặng thêm con shell mới sau khi cat /etc/passwd xong copy hết bỏ vào file go.pl nó sẽ ...
  • [xHydra] BruteForcing FTP - Website - Router con 14 Millones de Password
    INTRODUCCIÓN : Según  OWASP  el Brute Forcing consiste en enumerar sistemáticamente todos los posibles candidatos para la solución y compr...
  • PhpFox 3.0.1 Cross Site Scripting
    PhpFox 3.0.1 Cross Site Scripting
    Google Dork: Intext:"Powered By phpFox Version 3.0.1" Vendor Home : http://www.phpfox.com/  There are lots of parametrs Vulnerab...
  • vBulletin vBay <=1.1.9 Error-Based SQL Injection
    #!/usr/bin/env python -W ignore::DeprecationWarning """ VBay <= 1.1.9 - Remote Error based SQL Injection ...
  • Bandicam Full Crack - Duy Ripper
    Bandicam Full Crack - Duy Ripper
     
  • Server Jumping Finder Version 1.0
    Server Jumping Finder Version 1.0 srverdeki sitelerin dizinlerini bulmaya yarar Ok, Let's Begin ... ************************** ? ******...
  • özel bir shell
    Code: <?php $fdownload=$_GET['fdownload']; if ($fdownload <> "" ){ $path_parts = pathinfo("$fdownload")...
  • FAQ: Các câu hỏi liên quan về việc sử dụng extension của Juno_okyo
    Cài đặt add-on/extension như thế nào? Bạn có thể tìm và cài đặt extension của tớ bằng cách tìm theo từ khóa juno_okyo hoặc j2team trên Ch...
  • Joomla Shell Upload Vulnerability
    requirements: 1.mind use this google dork to find vulnerable joomla sites ##  google dork : inurl:index.php?option=com_fabrik after open the...
Google
Custom Search
Support: Facebook | Twitter | Google+ | Giới thiệu
Copyright © 2015 • Phan Anh Buổi Sáng • All Right Reserved. Template by Template Việt