Hiện nay thấy 3 blog của Fandung, Tien nguyen, Duy Phạm làm được "Bài viết mới nhất có hình đại diện". Không biết là bài viết của ai tốt nhất nên tôi cứ xin phép copy về lưu lại cho tôi và giới thiệu cho những người khác biết để mở rộng cộng đồng Blogger.
Đây là bài viết của Duy Phạm:
Phiên bản Recent Comments với tính năng mới là hiển thị avatar cập nhật thêm một vài tính năng mới:
- Tự động hiển thị avatar cho nhận xét của tài khoản Blogger và avatar mặc định cho nhận xét của người không có avatar.
- Thêm trích đoạn nội dung của nhận xét.
- Tự động phân biệt nhận xét của Admin.
- Và nhiều tùy chọn khác chờ bạn khám phá.
Bước 1: Thêm đoạn mã dưới đây vào trước thẻ
]]></b:skin>
trong template của bạn..rc-avatar{float:left;margin-right:10px;border:1px solid #999;border-radius:5px;background:#FFF;width:36px;height:36px;padding:3px}
Bước 2: Thêm 1 widget HTML/Javascript tại nơi muốn hiển thị Recent Comments. Hiệu chỉnh Tiêu đề và dán đoạn mã dưới đây vào phần Nội dung rồi chọn LƯU.
Code
<div id='recent-comments-avatar'>
<script type='text/javascript'>
var copyright_by_duypham_dot_info='Recent Comments free version 2.0 by http://duypham.info';
nc=5;
length_name=30;
length_content=150;
no_avatar='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsRMRp71LZFb09oR9HPNY1CU3bTyyBsnhomrNHMKebfsNFUiRMt_46XKf-yIjtAj5RhZXKOVPMCwYvX8IVte2BfULfHgvXjXn8X5Y8MqLkZ_HmYliV81png3n_V7lIjCwAduLoV2OswpM/s44/no-avatar.png';
on='on';
profile='View the profile of';
admin_style='<span style="background:#F00;color:#FFF">Admin</span>';
home_page='';
admin_uri='';
admin_avatar='';
avatar_show='yes';
var dp=["\x79\x3D\x30\x3B\x75\x3D\x30\x3B\x6C\x3D\x5B\x5D\x3B\x64\x3D\x5B\x5D\x3B\x70\x3D\x5B\x5D\x3B\x45\x3D\x5B\x5D\x3B\x78\x3D\x5B\x5D\x3B\x50\x3D\x5B\x5D\x3B\x74\x3D\x5B\x5D\x3B\x61\x3D\x5B\x5D\x3B\x6E\x3D\x5B\x5D\x3B\x6B\x3D\x5B\x5D\x3B\x77\x3D\x5B\x5D\x3B\x4D\x3D\x5B\x5D\x3B\x4B\x3D\x5B\x5D\x3B\x7A\x3D\x5B\x5D\x3B\x31\x32\x3D\x27\x31\x41\x27\x3B\x5A\x3D\x27\x59\x3A\x2F\x2F\x27\x3B\x54\x3D\x27\x2E\x27\x3B\x31\x6F\x3D\x27\x31\x79\x27\x3B\x48\x20\x31\x34\x28\x73\x29\x7B\x34\x20\x6F\x3D\x73\x2E\x36\x2E\x43\x2E\x24\x74\x3B\x74\x5B\x75\x5D\x3D\x6F\x3B\x53\x3D\x73\x2E\x36\x2E\x31\x69\x24\x31\x61\x2E\x24\x74\x3B\x69\x3D\x31\x52\x28\x28\x53\x2D\x31\x29\x2F\x31\x4A\x29\x2B\x31\x3B\x45\x5B\x75\x5D\x3D\x69\x3B\x75\x2B\x2B\x7D\x3B\x48\x20\x31\x39\x28\x71\x29\x7B\x79\x3D\x71\x2E\x36\x2E\x31\x69\x24\x31\x61\x2E\x24\x74\x3B\x50\x3D\x71\x2E\x36\x2E\x43\x2E\x24\x74\x3B\x33\x28\x27\x44\x27\x66\x20\x71\x2E\x36\x2E\x62\x5B\x30\x5D\x29\x7B\x4D\x3D\x71\x2E\x36\x2E\x62\x5B\x30\x5D\x2E\x44\x2E\x24\x74\x7D\x3B\x4B\x3D\x71\x2E\x36\x2E\x62\x5B\x30\x5D\x2E\x4C\x24\x47\x2E\x6D\x3B\x31\x63\x28\x34\x20\x67\x3D\x30\x3B\x28\x67\x3C\x49\x29\x26\x26\x28\x67\x3C\x79\x29\x3B\x67\x2B\x2B\x29\x7B\x63\x3D\x71\x2E\x36\x2E\x31\x72\x5B\x67\x5D\x3B\x33\x28\x67\x3D\x3D\x71\x2E\x36\x2E\x31\x72\x2E\x4A\x29\x7B\x31\x44\x7D\x3B\x6C\x3D\x63\x2E\x31\x49\x5B\x30\x5D\x2E\x46\x3B\x6C\x3D\x6C\x2E\x31\x5A\x28\x27\x2F\x27\x29\x3B\x55\x3D\x6C\x5B\x35\x5D\x3B\x56\x3D\x6C\x5B\x38\x5D\x3B\x34\x20\x57\x3D\x63\x5B\x27\x31\x45\x24\x66\x2D\x31\x46\x2D\x31\x48\x27\x5D\x2E\x46\x3B\x64\x5B\x67\x5D\x3D\x57\x3B\x70\x5B\x67\x5D\x3D\x56\x3B\x33\x28\x27\x58\x27\x66\x20\x63\x29\x7B\x34\x20\x6A\x3D\x63\x2E\x58\x2E\x24\x74\x7D\x65\x7B\x33\x28\x27\x31\x30\x27\x66\x20\x63\x29\x7B\x34\x20\x6A\x3D\x63\x2E\x31\x30\x2E\x24\x74\x7D\x65\x7B\x34\x20\x6A\x3D\x27\x26\x23\x31\x7A\x3B\x27\x7D\x7D\x3B\x6A\x3D\x6A\x2E\x42\x28\x2F\x3C\x31\x42\x20\x5C\x2F\x3E\x2F\x67\x2C\x27\x20\x27\x29\x3B\x6A\x3D\x6A\x2E\x42\x28\x2F\x40\x3C\x61\x2E\x2A\x3F\x61\x3E\x2F\x67\x2C\x27\x27\x29\x3B\x6A\x3D\x6A\x2E\x42\x28\x2F\x3C\x5B\x5E\x3E\x5D\x2A\x3E\x2F\x67\x2C\x27\x27\x29\x3B\x33\x28\x6A\x2E\x4A\x3C\x31\x31\x29\x7B\x78\x5B\x67\x5D\x3D\x6A\x7D\x65\x7B\x6A\x3D\x6A\x2E\x41\x28\x30\x2C\x31\x31\x29\x3B\x34\x20\x68\x3D\x6A\x2E\x31\x33\x28\x27\x20\x27\x29\x3B\x6A\x3D\x6A\x2E\x41\x28\x30\x2C\x68\x29\x3B\x78\x5B\x67\x5D\x3D\x6A\x2B\x27\x26\x23\x52\x3B\x27\x7D\x3B\x37\x3D\x63\x2E\x62\x5B\x30\x5D\x2E\x31\x47\x2E\x24\x74\x3B\x33\x28\x37\x2E\x4A\x3C\x31\x35\x29\x7B\x61\x5B\x67\x5D\x3D\x37\x7D\x65\x7B\x37\x3D\x37\x2E\x41\x28\x30\x2C\x31\x35\x29\x3B\x34\x20\x68\x3D\x37\x2E\x31\x33\x28\x27\x27\x29\x3B\x37\x3D\x37\x2E\x41\x28\x30\x2C\x68\x29\x3B\x61\x5B\x67\x5D\x3D\x37\x2B\x27\x26\x23\x52\x3B\x27\x7D\x33\x28\x27\x44\x27\x66\x20\x63\x2E\x62\x5B\x30\x5D\x29\x7B\x77\x5B\x67\x5D\x3D\x63\x2E\x62\x5B\x30\x5D\x2E\x44\x2E\x24\x74\x3B\x7A\x5B\x67\x5D\x3D\x27\x3C\x61\x20\x46\x3D\x22\x27\x2B\x77\x5B\x67\x5D\x2B\x27\x22\x20\x31\x36\x3D\x22\x31\x37\x22\x20\x31\x4D\x3D\x22\x32\x38\x22\x20\x43\x3D\x22\x27\x2B\x31\x53\x2B\x27\x20\x27\x2B\x61\x5B\x67\x5D\x2B\x27\x22\x3E\x27\x2B\x61\x5B\x67\x5D\x2B\x27\x3C\x2F\x61\x3E\x27\x7D\x65\x7B\x7A\x5B\x67\x5D\x3D\x61\x5B\x67\x5D\x7D\x3B\x33\x28\x63\x2E\x62\x5B\x30\x5D\x2E\x4C\x24\x47\x2E\x6D\x3D\x3D\x27\x59\x3A\x2F\x2F\x31\x54\x2E\x31\x55\x2E\x31\x57\x2F\x31\x38\x2F\x32\x34\x2E\x31\x76\x27\x29\x7B\x6E\x5B\x67\x5D\x3D\x31\x77\x3B\x6B\x5B\x67\x5D\x3D\x27\x31\x78\x20\x4E\x27\x7D\x65\x7B\x6E\x5B\x67\x5D\x3D\x63\x2E\x62\x5B\x30\x5D\x2E\x4C\x24\x47\x2E\x6D\x3B\x6B\x5B\x67\x5D\x3D\x61\x5B\x67\x5D\x7D\x3B\x4F\x2E\x31\x62\x28\x27\x3C\x72\x20\x31\x64\x3D\x5C\x22\x31\x65\x2F\x31\x66\x5C\x22\x20\x6D\x3D\x5C\x22\x27\x2B\x31\x67\x2B\x27\x2F\x31\x68\x2F\x27\x2B\x55\x2B\x27\x2F\x51\x2F\x31\x6A\x3F\x6B\x3D\x73\x2D\x66\x2D\x72\x26\x31\x6B\x2D\x31\x6C\x3D\x30\x26\x31\x6D\x3D\x31\x34\x5C\x22\x3E\x3C\x5C\x2F\x72\x3E\x27\x29\x7D\x7D\x3B\x33\x28\x31\x4B\x3D\x3D\x27\x31\x4C\x20\x31\x6E\x20\x31\x4E\x20\x31\x4F\x20\x32\x2E\x30\x20\x31\x50\x20\x27\x2B\x5A\x2B\x31\x32\x2B\x54\x2B\x31\x6F\x29\x7B\x4F\x2E\x31\x62\x28\x27\x3C\x72\x20\x31\x64\x3D\x5C\x22\x31\x65\x2F\x31\x66\x5C\x22\x20\x6D\x3D\x5C\x22\x27\x2B\x31\x67\x2B\x27\x2F\x31\x68\x2F\x51\x2F\x31\x6A\x3F\x6B\x3D\x73\x2D\x66\x2D\x72\x26\x31\x6B\x2D\x31\x6C\x3D\x27\x2B\x49\x2B\x27\x26\x31\x6D\x3D\x31\x39\x5C\x22\x3E\x3C\x5C\x2F\x72\x3E\x27\x29\x7D\x3B\x48\x20\x31\x51\x28\x29\x7B\x34\x20\x39\x3D\x27\x27\x3B\x39\x2B\x3D\x27\x3C\x31\x70\x3E\x27\x3B\x31\x63\x28\x34\x20\x67\x3D\x30\x3B\x28\x67\x3C\x49\x29\x26\x26\x28\x67\x3C\x79\x29\x3B\x67\x2B\x2B\x29\x7B\x74\x5B\x67\x5D\x3D\x74\x5B\x67\x5D\x2E\x42\x28\x27\x31\x6E\x20\x31\x71\x20\x27\x2B\x50\x2B\x27\x3A\x20\x27\x2C\x27\x27\x29\x3B\x34\x20\x76\x3D\x27\x27\x3B\x33\x28\x45\x5B\x67\x5D\x3D\x3D\x31\x29\x7B\x76\x3D\x27\x23\x63\x27\x7D\x65\x7B\x76\x3D\x27\x3F\x31\x56\x3D\x27\x2B\x45\x5B\x67\x5D\x2B\x27\x23\x63\x27\x7D\x3B\x39\x2B\x3D\x27\x3C\x31\x73\x3E\x27\x3B\x33\x28\x31\x58\x3D\x3D\x27\x31\x59\x27\x29\x7B\x39\x2B\x3D\x27\x3C\x31\x38\x20\x6B\x3D\x22\x27\x2B\x6B\x5B\x67\x5D\x2B\x27\x22\x20\x31\x74\x3D\x22\x32\x30\x2D\x4E\x22\x20\x6D\x3D\x22\x27\x2B\x6E\x5B\x67\x5D\x2B\x27\x22\x2F\x3E\x27\x7D\x3B\x39\x2B\x3D\x7A\x5B\x67\x5D\x3B\x33\x28\x28\x28\x77\x5B\x67\x5D\x3D\x3D\x4D\x29\x26\x26\x28\x6E\x5B\x67\x5D\x3D\x3D\x4B\x29\x29\x7C\x7C\x28\x28\x77\x5B\x67\x5D\x3D\x3D\x32\x31\x29\x26\x26\x28\x6E\x5B\x67\x5D\x3D\x3D\x32\x32\x29\x29\x29\x7B\x39\x2B\x3D\x27\x20\x27\x2B\x32\x33\x7D\x3B\x39\x2B\x3D\x27\x20\x27\x2B\x31\x71\x2B\x27\x20\x3C\x61\x20\x46\x3D\x22\x27\x2B\x64\x5B\x67\x5D\x2B\x76\x2B\x70\x5B\x67\x5D\x2B\x27\x22\x20\x31\x36\x3D\x22\x31\x37\x22\x20\x43\x3D\x22\x27\x2B\x78\x5B\x67\x5D\x2B\x27\x22\x3E\x27\x2B\x74\x5B\x67\x5D\x2B\x27\x3C\x2F\x61\x3E\x3C\x31\x75\x20\x31\x74\x3D\x22\x32\x35\x22\x3E\x3C\x2F\x31\x75\x3E\x3C\x2F\x31\x73\x3E\x27\x7D\x3B\x39\x2B\x3D\x27\x3C\x2F\x31\x70\x3E\x27\x3B\x4F\x2E\x32\x36\x28\x27\x32\x37\x2D\x51\x2D\x4E\x27\x29\x2E\x31\x43\x3D\x39\x7D\x3B","\x7C","\x73\x70\x6C\x69\x74","\x7C\x7C\x7C\x69\x66\x7C\x76\x61\x72\x7C\x7C\x66\x65\x65\x64\x7C\x61\x32\x7C\x7C\x64\x77\x7C\x7C\x61\x75\x74\x68\x6F\x72\x7C\x7C\x7C\x65\x6C\x73\x65\x7C\x69\x6E\x7C\x7C\x7C\x7C\x7C\x61\x6C\x74\x7C\x6C\x6B\x7C\x73\x72\x63\x7C\x69\x6D\x7C\x7C\x7C\x7C\x73\x63\x72\x69\x70\x74\x7C\x6A\x73\x6F\x6E\x7C\x7C\x7C\x7C\x75\x72\x7C\x6A\x32\x7C\x74\x74\x7C\x70\x72\x7C\x73\x75\x62\x73\x74\x72\x69\x6E\x67\x7C\x72\x65\x70\x6C\x61\x63\x65\x7C\x74\x69\x74\x6C\x65\x7C\x75\x72\x69\x7C\x70\x6E\x7C\x68\x72\x65\x66\x7C\x69\x6D\x61\x67\x65\x7C\x66\x75\x6E\x63\x74\x69\x6F\x6E\x7C\x6E\x63\x7C\x6C\x65\x6E\x67\x74\x68\x7C\x69\x6D\x61\x7C\x67\x64\x7C\x75\x72\x61\x7C\x61\x76\x61\x74\x61\x72\x7C\x64\x6F\x63\x75\x6D\x65\x6E\x74\x7C\x74\x62\x7C\x63\x6F\x6D\x6D\x65\x6E\x74\x73\x7C\x31\x33\x33\x7C\x6E\x75\x6D\x7C\x64\x6F\x74\x7C\x70\x69\x64\x7C\x63\x69\x64\x7C\x64\x32\x7C\x63\x6F\x6E\x74\x65\x6E\x74\x7C\x68\x74\x74\x70\x7C\x6C\x6F\x63\x7C\x73\x75\x6D\x6D\x61\x72\x79\x7C\x6C\x65\x6E\x67\x74\x68\x5F\x63\x6F\x6E\x74\x65\x6E\x74\x7C\x61\x64\x7C\x6C\x61\x73\x74\x49\x6E\x64\x65\x78\x4F\x66\x7C\x72\x63\x5F\x61\x76\x61\x74\x61\x72\x32\x7C\x6C\x65\x6E\x67\x74\x68\x5F\x6E\x61\x6D\x65\x7C\x72\x65\x6C\x7C\x6E\x6F\x66\x6F\x6C\x6C\x6F\x77\x7C\x69\x6D\x67\x7C\x72\x63\x5F\x61\x76\x61\x74\x61\x72\x31\x7C\x74\x6F\x74\x61\x6C\x52\x65\x73\x75\x6C\x74\x73\x7C\x77\x72\x69\x74\x65\x7C\x66\x6F\x72\x7C\x74\x79\x70\x65\x7C\x74\x65\x78\x74\x7C\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x7C\x68\x6F\x6D\x65\x5F\x70\x61\x67\x65\x7C\x66\x65\x65\x64\x73\x7C\x6F\x70\x65\x6E\x53\x65\x61\x72\x63\x68\x7C\x64\x65\x66\x61\x75\x6C\x74\x7C\x6D\x61\x78\x7C\x72\x65\x73\x75\x6C\x74\x73\x7C\x63\x61\x6C\x6C\x62\x61\x63\x6B\x7C\x43\x6F\x6D\x6D\x65\x6E\x74\x73\x7C\x69\x6E\x66\x7C\x75\x6C\x7C\x6F\x6E\x7C\x65\x6E\x74\x72\x79\x7C\x6C\x69\x7C\x63\x6C\x61\x73\x73\x7C\x64\x69\x76\x7C\x67\x69\x66\x7C\x6E\x6F\x5F\x61\x76\x61\x74\x61\x72\x7C\x6E\x6F\x7C\x69\x6E\x66\x6F\x7C\x38\x35\x39\x32\x7C\x64\x75\x79\x70\x68\x61\x6D\x7C\x62\x72\x7C\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C\x7C\x62\x72\x65\x61\x6B\x7C\x74\x68\x72\x7C\x72\x65\x70\x6C\x79\x7C\x6E\x61\x6D\x65\x7C\x74\x6F\x7C\x6C\x69\x6E\x6B\x7C\x32\x30\x30\x7C\x63\x6F\x70\x79\x72\x69\x67\x68\x74\x5F\x62\x79\x5F\x64\x75\x79\x70\x68\x61\x6D\x5F\x64\x6F\x74\x5F\x69\x6E\x66\x6F\x7C\x52\x65\x63\x65\x6E\x74\x7C\x74\x61\x72\x67\x65\x74\x7C\x66\x72\x65\x65\x7C\x76\x65\x72\x73\x69\x6F\x6E\x7C\x62\x79\x7C\x72\x63\x5F\x61\x76\x61\x74\x61\x72\x7C\x70\x61\x72\x73\x65\x49\x6E\x74\x7C\x70\x72\x6F\x66\x69\x6C\x65\x7C\x69\x6D\x67\x31\x7C\x62\x6C\x6F\x67\x62\x6C\x6F\x67\x7C\x63\x6F\x6D\x6D\x65\x6E\x74\x50\x61\x67\x65\x7C\x63\x6F\x6D\x7C\x61\x76\x61\x74\x61\x72\x5F\x73\x68\x6F\x77\x7C\x79\x65\x73\x7C\x73\x70\x6C\x69\x74\x7C\x72\x63\x7C\x61\x64\x6D\x69\x6E\x5F\x75\x72\x69\x7C\x61\x64\x6D\x69\x6E\x5F\x61\x76\x61\x74\x61\x72\x7C\x61\x64\x6D\x69\x6E\x5F\x73\x74\x79\x6C\x65\x7C\x62\x6C\x61\x6E\x6B\x7C\x63\x6C\x65\x61\x72\x7C\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64\x7C\x72\x65\x63\x65\x6E\x74\x7C\x5F\x62\x6C\x61\x6E\x6B","","\x66\x72\x6F\x6D\x43\x68\x61\x72\x43\x6F\x64\x65","\x72\x65\x70\x6C\x61\x63\x65","\x5C\x77\x2B","\x5C\x62","\x67"];eval(function (_a,_b,_c,_d,_e,_f){_e=function (_c){return (_c<_b?dp[4]:_e(parseInt(_c/_b)))+((_c=_c%_b)>35?String[dp[5]](_c+29):_c.toString(36));};if(!dp[4][dp[6]](/^/,String)){while(_c--){_f[_e(_c)]=_d[_c]||_e(_c);};_d=[function (_e){return _f[_e];}];_e=function (){return dp[7];};_c=1;};while(_c--){if(_d[_c]){_a=_a[dp[6]](new RegExp(dp[8]+_e(_c)+dp[8],dp[9]),_d[_c]);};};return _a;}(dp[0],62,133,dp[3][dp[2]](dp[1]),0,{}));
</script>
<script type='text/javascript'>rc_avatar();</script>
</div>
Thay 5 bằng số nhận xét bạn muốn hiển thị, 30 là số ký tự tối đa tên người nhận xét được hiển thị, 150 là số ký tự tối đa trích đoạn nội dung của nhận xét. Nếu không muốn hiển thị avatar hãy thay yes thành ký tự bất kỳ khác.home_page
là biến có giá trị là địa chỉ blog bạn cần hiển thị Recent Comments. Trường hợp tài khoản Blogger của Admin không phải là tài khoản khởi tạo blog thì để hiển thị phân biệt nhận xét của Admin bạn thêm giá trị là địa chỉ Profile Blogger của Admin cho biếnadmin_uri
và giá trị là địa chỉ avatar của Admin cho biếnadmin_avatar
.
Nguồn: blog.duypham.info
0 nhận xét:
Đăng nhận xét