<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.8.0-dev (info@mypapit.net)" -->
<rss version="2.0"  xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Joomla! Tips</title>
        <description><![CDATA[Tips and tricks for Joomla!]]></description>
        <link>http://www.blazingimages.com/</link>
        <lastBuildDate>Fri, 18 May 2012 15:15:38 GMT</lastBuildDate>
        <generator>FeedCreator 1.8.0-dev (info@mypapit.net)</generator>
		<atom:link href="http://www.blazingimages.com/component/option,com_ninjarsssyndicator/feed_id,2/format,raw/lang,en/" rel="self" type="application/rss+xml" />        <item>
            <title>Cleaning Up Cached Image Thumbnails</title>
            <link>http://www.blazingimages.com/blog/webassist-blog/cleaning-up-cached-image-thumbnails</link>
            <description><![CDATA[<p>The following describes how to include code to cleanup WebAssist Cached Image Thumbnails / Resized Images when the image is replaced or deleted. The tutorial provides code and describes how to apply the code to an update page. You would need to adapt it for the delete transaction, and if you are using the newest version, the delete transaction is on the results page.</p>
<p>I just created this code, so it is not fully tested.</p>
<p>On an update page, include the PHP file attached in a zip. It is a  small function for getting the directory/file information out of the  cache directory.</p>
<p><a class="jce_file" title="getDirectory.zip" href="http://www.blazingimages.com/assets/blogs/webassist/2012-05-16_cleaning-up-cached-image-thumbnails/getDirectory.zip">getDirectory.zip</a></p>
<p>Below is a link to the primary code snippet used.</p>
<p><a class="jce_file" title="WA_thumbnail-clean-up-snippet.zip" href="http://www.blazingimages.com/assets/blogs/webassist/2012-05-16_cleaning-up-cached-image-thumbnails/WA_thumbnail-clean-up-snippet.zip">WA_thumbnail-clean-up-snippet.zip</a></p>
<h4 dir="ltr">One more VERY important note before we get started. I have tried to account for a variety of scenarios like uploading a new/edited picture with the same name as the original picture, and replacement of a picture vs deleting a record and associated picture. What I cannot do anything about is when <span style="text-decoration: underline;"><strong>Overwrite</strong></span> is used for file name conflicts and more than one record in the database uses the same picture (or same image file name) in the same directory location. Under these circumstances, deleting one record would cause a broken link in the other record since the file was deleted. If this could be an issue for you, be sure to use <span style="text-decoration: underline;"><strong>Rename new file</strong></span> as the file naming method to avoid this problem, and always rename the new file not the existing one.</h4>
<p><span style="font-size: 14pt;"><strong>And now for the tutorial:</strong></span></p>
<p>IMMEDIATELY AFTER THE UPLOAD FILE CODE, add a WA delete file transaction  based on a successful upload of your new file, and delete the file to  be replaced. <br />That will still be the current value in the database  because the update transaction has not happened  yet.</p>
<blockquote>
<pre dir="ltr">&lt;?php<br /> WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");<br /> if((((isset($_POST["exec"]))?$_POST["exec"]:"") != "")){<br /> WA_DFP_UploadFiles("WA_UploadResult1", "image", "0", "", "true", $WA_UploadResult1_Params);<br /> }<br /> ?&gt;<br /> &lt;?php<br /> $WA_DeleteFileResult1 = false;<br /> if($WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == 1){<br /> $WA_DeleteFileResult1 = WA_FileAssist_DeleteFile("../../images/blogs/", "".$row_WADAblog['image'] &nbsp;."");<br /> }<br /> ?&gt;</pre>
</blockquote>
<p dir="ltr">Below that code include the following code block. Be  sure to customize the first three values to match your  transaction.</p>
<blockquote>
<pre dir="ltr">&lt;?php <br />// WA File Cleanup<br />/*<br />CONFIGURE THUMBNAIL TRANSACTION VALUES<br />*/<br />/*<br /> The results value created by the WA delete transaction to use as a trigger for whether or not to cleanup any thumbnails.<br />*/<br />$deleteResult = $WA_DeleteFileResult1;<br />/*<br /> The Server File Name Value. This is used to check if the uploaded file name is the same as the previous file name.<br /> If it is, resized images will still be deleted so they can be regenerated.<br /> This is done in case the image changed but file name remained the same, and overwrite is the method used in the upload.<br /> For a delete trasaction, just set the value to "". The delete file transaction will be the trigger.<br />*/<br />$newFileName = $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"];<br />/*<br /> Path to the directory where the image cache files are stored. This can be vary specific like /image_cache/images/blog or more general like /image_cache.<br /> <br /> The higher the directory, the more potential for an inadvertant thumbnails to be included. For example, if you had an image_cache directory and under it you had <br /> thumbnails generated in directories images/blog and images/gallery, if a source image foir thumbnails existed in both the blog and the gallery that had the <br /> same name, both thumbnail sets would be deleted. In addition, the higher the directory setting, the greater the execution time though this may be marginal <br /> in most cases. THE BEST PRACTICE HERE IS TO SET IT TO THE DIRECTORY JUST ABOVE THE WA DIRECTORIES OF fit, proportion, and crop.<br />*/<br />$cacheDir = '/image_cache/images/blogs';<br />/*<br /> The name of the database field that held the name of the file just deleted. cachedFileName is a bit misleading since none of the cached files or directories<br /> have this name, but the cached item's names are all based on the old file name.<br />*/<br />$cachedFileName = $row_WADAblog['image'];<br />/*<br /> Any array of files to ignore. Usually just an .htaccess file, if anything, for our purposes.<br />*/<br />$ignore = array('.htaccess');<br />/*<br />END CONFIG<br />*/<br /></pre>
</blockquote>
<p> </p>
<blockquote>
<pre dir="ltr">// Code block continued<br />if( $deleteResult || ( ($newFileName == $cachedFileName) &amp;&amp; ($cachedFileName != "") ) ){<br /> $dirTree = getDirectory($_SERVER['DOCUMENT_ROOT'].$cacheDir, $ignore);<br /> if (count($dirTree)) {<br /> foreach ($dirTree as $dir =&gt; $files) {<br /> $dirName = substr($dir,strrpos($dir,"/")+1,strlen($dir));<br /> $filter = substr($cachedFileName, 0, strrpos($cachedFileName, '.'));<br /> if (substr($dirName,0,strlen($filter)) == $filter) {<br /> if (count($files)) {<br /> foreach ($files as $file) {<br /> unlink($dir."/".$file);<br /> } }<br /> rmdir($dir);<br /> } } } }<br />?&gt;</pre>
</blockquote>
<p dir="ltr">THE NEXT STEP IS VERY IMPORTANT. If you have one  update transaction for the entire record, open that server behavior and  remove any update value for the image file. <br />Add a new update transaction  that is triggered off of a successful upload of your image file. <br />DO NOT  SET A REDIRECT VALUE. <br />Be sure to place this update transaction before  the existing update transaction that updates the rest of the fields and  redirects the page.<br /> <br /> <img src="http://www.webassist.com/forums/attachment.php?attachmentid=10725&amp;stc=1&amp;d=1337203690" border="0" /><img alt="clean_cache-01" src="http://www.blazingimages.com/assets/blogs/webassist/2012-05-16_cleaning-up-cached-image-thumbnails/clean_cache-01.jpg" height="332" width="500" /></p>
<p dir="ltr"><br /> This should now be working code with <span style="text-decoration: underline;"><strong>one caveat</strong></span>. If the user uploads a  file with the same file name as the file being replaced, the file and  thumbnails will be deleted. To prevent that, add a conditional statement  around the delete transaction that checks whether the file server name is the same as the current file name in the database.</p>
<blockquote>
<pre dir="ltr">&lt;?php<br />WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");<br />if((((isset($_POST["exec"]))?$_POST["exec"]:"") != "")){<br /> WA_DFP_UploadFiles("WA_UploadResult1", "image", "0", "", "true", $WA_UploadResult1_Params);<br />}<br />?&gt;<br /><span style="font-size: 12pt;"><strong>&lt;?php<br />if ($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] != $row_WADA</strong></span><strong><span style="font-size: 12pt;">blog</span></strong><span style="font-size: 12pt;"><strong>['image']) {<br />?&gt;</strong></span><br />&lt;?php<br />$WA_DeleteFileResult1 = false;<br />if($WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == 1){<br /> $WA_DeleteFileResult1 = WA_FileAssist_DeleteFile("../../images/blogs/", "".$row_WADAblog['image']&nbsp; ."");<br />}<br />?&gt;<br /><span style="font-size: 12pt;"><strong>&lt;?php } ?&gt;</strong></span></pre>
</blockquote>
<p dir="ltr">In conclusion, if you have any problems, re-read this tutorial carefully. WebAssist may place code in places other than where the cursor was, so check and see if you need to move any code blocks around, and double check the order of the code execution which should be:</p>
<ol>
<li>Include the function file from the link above at the top of the file</li>
<li>Whatever code or validations you have before the update stuff begins.</li>
<li>The WA recordset that includes the image field.</li>
<li>The upload transaction.</li>
<li>The Delete transaction with the name check conditional statement.</li>
<li>The code snippet that deletes the resized images (remember to customize the confguration values at the top of the snippet).</li>
<li>The update transaction that ONLY:<ol>
<li>Triggers on successful upload,</li>
<li>Updates the image file field with the uploaded server name, and</li>
<li>DOES NOT redirect the page when completed.</li>
</ol></li>
<li>The update transaction that updates everything else EXCEPT this image field, and redirects the page afterwards to where ever you want to redirect to.</li>
</ol>
<p>To implement this for a delete transaction, everything is the same except there is no update transaction and you want to do it every time there is an image file.</p>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Wed, 16 May 2012 21:44:25 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/blog/webassist-blog/cleaning-up-cached-image-thumbnails</guid>
        </item>
        <item>
            <title>Shelly's House</title>
            <link>http://www.blazingimages.com/resume/our-portfolio/shellys-house</link>
            <description><![CDATA[<div style="text-align: center;"><a target="_blank" href="http://www.shellyshouse.org/"><img alt="capture-shellys-house" src="http://www.blazingimages.com/assets/portfolio/capture-shellys-house.png" height="430" width="300" /></a></div>
<h4 style="text-align: center;"><a target="_blank" href="http://www.shellyshouse.org/">www.ShellysHouse.org</a></h4>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Sun, 11 Sep 2011 19:16:02 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/resume/our-portfolio/shellys-house</guid>
        </item>
        <item>
            <title>V &amp;amp; R Management</title>
            <link>http://www.blazingimages.com/resume/our-portfolio/vr-management</link>
            <description><![CDATA[<div style="text-align: center;"><a target="_blank" href="http://vrmanagement.net/"><img alt="capture-vr-management" src="http://www.blazingimages.com/assets/portfolio/capture-vr-management.png" height="289" width="300" /></a></div>
<h4 style="text-align: center;"><a target="_blank" href="http://vrmanagement.net/">www.VRManagement.net</a></h4>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Sun, 11 Sep 2011 19:07:58 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/resume/our-portfolio/vr-management</guid>
        </item>
        <item>
            <title>Handling DA Update form - perhaps a better alternative</title>
            <link>http://www.blazingimages.com/blog/webassist-blog/data-assist-update-and-file-uploads</link>
            <description><![CDATA[<p>I have read several discussion on this but I have not seen what I  believe to be a good answer to the various possible conditions. <br /> I believe I have a reasonably strong solution, but would love to hear from anyone who could improve on it.<br /> <br /> The issues:</p>
<ol>
<li>Delete the old file if there is a new one uploaded.</li>
<li>If the new file uploaded has the same name as the old one, DO NOT   ACCIDENTALLY DELETE THE NEW ONE WHEN USING THE OVERWRITE METHOD FOR THE   FILE NAME</li>
<li>Save the old file and do not update the database field if the upload fails</li>
</ol>
<p>To do this, I added a file delete behavior for the existing file name in  the database, then the upload behavior, and triggered both off the submit  button.</p>
<p>Then the update transaction. <span style="text-decoration: underline;"><strong>You may have to juggle the code around to get it in this order.</strong></span><br /> <br /> Now, here is the trick. Enclose both the delete and the upload  transactions in a PHP if statement that checks for whether or not there  was an error in the file upload. <br /> <em><strong>(Note the value of the PHP $_FILES array for the error key IS 0 if there  were no errors, and an empty file field actually produces an error code  of 4)</strong></em></p>
<table style="background-color: #dfc41f;" align="center" border="0">
<tbody>
<tr>
<td>&lt;?php<br /> <strong>// Test for file upload that was successful through PHP<br /> if (isset($_FILES["musicfile"]) &amp;&amp; ($_FILES["musicfile"]["error"] === 0)) {<br /> // If successful, do delete first so if the new filw has the same name it won't matter<br /> // Enclose both delete and upload in this condition so if there was any error in the upload, it won't matter</strong><br /> ?&gt;<br /> &lt;?php<br /> $WA_DeleteFileResult1 = false;<br /> if(isset($_POST["Update_x"])){<br /> $WA_DeleteFileResult1 = WA_FileAssist_DeleteFile("../../musicfiles/", "".$row_WADAmusic['musicfile'] &nbsp;."");<br /> }<br /> ?&gt;<br /> &lt;?php<br /> // WA_UploadResult1 Params Start<br /> $WA_UploadResult1_Params = array();<br /> // WA_UploadResult1_1 Start<br /> $WA_UploadResult1_Params["WA_UploadResult1_1"] = array(<br /> 'UploadFolder' =&gt; "../../musicfiles/",<br /> 'FileName' =&gt; "[FileName]",<br /> 'DefaultFileName' =&gt; "",<br /> 'ResizeType' =&gt; "0",<br /> 'ResizeWidth' =&gt; "0",<br /> 'ResizeHeight' =&gt; "0",<br /> 'ResizeFillColor' =&gt; "" );<br /> // WA_UploadResult1_1 End<br /> // WA_UploadResult1 Params End<br /> ?&gt;<br /> &lt;?php<br /> WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");<br /> if(isset($_POST["Update_x"])){<br /> WA_DFP_UploadFiles("WA_UploadResult1", "musicfile", "0", "", "false", $WA_UploadResult1_Params);<br /> }<br /> ?&gt;<br /> &lt;?php<br /> <strong>// End error check condition for WA behaviors<br /> }</strong><br /> ?&gt;</td>
</tr>
</tbody>
</table>
<p>Now set the update binding for the file name to the WA Server File Name  ($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]) with a  default to the recordset value of the file name (the original file name)<br /> <br /></p>
<table style="background-color: #dfc41f;" align="center" border="0">
<tbody>
<tr>
<td>&lt;?php echo  ((isset($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]))?$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]:$row_WADAmusic["musicfile"]);  ?&gt;</td>
</tr>
</tbody>
</table>
<p> </p>
<p>If there is any upload error, the WA upload code will not  be executed, so  $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] will not be  set.<br /> <br /> Now if no file is uploaded, or there is any error in the upload, nothing  will be deleted or uploaded (copied from temp to the web site space),  and the file name will remain unchanged.<br /> <br /> If a new file is uploaded, the old will be deleted, the new uploaded, and the database updated correctly.<br /> <br /> If the new upload has the same name as the old one, the old file will be  deleted first, the new one uploaded, and the database name will still  be correct.<br /> <br /> <em>None of this will protect against collisions with the same file name  from a different record, so always use caution with overwrite.</em></p>
<p><em>This method will also work fine with a renaming scheme like incrementing except you will never increment unless the file with the same name belongs to another record.</em></p>
<p><em>It would also work with a fixed file name like File_RecordID.jpg<br /></em></p>
<p> </p>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Tue, 09 Aug 2011 07:30:01 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/blog/webassist-blog/data-assist-update-and-file-uploads</guid>
        </item>
        <item>
            <title>Error 1402.Could not open key: UNKNOWN\Components</title>
            <link>http://www.blazingimages.com/blog/technical-support/error-1402could-not-open-key-unknowncomponents</link>
            <description><![CDATA[<p>Installing Adobe Acrobat and Outlook Junk Mail Filter update generated an error that looks like:</p>
<p style="padding-left: 30px;">Error 1402.Could not open key: UNKNOWN\Components\xxxxxxxxxxxxxxxxxxxx\yyyyyyyyyyyyyyyyyyyyyyyy</p>
<p>The problem, most likely is that the permissions on the key yyyyyyyyyyyyyyyyyyyyyyyy are incorrect. To resolve this, search the registry for xxxxxxxxxxxxxxxxxxxx.</p>
<p>It should come up under</p>
<p style="padding-left: 30px;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\xxxxxxxxxxxxxxxxxxxx</p>
<p>The key yyyyyyyyyyyyyyyyyyyyyyyy or more likely every subkey of xxxxxxxxxxxxxxxxxxxx is messed up. To correct this, you will likely need to take ownership of the subkeys and then correct permissions on those key. In my case, this proved to be easy because "Replacing owneron subcontainers and objects" worked (sometimes it doesn't).</p>
<p>Right click on xxxxxxxxxxxxxxxxxxxx choose permissions and then advanced. Click on the owner tab. Choose Edit. Make the owner "Administrators" if it is not already, and check the box that says "<strong>Replacing owneron subcontainers and objects</strong>".</p>
<p><img alt="ownership" src="http://www.blazingimages.com/assets/blogs/techsupport/2010-15-10_Error-14/ownership.jpg" width="500" height="379" /></p>
<p>Click on OK. Get back to the same dialogue through the procedure above, but go to the permissions tab. If the permissions were not already correct, you should see updated permissions in this dialogue now. Check the box that is labeled "<strong>Replace all child object permissions with inheritable permissions from this object</strong>" and click OK.</p>
<p><img alt="ownership2" src="http://www.blazingimages.com/assets/blogs/techsupport/2010-15-10_Error-14/ownership2.jpg" width="500" height="381" /></p>
<p>Rerun the installer. I found that a reboot is not necessary, but it never hurts.</p>
<p> </p>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Thu, 16 Sep 2010 03:42:08 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/blog/technical-support/error-1402could-not-open-key-unknowncomponents</guid>
        </item>
        <item>
            <title>Test Source</title>
            <link>http://www.blazingimages.com/test</link>
            <description><![CDATA[{source}<?php echo "Hello World"; ?>{/source}]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Thu, 22 Jul 2010 23:45:02 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/test</guid>
        </item>
        <item>
            <title>Payment Sent</title>
            <link>http://www.blazingimages.com/payment-sent</link>
            <description><![CDATA[<div style="text-align: center;">Your payment was sent.</div>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Wed, 14 Jul 2010 02:11:31 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/payment-sent</guid>
        </item>
        <item>
            <title>Payment Canceled</title>
            <link>http://www.blazingimages.com/payment-canceled</link>
            <description><![CDATA[<div style="text-align: center;">Your payment was canceled.</div>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Wed, 14 Jul 2010 02:10:36 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/payment-canceled</guid>
        </item>
        <item>
            <title>Adding Many 2 Many Relationships to DataAssist Search</title>
            <link>http://www.blazingimages.com/blog/webassist-blog/m2msearch</link>
            <description><![CDATA[<p>Suppose you have a many-to-many relationship and you use WebAssist DataAssist (WADA) to manage one of the tables, but you want to allow the end user to filter these events based on the many-to-many relationship? This tutorial will guide you through adding that capability. At the time of this posting, I did not find a tutorial for this in the WebAssist website.</p>
<p>If that was not clear, perhaps the example will help. Lets assume you have a list of articles and a list of publications. Many of your articles are published in more than one publication. You manage this with a many-to-many table that connects the two. If that isn't clear, Google "<strong>database many-to-many relationships</strong>." You have a results page that displays the articles, but you want to allow the end user to filter the results based on a specific publication.</p>
<p>You can view the demo of this here: <a target="_blank" href="http://www.blazingimages.com/demos/WADAm2msearch">http://www.blazingimages.com/demos/WADAm2msearch</a></p>
<p>To do this, first you create your database with the relationship. You can get the sample data for this demo <a target="_blank" href="http://www.blazingimages.com/demos/WADAm2msearch/data.sql">here</a>.</p>
<p>To do this, first create your table management using WADA's wizard. In this case I only created the results and search pages. I also chose to include the search form in the results page, so all the changes could be in the same script, but this can easily be adapted to the external search form as well. If the relationship is the only thing you want to search on, your best choice here is to include some field for the search in order to generate the rest of the search form behaviors and then remove the unwanted fields after you add the many-to-many search.</p>
<p>With the results page created, the first thing we need to do is modify the query for the results table. In the example, the original query came out like this:</p>
<p>&nbsp;<img alt="Default Query for results page." src="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img001.png" width="500" height="112" /></p>
<p>We need to join the the many-to-many table to the query and include DISTINCT into the query so that we do not get duplicates of the same article when no filter is applied. Without DISTINCT, one row will appear for any given article for each publication the article is in.</p>
<p><a class="modal" href="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img002.png"><img alt="img002" src="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img002.png" width="500" height="39" /></a></p>
<p>Click to enlarge the image. The modified query reads:</p>
<p>"SELECT DISTINCT articles.id, title FROM articles LEFT JOIN (articles2publications) ON (idarticles=articles.id) ORDER BY id ASC"</p>
<p>Notice that I specified articles.id in the query. I used id for the primary key column in all the tables. If you have the same column name, you need to specify which table you are referring to. If they ar all unique you don't. Another place this can go wrong is if you use unique id names like idarticles, but also name the connecting column of the many-to-many table idarticles.</p>
<p>Next you need to modify the search behavior code. The original code read:</p>
<p><a class="modal" href="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img003.png"><img alt="Original Search Behavior Code." src="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img003.png" width="500" height="256" /></a></p>
<p>$WADbSearch needs another array value to include a search for the many-to-many table. In this example, the join statement connects the many-to-many table on the article id, but does not put any output into the recordset, so you need to know the table structure because we want to filter on the publication id. The produces the query that says show all articles that are in the specified publication. The many-to-many table uses idarticles and idpublication. In this case, I would not need to specify the table in the where clause, but I have included it anyway to demonstrate that you can include it in the WADA Search behavior.</p>
<p><a class="modal" href="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img004.png"><img alt="Modified search behavior" src="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img004.png" width="525" height="41" /></a></p>
<p>Click to enlarge the image. S_publications will be the name of the search form input we are going to add. Notice the name of the function is different. WADA Search includes:</p>
<ul>
<li><strong>addComparisonFromEdit </strong>for textbox inputs</li>
<li><strong>addComparisonFromCheck </strong>for checkbox input and</li>
<li><strong>addComparisonFromList </strong>for dropdown and multi-select inputs.</li>
</ul>
<p>Many-to-many tables connect ID's, so the third parameter NEEDS to be "=". Finally, the last parameter is 1. That last parameter has to do with the type of qualifier that is placed around the statement. 0 is for text comparison (e.g. name='joe'). 1 is for numeric comparisons on numeric fields (e.g. id=1), and 2 is for dates.</p>
<p>Finally, create a recordset of the table on the other side of your many-to-many relationship. In this case that is publications. The recordset is used to create a dynamic list of the publications that the end user can filter on. Add a row to the search form and modify it to add the new search element, in this case <strong>S_publications</strong>. Be sure to include a non dynamic fist element that has no value to allow all your relationship elements to be included. In this example, that would translate to displaying all articles regardless of which publications they are in.</p>
<p><a class="modal" href="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img005.png"><img alt="Final added search form element" src="http://www.blazingimages.com/assets/blogs/webassist/2010-05-13_M2Msearch-with-data-assist/img005.png" width="500" height="317" /></a></p>
<p>Click on the image to enlarge it.</p>
<p>That is it. Try the demo to see how it works.</p>
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;" id="_mcePaste">addComparisonFromList</div>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Sun, 16 May 2010 00:44:25 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/blog/webassist-blog/m2msearch</guid>
        </item>
        <item>
            <title>Display/hide a module by criteria other than menu item</title>
            <link>http://www.blazingimages.com/blog/joomla-blog/display-hide-a-module</link>
            <description><![CDATA[<p>We have used a number of modules which we want to display or hide by criteria other than the Joomla default control of attaching the module to specific menu items. For example, we use Jaggy Blog which provides a module for our blog categories. We want the blog tag words to appear when the blog is being viewed, but not on the rest of the site. Since the categories are delivered through the module, there is no menu item to attach the tag word module to.</p>
<p>Here is a way to accomplish this. First, you need some PHP criteria to identify the page you want to display or hide the module on. Next you need a couple of plugins. We are using <a target="_blank" href="http://www.fijiwebdesign.com/portfolio/joomla-php-module-mod_php.html">mod_PHP</a> and <a target="_blank" href="http://www.nonumber.nl/extensions/modulesanywhere">Modules Anywhere</a>.</p>
<p>mod_PHP allows you to create modules that include code like Javascript and PHP code. Being able to include PHP code is essential. Modules Anywhere allows you to include modules in various place on your site including content areas and in this case, inside another module.</p>
<p>For the criteria, in our case, it was the GET value of view which equals Jaggyblog when we want the module to display. If you are using SEF links, you may need to hack you template to temporarily display GET values, or look at the link on a menu item or in you SEF listing if you are using a 3rd party extension. In our case we created a couple of menu items for the blog to find the parameter we needed.</p>
<p>Next create the module that you want to include and attach it to no menu items:</p>
<p><img alt="Create the module to be included." src="http://www.blazingimages.com/assets/blogs/joomla/2010-04-30_Display-hide-modules/img001.png" width="478" height="564" /></p>
<p>Next you need to create the module that will include the module we just created. Notice that we called the previous module a name which ended in "Include." because it won't be displayed on its own, but rather wrapped in the module we are about to create. We create a mod_PHP module (notice because mod_PHP was based on mod_HTML, it still says modHTML in the module type) which we called the same name as the previous module without the "Include."</p>
<p><img alt="Create the modPHP module." src="http://www.blazingimages.com/assets/blogs/joomla/2010-04-30_Display-hide-modules/img002.png" width="500" height="551" /></p>
<p>In the first module, the position and order don't matter because it is not assigned to any menu items. This module (mod_PHP) needs to be assigned to all menu items. That tells Joomla it should always be displayed. <strong>Here is the trick. If the module contents is empty, it won't display.</strong> <em>In our cases so far, the title bar does not display when using this technique, so if you use a module included this way and it shows up on every page as an empty module with a title bar, please let us know so we can take a look at it.</em></p>
<p>Now in the contents of the module use the PHP criteria you devised to display the contents only if your criteria is met. In our case, it was if ($_GET['view']=="jaggyblog") {</p>
<p><img alt="Set the cirteria using PHP" src="http://www.blazingimages.com/assets/blogs/joomla/2010-04-30_Display-hide-modules/img003.png" width="473" height="204" /></p>
<p>And there you go. The module only displays when the view is of the type we want. The div tag with the id of blogTags is optional. We included that so we could get the title element back. Next time we'll describe how this was done.</p>]]></description>
            <author> admin@blazingimages.com (Steven Berkson)</author>
            <pubDate>Thu, 29 Apr 2010 19:43:43 GMT</pubDate>
            <guid isPermaLink="false">http://www.blazingimages.com/blog/joomla-blog/display-hide-a-module</guid>
        </item>
    </channel>
</rss>

