<?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>www.qianqin.de &#187; web design</title>
	<atom:link href="http://www.qianqin.de/category/webdesign/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.qianqin.de</link>
	<description>personal web site of Qian Qin</description>
	<lastBuildDate>Thu, 17 Jun 2010 19:06:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Preventing multiple instances of Flash Movies</title>
		<link>http://www.qianqin.de/2009/05/16/preventing-multiple-instances-of-flash-movies/</link>
		<comments>http://www.qianqin.de/2009/05/16/preventing-multiple-instances-of-flash-movies/#comments</comments>
		<pubDate>Sat, 16 May 2009 14:25:55 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web site]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/?p=405</guid>
		<description><![CDATA[Currently, Flash does not natively support prevention of multiple instances, so a workaround is needed. Why would anyone want to prevent multiple instances anyway? Well, I use Flash as a Chat client, so allowing a user to run multiple instances would mean that they could join the chat multiple times, which is not really a [...]]]></description>
			<content:encoded><![CDATA[<p>Currently, Flash does not natively support prevention of multiple instances, so a workaround is needed. Why would anyone want to prevent multiple instances anyway? Well, I use Flash as a Chat client, so allowing a user to run multiple instances would mean that they could join the chat multiple times, which is not really a wanted feature. So how do I prevent users from joining the chat multiple times?<br />
<span id="more-405"></span><br />
As there is no way to do this on the client side, a server side solution is needed. So my first thought was to only allow each user with his account to join once, which should work fine in most cases. There is only one problem: When a user&#8217;s connection drops, the server wouldn&#8217;t know that and would block him from rejoining the server until the old client timed out. This is quite user unfriendly, so a different solution is needed. A different approach would be IP-based blocking (1 connection per IP), where this problem wouldn&#8217;t occur, but that would cause people behind routers not to be able to chat at the same time. Again unacceptable for me, so I thought of a third way:</p>
<p>Whenever a client connects to the server, the server will look through all existing users and check if there is one that has the same account. If no, it allows the client to continue normally. If yes, it will send a &#8220;alive&#8221; message to the other client and first let the new client continue as usual. At the same time, it will wait for an answer from the other client. If a message is received, the new client will get disconnected, as the user is already connected. </p>
<p>This approach works very well on my server. To make this system work for guests too, a unique key would be needed for each user, which should get saved as a flash cookie (browser wide). That will also prevent the user trying to join by opening the chat in different browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2009/05/16/preventing-multiple-instances-of-flash-movies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Flash&#8217;s ExternalInterface and Microsoft Internet Explorer</title>
		<link>http://www.qianqin.de/2009/04/13/externalinterface-and-internet-exploreradobe-flashs-externalinterface-und-microsoft-internet-explorer/</link>
		<comments>http://www.qianqin.de/2009/04/13/externalinterface-and-internet-exploreradobe-flashs-externalinterface-und-microsoft-internet-explorer/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 14:21:23 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[web site]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/?p=385</guid>
		<description><![CDATA[As my new community project is using a lot of Javascript and Flash Communication, I rely on Flash&#8217;s ExternalInterface. ExternalInterface allows me to create simple functions in Flash, which are callable from Javascript. I developed everything using Firefox, where everything worked just fine, but when using Internet Explorer, I encountered the problem that no ExternalInterface [...]]]></description>
			<content:encoded><![CDATA[<p>As my new <a href="http://animechat.de">community</a> project is using a lot of Javascript and Flash Communication, I rely on Flash&#8217;s ExternalInterface. ExternalInterface allows me to create simple functions in Flash, which are callable from Javascript. I developed everything using Firefox, where everything worked just fine, but when using Internet Explorer, I encountered the problem that no ExternalInterface functions would register, breaking the Flash/Javascript Communication completely.</p>
<p>After endless hours of testing, I found out that for ExternalInterface to work in IE, 2 conditions have to be met.</p>
<ol>
<li>The Flash needs to visible. Loading a flash into a hidden div does not work.</li>
<li>It has to be loaded before the document onload event. All Flash files loaded after the onload event can&#8217;t register any functions with ExternalInterface.</li>
</ol>
<p>There seems to be an issue with transparent PNGs (with alpha channel) in IE 7, too. I had some ugly black background in the pictures even though other PNGs worked just fine. The reason was that it the div was hidden first. I guess IE 7 has some serious issues with invisible divs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2009/04/13/externalinterface-and-internet-exploreradobe-flashs-externalinterface-und-microsoft-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Subwoofer for my car</title>
		<link>http://www.qianqin.de/2008/09/21/subwoofer-lupo/</link>
		<comments>http://www.qianqin.de/2008/09/21/subwoofer-lupo/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 00:16:39 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[car]]></category>
		<category><![CDATA[interesting things]]></category>
		<category><![CDATA[vacation]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/?p=188</guid>
		<description><![CDATA[Good sound systems have a subwoofer, that&#8217;s why I needed one for my little car. Because my car&#8217;s trunk is extremely small, I needed a special subwoofer case to fit it in without robbing space or removing the spare wheel. So I constructed one myself. Read more for some more pictures. For more information, check [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.qianqin.de/wp-content/uploads/2008/09/gehause01.png"><img class="alignnone size-medium wp-image-189" title="Subwoofer ISO" src="http://www.qianqin.de/wp-content/uploads/2008/09/gehause01-300x155.png" alt="" width="300" height="155" /></a>Good sound systems have a subwoofer, that&#8217;s why I needed one for my little car. Because my car&#8217;s trunk is extremely small, I needed a special subwoofer case to fit it in without robbing space or removing the spare wheel. So I constructed one myself. Read more for some more pictures.</p>
<p><span id="more-188"></span></p>
<p>For more information, check out the German version &#8220;<a href="/de/2008/09/21/subwoofer-lupo/">Subwoofer für den Lupo</a>&#8220;.</p>
<p><a href="http://www.qianqin.de/wp-content/uploads/2008/09/gehause021.png"><img class="alignnone size-thumbnail wp-image-194" title="Subwoofer Explode" src="http://www.qianqin.de/wp-content/uploads/2008/09/gehause021-150x150.png" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/gehause03.png"><img class="alignnone size-thumbnail wp-image-191" title="Subwoofer Top" src="http://www.qianqin.de/wp-content/uploads/2008/09/gehause03-150x150.png" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/gehause04.png"><img class="alignnone size-thumbnail wp-image-192" title="Subwoofer Front" src="http://www.qianqin.de/wp-content/uploads/2008/09/gehause04-150x150.png" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/gehause05.png"><img class="alignnone size-thumbnail wp-image-193" title="Subwoofer Side" src="http://www.qianqin.de/wp-content/uploads/2008/09/gehause05-150x150.png" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/build01.jpg"><img class="alignnone size-thumbnail wp-image-211" title="Biegen des Gitters" src="http://www.qianqin.de/wp-content/uploads/2008/09/build01-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/build02.jpg"><img class="alignnone size-thumbnail wp-image-212" title="Biegen des Gitters Teil 2" src="http://www.qianqin.de/wp-content/uploads/2008/09/build02-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/build03.jpg"><img class="alignnone size-thumbnail wp-image-213" title="Was nicht passt wird passend gemacht" src="http://www.qianqin.de/wp-content/uploads/2008/09/build03-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/case01.jpg"><img class="alignnone size-thumbnail wp-image-214" title="Das fertige Gitter" src="http://www.qianqin.de/wp-content/uploads/2008/09/case01-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/case02.jpg"><img class="alignnone size-thumbnail wp-image-215" title="Der Anschluss" src="http://www.qianqin.de/wp-content/uploads/2008/09/case02-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/case03.jpg"><img class="alignnone size-thumbnail wp-image-216" title="Fertiges Gehäuse geschlossen" src="http://www.qianqin.de/wp-content/uploads/2008/09/case03-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/09/case04.jpg"><img class="alignnone size-thumbnail wp-image-217" title="Fertiges Gehäuse offen" src="http://www.qianqin.de/wp-content/uploads/2008/09/case04-150x150.jpg" alt="" width="150" height="150" /></a><a href="http://www.qianqin.de/wp-content/uploads/2008/10/200810161016_071.jpg"><img class="alignnone size-thumbnail wp-image-233" title="Subwoofer Gehäuse im Lupo Kofferraum" src="http://www.qianqin.de/wp-content/uploads/2008/10/200810161016_071-150x150.jpg" alt="" width="150" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2008/09/21/subwoofer-lupo/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Strict HTML/XHTML and target=&#8221;_blank&#8221;</title>
		<link>http://www.qianqin.de/2008/06/11/strict-htmlxhtml-and-target_blank/</link>
		<comments>http://www.qianqin.de/2008/06/11/strict-htmlxhtml-and-target_blank/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 21:59:52 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[web site]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/?p=167</guid>
		<description><![CDATA[To keep this short: THERE IS NO target=&#8221;_blank&#8221;! It&#8217;s not valid &#8220;Strict HTML&#8221; or &#8220;Strict XHTML&#8221;. There is a huge discussion on the web about this, and frankly I don&#8217;t care. I see reasons for opening new windows, so I want new windows and &#8220;Strict XHTML&#8221;. But how to do that? Easy, I coded a [...]]]></description>
			<content:encoded><![CDATA[<p>To keep this short: THERE IS NO target=&#8221;_blank&#8221;! It&#8217;s not valid &#8220;Strict HTML&#8221; or &#8220;Strict XHTML&#8221;. There is a huge discussion on the web about this, and frankly I don&#8217;t care. I see reasons for opening new windows, so I want new windows and &#8220;Strict XHTML&#8221;. But how to do that? Easy, I coded a short Javascript which will find all external links and links to PDFs and Ads and makes them open up in new windows.</p>
<p><span id="more-167"></span> It finds all links automatically and if you want a specific link to be opened in a new window too, you&#8217;ll simply need to add <code>rel="external"</code> as an attribute of the link. Example:</p>
<pre>&lt;a href="http://www.junny.de/" rel="external"&gt;Junny's Blog&lt;/a&gt;</pre>
<p>People with Javascript disabled will have a normal link, whereas people with Javascript enabled will have a new window opened for them. You can download the script <a href="/files/oinw.js">&#8220;Open In New Window&#8221; (oinw.js) here</a>.</p>
<p>The script can be included just like any other Javascript:</p>
<pre>&lt;script type="text/javascript" src="oinw.js"&gt;&lt;/script&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2008/06/11/strict-htmlxhtml-and-target_blank/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PuTTY and WinSCP</title>
		<link>http://www.qianqin.de/2008/02/10/putty-winscp/</link>
		<comments>http://www.qianqin.de/2008/02/10/putty-winscp/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 10:59:39 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/2008/02/10/putty-winscp/</guid>
		<description><![CDATA[PuTTY is great, but it&#8217;s even better with WinSCP. You can let WinSCP manage all sessions, press Ctrl+P and PuTTY will pop up, with your session password saved and passed to it. But there are some configuration issues coming from this kind of setup. The first issue is more PuTTY based. When you open a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">PuTTY</a> is great, but it&#8217;s even better with <a href="http://www.winscp.net" target="_blank">WinSCP</a>. You can let WinSCP manage all sessions, press Ctrl+P and PuTTY will pop up, with your session password saved and passed to it. But there are some configuration issues coming from this kind of setup.</p>
<p><span id="more-144"></span></p>
<p>The first issue is more PuTTY based. When you open a new connection, it will probably use your desktop encoding, which might not work correctly if your server uses UTF-8. It&#8217;s possible to change the encoding by right-clicking on the title bar, but then you would have to do it every time. The solutions is easy, open putty for itself, change the setting and overwrite the &#8220;Default Settings&#8221;. This will work for X11 forwarding, too. These settings will apply to all sessions. It you want to custom settings for one session, you will just need to give the session the <a href="http://winscp.net/eng/docs/integration_app#opening_current_session_in_putty" target="_blank">same name in PuTTY and WinSCP</a>.</p>
<p>The second issue is that I like PuTTY windows maximized. And maximizing it by hand every time is annoying, so I created a link to PuTTY in the PuTTY directory and changed the properties of the link to open PuTTY maximized. Next I changed the PuTTY Integration settings in WinSCP to <code>%PROGRAMFILES%\PuTTY\putty.lnk</code>. This opens all PuTTY windows maximized.</p>
<p>This saves me alot time, too bad they are not the default settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2008/02/10/putty-winscp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>first confrontation with AJAX</title>
		<link>http://www.qianqin.de/2007/03/30/first-confrontation-with-ajax/</link>
		<comments>http://www.qianqin.de/2007/03/30/first-confrontation-with-ajax/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 23:58:56 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/2007/03/30/first-confrontation-with-ajax/</guid>
		<description><![CDATA[AJAX stands for Asynchronous JavaScript and XML, which is an old technique which has gotten very popular now. The best example for this is Google Suggest. The site reacts instantly to your input without reloading the page. I have been developing web sites for very long now and I never thought that AJAX could be [...]]]></description>
			<content:encoded><![CDATA[<p>AJAX stands for Asynchronous JavaScript and XML, which is an old technique which has gotten very popular now. The best example for this is <a href="http://labs.google.com/suggest/" rel="nofollow">Google Suggest</a>. The site reacts instantly to your input without reloading the page.<br />
<span id="more-100"></span><br />
I have been developing web sites for very long now and I never thought that AJAX could be this powerful. But after seeing the development of it lately, I decided to give it a try. With AJAX, I wanted to reanimate my dead anime community &#8220;<a href="http://www.animechat.de/">anime chat</a>&#8220;. I have closed it down for over 2 years now. The Chat used to be a &#8220;<a href="http://www.thepalace.com/" rel="nofollow">palace chat</a>&#8220;, which is very very old technology. It&#8217;s a 2D chat which could be implemented into webpages via Java, but seriously, which average person who would want to chat uses Java?<br />
So after seeing AJAX in action, I decided to build my own chat system with AJAX. It has many advantages. All a chatter would need is Firefox or Internet Explorer. Now this is a serious advantage against any other chatting system. I started building it a week ago and it is working just fine. When it&#8217;s usable, I will post some screen shots of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2007/03/30/first-confrontation-with-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mozilla Firefox cursor bug</title>
		<link>http://www.qianqin.de/2007/03/23/mozilla-firefox-zeiger-fehler/</link>
		<comments>http://www.qianqin.de/2007/03/23/mozilla-firefox-zeiger-fehler/#comments</comments>
		<pubDate>Fri, 23 Mar 2007 17:21:09 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/2007/03/23/mozilla-firefox-zeiger-fehler/</guid>
		<description><![CDATA[It seems like Firefox has a problem with disabled and re-enabled text input fields. Once deactivated and then reactivated, the blinking cursor disappears. It is also not possible to see the selection. Although everything works just fine, it is pretty annoying. Here is the solution for this problem. It involves Javascript, but you probably won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like Firefox has a problem with disabled and re-enabled text input fields. Once deactivated and then reactivated, the blinking cursor disappears. It is also not possible to see the selection. Although everything works just fine, it is pretty annoying. Here is the solution for this problem. It involves Javascript, but you probably won&#8217;t have this problem when you don&#8217;t use Javascript to de- and re-activate text fields:</p>
<p><code>var inbox = document.getElementById( 'idOfInputBox');<br />
inbox.blur();<br />
inbox.disabled=false;<br />
inbox.focus();</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2007/03/23/mozilla-firefox-zeiger-fehler/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving to WordPress</title>
		<link>http://www.qianqin.de/2007/01/17/umziehen-nach-wordpress/</link>
		<comments>http://www.qianqin.de/2007/01/17/umziehen-nach-wordpress/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 12:35:59 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[web site]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/2007/01/17/umziehen-nach-wordpress/</guid>
		<description><![CDATA[I have used my own CMS for about a year now, but last week, when I installed WordPress for my girlfriends homepage, I was kind of fascinated by its features. Although WordPress has no multilangual support out-of-the-box, but there was a plugin which made it possible. It&#8217;s called Polygot and allows the usage of multiple [...]]]></description>
			<content:encoded><![CDATA[<p>I have used my own CMS for about a year now, but last week, when I installed <a title="WordPress Website" target="_blank" href="http://www.wordpress.org/">WordPress</a> for my girlfriends homepage, I was kind of fascinated by its features. Although WordPress has no multilangual support out-of-the-box, but there was a plugin which made it possible. It&#8217;s called <a title="Polygot Homepage" target="_blank" href="http://fredfred.net/skriker/index.php/polyglot/">Polygot</a> and allows the usage of multiple languages. Because WordPress is W3C conform by default, I decided to do the same with my design.</p>
<p><span id="more-3"></span>Afters hours of trying and fighting (especially with the IE box model bug), I found a way to realize this full height 2 column design with header and footer to work with Firefox, Opera and Internet Explorer (5.5, 6.0 and 7.0). So now, I am proud to be able to put the &#8220;W3C Valid XHTML 1.0 Transitional Logo&#8221; on my page.</p>
<p>After finishing the design, I started to work with Polygot. It&#8217;s not very intuitive, so it took me a day to figure it out how to get it completely working. Date Strings weren&#8217;t translated, and WordPress itself didn&#8217;t set the filter for &#8220;single_cat_title&#8221;, which broke the design with the long language string. So I needed to hack my way through. Now, all that is left is to translate everything. Because this is a long process, I&#8217;ll be doing it over time. So if you find something untranslated, please tell me. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2007/01/17/umziehen-nach-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>qobject and mysql</title>
		<link>http://www.qianqin.de/2006/05/25/qobject/</link>
		<comments>http://www.qianqin.de/2006/05/25/qobject/#comments</comments>
		<pubDate>Wed, 24 May 2006 23:00:47 +0000</pubDate>
		<dc:creator>Qian Qin</dc:creator>
				<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.qianqin.de/2006/05/25/huangshan-mountain-3/</guid>
		<description><![CDATA[After years of programming web applications, I often found myself debugging MySQL queries. Usually, they don&#8217;t even show that fast. Sometimes I spend hours trying to find the error of my php script, changing code parts, I once even redone the whole script and wondered why it still doesn&#8217;t work until I found the error [...]]]></description>
			<content:encoded><![CDATA[<p>After years of programming web applications, I often found myself debugging MySQL queries. Usually, they don&#8217;t even show that fast. Sometimes I spend hours trying to find the error of my php script, changing code parts, I once even redone the whole script and wondered why it still doesn&#8217;t work until I found the error in the SQL query. Well, people learn from the faults the make, but I didn&#8217;t, at least until some time ago. You maybe read an earlier blog entry of mine about QCMS, an object-oriented php5 content management system I was making. I have used a lot of other CMS, in fact, I am still using Mambo for my free hosting service <a href="http://www.kawaiipage.de/">Kawaii Page</a>. Something was always bugging me about programming modules for other CMS, so I figured it isn&#8217;t php but MySQL! Creating tables, queries and all those properties&#8230; I wanted to improve this behavior in my CMS. Anyway, I ported the key element QObject from php4 to php5, to test it on a production system (<a href="http://www.chinarestaurantberlin.de/">China-Restaurants in Berlin</a>).</p>
<p><span id="more-48"></span>So what is so special about it? As I wrote before, storing and loading objects into a MySQL database can be a pain in the ass. Especially when you change your object to fit your new needs. Tables need to be changed, queries&#8230; Well, from now on, QObject is doing all this for me now! It takes care of all basic needs in MySQL. Creating Tables, setting keys, uniques, indexes, data types, it can even change the table when you add properties or change the data type on the run and of course loading and storing your php object into you database. No more worrying about MySQL anymore. Some very complex queries can&#8217;t be done through QObject, but if you are using those, you could also consider using a different language to code your CMS.</p>
<p>Let&#8217;s get a little more detailed. Here is a list of the features:</p>
<ul>
<li>Creating Tables (table names are the names of the object class), one table per object class</li>
<li>Setting Uniques for all object properties that start with u_</li>
<li>Setting Indexes for all object properties that start with i_</li>
<li>Ignoring properties that start with _ (good for temporary properties which are not supposed to be stored)</li>
<li>Unique ID for each object (O_ID)</li>
<li>Loading an O_ID will automatically result in casting the 1object into the correct subclass.</li>
<li>Support for TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT, VARCHAR, TEXT, LONGTEXT data types for properties. Dynamic Table reconfiguration on data type mismatch (storing string in an int field will automatically make the field accept strings)</li>
<li>Dynamic addition of properties. QObject detects differences between table properties and object properties and will change table to fit the object.</li>
<li>HTML Object property editor. Making backends easier to code.</li>
</ul>
<p>And now even more detailed, the list of methods:</p>
<ul>
<li><strong>load(int O_ID)</strong><br />
Lets you load the object with given O_ID. Return true when successful.</li>
<li><strong>numOf([string condition])</strong><br />
Return the number of objects of the same class. If condition is specified, it will be included into the SQL query after there &#8220;WHERE&#8221; clause.</li>
<li><strong>loadWhere(mixed properties, mixed values[,[string custom] [,[string orderlimit] [,boolean returnresults]]])</strong><br />
Loads the object with given properties=values. If there is only one property to be checked, it can be given as string, else, an array is expected. Custom field lets you specify special &#8220;WHERE&#8221; clauses like &#8220;property>value&#8221;. Orderlimit field lets you specify &#8220;ORDER BY&#8221; and &#8220;LIMIT&#8221; clause properties like &#8220;ORDER BY property ASC LIMIT 10,20&#8243;. Finally, returnresults specifies if the function should return an array of objects with matches. The function will set the object to the first match if there is more than one.</li>
<li><strong>loadAll()</strong><br />
Returns all objects of the same class as an array.</li>
<li><strong>store()</strong><br />
Stores object in database.</li>
<li><strong>remove()</strong><br />
Deletes object in database.</li>
<li><strong>storeFromPostData()</strong><br />
For use with the HTML Object Editor. Parses the form created by editObjectForm().</li>
<li><strong>editObjectForm()</strong><br />
The HTML Object Editor. Returns HTML code for a form for editing the object. For Saving the object back from the form data, use storeFromPostData().</li>
</ul>
<p>There are some more private functions, which I won&#8217;t specify any further. Here is a quick example of how to use QObject:</p>
<p>//foobar object using qobject<br />
class foobar extends qobject {<br />
var $foo = 0;<br />
var $bar = &#8220;foobar&#8221;;<br />
}</p>
<p>//connect to db<br />
init(&#8220;localhost&#8221;,3306,&#8221;root&#8221;,&#8221;",&#8221;qcms&#8221;);</p>
<p>//let&#8217;s generate some foobars and store them to database<br />
for($i=0;$i&lt;100;$i++) {<br />
$foobar = new foobar();<br />
$foobar->foo = $i;<br />
$foobar->bar.= $i;<br />
$foobar->store();<br />
}</p>
<p>//lets load and show them all<br />
$foobars = $foobar->loadAll();<br />
foreach($foobars as $foobar)<br />
echo $foobar->foo.&#8221; -> &#8220;$foobar->bar;</p>
<p>Well, as you can see, I didn&#8217;t need to use any MySQL at all to perform all these database operations.</p>
<p>On my production system test, QObjects works quite well. I haven&#8217;t had any problems with it.</p>
<p>Anyway, here is it for you to use if you want give it a try:<br />
<a href="/files/qobject.zip">Download QObject</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qianqin.de/2006/05/25/qobject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
