<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Wuwei2k2 Blog</title>
	<atom:link href="http://wuwei2k2.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wuwei2k2.wordpress.com</link>
	<description>Helpful code regarding Joomla, vTiger, Gallery2 and other web applications I use</description>
	<pubDate>Fri, 15 Aug 2008 18:37:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>Links to section/category from a content item in Joomla</title>
		<link>http://wuwei2k2.wordpress.com/2008/08/15/joomla-links-to-section-category-from-a-content-item/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/08/15/joomla-links-to-section-category-from-a-content-item/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 18:37:04 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=15</guid>
		<description><![CDATA[For version 1.0.x: normally, Joomla&#8217;s mosPathWay() and module would take care of generating links to sections and categories, but in case you ever needed to do it yourself:



        // TODO: You need someway to get $rid, which is the ID of the content item.
     [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For version 1.0.x: normally, Joomla&#8217;s mosPathWay() and module would take care of generating links to sections and categories, but in case you ever needed to do it yourself:</p>
<p><span id="more-15"></span></p>
<pre name="code" class="php">

        // TODO: You need someway to get $rid, which is the ID of the content item.
        // I usually get this in the main content.html.php page, so I use $row-&gt;id

        // The SQL to get the section and category for an article
        $sql = &quot;SELECT c.title ctitle, c.id cid, s.title stitle, s.id sid FROM #__content co INNER JOIN #__categories c, #__sections s WHERE (co.id=$rid) AND (c.id=co.catid) AND (s.id=co.sectionid)&quot;;
        $database-&gt;setQuery($sql);
        $result = $database-&gt;loadRow();

        if ($result != null) {
                // Section page
                $sid = $result[3];
                $stitle = $result[2];
                $slink = sefRelToAbs(&quot;index.php?option=com_content&amp;task=section&amp;id=$sid&quot;);

                // Category page
                $cid = $result[1];
                $ctitle = $result[0];
                $clink = sefRelToAbs(&quot;index.php?option=com_content&amp;task=category&amp;sectionid=$sid&amp;id=$cid&quot;);

                // Write out links
                $relatedSecCat = &quot;Related articles: &lt;a href=&#039;$slink&#039;&gt;$stitle&lt;/a&gt; &gt; &lt;a href=&#039;$clink&#039;&gt;$ctitle&lt;/a&gt;&quot;;
        }
        else $relatedSecCat = &quot;&quot;;
        echo $relatedSecCat;
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=15&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/08/15/joomla-links-to-section-category-from-a-content-item/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Forcing caching with Apache2 - mod_expires and mod_headers</title>
		<link>http://wuwei2k2.wordpress.com/2008/07/13/forcing-caching-apache2-mod_expires-mod_headers/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/07/13/forcing-caching-apache2-mod_expires-mod_headers/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 20:07:11 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[apache]]></category>

		<category><![CDATA[mod_expires]]></category>

		<category><![CDATA[mod_headers]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=10</guid>
		<description><![CDATA[Problem: Even when you use mod_expires to cache content on your server, some redirects may break the cache headers so the mod_expires will not output the right headers. This especially seems to happen when you have CMSs like Joomla/Drupal with SEO features and are trying to cache them.

This is how the mod_expires was set up [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Problem: Even when you use mod_expires to cache content on your server, some redirects may break the cache headers so the mod_expires will not output the right headers. This especially seems to happen when you have CMSs like Joomla/Drupal with SEO features and are trying to cache them.</p>
<p><span id="more-10"></span></p>
<p>This is how the mod_expires was set up before</p>
<pre>&lt;IfModule mod_expires.c&gt;
ExpiresDefault "access plus 20 minutes"
ExpiresActive On
&lt;/IfModule&gt;</pre>
<p>But these lines using mod_headers need to be added to remove the no-cache directives being output by the CMS:</p>
<pre>Header unset Cache-Control:
Header unset Expires:
Header unset Pragma:
Header unset Keep-Alive:
Header unset Connection:</pre>
<p>That removed the HTTP cache headers output by the CMS that seemed to be caused by the redirects (and which mod_expires was not replacing.)</p>
<p>You may need to enable mod_headers; it wasn&#8217;t enabled on my installation of Apache 2.2. The command to do that is:</p>
<pre>a2enmod headers</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=10&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/07/13/forcing-caching-apache2-mod_expires-mod_headers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First Joomla 1.5 module: Displaying contents from another webpage</title>
		<link>http://wuwei2k2.wordpress.com/2008/07/09/joomla-15-module-contents-from-webpage/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/07/09/joomla-15-module-contents-from-webpage/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 15:06:02 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=9</guid>
		<description><![CDATA[For my first Joomla 1.5 module, I had to write a module that would get the contents from another webpage (actually, just a number) and display it in the module area.

To make it more challenging, I also added the following requirements:

Has to use caching so as to not hit the webpage each time.
Should allow the [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For my first Joomla 1.5 module, I had to write a module that would get the contents from another webpage (actually, just a number) and display it in the module area.</p>
<p><span id="more-9"></span></p>
<p>To make it more challenging, I also added the following requirements:</p>
<ul>
<li>Has to use caching so as to not hit the webpage each time.</li>
<li>Should allow the &#8220;template&#8221; for displaying the content to be editable by the webmaster</li>
</ul>
<p>This is the code I wrote - simple, but its my first Joomla 1.5 module.</p>
<p><strong>mod_webnumber.php</strong></p>
<pre name="code" class="php">

&lt;?php
//no direct access
defined(&#039;_JEXEC&#039; )
or die(&#039;Direct Access to this location is not allowed.&#039;);

// Get a reference to the global cache object.
$cache = &amp; JFactory::getCache();
$cache-&gt;setCaching(1); // make sure it caches

$number  = $cache-&gt;call( array( &#039;Website&#039;, &#039;latestNumber&#039; ) );

// get a parameter from the module&#039;s configuration
$template = $params-&gt;get(&#039;template&#039;);
$output = str_replace (&quot;#n&quot;, $number, $template);

echo $output;

class Website {
    function latestNumber() {
        // Get the latest number from the webpage
        $number = file_get_contents (
          &quot;http://www.yourwebsite.com/&quot;);
        $number = strip_tags ($number);

        return $number;
    }
}
?&gt;
</pre>
<p><strong>mod_webnumber.xml </strong>(mostly derived from the official Joomla docs site on <a href="http://docs.joomla.org/How_to_create_a_module">creating a module</a>, following is only the parameters I used which the module depends on)</p>
<pre name="code" class="xml">

    &lt;files&gt;
        &lt;!-- The &quot;module&quot; attribute signifies that this is the main controller file --&gt;
        &lt;filename module=&quot;mod_webnumber&quot;&gt;mod_webnumber.php&lt;/filename&gt;
    &lt;/files&gt;
&lt;params&gt;
        &lt;param name=&quot;moduleclass_sfx&quot; type=&quot;text&quot; default=&quot;&quot; label=&quot;Module Class Suffix&quot; description=&quot;PARAMMODULECLASSSUFFIX&quot; /&gt;
        &lt;param name=&quot;@spacer&quot; type=&quot;spacer&quot; default=&quot;&quot; label=&quot;&quot; description=&quot;&quot; /&gt;
        &lt;param name=&quot;template&quot; type=&quot;text&quot; default=&quot;#n is the number you need.&quot; label=&quot;Template&quot; description=&quot;TEMPLATE&quot; /&gt;
    &lt;/params&gt;
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=9&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/07/09/joomla-15-module-contents-from-webpage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Digg API: Showing latest stories from your site/URL/domain</title>
		<link>http://wuwei2k2.wordpress.com/2008/05/16/digg-api-show-stories-site-url-domain/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/05/16/digg-api-show-stories-site-url-domain/#comments</comments>
		<pubDate>Fri, 16 May 2008 16:43:42 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[digg]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=8</guid>
		<description><![CDATA[To do: To show a list of the latest stories from your site/URL/domain using the Digg API.
Solution:
The following PHP code will display the latest 20 stories from the domain of your choice. Thanks a heap to Web Cash&#8217;s entry on grabbing a random Digg story as well as the Digg Story API which helped with [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>To do: To show a list of the latest stories from your site/URL/domain using the Digg API.</p>
<p>Solution:</p>
<p>The following PHP code will display the latest 20 stories from the domain of your choice. Thanks a heap to <a href="http://www.earn-web-cash.com/2008/02/16/digg-api-random-story/" target="_blank">Web Cash&#8217;s entry on grabbing a random Digg story</a> as well as the <a href="http://apidoc.digg.com/ListStories" target="_blank">Digg Story API</a> which helped with this code.</p>
<p><span id="more-8"></span></p>
<pre name="code" class="php">

&lt;?php
//  Takes an array of arguments and returns a query string
//  Each parameter&#039;s name is its key in the array
function buildQuery ($args) {
  $query = &#039;?&#039;;
  foreach ($args as $key =&gt; $val) {
    if ( $query != &#039;?&#039; )
      $query .= &#039;&amp;&#039;;

    $query .= $key . &#039;=&#039; . urlencode($val);
  }

  return $query;
}

// Digg specifies that user agent must be set
ini_set(&#039;user_agent&#039;, &#039;My domain stories/1.0&#039;);

$baseurl = &#039;http://services.digg.com&#039;;
$endpoint = &#039;/stories&#039;;
$url = $baseurl . $endpoint;
// Number of stories to display
$numberStories = 20;
// Your domain of choice - CHANGE THIS
$domainName = &#039;your.domain.com&#039;; 

//  Parameters to fetch latest articles
$params = array();
$params[&#039;appkey&#039;] = &#039;http://&#039; . $domainName;
$params[&#039;domain&#039;] = $domainName;
$params[&#039;type&#039;] = &#039;xml&#039;;

$params[&#039;count&#039;] = &#039;&#039; . $numberStories;
// The following displays the newest items first
// This can be changed using the parameters in the Digg API
$params[&#039;sort&#039;] = &#039;submit_date-desc&#039;; 

//  Reuse the $url created above
$query = buildQuery($params);
$reqUrl = $url . $query;

// Display the URL. Uncomment for troubleshooting.
// echo $reqUrl . &quot;\n&quot;;

$xml = simplexml_load_file($reqUrl);

//  Output the stories
for ($i=0; $i&lt;$numberStories;$i++) {
  $numberDiggs = intval($xml-&gt;story[$i][&#039;diggs&#039;]);
  echo &#039;&lt;p&gt;&#039;;
  echo &#039;&lt;h2&gt;&lt;a href=&quot;&#039; . $xml-&gt;story[$i][&#039;href&#039;] . &#039;&quot;&gt;&#039;
    . $xml-&gt;story[$i]-&gt;title . &#039;&lt;/a&gt;&lt;/h2&gt;&#039;;

  // Number of Diggs
  echo &#039;&lt;b&gt;Diggs: &#039; . $xml-&gt;story[$i][&#039;diggs&#039;] . &#039; &#039; ;
  // If you don&#039;t have an image for number of diggs,
  // then uncomment the following line
  for ($j=0; $j&lt;$numberDiggs; $j++) echo &#039;&lt;img src=&quot;digg.gif&quot;&gt; &#039;;
  echo &#039;&lt;/b&gt;&lt;br /&gt;&#039;;

  echo &#039;Date: &#039; . date(&#039;m-d-Y, H:i:s&#039;, (int) $xml-&gt;story[$i][&#039;submit_date&#039;]) . &#039;&lt;br /&gt;&#039;;
  echo &#039;Link: &lt;a href=&quot;&#039; . $xml-&gt;story[$i][&#039;link&#039;] . &#039;&quot;&gt;&#039;
    . $xml-&gt;story[$i][&#039;link&#039;] . &#039;&lt;/a&gt;&lt;br /&gt;&#039;;
  echo &#039;Topic: &#039; . $xml-&gt;story[$i]-&gt;topic[&#039;name&#039;] . &#039;&lt;br /&gt;&#039;;
  echo &#039;Container: &#039; . $xml-&gt;story[$i]-&gt;container[&#039;name&#039;] . &#039;&lt;br /&gt;&#039;;
  echo &#039;Desc: &#039; . $xml-&gt;story[$i]-&gt;description . &quot;&lt;/p&gt;\n&quot;;
}
?&gt;
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=8&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/05/16/digg-api-show-stories-site-url-domain/feed/</wfw:commentRss>
	
		<media:content url="digg.gif" medium="image" />
	</item>
		<item>
		<title>Making Gallery2 Joomla component point to Gallery2 URL</title>
		<link>http://wuwei2k2.wordpress.com/2008/05/03/gallery2-joomla-component-point-gallery2-url/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/05/03/gallery2-joomla-component-point-gallery2-url/#comments</comments>
		<pubDate>Sat, 03 May 2008 17:47:55 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[gallery2]]></category>

		<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=7</guid>
		<description><![CDATA[Request: The excellent Gallery2 Bridge component/module for Joomla has one &#8220;shortcoming&#8221;: it points to the embedded Joomla component. Some applications/websites will require the Bridge&#8217;s functionality to embed the Gallery, but will want to link to Gallery2 and not the embedded component.

Solution:
The URL link is created using the $baseUrl variable in /components/com_gallery2/init.inc.
At around line 83 of [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Request:</strong> The excellent <a href="http://www.gallery-addons.com/Gallery-Addons/Component/Embedding_Gallery2/">Gallery2 Bridge component/module for Joomla</a> has one &#8220;shortcoming&#8221;: it points to the embedded Joomla component. Some applications/websites will require the Bridge&#8217;s functionality to embed the Gallery, but will want to link to Gallery2 and not the embedded component.</p>
<p><span id="more-7"></span></p>
<p><strong>Solution:</strong></p>
<p>The URL link is created using the $baseUrl variable in /components/com_gallery2/init.inc.</p>
<p>At around line 83 of the Gallery2 Bridge component, there are the statements that assign the link URL:</p>
<pre name="code" class="php">

/* build url according to our current Itemid and our ItemidList */
if(!empty($ItemidList) &amp;&amp; in_array($Itemid, $ItemidList)){
        $baseUrl = &#039;index.php?option=com_gallery2&amp;amp;Itemid=&#039;.$Itemid;
} else if(!empty($ItemidList)){
        $baseUrl = &#039;index.php?option=com_gallery2&amp;amp;Itemid=&#039;.(int) $ItemidList[0];
} else {
        $baseUrl = &#039;index.php?option=com_gallery2&amp;amp;Itemid=99999999&#039;;
}
</pre>
<p>Right after this, add one statement to specify the URL of the actual Gallery2 site:</p>
<pre name="code" class="php">

/* $g2Uri is specified earlier in the code */
$baseUrl = $g2Uri;
</pre>
<p>and that&#8217;s it - all Gallery2 Bridge components and modules should now point to the live Gallery2 site.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=7&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/05/03/gallery2-joomla-component-point-gallery2-url/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting current user view in Custom Views - vTiger</title>
		<link>http://wuwei2k2.wordpress.com/2008/04/12/setting-current-user-view-in-custom-views-vtiger/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/04/12/setting-current-user-view-in-custom-views-vtiger/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 17:36:21 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[vtiger]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=6</guid>
		<description><![CDATA[Thanks to this forum post on vTiger, one additional change needs to be made to the CustomView code in order to get the CURRENTUSER variable to work (I don&#8217;t know which versions of vTiger it applies to, but I think to all version of 5.x):



function getRealValues($tablename,$fieldname,$comparator,$value,$datatype)
        {
  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Thanks to this <a href="http://forums.vtiger.com/viewtopic.php?p=64091#64091">forum post on vTiger</a>, one additional change needs to be made to the CustomView code in order to get the CURRENTUSER variable to work (I don&#8217;t know which versions of vTiger it applies to, but I think to all version of 5.x):</p>
<p><span id="more-6"></span></p>
<pre name="code" class="php">

function getRealValues($tablename,$fieldname,$comparator,$value,$datatype)
        {
                if($fieldname == &quot;smownerid&quot; || $fieldname == &quot;inventorymanager&#038;quot <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
                {
                        /* HACK - to get current user */
                        global $current_user;
                        if ($value == &quot;CURRENTUSER&#038;quot <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
                                $value = $current_user-&gt;user_name;
                        /* End HACK */ 

                        $value = $tablename.&quot;.&quot;.$fieldname.$this-&gt;getAdvComparator($comparator,getUserId_Ol($value),$datatype);
                } else if($fieldname == &quot;parentid&#038;quot <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> 
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=6&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/04/12/setting-current-user-view-in-custom-views-vtiger/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Customizing vTiger custom views with dynamic “variables” - II</title>
		<link>http://wuwei2k2.wordpress.com/2008/04/02/vtiger-custom-view-dynamic-variables-current-user-ii/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/04/02/vtiger-custom-view-dynamic-variables-current-user-ii/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 19:40:34 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[vtiger]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=5</guid>
		<description><![CDATA[A quick follow up to my previous post Customizing vTiger custom views with dynamic “variables” . There is an easy extension to enable multiple variables to be used in the custom views.

This is the code:


        /* Associative array with list of replacement pairs */
     [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A quick follow up to my previous post <a href="http://wuwei2k2.wordpress.com/2008/04/01/vtiger-custom-view-dynamic-variables-current-user/">Customizing vTiger custom views with dynamic “variables”</a> . There is an easy extension to enable multiple variables to be used in the custom views.</p>
<p><span id="more-5"></span></p>
<p>This is the code:</p>
<pre name="code" class="php">

        /* Associative array with list of replacement pairs */
        $dvReplacements = array(
                &quot;yourstring&quot; =&gt; $variable,
               //
        );
        /* Replace each of the variables */
        foreach ($dvReplacements as $dvKey=&gt;$dvValue) {
            if (strstr($advfsql,$dvKey))
            {
                $advfsql = str_replace ($dvKey, $dvValue, $advfsql );
            }
        }
</pre>
<p>For example, say I want to replace the variables SP_CURRENTNAME and SP_TODAY with the username of the logged in user and today&#8217;s date, respectively. The code is as follows (I am using &#8220;2099-12-31&#8243; as the replacement key, since for dates, vTiger requires you to enter them in date format. So, if I want a custom view to check against today&#8217;s date, I enter this value in the date field.)</p>
<pre name="code" class="php">

$dvReplacements = array(
            &quot;CURRENTUSER&quot; =&gt; $current_user-&gt;user_name,
            &quot;2099-12-31&quot; =&gt; date(&quot;Y-m-d&#038;quot <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
        );
        foreach ($dvReplacements as $dvKey=&gt;$dvValue) {
            if (strstr($advfsql,$dvKey))
            {
                $advfsql = str_replace ($dvKey, $dvValue, $advfsql );
            }
        }
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=5&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/04/02/vtiger-custom-view-dynamic-variables-current-user-ii/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Customizing vTiger custom views with dynamic &#8220;variables&#8221;</title>
		<link>http://wuwei2k2.wordpress.com/2008/04/01/vtiger-custom-view-dynamic-variables-current-user/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/04/01/vtiger-custom-view-dynamic-variables-current-user/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 21:04:24 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[vtiger]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=4</guid>
		<description><![CDATA[I&#8217;ve come across a problem where you have to customize your vTiger custom views by specifying particular &#8220;variables&#8221;. For instance, list the leads assigned only to the current user.
This will require some custom programming, but it can be done!

Here is how to do it:

Think of a variable name that you will use for your customization.
Set [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve come across a problem where you have to customize your vTiger custom views by specifying particular &#8220;variables&#8221;. For instance, list the leads assigned only to the current user.</p>
<p>This will require some custom programming, but it can be done!</p>
<p><span id="more-4"></span></p>
<p>Here is how to do it:</p>
<ol>
<li>Think of a variable name that you will use for your customization.</li>
<li>Set up a new custom view with the variable name</li>
<li>Change some code in <i>/modules/CustomView/CustomView.php</i> in either the <i>getCVStdFilterSQL()</i> or <i>getCVAdvFilterSQL()</i> to replace the variable name with the correct value</li>
</ol>
<p>For instance, here is an example</p>
<ol>
<li>I want to create a custom view for leads called &#8220;My Leads&#8221; which only displays the leads for the user logged in</li>
<li>I create a new custom view, and set the &#8220;Assigned To&#8221; to be &#8220;CURRENTUSER&#8221; (this is my variable name)</li>
<li>In the getCVAdvFilterSQL() function, just before the return $advfsql statement, I insert the following:</li>
</ol>
<pre name="code" class="php">

        if (strstr($advfsql,&quot;CURRENTUSER&quot;))
        {
            $advfsql = str_replace (&quot;CURRENTUSER&quot;,
                $current_user-&gt;user_name, $advfsql );
        }
</pre>
<p>This replaces all instances of the CURRENTUSER variable so that the custom view is now &#8230; customized! And dynamic! And it displays only the leads assigned to the current user logged in. (The $current_user variable is a global variable in vTiger.)</p>
<p>Caveats:</p>
<ol>
<li>Make sure your &#8220;variable&#8221; is a very exotic term. If you use a common word, you might end up mangling your SQL statement due to the str_replace() call.</li>
<li>I  don&#8217;t know why there are two types of Custom Views called advanced and standard which require two function calls: <i>getCVStdFilterSQL()</i> or <i>getCVAdvFilterSQL()</i></li>
</ol>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=4&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/04/01/vtiger-custom-view-dynamic-variables-current-user/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Belkin F5D7050 A, B, H, E &#8230; Different drivers!</title>
		<link>http://wuwei2k2.wordpress.com/2008/03/12/belkin-f5d7050-a-b-h-e-different-drivers/</link>
		<comments>http://wuwei2k2.wordpress.com/2008/03/12/belkin-f5d7050-a-b-h-e-different-drivers/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 17:08:31 +0000</pubDate>
		<dc:creator>wuwei2k2</dc:creator>
		
		<category><![CDATA[wireless]]></category>

		<category><![CDATA[belkin]]></category>

		<category><![CDATA[dongle]]></category>

		<category><![CDATA[driver]]></category>

		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://wuwei2k2.wordpress.com/?p=3</guid>
		<description><![CDATA[I&#8217;ve been playing around with my Belkin USB wireless card/dongle for a long time and unable to get the driver working &#8230; finally to realize that Belkin has several different versions of the same USB dongle, with different drivers!
They could have made it more obvious&#8230;

In any case, their official site makes it a little more [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been playing around with my Belkin USB wireless card/dongle for a long time and unable to get the driver working &#8230; finally to realize that Belkin has several different versions of the same USB dongle, with different drivers!</p>
<p>They could have made it more obvious&#8230;</p>
<p><span id="more-3"></span></p>
<p>In any case, <a href="http://www.belkin.com/support/article/?lid=en&amp;pid=F5D7050&amp;aid=5381&amp;scid=221">their official site </a>makes it a little more clear and provides the drivers as well. Make sure to find out exactly which version your dongle is (it should be listed in small font on the dongle).</p>
<p>Thanks to <a href="http://ubuntuforums.org/showthread.php?t=423079">this posting at UbuntuForums</a> for pointing me in the right direction.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/wuwei2k2.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/wuwei2k2.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wuwei2k2.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wuwei2k2.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wuwei2k2.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wuwei2k2.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wuwei2k2.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wuwei2k2.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wuwei2k2.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wuwei2k2.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wuwei2k2.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wuwei2k2.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wuwei2k2.wordpress.com&blog=3138671&post=3&subd=wuwei2k2&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://wuwei2k2.wordpress.com/2008/03/12/belkin-f5d7050-a-b-h-e-different-drivers/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>