<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3419868</id><updated>2011-04-21T15:46:58.831-07:00</updated><title type='text'>Failsafe YACCS</title><subtitle type='html'>Working out a way to use YACCS that doesn't take down the blog when rateyourmusic.com is down.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://failsafeyaccs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://failsafeyaccs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Phil Ringnalda</name><uri>http://www.blogger.com/profile/02038584071202736706</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://philringnalda.com/img/trees2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3419868.post-75050290</id><published>2002-04-01T07:47:00.000-08:00</published><updated>2003-02-24T10:17:39.000-08:00</updated><title type='text'></title><content type='html'>Working hack, version 0.9.9:&lt;br /&gt;&lt;br /&gt;Add &lt;code&gt;defer="defer"&lt;/code&gt; to the script tag that calls YACCS, something like: &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;script src="http://rateyourmusic.com/bc?b=90000009965" type="text/javascript" defer="defer"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Add a chunk of script to the &amp;lt;head&amp;gt; section of your template, and change the variables at the top to what you want to have shown before and after the count for zero, one, and more than one comment, and for archived (older) comment counts:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;function countcomments(){&lt;br /&gt;zero_pre = 'Comments ['&lt;br /&gt;zero_suf = ']'&lt;br /&gt;zero_show = 1&lt;br /&gt;one_pre = 'Comments ['&lt;br /&gt;one_suf = ']'&lt;br /&gt;one_show = 1&lt;br /&gt;many_pre = 'Comments ['&lt;br /&gt;many_suf = ']'&lt;br /&gt;many_show = 1&lt;br /&gt;archived_text = 'archived'&lt;br /&gt;&lt;br /&gt;if (document.childNodes)&lt;br /&gt;{&lt;br /&gt;if(typeof(ycsx) != "undefined")&lt;br /&gt;{&lt;br /&gt;for (i=0;i&amp;lt;ycsx.length/2;i++)&lt;br /&gt;{&lt;br /&gt;oSpan = document.getElementById("comment"+ycsx[i*2]);&lt;br /&gt;if(oSpan)&lt;br /&gt;{&lt;br /&gt;oSpanText = oSpan.firstChild;&lt;br /&gt;while(oSpanText.nodeType != "3")&lt;br /&gt;{&lt;br /&gt;if(oSpanText.hasChildNodes)&lt;br /&gt;{ &lt;br /&gt;oSpanText = oSpanText.firstChild;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;oSpanText.nodeValue = yaccs_fs_text(ycsx[i*2],zero_pre,zero_suf,zero_show,one_pre,one_suf,one_show,many_pre,many_suf,many_show,archived_text);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Add &lt;code&gt;onload="countcomments();"&lt;/code&gt; to your body tag, something like: &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;body onload="countcomments();"&amp;gt; &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Change your comment link (be sure to use your YACCS blog_id number, not mine!) to something like:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;a href="http://rateyourmusic.com/yaccs/comments?blog_id=90000009965&amp;blog_entry_id=&amp;lt;$BlogItemNumber$&amp;gt;" onclick="window.open(this.href, '_blank', 'scrollbars=yes,resizable=yes,height=400,width=370,left=80,top=80'); return false;"&amp;gt;&amp;lt;span id="comment&amp;lt;$BlogItemNumber$&amp;gt;"&amp;gt;Add a comment&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Notes: the comment link works with or without Javascript, so you don't need a &amp;lt;noscript&amp;gt; link as well; the "Add a comment" text will be what actually shows for zero comments (with the possible exception of posts which had a comment which was later deleted), so you should change that to your "zero comments" text; on Blog*Spot, the ad will sometimes fail to load fully and prevent the body onload event from firing: either just click "Refresh" and it should work the second time, or think of it as a reason to pay for ad-free Blog*Spot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419868-75050290?l=failsafeyaccs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75050290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75050290'/><link rel='alternate' type='text/html' href='http://failsafeyaccs.blogspot.com/2002_03_31_archive.html#75050290' title=''/><author><name>Phil Ringnalda</name><uri>http://www.blogger.com/profile/02038584071202736706</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://philringnalda.com/img/trees2.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-3419868.post-75047108</id><published>2002-03-30T09:19:00.000-08:00</published><updated>2002-03-30T16:18:49.000-08:00</updated><title type='text'></title><content type='html'>Working hack, version 0.9:&lt;br /&gt;&lt;br /&gt;Add &lt;code&gt;defer="defer"&lt;/code&gt; to the script tag that calls YACCS, something like:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;script src="http://rateyourmusic.com/bc?b=90000009965" type="text/javascript" defer="defer"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Add another big chunk of script to the &amp;lt;head&amp;gt; section of your template (this will get better once Hossein gives us a function in the remote script that we can call to get the link text):&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;function failsafe_yaccs_linktext(count){&lt;br /&gt;   zero_pre = 'Comments ['&lt;br /&gt;   zero_suff = ']'&lt;br /&gt;   zero_show = 1&lt;br /&gt;   one_pre = 'Comments ['&lt;br /&gt;   one_suf = ']'&lt;br /&gt;   one_show = 1&lt;br /&gt;   many_pre = 'Comments ['&lt;br /&gt;   many_suf = ']'&lt;br /&gt;   many_show = 1&lt;br /&gt;   archived_text = 'archived'&lt;br /&gt;&lt;br /&gt;   prefix = ''&lt;br /&gt;   middle = ''&lt;br /&gt;   suffix = ''&lt;br /&gt;   &lt;br /&gt;   if(count == -1)&lt;br /&gt;   {&lt;br /&gt;      prefix = archived_text&lt;br /&gt;      middle = ''&lt;br /&gt;      suffix = ''&lt;br /&gt;   }&lt;br /&gt;   else if(count == 0)&lt;br /&gt;   {&lt;br /&gt;      prefix = zero_pre&lt;br /&gt;      suffix = zero_suf&lt;br /&gt;&lt;br /&gt;      if(zero_show==1) &lt;br /&gt;      {&lt;br /&gt;         middle = count&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;   else if (count==1)&lt;br /&gt;   {&lt;br /&gt;      prefix = one_pre&lt;br /&gt;      suffix = one_suf&lt;br /&gt;&lt;br /&gt;      if(one_show == 1)&lt;br /&gt;      {&lt;br /&gt;         middle=count&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;      prefix = many_pre&lt;br /&gt;      suffix = many_suf&lt;br /&gt;&lt;br /&gt;      if(many_show==1)&lt;br /&gt;      {&lt;br /&gt;         middle = count&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;   return prefix+middle+suffix&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function countcomments(){&lt;br /&gt;   if (document.childNodes)&lt;br /&gt;   {&lt;br /&gt;      if(typeof(ycsx) != "undefined")&lt;br /&gt;      {&lt;br /&gt;         for (i=0;i&amp;lt;ycsx.length/2;i++)&lt;br /&gt;         {&lt;br /&gt;            oSpan = document.getElementById("comment"+ycsx[i*2]);&lt;br /&gt;            if(oSpan)&lt;br /&gt;            {&lt;br /&gt;               oSpanText = oSpan.firstChild;&lt;br /&gt;               while(oSpanText.nodeType != "3")&lt;br /&gt;               {&lt;br /&gt;                  if(oSpanText.hasChildNodes)&lt;br /&gt;                  { &lt;br /&gt;                     oSpanText = oSpanText.firstChild;&lt;br /&gt;                  }&lt;br /&gt;                  else&lt;br /&gt;                  {&lt;br /&gt;                     return false;&lt;br /&gt;                  }&lt;br /&gt;               }&lt;br /&gt;               oSpanText.nodeValue = failsafe_yaccs_linktext(ycsx[i*2+1]);&lt;br /&gt;            }&lt;br /&gt;         }&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Add &lt;code&gt; onload="countcomments();"&lt;/code&gt; to your body tag, something like:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;body onload="countcomments();"&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Change your comment link to:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;a href="http://rateyourmusic.com/yaccs/comments?blog_id=90000009965&amp;blog_entry_id=&amp;lt;$BlogItemNumber$&amp;gt;" &lt;br /&gt;onclick="window.open(this.href, '_blank', 'scrollbars=yes,resizable=yes,height=400,width=370,left=80,top=80'); return false;"&amp;gt;&amp;lt;span id="comment&amp;lt;$BlogItemNumber$&amp;gt;"&amp;gt;Add a comment&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To see what happens when the remote script fails to load, go to my &lt;a href="http://yaccsfailtest.blogspot.com"&gt;yaccsfailtest&lt;/a&gt; example.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419868-75047108?l=failsafeyaccs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75047108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75047108'/><link rel='alternate' type='text/html' href='http://failsafeyaccs.blogspot.com/2002_03_24_archive.html#75047108' title=''/><author><name>Phil Ringnalda</name><uri>http://www.blogger.com/profile/02038584071202736706</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://philringnalda.com/img/trees2.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-3419868.post-75046410</id><published>2002-03-29T20:58:00.000-08:00</published><updated>2002-03-29T20:58:45.510-08:00</updated><title type='text'></title><content type='html'>Then, autoinstall YACCS (damn, that's cool stuff!).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419868-75046410?l=failsafeyaccs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75046410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75046410'/><link rel='alternate' type='text/html' href='http://failsafeyaccs.blogspot.com/2002_03_24_archive.html#75046410' title=''/><author><name>Phil Ringnalda</name><uri>http://www.blogger.com/profile/02038584071202736706</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://philringnalda.com/img/trees2.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-3419868.post-75046404</id><published>2002-03-29T20:53:00.000-08:00</published><updated>2002-03-29T20:53:32.940-08:00</updated><title type='text'></title><content type='html'>First, we need a post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419868-75046404?l=failsafeyaccs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75046404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419868/posts/default/75046404'/><link rel='alternate' type='text/html' href='http://failsafeyaccs.blogspot.com/2002_03_24_archive.html#75046404' title=''/><author><name>Phil Ringnalda</name><uri>http://www.blogger.com/profile/02038584071202736706</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://philringnalda.com/img/trees2.jpg'/></author></entry></feed>
