EllisLab Community Forums http://ellislab.com/forums/ EllisLab Community Forums en Copyright 2013 2013-05-23T13:18:30-05:00 Datamapper: Something like where_in_related, but including all http://ellislab.com/forums/viewthread/235614/ http://ellislab.com/forums/viewthread/235614/#When:13:18:30Z <p>Ok, I’m working on a realestate website and I have few tables (of importance here) such as:</p> <p>properties: id, title, desc, price, <br /> amenities: id, name<br /> amenities_properties: id, amenity_id, property_id</p> <p>Now, within a search there are checkboxes that are used to select amenities that must be present in a property. So, in my controller I had something like:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #f5f8cc">$results&nbsp;</span><span style="color: #91f291">=&nbsp;new&nbsp;</span><span style="color: #f5f8cc">Property</span><span style="color: #91f291">();<br /></span><span style="color: #f5f8cc">$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">distinct</span><span style="color: #91f291">();<br /></span><span style="color: #479fd1">//other&nbsp;search&nbsp;queries&nbsp;go&nbsp;here...<br /></span><span style="color: #f5f8cc">$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">where_in_related_amenity</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'id'</span><span style="color: #91f291">,&nbsp;(array)</span><span style="color: #f5f8cc">$amenities_ids</span><span style="color: #91f291">);<br /></span><span style="color: #479fd1">//other&nbsp;search&nbsp;queries&nbsp;go&nbsp;here...<br /></span><span style="color: #f5f8cc">$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get</span><span style="color: #91f291">();&nbsp;</span> </span> </code></div> <p>This gets all properties that have at least one of the selected amenities, but I need only the properties that have them all!</p> <p>So I thought something like this will solve my problems:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #f5f8cc">$results&nbsp;</span><span style="color: #91f291">=&nbsp;new&nbsp;</span><span style="color: #f5f8cc">Property</span><span style="color: #91f291">();<br /></span><span style="color: #f5f8cc">$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">distinct</span><span style="color: #91f291">();<br /></span><span style="color: #479fd1">//other&nbsp;search&nbsp;queries&nbsp;go&nbsp;here...<br /></span><span style="color: #f5f8cc">$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">group_start</span><span style="color: #91f291">();<br />foreach&nbsp;(</span><span style="color: #f5f8cc">$amenities_ids&nbsp;</span><span style="color: #91f291">as&nbsp;</span><span style="color: #f5f8cc">$am_id</span><span style="color: #91f291">)<br /></span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">where_related_amenity</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'id'</span><span style="color: #91f291">,&nbsp;(int)</span><span style="color: #f5f8cc">$am_id</span><span style="color: #91f291">);<br /></span><span style="color: #f5f8cc">}<br />$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">group_end</span><span style="color: #91f291">();<br /></span><span style="color: #479fd1">//other&nbsp;search&nbsp;queries&nbsp;go&nbsp;here...<br /></span><span style="color: #f5f8cc">$results</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get</span><span style="color: #91f291">();&nbsp;</span> </span> </code></div> <p>Unfortunately, this returns no properties in my $results, although I’m sure at least one of them had amenities I tested with. The generated query has no errors but retrieves nothing. Here it is:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #f5f8cc">SELECT&nbsp;DISTINCT&nbsp;</span><span style="color: #91f291">`</span><span style="color: #FFFFFF">properties</span><span style="color: #91f291">`.*<br /></span><span style="color: #f5f8cc">FROM&nbsp;</span><span style="color: #91f291">(`</span><span style="color: #FFFFFF">properties</span><span style="color: #91f291">`)<br />...<br /></span><span style="color: #f5f8cc">LEFT&nbsp;OUTER<br />&nbsp;JOIN&nbsp;</span><span style="color: #91f291">`</span><span style="color: #FFFFFF">amenities_properties</span><span style="color: #91f291">`&nbsp;</span><span style="color: #f5f8cc">amenities_properties&nbsp;ON&nbsp;</span><span style="color: #91f291">`</span><span style="color: #FFFFFF">properties</span><span style="color: #91f291">`.`</span><span style="color: #FFFFFF">id</span><span style="color: #91f291">`&nbsp;=<br />&nbsp;`</span><span style="color: #FFFFFF">amenities_properties</span><span style="color: #91f291">`.`</span><span style="color: #FFFFFF">property_id</span><span style="color: #91f291">`<br /></span><span style="color: #f5f8cc">WHERE<br /></span><span style="color: #91f291">...<br />AND&nbsp;&nbsp;(<br />`</span><span style="color: #FFFFFF">amenities_properties</span><span style="color: #91f291">`.`</span><span style="color: #FFFFFF">amenity_id</span><span style="color: #91f291">`&nbsp;=&nbsp;</span><span style="color: #f5f8cc">24<br /></span><span style="color: #91f291">AND<br />&nbsp;`</span><span style="color: #FFFFFF">amenities_properties</span><span style="color: #91f291">`.`</span><span style="color: #FFFFFF">amenity_id</span><span style="color: #91f291">`&nbsp;=&nbsp;</span><span style="color: #f5f8cc">9<br /></span><span style="color: #91f291">)&nbsp;</span> </span> </code></div> <p>Any other ideas how to get properties that have ALL selected amenities related to them?</p> 2013-05-23T13:18:30-05:00 Code Igniter - Datamapper ORM 1.8.2 - Table Generation http://ellislab.com/forums/viewthread/235589/ http://ellislab.com/forums/viewthread/235589/#When:04:51:31Z <p>Hi, First of all I would like to thank CodeIgniter for a great framework, planning and reasearch lead me to decide to use CI an Datamapper ORM for my project.</p> <p>Many post is about the CI - DataMapper ORM rises with how to generate Model From Database which in my point of view is much complicated as the application will have to know your conventions in table which would be very .... but possible maybe :D</p> <p>My question is much much possible as Can DataMapper Generate Table in the Database from your define Model or is there any Datamapper extension or helper that would do this:</p> <p>ex : generateTable(‘modelName’)</p> <p>now i know this is possible as the plugin knows what it needs. is there any such so I would never have to code them my self.</p> <p>Thanks<br /> Nick Ace</p> 2013-05-23T04:51:31-05:00 How to make QR Code in codeigniter http://ellislab.com/forums/viewthread/235595/ http://ellislab.com/forums/viewthread/235595/#When:06:08:00Z <p>hi all, is there anything that can help me to make qr code generator program in codeigniter ..?<br /> please help ...<br /> Thank you.</p> 2013-05-23T06:08:00-05:00 DataMapper ORM v1.8.2 http://ellislab.com/forums/viewthread/205637/ http://ellislab.com/forums/viewthread/205637/#When:16:43:26Z <p><span style="font-size:18px;"><b><span style="color:#8888AA;">DataMapper ORM 1.8.2</span></b></span></p> <blockquote><p><span style="font-size:18px;">Download the <a href="http://datamapper.wanwizard.eu/pages/download.html">Latest Version Here</a></span></p> <p>&nbsp; View <a href="http://datamapper.wanwizard.eu/pages/changelog.html">the change log</a> and <a href="http://datamapper.wanwizard.eu/pages/upgrade.html">the upgrade process</a><br /> &nbsp; Having issues? <a href="http://datamapper.wanwizard.eu/pages/troubleshooting.html">Please look through the Troubleshooting Guide &amp; FAQs</a><br /> &nbsp; <a href="http://datamapper.wanwizard.eu/">View the Complete Manual</a><br /> &nbsp; <a href="http://www.google.com/cse/home?cx=009945192369939474941:_qezanlhudo">Search the Manual</a> <span style="font-size:9px;"></span><br /> &nbsp; <span style="color:#333366;"><i>(Due to the server’s caching configuration, you may need to forcibly refresh your browser to see the changes in the manual.)</i></span></p> </blockquote> <p>DataMapper (DM) is an Object-Relational Mapper that builds on ActiveRecord.&nbsp; Data is loaded from database tables into objects, and relationships can be managed through simple, easy-to-read functions.</p> <p>To install DataMapper ORM, the (fairly simple) upgrade process is <a href="http://datamapper.wanwizard.eu/pages/upgrade.html">described here</a>.</p> <p>DataMapper offers these features:<br /> &nbsp; • Everything is an object!<br /> &nbsp; • Easy to setup, easy to use.<br /> &nbsp; • Custom Validation on object properties.<br /> &nbsp; • Lazy Loading (related objects are only loaded upon access).<br /> &nbsp; • Relations and their integrity are automatically managed for you.<br /> &nbsp; • One to One, One to Many, and Many to Many relations fully supported.<br /> &nbsp; • Select data in the style of Active Record (with or without Method Chaining).</p> <p>You can learn much more from the manual.</p> <p>———————————————————————————————————</p> <p><span style="color:brown;"><span style="font-size:14px;"><b>Version 1.8.2:</b></span></span><br /> &nbsp; * New Features<br /> &nbsp; &nbsp; &nbsp; o Backported the DataMapper 2.0 bootstrap to get access to core classes in CodeIgniter version 2.0.3 and above.<br /> &nbsp; &nbsp; &nbsp; o Changed the way watched methods are processed. This allows extensions to replace core methods.<br /> &nbsp; &nbsp; &nbsp; o Add support for an absolute path for “extensions_path”.<br /> &nbsp; &nbsp; &nbsp; o Added a all_to_single_array() method to the array extension.<br /> &nbsp; * Bug Fixes<br /> &nbsp; &nbsp; &nbsp; o Added a default for nestedsets root field name as described in the documentation.<br /> &nbsp; &nbsp; &nbsp; o Fixed ignoring model configuration properties with a NULL or FALSE value.<br /> &nbsp; &nbsp; &nbsp; o Fixed broken trans_status() method.<br /> &nbsp; * Other Changes<br /> &nbsp; &nbsp; &nbsp; o Improved the way the available model paths are determined.<br /> &nbsp; &nbsp; &nbsp; o Several corrections to the documentation.</p> <p>This version introduces a bootstrap loader that needs to be installed in your index.php file, and will allow DataMapper to access CodeIgniters protected core methods and properties, while keeping CodeIgniters core extension mechanism operational (DataMapper does not introduce MY_ versions of libraries).</p> <p>Make sure to <a href="http://datamapper.wanwizard.eu/pages/changelog.html">check out the changelog</a> — you won’t want to skip this update!</p> <p>————————————————————————————————————————</p> <p><span style="color:brown;"><span style="font-size:14px;"><b>Bug reports and feature requests:</b></span></span></p> <p>DataMapper has moved to Github for the development of version 2.0. Please use the issue register / bug tracker on <a href="https://github.com/WanWizard/datamapper2/issues">github</a> to report new bugs or for new feature requests. If you do, please include in your description is link to the thread on this forum discussing the issue (if possible), so I have a link between the two and can keep track of all issues.</p> <p>————————————————————————————————————————</p> <p>Older Discussions: <a href="http://ellislab.com/forums/viewthread/190990/">Version 1.8.1</a>, <a href="http://ellislab.com/forums/viewthread/178045/">Version 1.8.0</a>, <a href="http://ellislab.com/forums/viewthread/149388/">Version 1.7.1</a>, <a href="http://ellislab.com/forums/viewthread/136039/">Version 1.6.2</a>, <a href="http://ellislab.com/forums/viewthread/132772/">Version 1.5.4</a>, <a href="http://ellislab.com/forums/viewthread/112904/">Version 1.5.3 and older</a>.</p> <p><span style="font-size:11px;"><span style="color:gray;"><i>Thanks goes to Overzealous, for all he has achieved with DMZ. And to stensi, for providing such an amazing code base to work on.</i></span></span></p> 2011-11-30T16:43:26-05:00 zip library CRC32 error http://ellislab.com/forums/viewthread/235587/ http://ellislab.com/forums/viewthread/235587/#When:02:58:29Z <p>I am getting an error with my zip files when I try to zip following code</p> <p>Controller</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #479fd1">//gets&nbsp;the&nbsp;zipname&nbsp;and&nbsp;the&nbsp;projectDir&nbsp;to&nbsp;send&nbsp;to&nbsp;the&nbsp;downloadZip&nbsp;function<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">downloadZip</span><span style="color: #91f291">()&nbsp;</span><span style="color: #f5f8cc">{<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$zipName&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">project_model</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">getProjectTitle</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">uri</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">segment</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">3</span><span style="color: #91f291">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$projectDir&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">project_model</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">getProjectPath</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">uri</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">segment</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">3</span><span style="color: #91f291">));<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">doDownload</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$projectDir</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$zipName</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #479fd1">//Does&nbsp;sends&nbsp;all&nbsp;projects&nbsp;to&nbsp;the&nbsp;downloadZip&nbsp;function<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">downloadAllProjects</span><span style="color: #91f291">()&nbsp;</span><span style="color: #f5f8cc">{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">if&nbsp;(</span><span style="color: #f5f8cc">$_SESSION[</span><span style="color: #FFFFFF">'isAdmin'</span><span style="color: #f5f8cc">]&nbsp;</span><span style="color: #91f291">!=&nbsp;</span><span style="color: #f5f8cc">true</span><span style="color: #91f291">)&nbsp;</span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;redirect</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'user'</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$projectDir&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #FFFFFF">'/projects/'</span><span style="color: #91f291">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$zipName&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #FFFFFF">'project.zip'</span><span style="color: #91f291">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">doDownload</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$projectDir</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$zipName</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #479fd1">/**<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Reads&nbsp;the&nbsp;projectdir&nbsp;and&nbsp;then&nbsp;returns&nbsp;a&nbsp;zip&nbsp;,&nbsp;which&nbsp;you&nbsp;download&nbsp;with&nbsp;the&nbsp;zipname<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;type&nbsp;$projectDir<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;type&nbsp;$zipName<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">private&nbsp;function&nbsp;</span><span style="color: #f5f8cc">doDownload</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$projectDir</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$zipName</span><span style="color: #91f291">)&nbsp;</span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">library</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'zip'</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">zip</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">read_dir</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$projectDir</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">FALSE</span><span style="color: #91f291">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #479fd1">//&nbsp;Download&nbsp;the&nbsp;file&nbsp;to&nbsp;your&nbsp;desktop.&nbsp;Name&nbsp;it&nbsp;"after&nbsp;the&nbsp;name&nbsp;given"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">zip</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">download</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$zipName</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}&nbsp;</span> </span> </code></div> <p>Module</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #479fd1">/**<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Gets&nbsp;the&nbsp;project's&nbsp;path&nbsp;and&nbsp;returns&nbsp;it&nbsp;as&nbsp;a&nbsp;string<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;type&nbsp;$id<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">getProjectPath</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$id</span><span style="color: #91f291">)&nbsp;</span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$record&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">getDetails</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$id</span><span style="color: #91f291">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #f5f8cc">$record</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">result</span><span style="color: #91f291">()&nbsp;as&nbsp;</span><span style="color: #f5f8cc">$row</span><span style="color: #91f291">)&nbsp;</span><span style="color: #f5f8cc">{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$projectDir&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #FFFFFF">'/projects/'&nbsp;</span><span style="color: #91f291">.&nbsp;</span><span style="color: #f5f8cc">$row</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">location&nbsp;</span><span style="color: #91f291">.&nbsp;</span><span style="color: #FFFFFF">'/'&nbsp;</span><span style="color: #91f291">.&nbsp;</span><span style="color: #f5f8cc">$row</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">fase&nbsp;</span><span style="color: #91f291">.&nbsp;</span><span style="color: #FFFFFF">'/'&nbsp;</span><span style="color: #91f291">.&nbsp;</span><span style="color: #f5f8cc">$row</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">title&nbsp;</span><span style="color: #91f291">.&nbsp;</span><span style="color: #FFFFFF">'/'</span><span style="color: #91f291">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">return&nbsp;</span><span style="color: #f5f8cc">$projectDir</span><span style="color: #91f291">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">getProjectTitle</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$id</span><span style="color: #91f291">)&nbsp;</span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$record&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">getDetails</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$id</span><span style="color: #91f291">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #f5f8cc">$record</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">result</span><span style="color: #91f291">()&nbsp;as&nbsp;</span><span style="color: #f5f8cc">$row</span><span style="color: #91f291">)&nbsp;</span><span style="color: #f5f8cc">{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$projectTitle&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$row</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">title</span><span style="color: #91f291">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">return&nbsp;</span><span style="color: #f5f8cc">$projectTitle</span><span style="color: #91f291">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}&nbsp;</span> </span> </code></div> <p>The download all projects works like a charm. The real problem comes when I zip a specific project. I get the files in the zip but the crc is 00000000 with every file. This is problem occurs when I run it on my ubuntu server but not on my local machine.</p> <p>Any idea how I can fix this?</p> 2013-05-23T02:58:29-05:00 Install Cjax Framework http://ellislab.com/forums/viewthread/235578/ http://ellislab.com/forums/viewthread/235578/#When:15:08:15Z <p>Hello,</p> <p>Im trying to install the Cjax Framework, but are unsuccessful to manage it. I have read both this <a href="http://cjax.sourceforge.net/docs/installing.php">http://cjax.sourceforge.net/docs/installing.php</a> and this <a href="https://github.com/EllisLab/CodeIgniter/wiki/Ajax-Framework-For-CodeIgniter">https://github.com/EllisLab/CodeIgniter/wiki/Ajax-Framework-For-CodeIgniter</a></p> <p>Still unsuccessful to manage the installation. My dir/file structure looks like this:</p> <p>/<br /> /.htaccess</p> <p>/application/<br /> <strong>/application/ajax.php<br /> /application/ajaxfw.php</strong><br /> /application/cache/<br /> <strong>/application/cjax/</strong><br /> /application/config/<br /> /application/controllers/<br /> <strong>/application/controllers/AjaxController.php</strong><br /> /application/core/<br /> /application/errors/<br /> /application/helpers/<br /> /application/hooks/<br /> /application/language/<br /> /application/libraries/<br /> /application/logs/<br /> /application/models/<br /> /application/response/<br /> <strong>/application/response/sample.php<br /> /application/response/test.php</strong><br /> /application/views/<br /> <strong>/application/test.php<br /> /application/test2.php</strong></p> <p>/assets/<br /> /assets/img,css,js -folders</p> <p>/system/<br /> /system/lots of more dirs</p> <p>I have also enabled so I dont need to have index.php in my URL. Eg instead of <a href="http://example.com/index.php/registration">http://example.com/index.php/registration</a> I can access it through <a href="http://example.com/registration">http://example.com/registration</a></p> <p>.htaccess looks like this:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #f5f8cc">RewriteEngine&nbsp;on<br />RewriteCond&nbsp;</span><span style="color: #91f291">$</span><span style="color: #f5f8cc">1&nbsp;</span><span style="color: #91f291">!^(</span><span style="color: #f5f8cc">index\</span><span style="color: #91f291">.</span><span style="color: #f5f8cc">php</span><span style="color: #91f291">|</span><span style="color: #f5f8cc">images</span><span style="color: #91f291">|</span><span style="color: #f5f8cc">assets</span><span style="color: #91f291">|</span><span style="color: #f5f8cc">robots\</span><span style="color: #91f291">.</span><span style="color: #f5f8cc">txt</span><span style="color: #91f291">)<br /></span><span style="color: #f5f8cc">RewriteRule&nbsp;</span><span style="color: #91f291">^(.*)$&nbsp;/</span><span style="color: #f5f8cc">index</span><span style="color: #91f291">.</span><span style="color: #f5f8cc">php</span><span style="color: #91f291">/$</span><span style="color: #f5f8cc">1&nbsp;[L]&nbsp;</span> </span> </code></div> <p>Hitting the following URLs:<br /> <a href="http://mysite.com/ajax.php/test/test">http://mysite.com/ajax.php/test/test</a><br /> <a href="http://mysite.com/ajax/test/test">http://mysite.com/ajax/test/test</a><br /> <a href="http://mysite.com/ajax.php/test">http://mysite.com/ajax.php/test</a><br /> <a href="http://mysite.com/ajax/test">http://mysite.com/ajax/test</a></p> <p>I get the following message:</p><blockquote><p>404 Page Not Found</p> <p>The page you requested was not found.</p> </blockquote> <p>What am I doing wrong and how do I fix the installation?</p> 2013-05-22T15:08:15-05:00 Proxy Library http://ellislab.com/forums/viewthread/235574/ http://ellislab.com/forums/viewthread/235574/#When:11:37:54Z <p>I’m having so much trouble with the proxy in my school center. I found this library, but I can’t download it <a href="https://github.com/EllisLab/CodeIgniter/wiki/Proxy-Library">https://github.com/EllisLab/CodeIgniter/wiki/Proxy-Library</a> </p> <p>What do you use when you need to config your proxies? </p> <p>Thank you!</p> 2013-05-22T11:37:54-05:00 flexi cart - A comprehensive shopping cart library for CodeIgniter http://ellislab.com/forums/viewthread/212926/ http://ellislab.com/forums/viewthread/212926/#When:03:30:11Z <p>Hey all,</p> <p>I would like to announce the release of ‘flexi cart’, a comprehensive shopping cart library for CodeIgniter.</p> <p>Whilst CodeIgniter does indeed come with its own cart library, the library is quite basic in functionality and is only aimed at creating simple e-commerce stores.</p> <p>The flexi cart library includes the following features:</p> <p><strong>Shipping</strong><br /> + Base available shipping options and charges on a customers location.<br /> + Calculate shipping charges based on the weight and value of an order. <br /> + Include or exclude specific shipping options from discount offers. <br /> + Set shipping charges for specific items purchased from the store.<br /> Example: Item A ships free of charge, Item B ships for $10 on top of the carts standard shipping charge. <br /> + Ban specific items from being shipped to specific locations. </p> <p><strong>Taxes</strong><br /> + Base available tax rates on a customers ‘billing to’ or ‘shipping to’ location.<br /> + Define specific tax rates for specific items in the cart. <br /> + Customers can toggle whether to show cart prices include or excluding taxes. </p> <p><strong>Localisation</strong><br /> + Setup locations like countries, states, cities, post/zip codes to even specific streets and door numbers.<br /> + Locations can be grouped into zones, where rules can then be applied to all locations within a zone, rather than setting the rule for each location.</p> <p><strong>Discounts and Reward Points/Vouchers</strong><br /> + Setup complex rule conditions for specific items and groups of items that are added to the cart based on customer location, cart/item value, item quantities and whether other items are present within the cart.<br /> + Define how tax should be applied to specific discounts. E.g. Whether tax should be applied before or after the discount is applied.<br /> + Allow customers to earn reward points from purchasing items that they can then later exchange for a discount voucher.</p> <p><strong>Plus many more features…</strong><br /> + Multiple currencies<br /> + Item stock control<br /> + Surcharges<br /> + Save/load incomplete carts for later shopping<br /> + Multilingual custom status and error messages<br /> + Currency and weight conversion tools</p> <p>The purpose of the flexi cart library is to offer modularised shopping cart features, that allow a developer to pick and choose which features they require, without having to include features that are surplus to the clients requirements.</p> <p>flexi cart is flexible enough to be used to create simple 10 item ecommerce stores, up to creating huge online stores rivaling the functionality of ecommerce giants like Magento, Opencart and X-cart. The tools are provided, you just have to put them together.</p> <p>The library, documentation, and a comprehensive live online demo are available from the flexi cart site.<br /> <strong><a href="http://haseydesign.com/flexi-cart">http://haseydesign.com/flexi-cart</a></strong></p> <p>The library has been a long time in the making and has been used for some of my own client sites.<br /> I would now like to release the code to the public so that others can also make use of it.</p> <p>Enjoy =)</p> <p><i>P.s. If anyone does particularly like the style of this library, I have also built a user authentication system that was originally based on Ben Edmunds popular Ion Auth library.<br /> The ‘<a href="http://haseydesign.com/flexi-auth">flexi auth</a>’ library is highly customisable like flexi cart including features like PHPASS password hashing, Google reCaptcha, user groups and privileges, plus much much more.</i></p> 2012-03-11T03:30:11-05:00 dB join issue http://ellislab.com/forums/viewthread/235515/ http://ellislab.com/forums/viewthread/235515/#When:13:27:22Z <p>I’m calling get_custom_user_data</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #f5f8cc">$select</span><span style="color: #91f291">=&nbsp;array(</span><span style="color: #FFFFFF">'uacc_status'</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$where</span><span style="color: #91f291">=&nbsp;array(</span><span style="color: #FFFFFF">'uacc_id'</span><span style="color: #91f291">=&gt;</span><span style="color: #f5f8cc">$user_id</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$row</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">flexi_auth</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get_custom_user_data</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$select</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$where</span><span style="color: #91f291">)-&gt;</span><span style="color: #f5f8cc">row</span><span style="color: #91f291">();&nbsp;</span> </span> </code></div> <p>and getting the following error</p><blockquote><p>Unknown column ‘user_privileges.upriv_id’ in ‘field list’</p> <p>SELECT `user_privileges`.`upriv_id`, `user_privileges`.`upriv_name`, `uacc_status` FROM (`user_accounts`) LEFT JOIN `user_groups` ON `user_accounts`.`uacc_group_fk` = `user_groups`.`ugrp_id` LEFT JOIN `user_profile` ON `user_accounts`.`uacc_id` = `user_profile`.`user_account_fk` WHERE `user_groups`.`ugrp_id` = ‘1’ AND `user_privilege_users`.`upriv_users_uacc_fk` = ‘1’ AND `uacc_id` = ‘1’</p> </blockquote> <p>Any idea as to why this is occurring?</p> 2013-05-20T13:27:22-05:00 Tank Auth is_logged_in usage http://ellislab.com/forums/viewthread/235256/ http://ellislab.com/forums/viewthread/235256/#When:14:44:35Z <p>I am trying to verify (in the absence of documentation), my understanding of $this-&gt;tank_auth-&gt;is_logged_in()</p> <p>As I understand it, this method verifies whether ‘somebody’ is logged in, but cannot verify who it is.</p> <p>I want to know if a particular user is now logged in.</p> <p>Thus my code at a certain point looks like this:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #91f291">if&nbsp;(</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">tank_auth</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">is_logged_in</span><span style="color: #91f291">()&nbsp;<br />&amp;&amp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$new_login_name&nbsp;</span><span style="color: #91f291">==&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">tank_auth</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get_username</span><span style="color: #91f291">())&nbsp;</span> </span> </code></div> <p>Do I need to bother with is_logged_in? <br /> Is the second half of my &amp;&amp; sufficient and safe?<br /> Will a login always succeed, overriding a current login?</p> <p>If there is doc I have failed to find, please point me to it.&nbsp; I support the concept of R-ing TFM when TFM exists <img src="http://ellislab.com/asset/images/smileys/blank.gif" width="19" height="19" alt="blank stare" style="border:0;" /></p> 2013-05-08T14:44:35-05:00