<?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>0</updated>
    <rights>Copyright (c) 2012</rights>
    <generator uri="http://www.pmachine.com/" version="2.2.2">ExpressionEngine</generator>
    <id>tag:codeigniter.com,2012:05:23</id>


    <entry>
      <title>Downloading Problem</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217805/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217805</id>
      <published>2012-05-23T17:53:09Z</published>
      <updated>0</updated>
      <author><name>Shiju S S</name></author>
      <content type="html">
      <![CDATA[
        <p>I used the following code for downloading files from a link</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=</span><span style="color: #DD0000">"Select&nbsp;*&nbsp;from&nbsp;downloads&nbsp;where&nbsp;b_status='Y'&nbsp;and&nbsp;c_downloadid='</span><span style="color: #0000BB">$dwid</span><span style="color: #DD0000">'&nbsp;limit&nbsp;1"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">=</span><span style="color: #0000BB">$data&#91;</span><span style="color: #DD0000">'result'</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">ahsta_db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_results</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$result</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">foreach(</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$filename</span><span style="color: #007700">=</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">c_filename</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">file_get_contents&#40;</span><span style="color: #DD0000">"./uploads/downloads/"</span><span style="color: #007700">.</span><span style="color: #0000BB">$filename&#41;</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;Read&nbsp;the&nbsp;file's&nbsp;contents<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">c_title</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">force_download</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#125;&nbsp;</span>
</span>
</code></div>

<p>The path is correct and no error is shown. If a download occurred I don&#8217;t where the file went. What can I do now.<br />
I also want a dialog like we see commonly before the download takes place. Please give necessary direction.</p>

<p>&nbsp;</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>BBedit Clippings</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217794/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217794</id>
      <published>2012-05-23T16:07:18Z</published>
      <updated>0</updated>
      <author><name>giberti</name></author>
      <content type="html">
      <![CDATA[
        <p>I&#8217;ve created a new clipping set for BBEdit specific to the 2.1 codebase. It also includes shortcuts to create common document types and phpDocumentor comment blocks.</p>

<p>Get it here: <a href="https://github.com/giberti/BBEdit_Clippings_CodeIgniter/">https://github.com/giberti/BBEdit_Clippings_CodeIgniter/</a></p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Ajax Framework For CodeIgniter</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217769/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217769</id>
      <published>2012-05-23T10:09:02Z</published>
      <updated>0</updated>
      <author><name>JoseNunes</name></author>
      <content type="html">
      <![CDATA[
        <p>Hello,</p>

<p>How do I install this along with Modules Extension for Code Igniter (HMVC) ?</p>

<p>By copying to the base directory, when trying to access ajax.php?test/test the app throws : &#8220;Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.&#8221;</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Codeigniter Direct</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217554/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217554</id>
      <published>2012-05-20T07:09:13Z</published>
      <updated>2012-05-20T11:07:16Z</updated>
      <author><name>Stunt</name></author>
      <content type="html">
      <![CDATA[
        <p>Codeigniter Direct is simple way to use Codeigniter libraries and helpers directly in file without using MVC pattern or controller structure.</p>

<p>This may help You in specific situations.</p>

<p>You can try it here :<br />
<a href="https://github.com/Stunt/Codeigniter-direct">https://github.com/Stunt/Codeigniter-direct</a></p>

<p><b>Never recommend to ignore Codeigniter structure and pattern. You never need it mostly.</b></p>

<p><br />
I&#8217;ll explain my situation to help you better understand,<br />
I&#8217;m working in Telecom company and dev on SIP and Voip devices for telephony platforms like <a href="http://www.asterisk.org">Asterisk</a>.<br />
We create our webbased VOIP applications using Codeigniter but we need also code in backgrounds, and events for services in non-webbased environment where device work with code not a reqular web-server.</p>

<p>The deal is that this environment is very limited and CLI is not everything.</p>

<p>So Hard-code is not good idea. Also creating a custom platform is not good option because of time and cost savings and because of debug,update,upgrade ,Or train new programmers to be famillar with that ...</p>

<p>So We have to use Zend-Framework in this environment and Codeigniter for our applications. <br />
But the problem is our small team trained with Codeigniter and they can&#8217;t work fast with Zend and result is that We lost our flexibility for manage dev team in projects and maybe we have to get new coders or convert our webapps from CI to Zend..</p>

<p>I decide to try with Codeigniter and make it available for direct usage and ignore the standard structure.</p>

<p>This is my start and I&#8217;m testing it. with minimal change to CI.</p>

<p>You can try it here :<br />
<a href="https://github.com/Stunt/Codeigniter-direct">https://github.com/Stunt/Codeigniter-direct</a></p>

<p>Now I&#8217;m able to create .php file and use CI object out of MVC pattern directly include in file without losing CI features.<br />
We&#8217;ll use it only in this situation. in our web apps and software products we always use Codeigniter structure, guideline and standards.&nbsp; </p>

<p><br />
<b>Never recommend to ignore Codeigniter structure and pattern. You never need it mostly.</b></p>

<p><br />
just open new Php file in public directory and use $CI object.</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">require_once&nbsp;</span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">).</span><span style="color: #DD0000">'/../direct.php'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$CI</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">'user_agent'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">agent</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">browser</span><span style="color: #007700">();&nbsp;</span>
</span>
</code></div>

<p>&#8212;-<br />
All the best<br />
Ahmad Samiei</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Logged_In function acting strangely</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217449/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217449</id>
      <published>2012-05-18T03:25:14Z</published>
      <updated>2012-05-18T03:25:36Z</updated>
      <author><name>guy8214</name></author>
      <content type="html">
      <![CDATA[
        <p>In the ag auth library, </p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">logged_in</span><span style="color: #007700">()<br />&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #007700">if(</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">session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">userdata</span><span style="color: #007700">(</span><span style="color: #DD0000">'logged_in'</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">)<br />&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;</span><span style="color: #007700">else<br />&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">FALSE</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&#125;&nbsp;</span>
</span>
</code></div>

<p>I had to make the equality operator be &#8216;==&#8217; rather than &#8216;===&#8217; in order for the session to work on a hostgator remote server. Strangely, it worked on my local MAMP server.</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Multiple File Import By Zip File</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217241/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217241</id>
      <published>2012-05-15T05:39:42Z</published>
      <updated>0</updated>
      <author><name>srpurdy</name></author>
      <content type="html">
      <![CDATA[
        <p>Thought someone maybe will find this helpful. <img src="http://ellislab.com/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /></p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>HTML code into a scroll box</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217110/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217110</id>
      <published>2012-05-12T09:39:44Z</published>
      <updated>0</updated>
      <author><name>samreenshinde</name></author>
      <content type="html">
      <![CDATA[
        <p>What is the code to paste a HTML code into a scroll box without the picture showing up?</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>eclipse templates</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/217036/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.217036</id>
      <published>2012-05-11T03:55:13Z</published>
      <updated>0</updated>
      <author><name>ncacace</name></author>
      <content type="html">
      <![CDATA[
        <p>Are closing PHP tags &#8216;?&gt;&#8217; no longer required..?</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Issue with OAuth and i18n routes</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/216775/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.216775</id>
      <published>2012-05-07T19:41:23Z</published>
      <updated>0</updated>
      <author><name>jsuissa</name></author>
      <content type="html">
      <![CDATA[
        <p>I was wondering if anyone here had any experience dealing with using OAuth with the i18n library.</p>

<p>I&#8217;m trying to find a way to disable the i18n routes for a specific controller, but it doesn&#8217;t seem to be working.&#8216;en&#8217; is automattically added to the first segment of my URL now.</p>

<p>After a user authenticates on LinkedIn it returns to the &#8216;correct&#8217; CI URL, now with the &#8216;en&#8217; as the 1st URL segment, but the authentication no longer works. When I dump my SESSION I only see the request token, no auth token.</p>

<p>Thanks in advance.</p>

<p>Justin</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Validation while updating the record</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/216216/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.216216</id>
      <published>2012-04-27T17:08:45Z</published>
      <updated>0</updated>
      <author><name>Lokesh Gupta</name></author>
      <content type="html">
      <![CDATA[
        <p>Please Help me</p>

<p><br />
!!urgent</p>

<p>Thanks in advance</p>

<p>I have an issue related to validation while updating the record.</p>

<p>Scenario:</p>

<p>1 I having a field which must be unique while insertion.<br />
2 When I updated that field it must be unique but if it is updated with same value it must be updated. But if there are more same values in database it should give validation message.<br />
&nbsp;   What is the best solution to validate while updating record? <br />
Code:</p>

<p>$user-&gt;id = $this-&gt;input-&gt;post(&#8216;id&#8217;); <br />
$user-&gt;name = $this-&gt;input-&gt;post(&#8216;name&#8217;);<br />
$user-&gt;oth= $this-&gt;input-&gt;post(&#8216;oth&#8217;);&nbsp;   <br />
$isSaved = $user-&gt;save();&nbsp;  &nbsp; <br />
if(!$isSaved)&#123; // did validation fail? <br />
&nbsp;  if ( $user-&gt;valid )<br />
 &#123;&nbsp;  &nbsp;  &nbsp;  &nbsp; <br />
 $data[&#8216;fail&#8217;] = &#8216;Insert failure.&#8217;;&nbsp;   <br />
&nbsp;  &#125; else &#123;<br />
&nbsp;  &nbsp;  $data[&#8216;fail&#8217;] = &#8216;Validation Error: Please correct errors.&#8217;;<br />
 foreach ($user-&gt;error-&gt;all as $key=&gt;$e)<br />
 &#123;<br />
 $data[&#8216;error&#8217;][$key] = $e;<br />
 &#125;&nbsp; <br />
&nbsp;  &#125;&nbsp;   <br />
&#125;</p>
      ]]>
      </content>
    </entry>


</feed>
