<?xml version="1.0" encoding="iso-8859-2"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Fractured Bloughts &#187; PHP</title>
	<atom:link href="http://fracturedbloughts.rolandhesz.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://fracturedbloughts.rolandhesz.com</link>
	<description>Musings about work and life</description>
	<lastBuildDate>Mon, 10 May 2010 19:52:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Running on a new WP theme</title>
		<link>http://fracturedbloughts.rolandhesz.com/2009/08/24/running-on-a-new-wp-theme/</link>
		<comments>http://fracturedbloughts.rolandhesz.com/2009/08/24/running-on-a-new-wp-theme/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 17:15:03 +0000</pubDate>
		<dc:creator>Roland Hesz</dc:creator>
				<category><![CDATA[Popular]]></category>
		<category><![CDATA[Site news]]></category>
		<category><![CDATA[Blog Theme]]></category>
		<category><![CDATA[disqus]]></category>
		<category><![CDATA[Headway Theme]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plug in]]></category>

		<guid isPermaLink="false">http://fracturedbloughts.rolandhesz.com/?p=674</guid>
		<description><![CDATA[I have fallen for the recommendations, and bought and installed the Headway Theme Finally, got it working too. It is easy, everything is a snap, except when you have want to make some really &#8220;fancy&#8221; thing on your site &#8211; like the Video Posts on the right -, then it&#8217;s php coding. Or when it [...]]]></description>
			<content:encoded><![CDATA[<p>I have fallen for the recommendations, and bought and installed the <a title="Headway Themes" href="http://headwaythemes.com/">Headway Theme</a></p>
<p>Finally, got it working too. It is easy, everything is a snap, except when you have want to make some really &#8220;fancy&#8221; thing on your site &#8211; like the Video Posts on the right -, then it&#8217;s php coding. Or when it chokes on plugins, like on <a class="zem_slink" title="DISQUS" rel="homepage" href="http://www.disqus.com/">Disqus</a>. Don&#8217;t know why, but it simply could not handle it.</p>
<p>I wonder what can cause this behaviour, as people say they are running it without trouble &#8211; I am well prepared now for the flaming I&#8217;m going to get for pointing out problems :) &#8211; but below you can see the problem in all it&#8217;s glory.</p>
<p><object style="width: 622px; height: 230px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="622" height="230" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://fracturedbloughts.rolandhesz.com/wp-content/uploads/2009/08/brokenfeatur.swf" /><embed style="width: 622px; height: 230px;" type="application/x-shockwave-flash" width="622" height="230" src="http://fracturedbloughts.rolandhesz.com/wp-content/uploads/2009/08/brokenfeatur.swf"></embed></object></p>
<p>The tricky thing is what I have discovered is that it only happens in the Featured leaf, and then only when I set it to Rotate the posts.</p>
<p>The solution for now was pure hacking. The Disqus code that seems to be the cuplrit &#8211; or the victim, depends on how you look at it &#8211; can be found in the disqus.php:</p>
<pre><code>
function dsq_comment_count() {
  global $dsq_cc_script_embedded;
  if ( $dsq_cc_script_embedded ) {
    return;
  } else if ( (is_single() || is_page() || $withcomments || is_feed()) ) {
    return;
  }
  ?&gt;
  &lt;script type="text/javascript"&gt;
  // &lt;![CDATA[
   (function() {
     var links = document.getElementsByTagName('a');
     var query = '&amp;';
     for(var i = 0; i &lt; links.length; i++) {
       if(links[i].href.indexOf('#disqus_thread') &gt;= 0) {
       links[i].innerHTML = 'View Comments';
       query += 'wpid' + i + '=' + encodeURIComponent(links[i].getAttribute('wpid')) + '&amp;';
     }
   }
   document.write('&lt;script charset="utf-8" type="text/javascript" src="&lt;?php echo DISQUS_URL ?&gt;/forums/&lt;?php echo strtolower(get_option('disqus_forum_url')); ?&gt;/get_num_replies_from_wpid.js?v=2.0' + query + '"&gt;&lt;' + '/script&gt;');
 })();
 //]]&gt;
 &lt;/script&gt;
 &lt;?php
   $dsq_cc_script_embedded = true;
}</code></pre>
<p><span style="text-decoration: line-through;">This only happened in the Featured Post leaf, and only when I enabled Rotate &#8211; maybe the rotate script and the Disqus script get tangled. I don&#8217;t know.</span></p>
<p><span style="text-decoration: line-through;">For now what I have done is pure, and serious no-no hacking. I have commented out the code between <code>&lt;script type="text/javascript"&gt;// &lt;![CDATA[</code> and <code>// ]]&gt;&lt;/script&gt;</code>.</span><br />
<span style="text-decoration: line-through;">Evidently it is the wrong solution, but for now it works, and I am going to find out the proper one.</span></p>
<p><strong>UPDATE: </strong>After a bit of thinking I have decided to instead implement a more cultured temporary solution.<br />
I have changed this line:</p>
<pre><code>} else if ( (is_single() || is_page() || $withcomments || is_feed()) ) {</code></pre>
<p>to this line:</p>
<pre><code>} else if ( (is_home() || is_single() || is_page() || $withcomments || is_feed()) ) {</code></pre>
<p>Yes, I know that was the logical thing from the start.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 339px; width: 1px; height: 1px;">&amp;gt;</div>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.avc.com/a_vc/2009/08/disqus-v3-is-live-on-this-blog.html">Disqus V3 Is Live On This Blog</a> (avc.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.slideshare.net/jeremyclarke/wordpress-theming-for-epic-n00bs-intro-to-template-tags-themes-and-php">WordPress Theming for Epic n00bs: Intro to Template Tags, Themes and PHP</a> (slideshare.net)</li>
<li class="zemanta-article-ul-li"><a href="http://www.benway.net/2009/07/18/disqus-and-wibiya/">Disqus and Wibiya</a> (benway.net)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/f258e61b-264c-477d-9018-0889ceece5f4/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=f258e61b-264c-477d-9018-0889ceece5f4" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://fracturedbloughts.rolandhesz.com/2009/08/24/running-on-a-new-wp-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
