<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PHP  Wordpress tips and tricks</title>
	<atom:link href="http://ctx2002.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ctx2002.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 20 Dec 2011 02:06:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ctx2002.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>PHP  Wordpress tips and tricks</title>
		<link>http://ctx2002.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ctx2002.wordpress.com/osd.xml" title="PHP  Wordpress tips and tricks" />
	<atom:link rel='hub' href='http://ctx2002.wordpress.com/?pushpress=hub'/>
		<item>
		<title>schedual a task for windows 7</title>
		<link>http://ctx2002.wordpress.com/2011/12/07/schedual-a-task-for-windows-7/</link>
		<comments>http://ctx2002.wordpress.com/2011/12/07/schedual-a-task-for-windows-7/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 02:27:09 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=205</guid>
		<description><![CDATA[To schedule a task that runs every N minutes Minute Schedule Syntax schtasks /create /tn TaskName /tr TaskRun /sc minute [/mo {1 - 1439}] [/st HH:MM] [/sd StartDate] [/ed EndDate] [{/et HH:MM &#124; /du HHHH:MM} [/k]] [/it] [/ru {[Domain\]User [/rp Password] &#124; System}] [/s Computer [/u [Domain\]User [/p Password]]] Remarks In a minute schedule, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=205&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To schedule a task that runs every N minutes</p>
<p>Minute Schedule Syntax</p>
<p>schtasks /create /tn TaskName /tr TaskRun /sc minute [/mo {1 - 1439}] [/st HH:MM] [/sd StartDate] [/ed EndDate] [{/et HH:MM | /du HHHH:MM} [/k]] [/it] [/ru {[Domain\]User [/rp Password] | System}] [/s Computer [/u [Domain\]User [/p Password]]]<br />
Remarks</p>
<p>In a minute schedule, the /sc minute parameter is required. The /mo (modifier) parameter is optional and specifies the number of minutes between each run of the task. The default value for /mo is 1 (every minute). The /et (end time) and /du (duration) parameters are optional and can be used with or without the /k (end task) parameter.</p>
<p>Examples<br />
To schedule a task that runs every 20 minutes</p>
<p>The following command schedules a security script, Sec.vbs, to run every 20 minutes. The command uses the /sc parameter to specify a minute schedule and the /mo parameter to specify an interval of 20 minutes.</p>
<p>Because the command does not include a starting date or time, the task starts 20 minutes after the command completes, and runs every 20 minutes thereafter whenever the system is running. Notice that the security script source file is located on a remote computer, but that the task is scheduled and executes on the local computer.</p>
<p>[b]schtasks /create /sc minute /mo 20 /tn &#8220;Security Script&#8221; /tr \\central\data\scripts\sec.vbs[/b]</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=205&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/12/07/schedual-a-task-for-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>Why hook_form not working</title>
		<link>http://ctx2002.wordpress.com/2011/10/31/why-hook_form-not-working/</link>
		<comments>http://ctx2002.wordpress.com/2011/10/31/why-hook_form-not-working/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 21:48:18 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=199</guid>
		<description><![CDATA[I have a module which I have defined a hook_form hook, but it was not working, after some investigation I have found that hook_form is only called when a node type is defined by a module. so, what is mean by &#8220;a node type defined by a module&#8221;? In drupal , we can define a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=199&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a module which I have defined a hook_form hook,</p>
<p>but it was not working, after some investigation I have found that hook_form is only called when a node type is defined by a module.</p>
<p>so, what is mean by &#8220;a node type defined by a module&#8221;?</p>
<p>In drupal , we can define a module type in 2 place, one is in module&#8217;s installation file.</p>
<p>for example:</p>
<p><strong>$test_type = array(</strong><br />
<strong>    &#8216;type&#8217; =&gt; &#8216;test&#8217;,</strong><br />
<strong>    &#8216;name&#8217; =&gt; st(&#8216;Test&#8217;),</strong><br />
<strong>    &#8216;module&#8217; =&gt; &#8216;node&#8217;,</strong><br />
<strong>    &#8216;custom&#8217; =&gt; TRUE,</strong><br />
<strong>    &#8216;modified&#8217; =&gt; TRUE,</strong><br />
<strong>    &#8216;locked&#8217; =&gt; FALSE,</strong><br />
<strong>  );</strong><br />
<strong>  $test_type = (object) _node_type_set_defaults($test_type);</strong><br />
<strong>  node_type_save($test_type);</strong></p>
<p>above code, create a node type through &#8220;node_type_save&#8221; , function.</p>
<p>the other place is use hook_node_info function in a module file.</p>
<p>for example:</p>
<p><strong>function test_node_info() {</strong><br />
<strong>  return array(</strong><br />
<strong>    &#8216;teiqcase&#8217; =&gt; array(</strong><br />
<strong>      &#8216;name&#8217; =&gt; t(&#8216;test&#8217;), </strong><br />
<strong>      &#8216;module&#8217; =&gt; &#8216;test&#8217;, </strong><br />
<strong>      &#8216;description&#8217; =&gt; t(&#8220;Test&#8221;), </strong><br />
<strong>      &#8216;has_title&#8217; =&gt; TRUE, </strong><br />
<strong>      &#8216;title_label&#8217; =&gt; t(&#8216;Test&#8217;), </strong><br />
<strong>      &#8216;has_body&#8217; =&gt; FALSE, </strong><br />
<strong>      &#8216;body_label&#8217; =&gt; t(&#8216;Body&#8217;),</strong><br />
<strong>    ),</strong><br />
<strong>  );</strong><br />
<strong>}</strong></p>
<p>above also create a node type &#8216;test&#8217; , but this one did not use &#8216;node_type_save&#8217; function, hence, it called &#8220;a node type defined by a module&#8221;<strong></strong>.</p>
<p>so to make a node type work with &#8220;hook_form&#8221;, we should not use &#8216;node_type_save&#8217; to define a node type, but use &#8220;hook_node_info&#8221; to define a node type</p>
<p>above only works for Drupal 6, drupal 7&#8242;s hook_form is totally different.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=199&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/10/31/why-hook_form-not-working/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>How to add javascript file to Drupal 6</title>
		<link>http://ctx2002.wordpress.com/2011/10/28/how-to-add-javascript-file-to-drupal-6/</link>
		<comments>http://ctx2002.wordpress.com/2011/10/28/how-to-add-javascript-file-to-drupal-6/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 21:58:37 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=193</guid>
		<description><![CDATA[Drupal function drupal_add_js is drupal way to adding javascripts, drupal settings into drupal. For me, I am usually use MODULENAME_preprocess(&#38;$var) to add js files. for example: I have a module called &#8220;test&#8221;, to add a js file my_test.js for the &#8220;test&#8221; module, in my module file, I have following code: function test_preprocess(&#38;$var) { $module_path = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=193&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Drupal function drupal_add_js is drupal way to adding javascripts, drupal settings into drupal.</p>
<p>For me, I am usually use MODULENAME_preprocess(&amp;$var) to add js files.</p>
<p>for example: I have a module called &#8220;test&#8221;, to add a js file my_test.js for the &#8220;test&#8221; module, in my module file, I have following code:</p>
<p><strong>function test_preprocess(&amp;$var)</strong></p>
<p><strong>{</strong></p>
<p><strong>$module_path = drupal_get_path(&#8216;module&#8217;,'test&#8217;);   </strong></p>
<p><strong>drupal_add_js($module_path . &#8220;/my_test.js&#8221;);</strong></p>
<p><strong>}</strong></p>
<p><strong>Mapping a function to URL</strong></p>
<p>First , we have to use hook_menu to create a url.</p>
<p>function test_menu()</p>
<p>{</p>
<p>$items['test_connection'] = array(</p>
<p>&#8216;title&#8217; =&gt; &#8216;a test&#8217;,</p>
<p>&#8216;page callback&#8217; =&gt; &#8216;my_test&#8217;,</p>
<p>&#8216;type&#8217; =&gt; MENU_CALLBACK</p>
<p>);</p>
<p>return $items;</p>
<p>}</p>
<p>above code registered a url path &#8216;test_connection&#8217; with drupal url subsystem.</p>
<p>then next step, we need to passing that registered url path to javascript.</p>
<p>use that test_preprocessor here again.</p>
<p><strong>function test_preprocess(&amp;$var)</strong></p>
<p><strong>{</strong></p>
<p>$module_path = drupal_get_path(&#8216;module&#8217;,'test&#8217;);</p>
<p>drupal_add_js($module_path . &#8220;/my_test.js&#8221;);</p>
<p><strong>$op = array(&#8216;absolute&#8217; =&gt; TRUE);</strong></p>
<p><strong>$url = url(&#8220;test_connection&#8221;,$op)</strong></p>
<p><strong>drupal_add_js(array(&#8216;test&#8217;=&gt;array(&#8216;url&#8217;=&gt;$url)) , &#8216;setting&#8217;  );</strong></p>
<p><strong>}</strong></p>
<p>the first thing to do is to create a absolute url,</p>
<p><strong>$op = array(&#8216;absolute&#8217; =&gt; TRUE);</strong></p>
<p><strong>$url = url(&#8220;test_connection&#8221;,$op)</strong></p>
<p>next, we have to store the absolute URL into javascript, drupal_add_url can be used for that purpose.</p>
<p>when pass an array into drupal_add_url as first argument and &#8216;setting&#8217; as second argument, the drupal_add_url will interpreter the array as a drupal setting.</p>
<p>so the line , <strong>array(&#8216;test&#8217;=&gt;array(&#8216;url&#8217;=&gt;$url)) will becomes Drupal.settings.test.url.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=193&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/10/28/how-to-add-javascript-file-to-drupal-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>drupal system_settings_form</title>
		<link>http://ctx2002.wordpress.com/2011/10/27/187/</link>
		<comments>http://ctx2002.wordpress.com/2011/10/27/187/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 03:58:05 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=187</guid>
		<description><![CDATA[the system_settings_form is not working with &#8216;#default_value&#8217; of form api, thought is correctly store data into database, but it not showing correct result back to text fields. change &#8216;#default_value&#8217; to &#8216;#value&#8217; worked. here is a bug report http://drupal.org/node/820816 &#160; also, for system_settings_form(). use hook_form_alter to fill in &#8216;#value&#8217;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=187&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>the system_settings_form is not working with &#8216;#default_value&#8217; of form api, thought is correctly store data into database,</p>
<p>but it not showing correct result back to text fields.</p>
<p>change &#8216;#default_value&#8217; to &#8216;#value&#8217; worked.</p>
<p>here is a bug report http://drupal.org/node/820816</p>
<p>&nbsp;</p>
<p>also, for system_settings_form(). use hook_form_alter to fill in &#8216;#value&#8217;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=187&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/10/27/187/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>php, unicode to utf-8</title>
		<link>http://ctx2002.wordpress.com/2011/08/25/php-unicode-to-utf-8/</link>
		<comments>http://ctx2002.wordpress.com/2011/08/25/php-unicode-to-utf-8/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 03:09:02 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=168</guid>
		<description><![CDATA[//unicode to uft-8 function utf8($num) { if($num&#60;=0x7F) return chr($num); if($num&#62;6)+192).chr(($num&#38;63)+128); if($num&#62;12)+224).chr((($num&#62;&#62;6)&#38;63)+128).chr(($num&#38;63)+128); if($num&#62;18)+240).chr((($num&#62;&#62;12)&#38;63)+128).chr((($num&#62;&#62;6)&#38;63)+128).chr(($num&#38;63)+128); return ''; } //to unicode code point function uniord($c) { $ord0 = ord($c{0}); if ($ord0&#62;=0   &#38;&#38; $ord0&#60;=127) return $ord0; $ord1 = ord($c{1}); if ($ord0&#62;=192 &#38;&#38; $ord0&#60;=223) return ($ord0-192)*64 + ($ord1-128);     $ord2 = ord($c{2}); if ($ord0&#62;=224 &#38;&#38; $ord0&#60;=239) return ($ord0-224)*4096 + [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=168&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code>//unicode to uft-8<br />
function utf8($num)<br />
{<br />
if($num&lt;=0x7F) return chr($num);<br />
if($num&gt;6)+192).chr(($num&amp;63)+128);<br />
if($num&gt;12)+224).chr((($num&gt;&gt;6)&amp;63)+128).chr(($num&amp;63)+128);<br />
if($num&gt;18)+240).chr((($num&gt;&gt;12)&amp;63)+128).chr((($num&gt;&gt;6)&amp;63)+128).chr(($num&amp;63)+128);<br />
return '';<br />
}</code></p>
<pre>
//to unicode code point
function uniord($c)
{
     $ord0 = ord($c{0}); if ($ord0&gt;=0   &amp;&amp; $ord0&lt;=127) return $ord0;
     $ord1 = ord($c{1}); if ($ord0&gt;=192 &amp;&amp; $ord0&lt;=223) return ($ord0-192)*64 + ($ord1-128);    
     $ord2 = ord($c{2}); if ($ord0&gt;=224 &amp;&amp; $ord0&lt;=239) return ($ord0-224)*4096 + ($ord1-128)*64 + ($ord2-128);      
     $ord3 = ord($c{3}); if ($ord0&gt;=240 &amp;&amp; $ord0&lt;=247) return ($ord0-240)*262144 + ($ord1-128)*4096 + ($ord2-128)*64 + ($ord3-128);      
     return false;
}
</pre>
<p>If U represents the value of a Unicode scalar value and C1, C2, C3 and C4 represent bytes in a UTF-8 byte sequence (in order),<br />
 then the value of a Unicode scalar value U can be calculated as follows:</p>
<p>If a sequence has one byte, then</p>
<p>U = C1</p>
<p>Else if a sequence has two bytes, then</p>
<p>U = (C1 – 192) * 64 + C2 – 128</p>
<p>Else if a sequence has three bytes, then</p>
<p>U = (C1 – 224) * 4,096 + (C2 – 128) * 64 + C3 – 128</p>
<p>Else</p>
<p>U = (C1 – 240) * 262,144 + (C2 – 128) * 4,096 + (C3 – 128) * 64 + C4 – 128</p>
<p>End if</p>
<p>Going the other way, given a Unicode scalar value U, then the UTF-8 byte sequence can be calculated as follows:</p>
<p>If U &lt;= U+007F, then</p>
<p>C1 = U</p>
<p>Else if U+0080 &lt;= U &lt;= U+07FF, then</p>
<p>C1 = U / 64 + 192</p>
<p>C2 = U mod 64 + 128</p>
<p>Else if U+0800 &lt;= U &lt;= U+D7FF, or if U+E000 &lt;= U &lt;= U+FFFF, then</p>
<p>C1 = U / 4,096 + 224</p>
<p>C2 = (U mod 4,096) 64 + 128</p>
<p>C3 = U mod 64 + 128</p>
<p>Else</p>
<p>C1 = U / 262,144 + 240</p>
<p>C2 = (U mod 262,144) 4,096 + 128</p>
<p>C3 = (U mod 4,096) 64 + 128</p>
<p>C4 = U mod 64 + 128</p>
<p>End if</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=168&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/08/25/php-unicode-to-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>change report PDF field size &#8212; sugarcrm</title>
		<link>http://ctx2002.wordpress.com/2011/08/03/change-report-pdf-field-size-sugarcrm/</link>
		<comments>http://ctx2002.wordpress.com/2011/08/03/change-report-pdf-field-size-sugarcrm/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 03:56:32 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[sugarcrm]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=163</guid>
		<description><![CDATA[in Sugarpdf.php, used initOptionsForWriteCellTable to calculate &#8216;width&#8217;, but that width was not considering content lenght. following is a quick hack for a particular report &#8212; a06e4b62-e5bd-3ca9-680c-4df9565f995d $options = $this-&#62;initOptionsForWriteCellTable($options, $item); if ($_REQUEST['id'] == 'a06e4b62-e5bd-3ca9-680c-4df9565f995d' &#38;&#38; 'Reports' == $_REQUEST['module'] &#38;&#38; $_REQUEST['to_pdf'] == 'on') { $temp = array(); foreach ($options['width'] as $key =&#62; $value) { if ($key [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=163&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>in Sugarpdf.php, used initOptionsForWriteCellTable to calculate &#8216;width&#8217;, but that width was not considering content lenght.</p>
<p>following is a quick hack for a particular report &#8212; a06e4b62-e5bd-3ca9-680c-4df9565f995d<br />
<code>$options = $this-&gt;initOptionsForWriteCellTable($options, $item);<br />
        if ($_REQUEST['id'] == 'a06e4b62-e5bd-3ca9-680c-4df9565f995d' &amp;&amp; 'Reports' == $_REQUEST['module'] &amp;&amp; $_REQUEST['to_pdf'] == 'on') {<br />
            $temp = array();<br />
        	foreach ($options['width'] as $key =&gt; $value) {<br />
                if ($key == 'Team: Team Name') $temp['Team: Team Name'] = 20.22;<br />
                else if ($key == 'Opportunities: SUM: Amount')  $temp['Opportunities: SUM: Amount'] = 40.22;<br />
                else $temp[$key] = 160.22;<br />
            }<br />
            $options['width'] = $temp;<br />
        	//var_dump($options,$_REQUEST); die();<br />
        }</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=163&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/08/03/change-report-pdf-field-size-sugarcrm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>Sugarcrm, on subpanel, make a link points to a different module</title>
		<link>http://ctx2002.wordpress.com/2011/05/17/sugarcrm-on-subpanel-make-a-link-points-to-a-different-module/</link>
		<comments>http://ctx2002.wordpress.com/2011/05/17/sugarcrm-on-subpanel-make-a-link-points-to-a-different-module/#comments</comments>
		<pubDate>Tue, 17 May 2011 03:33:11 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[sugarcrm]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=160</guid>
		<description><![CDATA[or subpanel to show a link, we need to set &#8216;widget_class&#8217; =&#62; &#8216;SubPanelDetailViewLink&#8217;, for example: with module ecn_customerconnections, we have a default subpanel under folder metadata/subpanels/default.php open that file, set any fields you want to show as a link, to &#8216;widget_class&#8217; =&#62; &#8216;SubPanelDetailViewLink&#8217;. but that only will show you to a module same type as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=160&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>or subpanel to show a link, we need to set &#8216;widget_class&#8217; =&gt; &#8216;SubPanelDetailViewLink&#8217;,</p>
<p>for example: with module ecn_customerconnections, we have a default subpanel under folder metadata/subpanels/default.php<br />
 open that file, set any fields you want to show as a link, to &#8216;widget_class&#8217; =&gt; &#8216;SubPanelDetailViewLink&#8217;.</p>
<p>but that only will show you to a module same type as sub panel, if you want to show a different module, you have to set<br />
  &#8216;target_module&#8217; =&gt; &#8216;Accounts&#8217;,<br />
                &#8216;target_record_key&#8217; =&gt; &#8216;account_id_c&#8217;,</p>
<p>for module ecn_customerconnections, we want a link to show related account, so we set up target_module =&gt; &#8216;Accounts&#8217; and &#8216;target_record_key&#8217; =&gt; &#8216;account_id_c&#8217;,<br />
 that &#8220;account_id_c&#8221; is DB field inside ecn_customerconnections.<br />
 after set up those 2 fields, link will points to related module.</p>
<p>but some time this is still not enough, even we set up target_module and target_record_key, the link still points to same module that same as subpanel.<br />
 this is because of related target_record_key is not filled up, so we have to use logic hook to fill that related target key.<br />
 in here, we have to fill up account_id_c through process_record logic hook.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=160&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/05/17/sugarcrm-on-subpanel-make-a-link-points-to-a-different-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>zendframe work &#8211; code path for loading customized resource plug</title>
		<link>http://ctx2002.wordpress.com/2011/05/09/zendframe-work-code-path-for-loading-customized-resource-plug/</link>
		<comments>http://ctx2002.wordpress.com/2011/05/09/zendframe-work-code-path-for-loading-customized-resource-plug/#comments</comments>
		<pubDate>Mon, 09 May 2011 08:37:32 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[zendframe php]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=157</guid>
		<description><![CDATA[Application constructor invokes setOptions method. the setOptions method invokes setBootstrap method. inside that setBootstrap method, this line : $this-&#62;_bootstrap = new $class($this); create a Bootstrap object. in the Bootstrap&#8217;s constructor method, $this-&#62;setOptions will load customized resource plugin.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=157&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Application constructor invokes setOptions method.<br />
the setOptions method invokes setBootstrap method.<br />
inside that setBootstrap method, this line : $this-&gt;_bootstrap = new $class($this); create a Bootstrap object. in the Bootstrap&#8217;s constructor method, $this-&gt;setOptions will load customized resource plugin.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=157&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/05/09/zendframe-work-code-path-for-loading-customized-resource-plug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>MS sql server , similar sql to mysql&#8217;s limit range search</title>
		<link>http://ctx2002.wordpress.com/2011/04/07/ms-sql-server-similar-sql-to-mysqls-limit-range-search/</link>
		<comments>http://ctx2002.wordpress.com/2011/04/07/ms-sql-server-similar-sql-to-mysqls-limit-range-search/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 03:23:03 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[ms sql server]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=150</guid>
		<description><![CDATA[in mysql , one can use &#8220;limit&#8221; to do a range search, Ms sql has no such function, but we can emulate that mysql limit function with &#8220;top&#8221; keyword. $sql = "select * from ( select top ".$startNumber." * FROM ( SELECT top ".$endNumber." from TableOne order by number asc ) as new_tab order by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=150&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>in mysql , one can use &#8220;limit&#8221; to do a range search, Ms sql has no such function, but we can emulate that mysql limit function with &#8220;top&#8221; keyword.</p>
<p><code>$sql = "select * from<br />
(<br />
select top ".$startNumber." * FROM<br />
(<br />
    SELECT top ".$endNumber." from TableOne <strong>order by number asc</strong><br />
) as new_tab <strong>order by number desc</strong><br />
) as new_tab2 <strong>order by number asc</strong>";</code></p>
<p>for example: we have table contains 100 number, 1,2,3,4,5 &#8230; 100, and we want to fetch 5 numbers , start from 10.<br />
so, what we want to get is a list contains (10,11,12,13,14).</p>
<p>at first, the $endNumber assigned a value 14 (start + howManyItem -1),<br />
query <code>SELECT top $endNumber from TableOne order by number asc</code> will return a list of records start from 1 to 14</p>
<p>second,<br />
query , select top $startNumber * FROM<br />
(<br />
    SELECT top $endNumber from TableOne <strong>order by number asc</strong><br />
) as new_tab <strong>order by number desc</strong><br />
will return a list 14,13,12,11,10</p>
<p>finally, we use ascending order again, which result a list contains (10,11,12,13,14).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=150&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/04/07/ms-sql-server-similar-sql-to-mysqls-limit-range-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
		<item>
		<title>many-to-many relationship and subpanel</title>
		<link>http://ctx2002.wordpress.com/2011/03/14/many-to-many-relationship-and-subpanel/</link>
		<comments>http://ctx2002.wordpress.com/2011/03/14/many-to-many-relationship-and-subpanel/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 21:57:06 +0000</pubDate>
		<dc:creator>ctx2002</dc:creator>
				<category><![CDATA[sugarcrm]]></category>

		<guid isPermaLink="false">http://ctx2002.wordpress.com/?p=138</guid>
		<description><![CDATA[put following under custom/Extension/Application/Ext/TableDictionary file name : ecn_customerconnections_accounts.php $dictionary["ecn_customerconnections_accounts"] = array ( 'true_relationship_type' =&#62; 'many-to-many', 'relationships' =&#62; array ( 'ecn_customerconnections_accounts' =&#62; array ( 'lhs_module' =&#62; 'ecn_CustomerConnections', 'lhs_table' =&#62; 'ecn_customerconnections', 'lhs_key' =&#62; 'id', 'rhs_module' =&#62; 'Accounts', 'rhs_table' =&#62; 'accounts', 'rhs_key' =&#62; 'id', 'relationship_type' =&#62; 'many-to-many', 'join_table' =&#62; 'ecn_customeons_accounts_c', 'join_key_lhs' =&#62; 'ecn_customefa5ections_ida', 'join_key_rhs' =&#62; 'ecn_custom3fb4ccounts_idb', ), ), [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=138&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>put following under custom/Extension/Application/Ext/TableDictionary</strong></p>
<p>file name : ecn_customerconnections_accounts.php<br />
<code>$dictionary["ecn_customerconnections_accounts"] = array (<br />
  'true_relationship_type' =&gt; 'many-to-many',<br />
  'relationships' =&gt;<br />
  array (<br />
    'ecn_customerconnections_accounts' =&gt;<br />
    array (<br />
      'lhs_module' =&gt; 'ecn_CustomerConnections',<br />
      'lhs_table' =&gt; 'ecn_customerconnections',<br />
      'lhs_key' =&gt; 'id',<br />
      'rhs_module' =&gt; 'Accounts',<br />
      'rhs_table' =&gt; 'accounts',<br />
      'rhs_key' =&gt; 'id',<br />
      'relationship_type' =&gt; 'many-to-many',<br />
      'join_table' =&gt; 'ecn_customeons_accounts_c',<br />
      'join_key_lhs' =&gt; 'ecn_customefa5ections_ida',<br />
      'join_key_rhs' =&gt; 'ecn_custom3fb4ccounts_idb',<br />
    ),<br />
  ),<br />
  'table' =&gt; 'ecn_customeons_accounts_c',<br />
  'fields' =&gt;<br />
  array (<br />
    0 =&gt;<br />
    array (<br />
      'name' =&gt; 'id',<br />
      'type' =&gt; 'varchar',<br />
      'len' =&gt; 36,<br />
    ),<br />
    1 =&gt;<br />
    array (<br />
      'name' =&gt; 'date_modified',<br />
      'type' =&gt; 'datetime',<br />
    ),<br />
    2 =&gt;<br />
    array (<br />
      'name' =&gt; 'deleted',<br />
      'type' =&gt; 'bool',<br />
      'len' =&gt; '1',<br />
      'default' =&gt; '0',<br />
      'required' =&gt; true,<br />
    ),<br />
    3 =&gt;<br />
    array (<br />
      'name' =&gt; 'ecn_customefa5ections_ida',<br />
      'type' =&gt; 'varchar',<br />
      'len' =&gt; 36,<br />
    ),<br />
    4 =&gt;<br />
    array (<br />
      'name' =&gt; 'ecn_custom3fb4ccounts_idb',<br />
      'type' =&gt; 'varchar',<br />
      'len' =&gt; 36,<br />
    ),<br />
  ),<br />
  'indices' =&gt;<br />
  array (<br />
    0 =&gt;<br />
    array (<br />
      'name' =&gt; 'ecn_custometions_accountsspk',<br />
      'type' =&gt; 'primary',<br />
      'fields' =&gt;<br />
      array (<br />
        0 =&gt; 'id',<br />
      ),<br />
    ),<br />
    1 =&gt;<br />
    array (<br />
      'name' =&gt; 'ecn_custometions_accounts_alt',<br />
      'type' =&gt; 'alternate_key',<br />
      'fields' =&gt;<br />
      array (<br />
        0 =&gt; 'ecn_customefa5ections_ida',<br />
        1 =&gt; 'ecn_custom3fb4ccounts_idb',<br />
      ),<br />
    ),<br />
  ),<br />
);</code></p>
<p><strong>create a file custom/Extension/modules/Accounts/Layoutdefs/ecn_customerconnections_accounts_Account.php with following content:</strong></p>
<p><code>$layout_defs["Accounts"]["subpanel_setup"]["ecn_customerconnections_accounts"] = array (<br />
  'order' =&gt; 100,<br />
  'module' =&gt; 'ecn_CustomerConnections',<br />
  'subpanel_name' =&gt; 'default',<br />
  'sort_order' =&gt; 'asc',<br />
  'sort_by' =&gt; 'id',<br />
  'title_key' =&gt; 'LBL_ECN_CUSTOMERCONNECTIONS_ACCOUNTS_FROM_ECN_CUSTOMERCONNECTIONS_TITLE',<br />
  'get_subpanel_data' =&gt; 'ecn_customerconnections_accounts',<br />
  'top_buttons' =&gt;<br />
  array (<br />
    0 =&gt;<br />
    array (<br />
      'widget_class' =&gt; 'SubPanelTopButtonQuickCreate',<br />
    ),<br />
    1 =&gt;<br />
    array (<br />
      'widget_class' =&gt; 'SubPanelTopSelectButton',<br />
      'mode' =&gt; 'MultiSelect',<br />
    ),<br />
  ),<br />
);</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ctx2002.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ctx2002.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ctx2002.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ctx2002.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ctx2002.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ctx2002.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ctx2002.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ctx2002.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ctx2002.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ctx2002.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ctx2002.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ctx2002.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ctx2002.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ctx2002.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ctx2002.wordpress.com&amp;blog=4344729&amp;post=138&amp;subd=ctx2002&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ctx2002.wordpress.com/2011/03/14/many-to-many-relationship-and-subpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b67dd441d570e1913e87396718b70f48?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ctx2002</media:title>
		</media:content>
	</item>
	</channel>
</rss>
