<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">CodeIgniter Forums</title>
    <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/" />
    <link rel="self" type="application/atom+xml" href="http://codeigniter.com/forums/atom/" />
    <updated>2009-01-06T06:41:37Z</updated>
    <rights>Copyright (c) 2009</rights>
    <generator uri="http://www.pmachine.com/" version="1.6.6">ExpressionEngine</generator>
    <id>tag:codeigniter.com,2009:01:06</id>


    <entry>
      <title>Passing an Array from a Model to a Controller&#63;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/101392/" />      
      <id>tag:codeigniter.com,2009:forums/viewthread/.101392</id>
      <published>2009-01-06T06:37:36Z</published>
      <updated>2009-01-06T06:41:37Z</updated>
      <author><name>Solarpitch</name></author>
      <content type="html">
      <![CDATA[
        <p>Hey Guys,</p>

<p>Just wondering if it possible to pass an array from a Model to a Controller. Basically in the below model function I need to return both the <b>results of the query</b> and the <b>pagination</b> to the controller for output in the view.</p>

<p></p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">function </span><span style="color: #0000BB">sales_breakdown</span><span style="color: #007700">()<br /></span><span style="color: #0000BB">&#123;&nbsp;&nbsp;&nbsp;<br />$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">library</span><span style="color: #007700">(</span><span style="color: #DD0000">'pagination'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$query </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT * FROM sales"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />if (</span><span style="color: #0000BB">$query</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">num_rows</span><span style="color: #007700">() &gt; </span><span style="color: #0000BB">0</span><span style="color: #007700">)<br /></span><span style="color: #0000BB">&#123;<br />$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">display </span><span style="color: #007700">.=<br /></span><span style="color: #DD0000">" &lt;table border='0' cellspacing='0' cellpadding='0' id='breakdown_table'&gt;<br />&lt;tr&gt;<br />&lt;td&gt;Item&lt;/td&gt;<br />&lt;td&gt;Price&lt;/td&gt;<br />&lt;td&gt;Type&lt;/td&gt;<br />&lt;td&gt;Category&lt;/td&gt;<br />&lt;td&gt;Time&lt;/td&gt;<br />&lt;/tr&gt;"</span><span style="color: #007700">;<br /><br /><br />foreach (</span><span style="color: #0000BB">$query</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">result</span><span style="color: #007700">() as </span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br /></span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">display </span><span style="color: #007700">.=<br /></span><span style="color: #DD0000">" <br />&lt;tr &gt;<br />&lt;td&gt;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">item</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;/td&gt;<br />&lt;td&gt;&amp;euro;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">price</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;/td&gt;<br />&lt;td&gt;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">type</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;/td&gt;<br />&lt;td&gt;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">temp3</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;/td&gt;<br />&lt;td&gt;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">time</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;/td&gt;<br />&lt;/tr&gt;"</span><span style="color: #007700">; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#125; <br /><br />$config&#91;</span><span style="color: #DD0000">'base_url'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #DD0000">'http://mysite.ie/index.php/enterprise/sales_breakdown/'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'total_rows'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #DD0000">'200'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'per_page'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #DD0000">'20'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">pagination</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">initialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">display </span><span style="color: #007700">.= </span><span style="color: #DD0000">"&lt;/table&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />return </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">display</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">&#125; </span>
</span>
</code></div><p></p>

<p>You see, instead of </p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">return </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">display</span><span style="color: #007700">; </span>
</span>
</code></div><p> I&#8217;d like to set an array like&#8230;<br />
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$myarray </span><span style="color: #007700">= array();<br /><br /></span><span style="color: #FF8000">//then do something like...<br /><br /></span><span style="color: #0000BB">$myarray&#91;0&#93; </span><span style="color: #007700">= </span><span style="color: #FF8000">//this would be what I have set as "$this-&gt;display .=" at the min<br /></span><span style="color: #0000BB">$myarray&#91;1&#93; </span><span style="color: #007700">= </span><span style="color: #FF8000">//which would be equal to "$this-&gt;pagination-&gt;initialize($config);"<br /><br />//then I could return the array to the controller with both the formatted query and the pagination links<br /><br /></span><span style="color: #007700">return </span><span style="color: #0000BB">$myarray</span><span style="color: #007700">; </span>
</span>
</code></div><p></p>

<p>Not sure how I could get the value of $myarray[0] and $myarray[1] in the controller&#8230;</p>

<p></p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">function </span><span style="color: #0000BB">sales_breakdown</span><span style="color: #007700">()</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">helper</span><span style="color: #007700">(</span><span style="color: #DD0000">'url'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">model</span><span style="color: #007700">(</span><span style="color: #DD0000">'report_model'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$data&#91;</span><span style="color: #DD0000">'sales_breakdown'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">report_model</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sales_breakdown</span><span style="color: #007700">(); </span><span style="color: #FF8000">// ???<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$data&#91;</span><span style="color: #DD0000">'right_box'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #DD0000">"right_box/sales_breakdown"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">view</span><span style="color: #007700">(</span><span style="color: #DD0000">'template/page_1'</span><span style="color: #007700">, </span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125; </span>
</span>
</code></div><p></p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>DX Auth 1.0.6 (Authentication library)</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/98465/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.98465</id>
      <published>2008-12-01T05:14:22Z</published>
      <updated>2009-01-02T18:19:08Z</updated>
      <author><name>dexcell</name></author>
      <content type="html">
      <![CDATA[
        <p><b>Introduction</b><br />
DX Auth is an authentication library for Code Igniter. It&#8217;s goal to enable you to easily include secure and easy to use authentication library to your project, while giving you the flexibility to choose from simple authentication system to full fledged authentication system.</p>

<p>DX Auth is also build with internationalization in mind, so every string is available in language file. <b>(Except the examples because that is your code, not the library)</b>.</p>

<p>It&#8217;s based on CL Auth 0.2.5 beta developed by Jason Ashdown.</p>

<p><b>What is the feature of DX Auth?</b></p>

<p>&nbsp;   * Basic auth (Login, logout, register, change password).<br />
&nbsp;   * Remember me.<br />
&nbsp;   * Login using username or email address or both (depend on config settings).<br />
&nbsp;   * Forgot password.<br />
&nbsp;   * Ban user.<br />
&nbsp;   * Last login IP address and time (optional).<br />
&nbsp;   * Email activation (optional).<br />
&nbsp;   * User Profile &#40;optional&#41;.<br />
&nbsp;   * Role based (admin, user, moderator, etc&#41;. Inheritance also supported (optional&#41;<br />
&nbsp;   * Restrict page based on URI and role (optional&#41;.<br />
&nbsp;   * Custom permission for each role (optional&#41;.<br />
&nbsp;   * Login attempt (optional&#41;. You can use this to display catpcha after specified try to login to prevent bot.<br />
&nbsp;   * Event feature (For example: You can put your own code like PM welcome message after user activated, etc&#41;.<br />
&nbsp;   * Captcha (optional, native and reCAPTCHA is available&#41;.<br />
&nbsp;   * Simple admin panel (So you can customize it, include it into your own admin panel, or delete if you don&#8217;t need it&#41;.<br />
&nbsp;   * Most of the feature is optional, means you can turn it off in config file, delete it, or just don&#8217;t use it.</p>

<p><br />
<b>What is changed since CL Auth 0.2.5</b></p>

<p>If you are ever using CL Auth before, you might want to know what&#8217;s changed since CL Auth 0.2.5</p>

<p>&nbsp;   * Bug fixes.<br />
&nbsp;   * Add and change function.<br />
&nbsp;   * Changed code structure.<br />
&nbsp;   * Group changed to role.<br />
&nbsp;   * Compatible with CI bundled session without hacking it.<br />
&nbsp;   * Added language file for internationalization.<br />
&nbsp;   * All function named lower_case instead of camelCase.<br />
&nbsp;   * Source code writing following CI User guide.<br />
&nbsp;   * Commented source code so you can follow along.<br />
&nbsp;   * Code Igniter style user guide with detailed explanation.<br />
&nbsp;   * And other that i don&#8217;t remember <img src="http://ellislab.com/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" />.</p>

<p>DX Auth is tested in CI 1.7.0, but should be working for above version.</p>

<p>DX Auth is licensed under MIT license.</p>

<p>Here is the link:</p>

<p><a href="http://dexcell.shinsengumiteam.com/dx_auth/"><span style="font-size:18px;">Documentation (Very well documented)</span></a></p>

<p><a href="http://dexcell.shinsengumiteam.com/dx_auth/installation/downloads.html"><span style="font-size:18px;">Download link</span></a></p>

<p><a href="http://dexcell.shinsengumiteam.com/dx_auth/examples/simple.html"><span style="font-size:18px;">Simple example on how to use DX Auth (See how easy to use it)</span></a></p>

<p>Version 1.0.6 (See how to upgrade below)</p>

<p>Release Date: January 3, 2009</p>

<p>It&#8217;s recommended to download the latest version.</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>AutoImport 1.0  for CodeIgniter Released!</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/100940/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.100940</id>
      <published>2008-12-30T16:19:14Z</published>
      <updated>2008-12-30T16:19:55Z</updated>
      <author><name>MikeHibbert</name></author>
      <content type="html">
      <![CDATA[
        <p>For all you guys who have car dealer clients and want to add Autotrader stock import functionality to their site, AutoImport 1.0 will make your task vastly simple!</p>

<p>Check it out at <a href="http://www.mikehibbert.me.uk/autoimport">http://www.mikehibbert.me.uk/autoimport</a></p>

<p>Mike</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>form_validation: rule matches</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/101026/" />      
      <id>tag:codeigniter.com,2009:forums/viewthread/.101026</id>
      <published>2009-01-01T01:45:20Z</published>
      <updated>2009-01-01T01:46:16Z</updated>
      <author><name>akkumaru</name></author>
      <content type="html">
      <![CDATA[
        <p>the rule &#8216;matches&#8217; syntax:</p>

<p></p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">matches&#91;form_item&#93;</span><span style="color: #007700">; </span>
</span>
</code></div><p></p>

<p>the logic is fine,<br />
but the produced error message still just states the form_item&#8217;s &#8216;FIELD NAME&#8217;, NOT its &#8216;HUMAN NAME&#8217;,,</p>

<p>i&#8217;m not sure if it can be categorized as bug, but i think it would be lovely to have an improvement on this issue,,</p>

<p>thank you</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Typeigniter is born!</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/101302/" />      
      <id>tag:codeigniter.com,2009:forums/viewthread/.101302</id>
      <published>2009-01-05T09:28:32Z</published>
      <updated>2009-01-05T16:24:05Z</updated>
      <author><name>murphy2006</name></author>
      <content type="html">
      <![CDATA[
        <p>Hello Guys,</p>

<p>I have started another blog project based upon the wonderful Codeigniter framework.<br />
My version of a blog engine is a little different from the normal approach.</p>

<p>First a blog post is created, then it is filled with content such as texts, images and videos for example. The good thing about this is that the author get the possibility to turn off or move pieces of data within the blog post itself. Also all content and settings is editable just by clicking on the text (inline editable)!</p>

<p>The &#8220;magic&#8221; ajax stuff are done by the awesome Jquery.</p>

<p>I have given it the name TypeIgniter.</p>

<p>You can find a demo below, please note that it is in Alpha version and some things may not work as intended. Please post your comments and suggestions in this thread.</p>

<p><a href="http://typeigniter.com/demo/backend/">http://typeigniter.com/demo/backend/</a></p>

<p>Username: demo at demo dot com<br />
Password: password</p>

<p>Kind Regards,<br />
Daniel</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>PHP practices in CodeIgniter</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/101383/" />      
      <id>tag:codeigniter.com,2009:forums/viewthread/.101383</id>
      <published>2009-01-06T03:30:03Z</published>
      <updated></updated>
      <author><name>XORd</name></author>
      <content type="html">
      <![CDATA[
        <p>Hi, folks! I am very excited about CI since the very first time it came out. <br />
However, today my excitement was disturbed by the fact that I was not able to perform a<br />
moderately complex output to my view - something that I would normally do this way (using my favourite <a href="http://www.woyano.com/jv/ezsql">ez_sql database class</a>). I have the corresponding CI instructions as comments.</p>

<p></p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$items </span><span style="color: #007700">= </span><span style="color: #0000BB">$db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_results</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT * FROM items"</span><span style="color: #007700">); </span><span style="color: #FF8000">// $query=$this-&gt;db-&gt;get('items');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// $data&#91;'items'&#93;=$query-&gt;result();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// $this-&gt;load-&gt;view('itemsview', $data);<br /><br /></span><span style="color: #0000BB">$output </span><span style="color: #007700">= </span><span style="color: #DD0000">'&lt;table&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;ID&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Name&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Lat Added SubItem&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;'</span><span style="color: #007700">;<br /><br />foreach(</span><span style="color: #0000BB">$items </span><span style="color: #007700">as </span><span style="color: #0000BB">$item</span><span style="color: #007700">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;$last_subitem </span><span style="color: #007700">= </span><span style="color: #0000BB">$db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_row</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// gets a single row from the db<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM sub_items&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE item='$item-&gt;id'&nbsp;&nbsp;&nbsp;&nbsp;// Ok, this should happen in the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORDER BY datetime DESC"</span><span style="color: #007700">); </span><span style="color: #FF8000">// view; I am not quite confident<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// about its implementation in CI<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// the foreach loop happens in<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// my view. How do I get the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// corresponding sub_item of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// each main item before the view?<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$output </span><span style="color: #007700">.= </span><span style="color: #DD0000">"&lt;tr&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;$item-&gt;id&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;$item-&gt;name&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;$last_subitem-&gt;name&lt;/td&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">&#125;<br /><br />$output </span><span style="color: #007700">.= </span><span style="color: #DD0000">'&lt;/table&gt;'</span><span style="color: #007700">;<br /><br />echo </span><span style="color: #0000BB">$output</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt; </span>
</span>
</code></div><p></p>

<p>Please, give me an advice on the implementation of such a practice in CI.</p>

<p>Thank you for you time to read through the code!</p>



<p>&#8212;<br />
XORd</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Add a single database entry&#63;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/101394/" />      
      <id>tag:codeigniter.com,2009:forums/viewthread/.101394</id>
      <published>2009-01-06T07:10:33Z</published>
      <updated>2009-01-06T07:10:47Z</updated>
      <author><name>Friedebarth</name></author>
      <content type="html">
      <![CDATA[
        <p>Hello CodeIgniters. I&#8217;ve watched the video tutorials and have read the userguide, but I can&#8217;t figure out how to do the following.</p>

<p>My goal is to develop a CMS for simming fleets/clans specialised in Star Trek fandom. Therefore, I need the guys being able to easily edit the data (fleet name etc.), so I thought I could pull it from the database, where they could edit it (yes, I <i>am</i> going to add a form <img src="http://ellislab.com/images/smileys/lol.gif" width="19" height="19" alt="LOL" style="border:0;" />), and that&#8217;s why I created a table called fms_start (like my index controller and it&#8217;s viewfile.</p>

<p>This table has: id (quite unnecessary because there should only be one entry), which is auto_increment and int. Then, it has fname, body and footer. Now, the defaults for these are iFleet, Your text here and Copyright Joe Bloggs. Now what I wanted to do is this (database data in [] brackets):</p>

<p></p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">&lt;</span><span style="color: #0000BB">html</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">header</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">title</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#91;fname&#93;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">title</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">header</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">body</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">h1</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#91;fname&#93;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h1</span><span style="color: #007700">&gt;<br /></span><span style="color: #0000BB">&#91;body&#93;<br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">small</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#91;footer&#93;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">small</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">body</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">html</span><span style="color: #007700">&gt; </span>
</span>
</code></div><p></p>

<p>Now I didn&#8217;t really get how to do that. Could someone please help me out? Thanks <img src="http://ellislab.com/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /></p>

<p>Your Friedebarth</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Session Timeout on Browser Close [Solved with patch]</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/57081/" />      
      <id>tag:codeigniter.com,2007:forums/viewthread/.57081</id>
      <published>2007-07-23T15:04:24Z</published>
      <updated></updated>
      <author><name>brutuscat</name></author>
      <content type="html">
      <![CDATA[
        <p>Hey Rick, after some research I found that the when you set the php&#8217;s session life time to 0, it&#8217;s dies after the browser is closed. (php site http://ar2.php.net/manual/en/function.setcookie.php). After debuged my cookie I&#8217;ve founded that was setted to 0 on the client also. <br />
So we could have the same in codeigniter, it&#8217;s a small change.</p>

<p>At Session.php<br />
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//At method<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">sess_run</span><span style="color: #007700">() </span><span style="color: #0000BB">&#123;<br /></span><span style="color: #007700">...<br />...<br /></span><span style="color: #FF8000">//next is line 101<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">is_numeric</span><span style="color: #007700">(</span><span style="color: #0000BB">$expiration</span><span style="color: #007700">))<br /></span><span style="color: #0000BB">&#123;<br /> </span><span style="color: #007700">if (</span><span style="color: #0000BB">$expiration </span><span style="color: #007700">&gt; </span><span style="color: #0000BB">0</span><span style="color: #007700">)<br /> </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sess_length </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">config</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">item</span><span style="color: #007700">(</span><span style="color: #DD0000">'sess_expiration'</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">&#125;<br /> </span><span style="color: #007700">else if (</span><span style="color: #0000BB">$expiration </span><span style="color: #007700">== </span><span style="color: #0000BB">0</span><span style="color: #007700">)<br /> </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sess_length </span><span style="color: #007700">= </span><span style="color: #0000BB">0<br /> &#125;<br /> </span><span style="color: #007700">else if (</span><span style="color: #0000BB">$expiration </span><span style="color: #007700">== -</span><span style="color: #0000BB">1</span><span style="color: #007700">)<br /> </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sess_length </span><span style="color: #007700">= (</span><span style="color: #0000BB">60</span><span style="color: #007700">*</span><span style="color: #0000BB">60</span><span style="color: #007700">*</span><span style="color: #0000BB">24</span><span style="color: #007700">*</span><span style="color: #0000BB">365</span><span style="color: #007700">*</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">&#125;<br />&#125;<br /></span><span style="color: #007700">...<br />...<br /></span><span style="color: #0000BB">&#125;<br /><br /><br /></span><span style="color: #FF8000">//And at method<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">sess_write</span><span style="color: #007700">() </span><span style="color: #0000BB">&#123;<br /></span><span style="color: #007700">...<br />...<br /></span><span style="color: #FF8000">// At line 275<br /></span><span style="color: #0000BB">setcookie</span><span style="color: #007700">(<br /> </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sess_cookie</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">$cookie_data</span><span style="color: #007700">,<br /> (</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sess_length </span><span style="color: #007700">== </span><span style="color: #0000BB">0</span><span style="color: #007700">) ? </span><span style="color: #0000BB">0 </span><span style="color: #007700">: </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sess_length </span><span style="color: #007700">+ </span><span style="color: #0000BB">time</span><span style="color: #007700">(),<br /> </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">config</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">item</span><span style="color: #007700">(</span><span style="color: #DD0000">'cookie_path'</span><span style="color: #007700">),<br /> </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">config</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">item</span><span style="color: #007700">(</span><span style="color: #DD0000">'cookie_domain'</span><span style="color: #007700">),<br /> </span><span style="color: #0000BB">0<br /></span><span style="color: #007700">);<br />...<br />...<br /></span><span style="color: #0000BB">&#125;<br />?&gt; </span>
</span>
</code></div><p></p>

<p>After this changes:<br />
 - sess_expiration = 0 it will timeout after browser closes<br />
 - sess_expiration = -1 it will receive the default 2 years value.</p>

<p>Hope you can add this.</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Ocular Images &#45; Possible Operator Error</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/101393/" />      
      <id>tag:codeigniter.com,2009:forums/viewthread/.101393</id>
      <published>2009-01-06T06:38:20Z</published>
      <updated></updated>
      <author><name>batty</name></author>
      <content type="html">
      <![CDATA[
        <p>Huge props to kilishan for creating and improving Ocualr.&nbsp; THANKS!!!</p>

<p>I am having what I think is an &#8216;operator error&#8217; issue with Ocular.&nbsp; The short story is that images do not seem to be appearing on my output pages even though I have been careful to ensure that the path is correct.&nbsp; </p>

<p>Here is the path to the actual image:</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">~/</span><span style="color: #0000BB">Library</span><span style="color: #007700">/</span><span style="color: #0000BB">WebServer</span><span style="color: #007700">/</span><span style="color: #0000BB">Documents</span><span style="color: #007700">/</span><span style="color: #0000BB">CodeIgniter</span><span style="color: #007700">/</span><span style="color: #0000BB">public</span><span style="color: #007700">/</span><span style="color: #0000BB">images</span><span style="color: #007700">/</span><span style="color: #0000BB">logo_ptologic</span><span style="color: #007700">.</span><span style="color: #0000BB">jpg </span>
</span>
</code></div><p><br />
Here is the path when viewing HTML source on the delivered page:<br />
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">&lt;</span><span style="color: #0000BB">img src</span><span style="color: #007700">=</span><span style="color: #DD0000">"public/images/logo_ptologic.jpg" </span><span style="color: #0000BB">alt</span><span style="color: #007700">= </span><span style="color: #DD0000">"PTOlogic Logo"</span><span style="color: #007700">&gt; </span>
</span>
</code></div><p></p>

<p>I have tried moving the images folder around in an attempt to find the right spot:<br />
/codeigniter/public/images/file.jpg (the recommended location)<br />
/codeigniter/system/public/images/...<br />
and even /documents/public/...<br />
The funny thing is that my .css and .js files are working just fine in the recommended location.</p>

<p>Could I be missing something?&nbsp; Perhaps a config file I have not set properly?</p>

<p>Rob</p>

<p>Platform Info:<br />
localhost on a MacBook Pro<br />
CodeIgniter 1.7.0<br />
Ocular 0.25</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>&#8220;&amp;lt;&#63;=&#8221; is not work&#63;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/101212/" />      
      <id>tag:codeigniter.com,2009:forums/viewthread/.101212</id>
      <published>2009-01-04T05:41:29Z</published>
      <updated></updated>
      <author><name>fRkSsK</name></author>
      <content type="html">
      <![CDATA[
        <p>hi<br />
when i write;</p>

<p>&lt;?= anchor(&#8216;application&#8217;, &#8216;The Application&#8217;);?&gt;<br />
or<br />
&lt;?= base_url();?&gt;<br />
or..</p>

<p>it does not work. php doesn&#8217;t work. source code is shown same &#8220;&lt;?= base_url();?&gt;&#8221;</p>

<p>but when i write example &lt;?php echo &#8216;hello&#8217; ?&gt; is work.</p>

<p>so What i must do for this problem?</p>
      ]]>
      </content>
    </entry>


</feed>