<?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>Oracle of ONE1 &#187; code</title>
	<atom:link href="http://dvector.com/oracle/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://dvector.com/oracle</link>
	<description>Obscure words of unity</description>
	<lastBuildDate>Wed, 31 Aug 2011 21:25:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Release of ggis-InlinePost v1.1</title>
		<link>http://dvector.com/oracle/2010/06/26/release-of-ggis-inlinepost-v1-1/</link>
		<comments>http://dvector.com/oracle/2010/06/26/release-of-ggis-inlinepost-v1-1/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 16:12:35 +0000</pubDate>
		<dc:creator>one1</dc:creator>
				<category><![CDATA[ggis InlinePost]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[ggis-inlinepost]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://dvector.com/oracle/?p=399</guid>
		<description><![CDATA[The version 1.1 of ggis-InlinePost is released into the wild on June 26, 2010. It is available for download from the WP plugin directory. This release fixes a few minor issues, converts to standard shortcode conventions, and has been tested with the recently released WordPress 3.0.
Changelog

FIX: Shortcodes within an inlined post are now processed. Uses [...]]]></description>
			<content:encoded><![CDATA[<p>The version 1.1 of ggis-InlinePost is released into the wild on June 26, 2010. It is available for download from the <a href="http://downloads.wordpress.org/plugin/ggis-inline-post.1.1.zip">WP plugin directory</a>. This release fixes a few minor issues, converts to standard shortcode conventions, and has been tested with the recently released WordPress 3.0.</p>
<h3>Changelog</h3>
<ol>
<li>FIX: Shortcodes within an inlined post are now processed. Uses do_shortcode().</li>
<li>FIX: Comment metadata now shows correct number of comments made.</li>
<li>NEW: Change code convention to shortcode which allows use of the standard shortcode functions. Old insert methods are deprecated but will still work.</li>
<li>NEW: Recursive inlining now allowed when using new shortcode styling. Protection against infinite loop coded.</li>
<li>NEW Added the showcontent attribute to control display of the post&#8217;s content.</li>
</ol>
<p><span id="more-399"></span></p>
<h3>Shortcode convention</h3>
<p>Users will mainly notice that the code used to inline a post has been updated to the shortcode convention.</p>
<pre>&#91;ggisinlinepost id="%id" attribute1="%attr1" attribute2="%attr2"]
</pre>
<p>The previous code convention while deprecated will still work: <em>&#91;-ggis-inlinepost id=&#8221;%id&#8221; titletag=&#8221;%tag&#8221;-]</em>.</p>
<p>Usage is covered on the <a href="http://dvector.com/oracle/ggis-inlinepost/">ggis-inlinepost page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dvector.com/oracle/2010/06/26/release-of-ggis-inlinepost-v1-1/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Release of ggis-InlinePost v1.0</title>
		<link>http://dvector.com/oracle/2010/06/03/release-of-ggis-inlinepost-v1-0/</link>
		<comments>http://dvector.com/oracle/2010/06/03/release-of-ggis-inlinepost-v1-0/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 20:06:49 +0000</pubDate>
		<dc:creator>one1</dc:creator>
				<category><![CDATA[ggis InlinePost]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[ggis-inlinepost]]></category>

		<guid isPermaLink="false">http://dvector.com/oracle/?p=377</guid>
		<description><![CDATA[Today, I release the version 1.0 of ggis-InlinePost. It is available for download from the WP plugin directory. This release fixes the improper newline formatting reported by a few users. Additionally, it adds or enhances the following:

FIX: Correct paragraph/newline formatting.
NEW: Inlined post now recognizes the &#8216;more&#8217; shortcode.
NEW: If a post requires a password, the password [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I release the version 1.0 of ggis-InlinePost. It is available for download from the <a title="Download ggis-inline-post.1.0" href="http://downloads.wordpress.org/plugin/ggis-inline-post.1.0.zip">WP plugin directory</a>. This release fixes the improper newline formatting reported by a few users. Additionally, it adds or enhances the following:</p>
<ol>
<li>FIX: Correct paragraph/newline formatting.</li>
<li>NEW: Inlined post now recognizes the &#8216;more&#8217; shortcode.</li>
<li>NEW: If a post requires a password, the password entry form will be displayed.</li>
<li>UPDATE: Improved display of metadata.</li>
</ol>
<p><span id="more-377"></span></p>
<p>The metadata uses the following CSS classes for display:</p>
<ul>
<li>entry-meta</li>
<li>meta-sep</li>
<li>meta-prep</li>
</ul>
<p>Please post your questions or comments on this post here.</p>
]]></content:encoded>
			<wfw:commentRss>http://dvector.com/oracle/2010/06/03/release-of-ggis-inlinepost-v1-0/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Remository Inline Direct Download</title>
		<link>http://dvector.com/oracle/2009/09/20/remository-inline-direct-download/</link>
		<comments>http://dvector.com/oracle/2009/09/20/remository-inline-direct-download/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 21:53:46 +0000</pubDate>
		<dc:creator>one1</dc:creator>
				<category><![CDATA[joomla]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[remository]]></category>

		<guid isPermaLink="false">http://dvector.com/oracle/?p=323</guid>
		<description><![CDATA[A number of my clients use Remository within Joomla for document management. The QuickDown plugin, available from the same site, is used to insert document information within an article. While I have been very satified with Remository, I have not found that QuickDown matches my clients&#8217; needs.
QuickDown basically creates a link to the Remository page [...]]]></description>
			<content:encoded><![CDATA[<p>A number of my clients use <a href="http://remository.com/">Remository</a> within Joomla for document management. The QuickDown plugin, available from the same site, is used to insert document information within an article. While I have been very satified with Remository, I have not found that QuickDown matches my clients&#8217; needs.</p>
<p>QuickDown basically creates a link to the Remository page along with a variety of document information formatted within a table. Instead, I am usually interested in having a direct download link inserted inline with the article&#8217;s content.</p>
<p><span id="more-323"></span></p>
<p>There are 2 files that need to be modified in order to get this working properly. One of them is the Remository core file <em>p-classes/remositoryRepository.php</em>. The other is the plugin file <em>quickdown.php</em>.</p>
<h3>Remository core change</h3>
<p>The function makeCheck() is the one needing changes in remositoryRepository.php. Below are the original function and the updated function.</p>
<pre>// ORIGINAL
function makeCheck ($id, $func) {
  $interface =&amp; remositoryInterface::getInstance();
  return md5($this-&gt;Time_Stamp.$interface-&gt;getCfg('absolute_path').date('md').$id.$func);
}

// MODIFIED
function makeCheck ($id, $func) {
  $interface =&amp; remositoryInterface::getInstance();
  return md5($interface-&gt;getCfg('absolute_path').date('md').$id.$func);
}</pre>
<p>Notice that the only change is the removal of a UNIX timestamp. makeCheck() is used in the creation of the direct download link creation and in its verification before allowing download. This is a bit different than the approach I would take but it is effective. If you wanted to make a permanent direct download link, you would remove all references to date or time in the obfuscated check code.</p>
<p>The download link created by the above modified code is good until the next day begins. Is this too long? For your situation perhaps but not for mine. Regardless, please note that the download link duration should outlive your cache.</p>
<h3>QuickDown plugin change</h3>
<p>Next, I wish to change the formatted output of the plugin and to have it include a proper direct download link. I have taken some shortcuts in order to make my changes to the original files easier to follow and not insert bunches of my code into the original code. All of these modifications are done to the file <em>quickdown.php</em>.</p>
<p>First, I added the makeCheck function.</p>
<pre>function makeCheck ($id, $func) {
  $absolute_path = '/my/absolute/path/remdocs';
  return ( $absolute_path . date('md') . $id . $func );
}</pre>
<p>Instead of creating a Remository instance, I simply added my absolute path to the remository documents (quick and dirty).</p>
<p>Next, I added a new plugin usage code {inlinedown:ID}. This completely separates my approach from the author&#8217;s and allows usage of the plugin as originally intended.</p>
<p>In the botQuickdown() function at line 57, I added:</p>
<pre>$row-&gt;text = preg_replace('/{inlinedown:.+?}/', '', $row-&gt;text);</pre>
<p>Then at line 86, I added:</p>
<pre>if (preg_match_all('/{inlinedown:.+?}/', $content, $matches, PREG_PATTERN_ORDER)) {
  //Get IDS
  foreach ($matches as $fmatch) {
    foreach ($fmatch as $match) {
      $match = str_replace("{inlinedown:", "", $match);
      $match = str_replace("}", "", $match);
      $output = $this-&gt;ggis_createLink($match, $this-&gt;params);
      $content = preg_replace("/{inlinedown:$match}/", $output, $content);
    }
  }
  unset($matches);
}</pre>
<p>Finally, I added my own create link function named ggis_createLink().</p>
<pre>function ggis_createLink($idparam, &amp;$param){
  $inline = TRUE;
  //Getting File-info from Database
  $database =&amp; JFactory::getDBO();
  $id = intval($idparam);
  $database-&gt;setQuery("SELECT * FROM #__downloads_files WHERE id=$id");
  $filelist = $database-&gt;loadObjectList();
  if ($filelist) {
    $file = $filelist[0];
    $url = 'index.php?option=com_remository&amp;';
    $func = 'download';
    $url .= 'func='.$func;
    $url .= '&amp;id='.$idparam;
    $url .= '&amp;chk=' . $this-&gt;makeCheck($idparam,$func) . '&amp;no_html=1';

    if ($inline){
      $output = '&lt;a href="'. $url .'"&gt;';
      $output .= '&lt;img src="components/com_remository/images/download_trans.gif" border="0" align="middle"&gt;';
      $output .= '&lt;b&gt;'. $file-&gt;filetitle .'&lt;/b&gt; (' . $file-&gt;filetype . ' ' . $file-&gt;filesize . ')&lt;/a&gt;';
    }else{
      $output = '&lt;table&gt;';
      $output .= '&lt;tr&gt;&lt;td&gt;&lt;a href="'. $url .'"&gt;';
      $output .= '&lt;img src="components/com_remository/images/download_trans.gif"border="0"&gt;&amp;nbsp;';
      $output .= '&lt;b&gt;'. _DOWNLOAD .'&amp;nbsp;'. $file-&gt;filetitle .'&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;';
      $output .= '&lt;/table&gt;';
    }
  }
  return ($output);
}</pre>
<h3>Final result</h3>
<p>The final result is an inline direct download link. This link shows the download image, the file title, the file type, and the file size. Depending on your styling, it should look similar to the image below.</p>
<p><img class="aligncenter size-full wp-image-339" src="http://dvector.com/oracle/files/2009/09/quickdown.gif" alt="quickdown" width="457" height="65" /></p>
<p>Hopefully, you may find this modification of Remository and QuickDown useful for your purposes.</p>
]]></content:encoded>
			<wfw:commentRss>http://dvector.com/oracle/2009/09/20/remository-inline-direct-download/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sidebar Display on Every View</title>
		<link>http://dvector.com/oracle/2008/05/21/sidebar-display-on-every-view/</link>
		<comments>http://dvector.com/oracle/2008/05/21/sidebar-display-on-every-view/#comments</comments>
		<pubDate>Wed, 21 May 2008 21:41:01 +0000</pubDate>
		<dc:creator>oracle</dc:creator>
				<category><![CDATA[dvector]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dvector support]]></category>
		<category><![CDATA[sidebar]]></category>

		<guid isPermaLink="false">http://dvector.com/oracle/2008/05/21/sidebar-display-on-every-view/</guid>
		<description><![CDATA[The default template shows the sidebar only on selected pages. I often make a design decision to display the sidebar on every or nearly every page. This is a fairly straightforward set of template edits. As an example, we will work with the template single.php. This is the template which displays individual posts
To gain further [...]]]></description>
			<content:encoded><![CDATA[<p>The default template shows the sidebar only on selected pages. I often make a design decision to display the sidebar on every or nearly every page. This is a fairly straightforward set of template edits. As an example, we will work with the template single.php. This is the template which displays individual posts</p>
<p>To gain further understanding of which template files are used when view a WordPress site visit <a href="http://codex.wordpress.org/Site_Architecture_1.5" title="Site Architecture">WordPress Site Architecture</a>.</p>
<p><span id="more-36"></span></p>
<h2>Narrow Column</h2>
<p>The default single.php has its content div set to widecolumn. This needs to be changed to narrowcolumn.</p>
<pre>&lt;div id="content" class="widecolumn"&gt;
to
&lt;div id="content" class="narrowcolumn"&gt;</pre>
<h2> Display Sidebar</h2>
<p>Now display the sidebar by adding the following code just before the get_footer call.</p>
<pre>FROM
&lt;?php get_footer(); ?&gt;

TO
&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;</pre>
<p>Wow, it doesn&#8217;t get much easier than that! Now you know how to convert from without sidebar to with sidebar displays.</p>
<p>Reference links:</p>
<ul>
<li><a href="http://codex.wordpress.org/Site_Architecture_1.5" title="Site Architecture">WordPress Site Architecture</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dvector.com/oracle/2008/05/21/sidebar-display-on-every-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Special Home Page</title>
		<link>http://dvector.com/oracle/2008/05/21/special-home-page/</link>
		<comments>http://dvector.com/oracle/2008/05/21/special-home-page/#comments</comments>
		<pubDate>Wed, 21 May 2008 21:12:00 +0000</pubDate>
		<dc:creator>one1</dc:creator>
				<category><![CDATA[dvector]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dvector support]]></category>

		<guid isPermaLink="false">http://dvector.com/oracle/2008/05/21/special-home-page/</guid>
		<description><![CDATA[The Home page of your site is the entryway for many visitors. By default, WordPress shows nothing but your most recent posts. Alternatively, WordPress makes it easy to set a page as your Home. I find that neither of these are sufficient and take another approach. If your templates contain a file named home.php then [...]]]></description>
			<content:encoded><![CDATA[<p>The Home page of your site is the entryway for many visitors. By default, WordPress shows nothing but your most recent posts. Alternatively, WordPress makes it easy to set a page as your Home. I find that neither of these are sufficient and take another approach. If your templates contain a file named home.php then that template file will be used instead of the default WordPress options.</p>
<p><span id="more-41"></span></p>
<h2>Create home.php</h2>
<p>Simply copy your index.php to home.php. Most of the template will be the same except for a few minor modifications.</p>
<h2>Sticky Posts</h2>
<p>Sticky posts are those that will remain at the top of your home page regardless of their age. Create a hidden category named &#8216;_sticky&#8217; and make note of it&#8217;s ID. Edit your home.php. Shortly after the <code>&lt;div id="content"&gt;</code> tag enter code similar to the following:</p>
<pre>&lt;?php query_posts('cat=86&amp;showposts=2');?&gt;
&lt;?php if (have_posts()) : ?&gt;
  &lt;?php while (have_posts()) : the_post(); ?&gt;
	&lt;div class='post' id='post-&lt;?php the_ID(); ?&gt;'&gt;
	&lt;h2 class='articleHeadline'&gt;
	&lt;?php the_title(); ?&gt;
	&lt;/h2&gt;
	&lt;p class='article'&gt;
	&lt;?php the_content('Read the rest of this entry'); ?&gt;
	&lt;/p&gt;
	&lt;/div&gt;
  &lt;?php endwhile; ?&gt;
&lt;?php endif; ?&gt;</pre>
<p>Firstly, make certain you replace 86 with the ID of your _sticky category. Now, some explanation of what is happening. The block which starts at <code>&lt;?php if (have_posts()) : ?&gt;</code> and ends at <code>&lt;?php endif; ?&gt;</code> is the standard <a href="http://codex.wordpress.org/The_Loop" title="WordPress Loop">WordPress Loop</a>. So the trick here lies within <code>&lt;?php query_posts('cat=86&amp;showposts=2');?&gt;</code>. This function call requests the most recent 2 (showpost=2) posts in the category with an ID of 86 (cat=86).</p>
<h2>Display Regular Posts</h2>
<p>Now in order for regular posts to display, we must reset our posts query. Let&#8217;s do a little more than that by also excluding all categories we wish to remain hidden. Just before the next Loop, add the following:</p>
<pre>&lt;?php query_posts('cat=-1,-86&amp;showposts=10');?&gt;</pre>
<p>Here we are excluding categories with the IDs of 1 and 86 and then displaying the most recent 10 posts.</p>
<p>This article introduced two key concepts, the function query_posts and the Loop. Do a little digging into these concepts and you have gained large amounts of control over your site&#8217;s display.</p>
<p>Reference links:</p>
<ul>
<li><a href="http://codex.wordpress.org/The_Loop" title="The Loop">The Loop</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/query_posts" title="query_posts">query_posts</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dvector.com/oracle/2008/05/21/special-home-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

