tag:blogger.com,1999:blog-1622718725665192500.post6088666082392358610..comments2023-10-15T06:35:34.233-07:00Comments on Fruitful Bookmarks (eng): How to sort blogger posts by popularityffbshttp://www.blogger.com/profile/17456754845646147816noreply@blogger.comBlogger44125tag:blogger.com,1999:blog-1622718725665192500.post-20307375588085690752012-12-13T10:40:52.854-08:002012-12-13T10:40:52.854-08:00I think the code is not an issue now. It seems tha...I think the code is not an issue now. It seems that the problem is that you have the same tops with the same callback on your posts (in the sidebar), so the static pages load the tops and the tops are trying to load posts to display them on static page, the posts have tops too and trying to execute same callback function, so all this falls into recursion and fails badly. You need to re-think structure of your template if you want to use static top pages, you definitely need to remove callback from the tops code on your post pages (callback=gradditLoadTopPosts), why are they there? This callback function should be called only on static pages, not inside posts.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-3911713936585974742012-12-13T08:32:49.283-08:002012-12-13T08:32:49.283-08:00i just done what you said and its still the same f...i just done what you said and its still the same fruits this time page loads and its same as the sidebar widget and after 5 seconds the page turns into full screen and the top widget keeps looping all the way down have a look<br /><br />http://bengalipiffs.blogspot.co.uk/p/top-post.html<br /><br />this is how statis page looks <br /><br /><script type='text/javascript'> <br /> function gradditLoadTopPosts(id) { <br /> var element = $("#" + id); <br /> if (element.length > 0) { <br /> var wrapperDiv = $("#top5"); <br /> if (wrapperDiv.length == 1) { <br /> element.find("a").each(function(i, a) { <br /> var host = a.hostname; <br /> var blogHost = "bengalipiffs.blogspot"; <br /> if (host.indexOf(blogHost) >= 0) { <br /> var docHost = document.location.host + ""; <br /> var level1Doc = docHost.substring(blogHost.length, docHost.length); <br /> var level1Post = host.substring(blogHost.length, host.length); <br /> var link = a.href; <br /> if (level1Doc != level1Post) { <br /> link = link.replace(blogHost + level1Post, blogHost + level1Doc); <br /> } <br /> var containerId = "top_posts_" + i; <br /> wrapperDiv.append("<div id='" + containerId + "' style='display: none;'></div>"); <br /> var container = $("#" + containerId); <br /> container.load(link); <br /> setTimeout(function() { <br /> var post = container.find("div[class='post hentry']"); <br /> if (post.length > 0) { <br /> var newText = ""; <br /> if (i > 0) { <br /> newText = "<hr style='width: 100%; clear: both;'/>" <br /> } <br /> newText += gradditCutText(post.html(), 900, 2) + "<" + "br /><" + "br/>"; <br /> var startIdx = newText.indexOf("<h3 class="post-title entry-title">"); <br /> var endIdx = newText.indexOf("</h3>"); <br /> newText = newText.substr(0, startIdx) + "<a href='" + link + "'>" + newText.substr(startIdx, endIdx - startIdx + 5) + "</a>" + newText.substr(endIdx, newText.length); <br /> container.html(newText); <br /> container.show(); <br /> } <br /> }, 2000 * (i + 1)); <br /> } <br /> }); <br /> } <br /> } <br /> } <br /> </script> <br /><br /><div id="top5"><br /></div><br /><div id="graddit_top_wrapper4"></div><br /><script src="http://www.graddit.com/showtop/eng/39?id=graddit_top_wrapper4" type="text/javascript"></script>kawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-30673487351867982722012-12-13T08:25:17.553-08:002012-12-13T08:25:17.553-08:00Ok, now change this:
var blogHost = "bengali...Ok, now change this:<br /><br />var blogHost = "bengalipiffs.blogspot.co.uk";<br /><br />to this:<br /><br />var blogHost = "bengalipiffs.blogspot";<br /><br />If you'll check my function, it doesn't have country domain in there, it's made on purpose. Lets see if that'll help.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-72504593501077980162012-12-13T07:20:20.285-08:002012-12-13T07:20:20.285-08:00ignore the brackets <b> </b> sorry i t...ignore the brackets <b> </b> sorry i try make this text bold but didn't work<br />anyway still does not work fruits still the same mate <br /><br />check it again and let me know<br /><br />http://bengalipiffs.blogspot.co.uk/p/top-post.htmlkawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-87391979208207015762012-12-13T07:17:12.078-08:002012-12-13T07:17:12.078-08:00ok this is how it looks right now
<b>on blo...ok this is how it looks right now<br /><br /><b>on blogger template underneath the head it looks like this</b><br /><br /><head> <br /><script src='http://static.graddit.com/js/graddit-extras.js' type='text/javascript'/><br /><br /><br /><b>on static page it looks like this</b><br /><br /><script type='text/javascript'> <br /> function gradditLoadTopPosts(id) { <br /> var element = $("#" + id); <br /> if (element.length > 0) { <br /> var wrapperDiv = $("#top5"); <br /> if (wrapperDiv.length == 1) { <br /> element.find("a").each(function(i, a) { <br /> var host = a.hostname; <br /> var blogHost = "bengalipiffs.blogspot.co.uk"; <br /> if (host.indexOf(blogHost) >= 0) { <br /> var docHost = document.location.host + ""; <br /> var level1Doc = docHost.substring(blogHost.length, docHost.length); <br /> var level1Post = host.substring(blogHost.length, host.length); <br /> var link = a.href; <br /> if (level1Doc != level1Post) { <br /> link = link.replace(blogHost + level1Post, blogHost + level1Doc); <br /> } <br /> var containerId = "top_posts_" + i; <br /> wrapperDiv.append("<div id='" + containerId + "' style='display: none;'></div>"); <br /> var container = $("#" + containerId); <br /> container.load(link); <br /> setTimeout(function() { <br /> var post = container.find("div[class='post hentry']"); <br /> if (post.length > 0) { <br /> var newText = ""; <br /> if (i > 0) { <br /> newText = "<hr style='width: 100%; clear: both;'/>" <br /> } <br /> newText += gradditCutText(post.html(), 900, 2) + "<" + "br /><" + "br/>"; <br /> var startIdx = newText.indexOf("<h3 class="post-title entry-title">"); <br /> var endIdx = newText.indexOf("</h3>"); <br /> newText = newText.substr(0, startIdx) + "<a href='" + link + "'>" + newText.substr(startIdx, endIdx - startIdx + 5) + "</a>" + newText.substr(endIdx, newText.length); <br /> container.html(newText); <br /> container.show(); <br /> } <br /> }, 2000 * (i + 1)); <br /> } <br /> }); <br /> } <br /> } <br /> } <br /> </script> <br /><br /><div id="top5"><br /></div><br /><div id="graddit_top_wrapper4"></div><br /><script src="http://www.graddit.com/showtop/eng/39?id=graddit_top_wrapper4" type="text/javascript"></script>kawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-65562264826157029972012-12-13T06:57:17.542-08:002012-12-13T06:57:17.542-08:00First of all, remove jQuery include from the stati...First of all, remove jQuery include from the static page body, you have it already in you template above, these two includes may be conflicting; let me know when done, I'll check if there's any other issues with the tops.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-80400096275223884252012-12-13T02:12:57.536-08:002012-12-13T02:12:57.536-08:00and here is the static page link
http://bengalipi...and here is the static page link<br /><br />http://bengalipiffs.blogspot.co.uk/p/top-post.html<br /><br />kawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-72118212891334696782012-12-13T02:12:00.395-08:002012-12-13T02:12:00.395-08:00no stil not working heres the code inside my stati...no stil not working heres the code inside my static template<br /><br /><br /><script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/> <br /><br /> <script type='text/javascript'> <br /> function gradditLoadTopPosts(id) { <br /> var element = $("#" + id); <br /> if (element.length > 0) { <br /> var wrapperDiv = $("#top5"); <br /> if (wrapperDiv.length == 1) { <br /> element.find("a").each(function(i, a) { <br /> var host = a.hostname; <br /> var blogHost = "bengalipiffs.blogspot.co.uk"; <br /> if (host.indexOf(blogHost) >= 0) { <br /> var docHost = document.location.host + ""; <br /> var level1Doc = docHost.substring(blogHost.length, docHost.length); <br /> var level1Post = host.substring(blogHost.length, host.length); <br /> var link = a.href; <br /> if (level1Doc != level1Post) { <br /> link = link.replace(blogHost + level1Post, blogHost + level1Doc); <br /> } <br /> var containerId = "top_posts_" + i; <br /> wrapperDiv.append("<div id='" + containerId + "' style='display: none;'></div>"); <br /> var container = $("#" + containerId); <br /> container.load(link); <br /> setTimeout(function() { <br /> var post = container.find("div[class='post hentry']"); <br /> if (post.length > 0) { <br /> var newText = ""; <br /> if (i > 0) { <br /> newText = "<hr style='width: 100%; clear: both;'/>" <br /> } <br /> newText += gradditCutText(post.html(), 900, 2) + "<" + "br /><" + "br/>"; <br /> var startIdx = newText.indexOf("<h3 class="post-title entry-title">"); <br /> var endIdx = newText.indexOf("</h3>"); <br /> newText = newText.substr(0, startIdx) + "<a href='" + link + "'>" + newText.substr(startIdx, endIdx - startIdx + 5) + "</a>" + newText.substr(endIdx, newText.length); <br /> container.html(newText); <br /> container.show(); <br /> } <br /> }, 2000 * (i + 1)); <br /> } <br /> }); <br /> } <br /> } <br /> } <br /> </script> <br /><br /><div id="top5"><br /></div><br /><div id="graddit_top_wrapper4"></div><br /><script src="http://www.graddit.com/showtop/eng/39?id=graddit_top_wrapper4" type="text/javascript"></script>kawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-75936118472750187042012-12-12T17:08:53.808-08:002012-12-12T17:08:53.808-08:00I have also update the code in paragraph 5 to work...I have also update the code in paragraph 5 to work properly with national domains, so it now should be working for all (.com, .co.uk, etc.) - don't forget to take newer code.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-71098347875657291012012-12-12T10:13:35.981-08:002012-12-12T10:13:35.981-08:00Give me the link to that static page.Give me the link to that static page.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-41768735174520855142012-12-12T06:51:22.817-08:002012-12-12T06:51:22.817-08:00hi now i pasted into static page
i have done ever...hi now i pasted into static page<br /><br />i have done everything you said but there is no difference in tops the tops on the static page is exactly the same as my sidebar widget tops, i think somethink must be wrongkawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-10335640157395397952012-12-12T06:26:38.463-08:002012-12-12T06:26:38.463-08:00Ok, my instruction wasn't clear that you need ...Ok, my instruction wasn't clear that you need to add JS function inside your static page, not template. I've changed paragraph 4 to reflect this. Did you add function to template or to static page? It's prepared to be in static page, not in the template. I've just tried it on my test blog, didn't get that XML error.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-8280877280824630292012-12-12T05:58:48.497-08:002012-12-12T05:58:48.497-08:00i tryed the new code still dosnt work
Error parsi...i tryed the new code still dosnt work<br /><br />Error parsing XML, line 31, column 72:<br /><br />which is still the br tagskawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-21992650283205483632012-12-11T13:29:22.327-08:002012-12-11T13:29:22.327-08:00Oh, now I think I've got it. The issue is that...Oh, now I think I've got it. The issue is that Blogger editor replaces some characters, so the they got lost in JS listing above: a couple of br tags in line 22 of paragraph 5. I've rewritten that line, so it should not cause this error anymore. Please try.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-34700902988011195022012-12-11T10:02:55.445-08:002012-12-11T10:02:55.445-08:00hey fruits have you updated those site yet because...hey fruits have you updated those site yet because i still cannot see the preview its empty page i am trying to follw this guide but theres a problem with your script blogger dosnt parse it corectly so it wount save template you seekawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-26356734156901737542012-11-29T09:49:20.102-08:002012-11-29T09:49:20.102-08:00This error isn't really informative, you'l...This error isn't really informative, you'll need to remove the function (possibly line by line) and try save template to figure out what part of it causes problem. Good think to do would be to have all this kind of stuff in a separate file. Regarding blank pages - yes, I guess I know what's the reason, it's blogger replacing .com with .co.uk (or similar) that causes origin JS error. I'll try to fix that.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-71428324703045527792012-11-28T20:28:44.149-08:002012-11-28T20:28:44.149-08:00hello again fruitfulbookmarks
i have tried to foll...hello again fruitfulbookmarks<br />i have tried to following this blog page tutorial<br /><br />How to sort blogger posts by popularity <br /><br />i got stuck on step 5<br /><br />after copying that script, when saving blogger gives a error<br /><br />"Error parsing XML,Open quote is expected for attribute "{1}" associated with an element type "class"."<br /><br />so it wont save? what do i do?<br /><br />also your demo pages is not working either <br /><br />http://fruitfulbookmarks-en.blogspot.com/p/top-posts.html<br />http://fruitfulbookmarks-en.blogspot.com/p/top-posts-about-blogspot.html<br /><br />both these page content are blank<br /><br />kawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-85842017731956722642012-11-28T16:28:47.089-08:002012-11-28T16:28:47.089-08:00i done the tops widget on same page
it works i gav...i done the tops widget on same page<br />it works i gave unique div id and i change script <br />&callback=gradditLoadTopPosts<br />and it works thanks alot kawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-82250910763421705762012-11-28T13:12:02.474-08:002012-11-28T13:12:02.474-08:00If I copy this to blogger template will I b able t...If I copy this to blogger template will I b able to change with bloggerkawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-75077799464592014882012-11-28T12:46:16.722-08:002012-11-28T12:46:16.722-08:00I don't think I understood your request, but i...I don't think I understood your request, but if you just want to change custom graddit css, take original here: http://static.graddit.com/css/graddit.css, change it and save to some public hosting (like google sites) and use it instead of graddit.css.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-51898485692736388572012-11-28T11:48:24.035-08:002012-11-28T11:48:24.035-08:00Ok thanks hey fruitful bookmark how do I change st...Ok thanks hey fruitful bookmark how do I change store the CSS for the sidebar tops and voting widget stars on my website I want to change CSS for those div tags how do I get the source to put on blogger skins thankskawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-41704666350352943182012-11-28T06:11:44.774-08:002012-11-28T06:11:44.774-08:00You can't set 2 minutes, minimum is 60 minutes...You can't set 2 minutes, minimum is 60 minutes. Tops reflect your visitors reaction, it is pointless to have tops that update every 2 minutes, this time is not enough to get number of votes/views that can change list of most viewed pages. Frequent tops update is something you might want to have if you have thousands of visitors that vote every second.ffbshttps://www.blogger.com/profile/17456754845646147816noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-1704782541078859582012-11-28T00:35:18.379-08:002012-11-28T00:35:18.379-08:00I havnt tryed it yet but once I do il let UNO I ha...I havnt tryed it yet but once I do il let UNO I had a question why do tops update take such a long time wats the minimal amount of time to set because I set 2 minutes Dosnt update resets backkawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-65947508915457388012012-11-28T00:35:03.072-08:002012-11-28T00:35:03.072-08:00I havnt tryed it yet but once I do il let UNO I ha...I havnt tryed it yet but once I do il let UNO I had a question why do tops update take such a long time wats the minimal amount of time to set because I set 2 minutes Dosnt update resets backkawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.comtag:blogger.com,1999:blog-1622718725665192500.post-67902836391730289322012-11-28T00:34:33.632-08:002012-11-28T00:34:33.632-08:00I havnt tryed it yet but once I do il let UNO I ha...I havnt tryed it yet but once I do il let UNO I had a question why do tops update take such a long time wats the minimal amount of time to set because I set 2 minutes Dosnt update resets backkawsarhttps://www.blogger.com/profile/16046167478403139068noreply@blogger.com