Just simply edit the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url. and done This hack probably is one of the oldest blogger hacks ever. So easy, Just do this steps; 6. Click Save Changes Hey Jack, I can do that, but i’m to lazy to do all that, can’t just give me any simpler way? But still, you need to edit the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url. Jack, I see that you have a Recent Post. Can I have that too for my blogspot / blogger blog? There you’ll see that the script source is like this: see the word comment with green color there? Oh and also don’t forget about the title, see <h2>RECENT COMMENTS</h2> there? You know what to do Jack, I’m too lazy to… Jack, I don’t like the result. it’s shown as a list. How can i modify it? 1. Click this file. yes i mean this. The link will let you download the javascript file resource. There are some parameters you can use, they are: 5. There you’ll see that i have this lines inside Basically, the structure of the file is like this 6. Here you can modify the result. Just remember to always backup your original widget first if you want to do any changing or modifying on them. Wish you luck and Have a nice try.
If you want to learn about this widget, then please read this article moreRecent Comments on Blogger
1. Go to your Dashboard
2. Go to Template Tab
3. There you will see a widget manager. Click Add a Page Elements on the section you want to place the recent comment.
4. Now you should see a list of widget elements you can pick. click on the Add to Blog Button under HTML/Javascript. this element is useful if we want to add a 3rd party functionality or other code. so we pick this. remember to choose this elements each time you need to add third-party codes.
5. Now you should have a new popup window open,
- Leave the title blank
- And go to the content area.
- Copy this Code and paste on that widget content area.
please note: you should change the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url.<script src="http://files.lifewg.googlepages.com/blogger-widget.js"></script>
<script>
var numposts = 10;
var showpostdate = false;
var showpostsummary = false;
var numchars = 100;
</script>
<h2>RECENT COMMENTS</h2>
<script src="http://YourBlogNameHere.blogspot.com/feeds/comments/default?orderby=published&alt=json-in-script&callback=rp"></script>
7. Refresh your blog and done.
Oh yes of course. for you lazy boy, you can click on the button below, and just follow the instruction. yeah.. it’s easier for you lazy boy
Recent Posts on Blogger
Yes Sir, You can! If you are not too lazy. you can follow the steps above, just focus on the last line. we need to make some changing there.
src="http://YourBlogNameHere.blogspot.com/feeds/comments/default?orderby=published&alt=json-in-script&callback=rp"
Comments means it will gives you list of comments. change it with posts if you want to have a list of your recent posts.
It should become like this:src="http://YourBlogNameHere.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=rp"
ok.. ok.. here it is
And still, you need to edit the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url.
Oh.. I see that you are not that lazy
Ok, please just follow this steps carefully
2. You would probably seen your browsers is asking you whether to open or to save the file. Choose to save it as wherever you want.
3. Open it with Notepad or your favorite editor. I use Textpad
4. The source would be like this;//credit to hoctro
function rp(json) {
document.write('<ul>');for (var i = 0; i < numposts; i++) {
document.write('<li>');
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.link[k].href;
break;
}
}
posttitle = posttitle.link(posturl);
var readmorelink = "(more)";
readmorelink = readmorelink.link(posturl);
var postdate = entry.published.$t;
var cdyear = postdate.substring(0,4);
var cdmonth = postdate.substring(5,7);
var cdday = postdate.substring(8,10);
var monthnames = new Array();
monthnames[1] = "Jan";
monthnames[2] = "Feb";
monthnames[3] = "Mar";
monthnames[4] = "Apr";
monthnames[5] = "May";
monthnames[6] = "Jun";
monthnames[7] = "Jul";
monthnames[8] = "Aug";
monthnames[9] = "Sep";
monthnames[10] = "Oct";
monthnames[11] = "Nov";
monthnames[12] = "Dec";
if ("content" in entry) {
var postcontent = entry.content.$t;
} else if ("summary" in entry) {
var postcontent = entry.summary.$t;
} else
var postcontent = "";
var re = /<\S[^>]*>/g;
postcontent = postcontent.replace(re, "");
document.write(posttitle);
if (showpostdate == true) document.write(' - ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday);
if (showpostsummary == true) {
if (postcontent.length < numchars) {
document.write(postcontent);
} else {
postcontent = postcontent.substring(0, numchars);
var quoteEnd = postcontent.lastIndexOf(" ");
postcontent = postcontent.substring(0,quoteEnd);
document.write(postcontent + '...' + readmorelink);
}
}
document.write('</li>');
}
document.write('</ul>');
}
var numposts = 10; /* How many posts do you want?
var showpostdate = false; /* DO you want us to show the date?
var showpostsummary = false; /* Do you want to show the post summary?
var numchars = 100; /* If you want to show the post summary, how many characters do you want to show?document.write('<ul>');document.write('<li>');
document.write('</li>');
document.write('</ul>');function rp(json) {
HERE YOU CAN ADD ANYTHING YOU WANT, AS AN EXAMPLE IS TITLE
document.write('<ul>'); //This 2 line should keep together, without any text or whate-
(loop function start)
document.write('<li>'); // ver inside it. so don't put anything here.
------------------------------------------------------------------
HERE IS THE CONTENT.
YOUR CONTENT WOULD BE REPEATED HERE.
------------------------------------------------------------------
document.write('</li>'); //This 2 line should keep together, without any text or whate-
(loop function stop)
document.write('</ul>'); // ver inside it. so don't put anything here.
if you don’t like it’s shown on a list, you can delete all 4 lines. so it becomes like thisfunction rp(json) {
HERE YOU CAN ADD ANYTHING YOU WANT, AS AN EXAMPLE IS TITLEdocument.write('<ul>'); //This 2 line should keep together, without any text or whate-
(loop function start)document.write('<li>'); // ver inside it. so don't put anything here.
------------------------------------------------------------------
HERE IS THE CONTENT.
YOUR CONTENT WOULD BE REPEATED HERE.
------------------------------------------------------------------document.write('</li>'); //This 2 line should keep together, without any text or whate- HERE YOU CAN ADD ANYTHING TO SEPARATE BETWEEN CONTENT RESULTS LINES. example <br/>
(loop function stop)document.write('</ul>'); // ver inside it. so don't put anything here.
Thứ Ba, 21 tháng 10, 2008
Recent Comment on blogger and Recent Post on Blogger - Teach you how to customize it
Người đăng: ngthloi vào lúc 20:45
Nhãn: Tip+Tricks, Tutorials
Đăng ký:
Đăng Nhận xét (Atom)
0 nhận xét:
Đăng nhận xét