<?xml version="1.0" encoding="UTF-8"?>
<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/"
	>

<channel>
	<title>Well, at least we got the duck. &#187; php</title>
	<atom:link href="http://ingol.nl/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://ingol.nl/blog</link>
	<description></description>
	<lastBuildDate>Fri, 27 Jan 2012 09:48:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Show the LIVE Status from an OWN3D.TV Livestream with a jQuery Plugin</title>
		<link>http://ingol.nl/blog/2011/06/16/show-the-live-status-from-an-own3d-tv-livestream-with-a-jquery-plugin/</link>
		<comments>http://ingol.nl/blog/2011/06/16/show-the-live-status-from-an-own3d-tv-livestream-with-a-jquery-plugin/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 21:19:23 +0000</pubDate>
		<dc:creator>Onno</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[livestream]]></category>
		<category><![CDATA[own3d]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[zendframework]]></category>

		<guid isPermaLink="false">http://ingol.nl/blog/?p=744</guid>
		<description><![CDATA[Demo
jQuery plug-in source at BitBucket
Examples of how to use the plug-in.
The jQuery OWN3D Plug-in Code.
A simple PHP &#8211; Zend Framework script to enable a cross domain request to the OWN3D API (the full project contains two, one for the live status and one for the channel information).
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ingol.nl/own3d/" target="_blank" style="font-size: 20px">Demo</a><br />
jQuery plug-in <a href="https://bitbucket.org/orlissenberg/jquery-own3d-plugin/src" target="_blank">source at BitBucket</a></p>
<p>Examples of how to use the plug-in.</p>
<pre class="brush: jscript; title: ; notranslate">
// global configuration options
$.own3d.liveurl = 'http://ingol.nl/own3d/live.php';
$.own3d.channelurl = 'http://ingol.nl/own3d/channel.php';

// A single stream
$('#own3d-cowclan').own3d({liveid:'1213', title:'COWCLAN'});
// A single stream with HD
$('#own3d-rebootgpf').own3d({liveid:'1208', title:'REBOOTGPF', hd:true});
// A single stream without title
$('#own3d-1208').own3d({liveid:'1208', hd:true, embed:true, channelid: 'orlissenberg'});
// A single channel, live streams only
$('#channel').own3d({channelid:'clgame', hd:true, embed:true});
// A single channel, live and offline streams
$('#channel-all').own3d({channelid:'clgame', hd:true, showall:true});
</pre>
<p>The jQuery OWN3D Plug-in Code.</p>
<pre class="brush: jscript; title: ; notranslate">
(function($){
  $.own3d = {
    liveurl : 'live.php',
    channelurl : 'channel.php'
  };

  $.fn.own3d = function(options) {
    return this.each(function(){
      var self = $(this);
      self.data('liveid', options.liveid);

      if (options &amp;amp;amp;&amp;amp;amp; options.liveid) {
        $.ajax({
            type: &amp;amp;quot;GET&amp;amp;quot;,
            async: true,
            data: {live_id:options.liveid},
            url: $.own3d.liveurl,
            dataType: &amp;amp;quot;jsonp&amp;amp;quot;,
            success: function(data){
              var title = (options.title) ? options.title : 'OWN3D CHANNEL ['+options.liveid+']';
              var liveclass = (options.hd) ? 'own3d-live-hd' : 'own3d-live';

              self.empty();
              self.addClass('own3d');

              var link = $('&amp;amp;lt;a/&amp;amp;gt;')
                  .attr('href','http://www.own3d.tv/live/'+options.liveid)
                  .attr('target','_blank');

              if (data.isLive &amp;amp;amp;&amp;amp;amp; data.isLive == 'true') {
                link.html(title+' - LIVE (viewers: '+data.liveViewers+' - duration: '+Math.round(parseInt(data.liveDuration) / 60)+' minutes)');

                if ((options.showthumbnail || options.embed) &amp;amp;amp;&amp;amp;amp; options.channelid) {
                  $.ajax({
                      type: &amp;amp;quot;GET&amp;amp;quot;,
                      async: true,
                      data: {channel_id : options.channelid, stream_guid : 'http://www.own3d.tv/live/'+options.liveid},
                      url: $.own3d.channelurl,
                      dataType: &amp;amp;quot;jsonp&amp;amp;quot;,
                      success: function(data){
                        if (options.showthumbnail &amp;amp;amp;&amp;amp;amp; data.thumbnail) {
                          var table = $('&amp;amp;lt;table/&amp;amp;gt;');

                          var status = $('&amp;amp;lt;td/&amp;amp;gt;').append($('&amp;amp;lt;div/&amp;amp;gt;').addClass(liveclass).append(link));
                          table.append($('&amp;amp;lt;tr/&amp;amp;gt;').append(status));

                          var thumbnail = $('&amp;amp;lt;td/&amp;amp;gt;').append($('&amp;amp;lt;img/&amp;amp;gt;').attr('src',data.thumbnail));
                          table.append($('&amp;amp;lt;tr/&amp;amp;gt;').append(thumbnail));

                          self.append(table);
                        } else if (options.embed &amp;amp;amp;&amp;amp;amp; data.title) {

                            var e = '&amp;amp;lt;iframe height=&amp;amp;quot;360&amp;amp;quot; width=&amp;amp;quot;640&amp;amp;quot; frameborder=&amp;amp;quot;0&amp;amp;quot; src=&amp;amp;quot;http://www.own3d.tv/liveembed/'+self.data('liveid')+'&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/iframe&amp;amp;gt;';
                            var table = $('&amp;amp;lt;table/&amp;amp;gt;');

                            var status = $('&amp;amp;lt;td/&amp;amp;gt;').append($('&amp;amp;lt;div/&amp;amp;gt;').addClass(liveclass).append(link));
                            table.append($('&amp;amp;lt;tr/&amp;amp;gt;').append(status));

                            var embeddedplayer = $('&amp;amp;lt;td/&amp;amp;gt;').html(e);
                            table.append($('&amp;amp;lt;tr/&amp;amp;gt;').append(embeddedplayer));

                            self.append(table);
                        };
                      },
                      error: function(XMLHttpRequest, textStatus, errorThrown){
                        // console.debug(errorThrown);
                      }
                  });
                } else {
                  self.append(link);
                  self.addClass(liveclass);
                }
              } else {
                link.html(title+' - OFFLINE');
                self.removeClass(liveclass);
                self.append(link);
              }
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                // console.debug(errorThrown);
            }
        });
      } else if (options &amp;amp;amp;&amp;amp;amp; options.channelid) {
        var ajaxdata = {
          channel_id : options.channelid
        };
        if (options.showall) { ajaxdata.showall = 1; };

        $.ajax({
            type: &amp;amp;quot;GET&amp;amp;quot;,
            async: true,
            data: ajaxdata,
            url: $.own3d.channelurl,
            dataType: &amp;amp;quot;jsonp&amp;amp;quot;,
            success: function(data){
              self.empty();

              var embedded = true;
              for(var i=0;i&amp;amp;lt;data.streams.length;i++) {
                var stream = data.streams[i];

                var plugindata = {
                  liveid : stream.liveid,
                  title : stream.title,
                  channelid : options.channelid,
                  // embed the first, thumbnail the rest
                  showthumbnail : (options.showthumbnail) || (!(options.showthumbnail) &amp;amp;amp;&amp;amp;amp; options.embed &amp;amp;amp;&amp;amp;amp; !embedded) ? true : false,
                  embed : (options.embed) ? true &amp;amp;amp;&amp;amp;amp; embedded : false
                };

                // prevent opening multiple embedded players
                embedded = false;                

                self.append($('&amp;amp;lt;div/&amp;amp;gt;').own3d(plugindata));
              }
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
              // console.debug(errorThrown);
            }
        });
      }
    });
  }
})(jQuery)
</pre>
<p>A simple PHP &#8211; Zend Framework script to enable a cross domain request to the OWN3D API (the full project contains two, one for the live status and one for the channel information).</p>
<pre class="brush: php; title: ; notranslate">
&amp;amp;lt;?php

// Define path to application directory
define('APPLICATION_PATH', realpath(dirname(__FILE__)));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../../apps/library'),
    get_include_path(),
)));

$liveid = isset($_GET['live_id']) ? intval($_GET['live_id']) : 0;

require_once 'Zend/Http/Client.php';
$client = new Zend_Http_Client('http://api.own3d.tv/liveCheck.php?live_id='.$liveid, array('adapter' =&amp;amp;gt; 'Zend_Http_Client_Adapter_Socket'));

$xmlstr = $client-&amp;amp;gt;request()-&amp;amp;gt;getBody();
$xml = new SimpleXMLElement($xmlstr);

require_once 'Zend/Json/Encoder.php';
header('Content-Type: application/json');

// JSONP
if (isset($_GET['callback'])) {
        echo $_GET['callback'].'('. Zend_Json_Encoder::encode(array(
        'isLive'=&amp;amp;gt;(string)$xml-&amp;amp;gt;liveEvent-&amp;amp;gt;isLive,
        'liveViewers'=&amp;amp;gt;(string)$xml-&amp;amp;gt;liveEvent-&amp;amp;gt;liveViewers,
        'liveDuration'=&amp;amp;gt;(string)$xml-&amp;amp;gt;liveEvent-&amp;amp;gt;liveDuration,
    )).')';
}
// JSON
else {
    echo Zend_Json_Encoder::encode(array(
        'isLive'=&amp;amp;gt;(string)$xml-&amp;amp;gt;liveEvent-&amp;amp;gt;isLive,
        'liveViewers'=&amp;amp;gt;(string)$xml-&amp;amp;gt;liveEvent-&amp;amp;gt;liveViewers,
        'liveDuration'=&amp;amp;gt;(string)$xml-&amp;amp;gt;liveEvent-&amp;amp;gt;liveDuration,
    ));
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ingol.nl/blog/2011/06/16/show-the-live-status-from-an-own3d-tv-livestream-with-a-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>TIP: Get rid of &#8220;It is not safe to rely on the system&#8217;s timezone settings.&#8221;</title>
		<link>http://ingol.nl/blog/2010/04/08/tip-get-rid-of-it-is-not-safe-to-rely-on-the-systems-timezone-settings/</link>
		<comments>http://ingol.nl/blog/2010/04/08/tip-get-rid-of-it-is-not-safe-to-rely-on-the-systems-timezone-settings/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 10:44:22 +0000</pubDate>
		<dc:creator>Onno</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[timezone]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://ingol.nl/blog/?p=370</guid>
		<description><![CDATA[Warning: strtotime() [function.strtotime]: It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely  [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Warning: strtotime() [function.strtotime]: It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.</p></blockquote>
<p>; Copy this line into the php.ini<br />
; http://php.net/manual/en/timezones.php<br />
date.timezone = &#8220;Europe/Amsterdam&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://ingol.nl/blog/2010/04/08/tip-get-rid-of-it-is-not-safe-to-rely-on-the-systems-timezone-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Code Generator on Google Code</title>
		<link>http://ingol.nl/blog/2009/09/17/zend-code-generator-on-google-code/</link>
		<comments>http://ingol.nl/blog/2009/09/17/zend-code-generator-on-google-code/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 18:00:27 +0000</pubDate>
		<dc:creator>Onno</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[codegeneration]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://ingol.nl/blog/?p=3</guid>
		<description><![CDATA[I started a project to create a zend code generator. It&#8217;s a pretty basic 3 layer model that it generates right now, tests included. Take a look at http://code.google.com/p/zend-code-generator/
]]></description>
			<content:encoded><![CDATA[<p>I started a project to create a zend code generator. It&#8217;s a pretty basic 3 layer model that it generates right now, tests included. Take a look at http://code.google.com/p/zend-code-generator/</p>
]]></content:encoded>
			<wfw:commentRss>http://ingol.nl/blog/2009/09/17/zend-code-generator-on-google-code/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Quick and Dirty RegEx Tester in Zend Framework.</title>
		<link>http://ingol.nl/blog/2009/08/19/quick-and-dirty-regex-tester-in-zend-framework/</link>
		<comments>http://ingol.nl/blog/2009/08/19/quick-and-dirty-regex-tester-in-zend-framework/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 11:36:56 +0000</pubDate>
		<dc:creator>Onno</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://ingol.nl/blog/?p=209</guid>
		<description><![CDATA[1 public function indexAction()
2      {
3           Zend_Layout::startMvc();
4           self::getFrontController ()-&#62;setParam ( &#8220;noViewRenderer&#8221;, true );
5
6           $subject = $this-&#62;_getParam(&#8220;subject&#8221;,&#8221;");
7           $pattern = $this-&#62;_getParam(&#8220;pattern&#8221;,&#8221;//&#8221;);
8           $result =  [...]]]></description>
			<content:encoded><![CDATA[<p>1 public function indexAction()<br />
2      {<br />
3           Zend_Layout::startMvc();<br />
4           self::getFrontController ()-&gt;setParam ( &#8220;noViewRenderer&#8221;, true );<br />
5<br />
6           $subject = $this-&gt;_getParam(&#8220;subject&#8221;,&#8221;");<br />
7           $pattern = $this-&gt;_getParam(&#8220;pattern&#8221;,&#8221;//&#8221;);<br />
8           $result = preg_match_all($pattern, $subject, $matches);<br />
9<br />
10           $form = new Zend_Form();<br />
11           $subjectElement = new Zend_Form_Element_Text(&#8220;subject&#8221;);<br />
12           $subjectElement-&gt;setValue($subject);<br />
13           $form-&gt;addElement($subjectElement);<br />
14<br />
15           $patternElement = new Zend_Form_Element_Text(&#8220;pattern&#8221;);<br />
16           $patternElement-&gt;setValue($pattern);<br />
17           $form-&gt;addElement($patternElement);<br />
18<br />
19           $form-&gt;addElement(&#8220;submit&#8221;,&#8221;send&#8221;);<br />
20<br />
21           echo $form;<br />
22           echo Zend_Json::encode($matches);<br />
23      }</p>
<p>Thanks for the html conversion of this code:<br />
<a href="http://www.phpdebutant.com/archive/PHP-code-to-HTML-conversion/PHP%20code%20to%20HTML%20conversion.php">http://www.phpdebutant.com</a></p>
<p>Regex Tutorial/Reference:<br />
<a href="http://www.phpro.org/tutorials/Introduction-to-PHP-Regex.html">http://www.phpro.org/tutorials/Introduction-to-PHP-Regex.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ingol.nl/blog/2009/08/19/quick-and-dirty-regex-tester-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Favicon PHP Proxy.</title>
		<link>http://ingol.nl/blog/2009/07/09/google-favicon-php-proxy/</link>
		<comments>http://ingol.nl/blog/2009/07/09/google-favicon-php-proxy/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 11:34:28 +0000</pubDate>
		<dc:creator>Onno</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[favicon]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://ingol.nl/blog/?p=207</guid>
		<description><![CDATA[A little code snippet to fetch and cache favicons via the google s2 favicon service.
It uses the PHP Zend framework to store and retrieve the favicons from a (MySQL) database &#8230;
http://ingol.nl/code/FaviconProxy.htm
]]></description>
			<content:encoded><![CDATA[<p>A little code snippet to fetch and cache favicons via the google s2 favicon service.<br />
It uses the PHP Zend framework to store and retrieve the favicons from a (MySQL) database &#8230;</p>
<p><a href="http://ingol.nl/code/FaviconProxy.htm">http://ingol.nl/code/FaviconProxy.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ingol.nl/blog/2009/07/09/google-favicon-php-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

