<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Toolbox Digital Services &#187; Tips</title>
	<atom:link href="http://toolboxdigital.com/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://toolboxdigital.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 05 Aug 2010 09:15:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Disabling Google Analytics for front-end Administrators in Joomla</title>
		<link>http://toolboxdigital.com/2010/03/disabling-google-analytics-for-front-end-administrators-in-joomla/</link>
		<comments>http://toolboxdigital.com/2010/03/disabling-google-analytics-for-front-end-administrators-in-joomla/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:26:29 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=610</guid>
		<description><![CDATA[A good question, raised by Jack Bremer, prompted the writing of this brief post in case it&#8217;s of use to somebody else at some point (including myself).  The GA ...]]></description>
			<content:encoded><![CDATA[<p>A good question, raised by <a href="https://twitter.com/jackbremer/status/10015777644">Jack Bremer</a>, prompted the writing of this brief post in case it&#8217;s of use to somebody else at some point (including myself).  The GA plugin in WordPress has this option, which is great for larger sites with loads of front-end admins all working on the site &#8211; you don&#8217;t want to be diluting your Analytics with all that noise.</p>
<p>So, how can the same be acheived in Joomla? Well, quite easily actually.  Read on to find out how&#8230;</p>
<span id="more-610"></span>
<p>
<img src="http://toolboxdigital.com/wp-content/uploads/2010/03/ga-shot.jpg" alt="Google Analytics" title="Google Analytics" width="774" height="280" class="alignnone size-full wp-image-627" />
</p>
<h3>Modify the Template</h3>
<p>For this to work we will need to make a simple logic change in the site&#8217;s template index.php file, which you can find in template/your_template directory of your site.  First we&#8217;ll need to get the $user variable loaded into the template, so, near the top, add the following line of PHP:</p>
<pre class="brush:php">
$user =&#038; JFactory::getUser();
</pre>
<p>This will load an array of variables into $user that we can use to determine who&#8217;s currently logged-on to the front-end of your website.  The particular value we&#8217;re looking for is the User ID, contained in $user->gid (the current user&#8217;s Group ID) &#8211; this value is zero (false) if a guest is browsing the site, but will be a specific figure depending on which group they are assigned to when logged-on.</p>
<h3>Add the logic code</h3>
<p>Next step is to locate your GA tracking code, which should be right at the bottom of your index.php file, just before the </body> tag.  We need to wrap this in some PHP test code to selectively load the tracking script based on the outcome of our condition, so first locate your tracking code which will look like this:</p>
<pre class="brush:javascript">
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12345678");
pageTracker._trackPageview();
} catch(err) {}</script>
</pre>
<p>Then add the PHP test to selectively load the scripts, which looks like this:</p>
<pre class="brush:php">
&lt;?php if (!$user->gid == 25) : ?>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12345678");
pageTracker._trackPageview();
} catch(err) {}</script>

&lt;?php endif; ?>
</pre>
<p>This example above will disable the GA tracking code only for Super Administrators logged-on to the front end.  You can add your own test conditions depending on your requirements, by using the list below as a reference for the group to test:</p>
<ul class="chev">
<li>18 &#8211; Registered</li>
<li>19 &#8211; Author</li>
<li>20 &#8211; Editor</li>
<li>21 &#8211; Publisher</li>
<li>23 &#8211; Manager</li>
<li>24 &#8211; Administrator</li>
<li>25 &#8211; Super Administrator</li>
</ul>
<br />
<p><strong>Disable tracking for anyone who isn&#8217;t a guest user (not logged-on):</strong></p>
<pre class="brush:php">
if (!$user) :
</pre>
<p><strong>Disable tracking for all back-end users:</strong></p>
<pre class="brush:php">
if (!$user == 23 || !$user == 24 || !$user == 25) :
</pre>
<p><strong>Disable tracking for all registered users:</strong></p>
<pre class="brush:php">
if (!$user == 18) :
</pre>
<p>I&#8217;m sure you get the gist!</p>
<p><strong>Got a better idea or know of a plugin that can do this for you?  Please share it in the comments, we&#8217;d love to hear your ideas!</strong></p>]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/03/disabling-google-analytics-for-front-end-administrators-in-joomla/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Advanced Techniques: The Joomla Parent Menu ItemID</title>
		<link>http://toolboxdigital.com/2010/03/advanced-techniques-the-joomla-parent-menu-itemid/</link>
		<comments>http://toolboxdigital.com/2010/03/advanced-techniques-the-joomla-parent-menu-itemid/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 22:50:56 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=411</guid>
		<description><![CDATA[Joomla&#8217;s ItemID system offers a great way of customizing sites by giving the opportunity to style major parts of a template or page based on the menu links ItemID.  ...]]></description>
			<content:encoded><![CDATA[<p>Joomla&#8217;s ItemID system offers a great way of customizing sites by giving the opportunity to style major parts of a template or page based on the menu links ItemID.  Every menu link in a Joomla website has one; and they are unique to each and every link on your site.</p>
<p>But what if you need to style entire sections of a site based on a handful of top-level (parent) menu items?</p>
<p>This article explores the methodology of styling sub-level pages respective of their common parent menu links.</p>
<span id="more-411"></span>
<p><img src="http://toolboxdigital.com/wp-content/uploads/2010/01/menusystem.jpg" alt="menusystem" title="menusystem" width="774" height="283" class="alignnone size-full wp-image-487" /></p>
<h3>Method 1: Modifying the mod_breadcrumb Module Code</h3>
<p>The mod_breadcrumb module is native to Joomla, and by it&#8217;s core function maintains a trail of menu link hierarchy leading to the current page.  This code can be utilized in order to obtain the top-level menu&#8217;s textual name (rather than an itemID number).  This method expands the code further to reformat this text into a usable, readable format which can be used to style a page in an understandable way.  It&#8217;s more code-heavy than method 2, but provides an easier-to-understand output that works in exactly the same way.</p>
<p>Let&#8217;s first examine the original code:</p>
<pre class="brush:php">
defined('_JEXEC') or die('Restricted access');

class modBreadCrumbsHelper
{
	function getList(&#038;$params)
	{
		global $mainframe;

		// Get the PathWay object from the application
		$pathway =&#038; $mainframe->getPathway();
		$items   = $pathway->getPathWay();

		$count = count($items);
		for ($i = 0; $i &lt; $count; $i ++)
		{
			$items[$i]->name = stripslashes(htmlspecialchars($items[$i]->name));
			$items[$i]->link = JRoute::_($items[$i]->link);
		}

		if ($params->get('showHome', 1))
		{
			$item = new stdClass();
			$item->name = $params->get('homeText', JText::_('Home'));
			$item->link = JURI::base();
			array_unshift($items, $item);
		}

		return $items;
	}
	
	function setSeparator($custom = null)
	{
		global $mainframe;

		$lang =&#038; JFactory::getLanguage();

		if ($custom == null) {
			if($lang->isRTL()){
				$_separator = JHTML::_('image.site', 'arrow_rtl.png');
			}
			else{
				$_separator = JHTML::_('image.site', 'arrow.png');
			}
		} else {
			$_separator = $custom;
		}
		return $_separator;
	}
}
</pre>
<p>We can immediately remove the second part of the code that sets the separator, since we don&#8217;t need that.  Also, since we only need to return the parent item&#8217;s text, we don&#8217;t need the loop in place.  We shall also use the <em>Application Object</em> since <strong><br />$global mainframe</strong> will be removed in Joomla 1.6, so:</p>
<pre class="brush:php">
$global mainframe; 
</pre>
<p>Becomes:</p>
<pre class="brush:php">
$app = &#038;JFactory::getApplication();
</pre>
<p>Which gives us the completed code below:</p>
<pre class="brush:php">
class getParentMenuTitle {
	function getList() {
		$getParent = &#038;JFactory::getApplication();
		// Get the PathWay object
		$pathway =&#038; $getParent->getPathway();
		$items = $pathway->getPathWay();
	return $items;
	}
}
$list = getParentMenuTitle::getList();
$count = count($list);
if ($count !== 0) :
	$parentmenu = $list[0]->name;
	$parentmenu = ereg_replace(" ", "-", $parentmenu); // replace spaces with a dash
	$parentmenu = ereg_replace("[^+A-Za-z0-9-]", "", $parentmenu); // strip special characters
	$parentmenu = strtolower($parentmenu); //set name to lowercase
else :
	$parentmenu = "home"; // Set parentmenu to "home" if there are no items
endif;
</pre>
<h3>How To Use The Code</h3>
<p>This block of code can be inserted directly into your active template&#8217;s <strong>index.php</strong> file before the HTML is started.  Remember to enclose the code block in PHP tags.  Alternatively you can include it from an external file.</p>
<p>Once working in the template, you can apply the variable <strong>$parentmenu</strong> to a top-level container to initiate a CSS hook.  Where you add this will depend on what you need to influence in the design, but the further up the hierarchy the more things you will be able to affect in the design &#8211; for example:</p>
<pre class="brush:php">
&lt;body id="&lt;?php echo $parentmenu; ?>">
</pre>
<p>&#8230;will allow you to influence the design across the whole template, such as:</p>
<pre class="brush:css">
body#menu-link-name a {color:red;}
</pre>
<p>&#8230;which will change all links on the page to red for that particular top-level menu link.</p>
<h3>Method 2: Using the Jsite Object</h3>
<p>This method is by far the simplist of the two methods, and unless you need a more human-readable format for the menu class/ids then it&#8217;s by far the recommended method of the two.  It uses the Jsite object to obtain the parent menu&#8217;s ItemID and stores it in a variable which can then be applied to any class/id in the template:</p>
<pre class="brush:php">
$parentmenu = JSite::getMenu()->getActive()->tree[0];
</pre>
<p>You can obtain the ItemID of any menu links in the pathway by altering the value of <strong>tree[0]</strong>.</p>
<h3>How To Use The Code</h3>
<p>Again, this code needs to be inserted into the template.  The ItemID is stored in the <strong>$parentmenu</strong> variable, just as it was before, so you can use a similar method to above &#8211; but prefix the class/id with something or else you may have problems, for example:</p>
<pre class="brush:php">
&lt;body id="menuID-&lt;?php echo $parentmenu; ?>">
</pre>
<h3>Why Would You Need To Use Method 1?</h3>
<p>The first method could be useful in instances where you (as the developer) might want to pass more control onto someone who is less technically-minded &#8211; the class/id names which are generated using this method are very easy to predict, whereas method 2 requires the administrator to lookup the itemID for each menu item that requires styling.</p>
<h3>Something to Share?</h3>
<p>Have an alternative technique, or have you used this (or something similar) on a site before?  Please do share it in the comments.</p>
<span class="small">Many thanks to <a href="http://joomline.org/">Gergő Erdősi</a> and <a href="http://www.alltogetherasawhole.org">Amy Stephen</a> for the code presented in method 2 above. 
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/03/advanced-techniques-the-joomla-parent-menu-itemid/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Advanced Techniques: Mass Settings Changes In Joomla!</title>
		<link>http://toolboxdigital.com/2010/01/advanced-techniques-mass-settings-changes-in-joomla/</link>
		<comments>http://toolboxdigital.com/2010/01/advanced-techniques-mass-settings-changes-in-joomla/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 10:21:08 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=461</guid>
		<description><![CDATA[Ever need to do a bulk settings change to an established site in Joomla?  Perhaps you forgot to make the changes are you were building the site.  This ...]]></description>
			<content:encoded><![CDATA[<p>Ever need to do a bulk settings change to an established site in Joomla?  Perhaps you forgot to make the changes are you were building the site.  This article describes how you can perform mass settings changes in Joomla using a simple MySQL query.</p>
<span id="more-461"></span>
<p>We recently worked on a development which already had a complex hierarchy of menu links set-up on the system (approx. 200 links), but realised later in the development that the &#8220;SSL Enabled&#8221; flag in the menu settings needed to be set to the &#8220;Off&#8221; setting in order to force the majority of the site to run in non-SSL mode:</p>
<p><img src="http://toolboxdigital.com/wp-content/uploads/2010/01/ssl-off.jpg" alt="ssl-off" title="ssl-off" width="596" height="289" class="noborder" /></p>
<p>The obvious solution is to go through each menu item one at a time at set this manually &#8211; but there&#8217;s a risk that some may be missed, and of course, the time it would take to do this to 200+ links would be considerable.</p>
<p>So, instead, we set about using simple find &#038; replace commands, we can run a query directly on the database to do this for us in one step.  The query we will be using has this structure:</p>
<p><strong>NOTE: Please ensure you make a full backup of your database before proceeding &#8211; if there&#8217;s a problem, you will easily be able to restore the database and try again.</strong></p>
<p>update <strong>TABLE_NAME</strong> set <strong>FIELD_NAME</strong> = replace(<strong>FIELD_NAME</strong>, &#8217;string to find&#8217;, &#8216;new string&#8217;)<p>
<p>Use a program such as <a href="http://http://www.phpmyadmin.net" target="_blank">PHPMyAdmin</a> to easily make edits to your database.  Most hosting providers give easy access to this via your hosting control panel &#8211; this will allow you to find the table/field names and run the query easily.</p>
<p>So, in our case, it&#8217;s fairly obvious we&#8217;ll find the setting we need to adjust in the <strong>jos_menu</strong> table, so, browse the table, then click the edit icon to open up the contents of one of the rows:</p>
<p><img src="http://toolboxdigital.com/wp-content/uploads/2010/01/phpmyadmin.jpg" alt="phpmyadmin" title="phpmyadmin" width="774" height="739" class="noborder" /></p>
<p>You&#8217;ll see I&#8217;ve indicated the bit we need to change on the image above &#8211; it&#8217;s in the field named <strong>params</strong>.  So, we now know the name of the table, and the field that we need to modify.  The text to search for (in this case) will be &#8220;secure=0&#8243; (so, any menu SSL settings that are set to &#8220;ignore&#8221;), and the setting we need to change to (like on the diagram) is &#8220;secure=-1&#8243; (&#8221;Off).  If you&#8217;re in any doubt as to the setting that&#8217;s needed, just change it in Joomla and view the string in PHPMyAdmin.</p>
<p>This now allows us to construct the final query that we will run on the database:</p>
<pre class="brush:sql">
update jos_menu set params = replace(params, 'secure=0', 'secure=-1')
</pre>
<p>Simple, isn&#8217;t it?</p>
<p>To run the query, simply click the &#8220;SQL&#8221; tab in PHPMyAdmin, paste your query into the box, and click go.  Once it&#8217;s run successfully, log into the Joomla administrator and check that everything was changed as expected.</p>

]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/01/advanced-techniques-mass-settings-changes-in-joomla/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Delete Test Orders and Reset Counters in Magento</title>
		<link>http://toolboxdigital.com/2009/10/how-to-delete-test-orders-and-reset-counters-in-magento/</link>
		<comments>http://toolboxdigital.com/2009/10/how-to-delete-test-orders-and-reset-counters-in-magento/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 13:30:45 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=113</guid>
		<description><![CDATA[You&#8217;d have thought there was a basic provision for this in Magento, but unfortunately this is not the case and, looking at this thread on the Magento forums, it&#8217;s not ...]]></description>
			<content:encoded><![CDATA[<p>You&#8217;d have thought there was a basic provision for this in Magento, but unfortunately this is not the case and, looking at <a href="http://www.magentocommerce.com/boards/viewthread/1680/">this thread</a> on the Magento forums, it&#8217;s not something that Varien are looking at correcting at any point in the near future.  The problem is that in-development stores need testing; to do that properly, you need to push test orders fully through the system, from invoice to completion.</p>

<p>So what happens when you want to launch the site and you&#8217;re stuck with dozens of undesirable test orders?  Well, read on to find out how&#8230;</p><span id="more-113"></span>

<p>The first thing you need to bear in mind is that, whilst this is possible using a load of MySQL queries, that kind of thing on a working site is pretty scary and risky if you&#8217;re not sure what you&#8217;re doing.  For this reason, I would recommend purchasing the Yireo extension <a href="https://www.yireo.com/software/delete-any-order">Delete Any Order</a> which will do the job for you.  It will also scan the database for orphaned sales data and remove, something which would take significant time by hand.</p>

<p>The extension costs a mere EUR20 and is worth it just for the piece of mind.  Whatever you choose, please ensure you <strong>backup your database first</strong>.</p>
<h3>Deleting the Orders</h3>
<p>Once you&#8217;ve purchased the extension, upload it to the root of your Magento site.</p>

<p>This will give you an additional option in System-&gt;Tools called &#8220;Delete Any Order&#8221;.  Select it to run the extension.</p>

<p>If you are preparing a store for launch and want to remove all orders and reset the sales reference numbers, select all orders and choose the &#8220;Delete&#8221; option from the drop-down menu (top-right).</p>
<h3>Reset the Counters</h3>
<p>You don&#8217;t really want your new store starting orders, invoices, shipment and credit memos from some random number do you?  Do the following to reset these counters to the default (1000001).</p>
<p>
1. Use PHPMyAdmin to view your database.<br/>
2. Click the &#8220;SQL&#8221; tab.<br/>
3. Paste the following query into the code entry window:</p>
<pre class="brush:text">TRUNCATE `eav_entity_store`;
ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1;
SET FOREIGN_KEY_CHECKS=1;</pre>
<p>4. If all goes well, the system will display a message stating that the query was a success.</p>
<p>The next order placed will now use the default number to start.</p>

<p>I recommend testing these steps out on a test site rather than your live environment, if that&#8217;s possible &#8211; just so that you are comfortable with the steps before deploying on a live site.</p>]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2009/10/how-to-delete-test-orders-and-reset-counters-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving a Magento Installation</title>
		<link>http://toolboxdigital.com/2009/09/moving-a-magento-installation/</link>
		<comments>http://toolboxdigital.com/2009/09/moving-a-magento-installation/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:10:47 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=85</guid>
		<description><![CDATA[If you&#8217;ve ever had to move a Magento site from one server/domain to another, you&#8217;ll already know how tricky it can be to get things working right afterwards.  The ...]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever had to move a <a href="http://www.magentocommerce.com" title="Magento">Magento</a> site from one server/domain to another, you&#8217;ll already know how tricky it can be to get things working right afterwards.  The following article describes the processes and steps involved to successfully move your Magento site to a new server/domain name, along with some possible solutions for further issues you may encounter.</p><span id="more-85"></span>

<p><img src="http://toolboxdigital.com/wp-content/uploads/2009/09/mage-ss1.jpg" alt="mage-ss1" title="mage-ss1" width="774" height="246" class="alignnone size-full wp-image-96" /></p>

<h3>1. Package up and/or download the site files</h3>

<p>I used my Control Panel&#8217;s &#8220;site backup&#8221; feature here for two reasons: a) you have less to download, and b) you can be sure you have all the files intact when you deploy the other end.&nbsp; If you don&#8217;t have this feature with your host, you can manually download the files &#8211; but be sure to check you have everything and that there were no errors during the downloading process!</p>

<p>Also, if you have shell access to the server, you can zip up the whole lot and download in one go &#8211; this will make it easier to deploy on the receiving end, and will ensure none of the files are corrupted and/or go astray during the upload.</p>

<p>Once I had my package downloaded, I deployed to the new server &#8211; again, if you can, upload the zip package and extract via the server.&nbsp; If you are unable to do this, extract the package locally and upload the files manually (cue: cup of tea).</p>

<h3>2. Take a backup of the original site&#8217;s database</h3>

<p>Using PHPMyAdmin, take a full backup of the site database that Magento was using.&nbsp; This should be in the form of a .sql file.&nbsp; Make sure you take a full backup of all the database tables.  If the database is particularly large, use compression on the export (built-in to PHPMyAdmin) which will help keep within the file upload limits.</p>

<h3>3. Import the SQL file into the new database</h3>

<p>Working in PHPMyAdmin on the target server, simply import the SQL file into an empty database (you may need to create one first).</p>

<h3>4. Update the live site URL data in the database</h3>

<p>This needs to be done in two places in the database.&nbsp; Using PHPMyAdmin, select the table named <strong>core_config_data</strong> and locate the following database rows:</p>

<p><strong>web/unsecure/base_url</strong><br/>
<strong>web/secure/base_url</strong></p>

<p>Note the text value for each entry &#8211; this corresponds to the root URL of the site.&nbsp; This should be confirmed as the data should reflect the current site&#8217;s root URL.&nbsp; To change, simply click the edit button for each of the two rows and input your new base URL value into the text box, saving when you&#8217;ve finished each one.</p>

<h3>5. Update local.xml with the new configuration details</h3>

<p>You can find your <strong>local.xml</strong> file in the <strong>app/etc</strong> directory.</p>

<p>Look through the file until you see the database connection information.&nbsp; If will look similar to the following:</p>

<pre class="brush:xml">
&lt;default_setup>
  &lt;connection>
     &lt;host>&lt;![CDATA[localhost]]&gt;&lt;/host>
     &lt;username>&lt;![CDATA[my_user]]&gt;&lt;/username>
     &lt;password>&lt;![CDATA[my_pass]]&gt;&lt;/password>
     &lt;dbname>&lt;![CDATA[my_database]]&gt;&lt;/dbname>
     &lt;active>1&lt;/active>
  &lt;/connection>
&lt;/default_setup>
</pre>

<p>Then change the values in the square brackets after the CDATA tags to your new database server settings, for example:</p>

<pre class="brush:xml">
&lt;username>&lt;![CDATA[mynewusername]]&gt;&lt;/username> 
</pre>

<p>Once done, save the file.</p>

<h3>6. Delete the cache data</h3>

<p>Simply locate your <strong>var</strong> folder and delete all content within.</p>

<p>You may also need to manually deploy the <em>.htaccess</em> file from the old site to the new site &#8211; so if your links do not work on the new server, make sure .htaccess is present and correct.</p>

<h3>Problem 1: MagentoConnect No Longer Works</h3>

<p>If you are planning to update Magento Core, any modules, or add new extensions to your Magento site, you will need to correct this since the Connect Manager (/downloader on the server) references the old site, and the links are hard-coded into the files, making it practically impossible to update manually.  There is also a real risk of accidentally updating files on the old server if running MagentoConnect (if the old site still exists).</p>

<p>The best way to sort this problem is this:</p>

<p><strong>1. Delete or Rename the /downloader directory</strong><br/>
Probably safer to rename this for the time being.  You will need to do this via FTP or your control panel file manager.</p>

<p><strong>2. Obtain a fresh copy of Magento</strong><br/>
The version number will need to be the same as the version you are running on your site.  Download the .zip file and extract locally to your computer.</p>

<p><strong>3. Upload the &#8220;clean&#8221; /downloader directory</strong><br/>
Once you have the extracted files from step 2, find the /downloader directory and upload it to your Magento installation.</p>

<p><strong>4. Run MagentoConnect and perform a core update</strong><br/>
You can leave this step for now if you prefer not to update your installation.  This will check all core modules and update as necessary, and will also add the missing list of core modules back into MagentoConnect.  Paste the following extension key into MagentoConnect Manager:</p>

<p><strong>magento-core/Mage_All_Latest</strong></p>

<p>You can also do this for any extensions you have installed, which will also add them back into the list.</p>

<h3>Problem 2: &#8220;Notice: Undefined index&#8221; Error when running the site</h3>
<p>This could be caused by an error during the MySQL import and is possibly related to auto-increments on certain rows in the database.</p>

<p>Try this and see if it fixes the problem:</p>

<p>1. Logon to PHPMyAdmin.<br/>
2. Locate the following tables: &#8220;core_store&#8221;, &#8220;core_store_group&#8221; &#038; &#8220;core_website&#8221;.<br/>
3. Note the &#8220;website_id&#8221; value for the admin code.  It should have a 0 (zero) value; if not, change it to zero and save.  Repeat this for all three tables.</p>]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2009/09/moving-a-magento-installation/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Hiding your WordPress development site on a live server</title>
		<link>http://toolboxdigital.com/2009/09/hiding-your-wordpress-development-site-on-a-live-server/</link>
		<comments>http://toolboxdigital.com/2009/09/hiding-your-wordpress-development-site-on-a-live-server/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 13:48:43 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=49</guid>
		<description><![CDATA[I recently wanted to develop a WordPress site on a live web server, in the root of the server, using the final domain name &#8211; however, I didn&#8217;t want the ...]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to develop a WordPress site on a live web server, in the root of the server, using the final domain name &#8211; however, I didn&#8217;t want the public to be able to view the work in progress site.  This article will show you how this can be achieved with ease!</p><span id="more-49"></span>

<p>What I would normally do in this situation is add an index.html file to the site root, then the following code into .htaccess to ensure the HTML file takes priority over WP&#8217;s PHP version of the same file:</p>

<pre class="brush:plain">
DirectoryIndex index.html index.php
</pre>

<p>However, this won&#8217;t work with WordPress; it rewrites the URL to the domain root (as specified in the WP Settings panel), leaving me with access to my HTML holding page only.</p>

<p>So I set about a different technique.  How about only allowing access to the WordPress files to my IP, and displaying the traditional HTML if the IP does not match?  Well, that&#8217;s what I did.</p>

<p>By adding a simple snippet of code to the WordPress template, you can deny access to the WP site to everyone except you (or, to be more specific, your IP address).  The code looks like this:</p>
<pre class="brush:php">
&lt;?php $ip=$_SERVER['REMOTE_ADDR'];
if ($ip !== "111.222.333.444") : ?>
    &lt;!-- HTML holding page code -->
&lt;?php else : ?>
    &lt;!-- WordPress template code -->
&lt;?php endif; ?></pre>

<p>Since my WP site used a static page for the landing page, this code needed to be inserted into my page.php template file.  If you&#8217;re showing posts on your landing page, add the code to the index.php template.</p>

<p>If you move to a different internet connection or use a dynamic IP, you will need to update the file with your <a href="http://www.whatismyip.com/">current IP address</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2009/09/hiding-your-wordpress-development-site-on-a-live-server/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Scheduling a MySQL Database Backup on your VPS</title>
		<link>http://toolboxdigital.com/2009/09/scheduling-a-mysql-database-backup-on-your-vps/</link>
		<comments>http://toolboxdigital.com/2009/09/scheduling-a-mysql-database-backup-on-your-vps/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 09:16:22 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[CRON]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=45</guid>
		<description><![CDATA[The following guide will show you how to create and schedule a Bash server script in order to backup MySQL databases on your VPS or dedicated server.  Please note ...]]></description>
			<content:encoded><![CDATA[<p>The following guide will show you how to create and schedule a Bash server script in order to backup MySQL databases on your VPS or dedicated server.  Please note that different server configurations may require slightly different commands to those shown.</p>

<p>Please <strong>BACKUP EVERYTHING</strong> before proceeding, and use the following information at your own risk!</p><span id="more-45"></span>

<p>I recently purchased a decent VPS for hosting a handful of demanding Magento sites (my shared hosting is just not up to scratch unfortunately).</p>

<p>I like to be able to offer comprehensive backup solutions to clients for complete peace-of-mind &#8211; relying on your host to do this is a big no-no &#8211; they will only make sure their backups cover themselves in the event of a hardware failure, so will be of little use if you or your client makes a mistake and breaks the site, or if, God forbid, your site gets hacked or maliciously attacked.</p>

<p>Joomla has a few options for auto-backing up your database and sending an email &#8211; so I started hunting around for Bash Scripts that I could run via CRON to do this for multiple databases on my VPS.</p>

<p>After visiting a few dozen pages, I finally managed to put everything together in my own Bash script and deployed it to the VPS, scheduled to run every day &#8211; and it works perfectly!  So, without further ado, here&#8217;s the process and script you need to implement this on your own server.</p>

<p>My VPS runs the Plesk control panel, so the process may be slightly different for your server, but the method should be the same.  You will need root access via SSH in order to test the script.</p>

<h3>STEP ONE: Setup your Server Folders</h3>

<p>I set my folders up on the server root.  You will need two folders:</p>
<p>
<strong><ul>
	<li>scripts</li>
	<li>mysqlbackups</li>
</ul></strong>
</p>
<p>The names are just suggestions; you can use whatever you want for these.</p>

<p>You can create these folders via FTP (use the root account for the server) or via the control panel file manager.</p>

<h3>STEP TWO: Create your Script</h3>

<p>Using a plain text editor (I used Coda for this), create the following script:</p>

<pre class="brush:text">
#!/bin/sh
mysqldump -udatabase_user_name -pdatabase_password --opt database_name >
/mysqlbackups/mysql_backup.sql
cd /mysqlbackups/
tar -zcvf mysql_backup.tgz mysql_backup.sql
uuencode mysql_backup.tgz mysql_backup.tgz > mysql_backup.uuc
mail -s "MySQL Backup" myemail@domain.com < mysql_backup.uuc
rm -f mysql_backup.uuc
rm -f mysql_backup.tgz
rm -f mysql_backup.sql
</pre>

<p>...and save it as mysqlbackup.sh.</p>

<strong>NOTE: The following code should be all on one line, without the line-break:</strong>

<pre class="brush:text">
mysqldump -udatabase_user_name -pdatabase_password --opt database_name >
/mysqlbackups/mysql_backup.sql
</pre>

<p>You can easily add more MySQL databases to the backup list by duplicating the above and changing the filenames (so that you can tell them apart, of course!).</p>

<h3>STEP THREE: Upload and Test</h3>

<p>You should now upload the saved script to your server.  Upload it to the "scripts" directory you created in Step One.</p>

<p>To test, logon to the server via an SSH terminal, and go to the scripts directory:</p>

<pre class="brush:text">
cd /scripts
</pre>

<p>Now run the script - this command may vary, so if it does not work for you, you may have to investigate the correct command for your server environment.</p>

<pre class="brush:text">
bash -x mysqlbackup.sh
</pre>

<p>The terminal window should output the results (no errors with any luck), and if you check your email inbox you should have been emailed the .tgz backup file!</p>

<p>The original files created (the .sql, .tgz and .uuc files) are all deleted from the server via the script after it has run successfully.</p>

<h3>STEP FOUR: Schedule Via CRON</h3>

<p>Now that you've confirmed the script works correctly, you can schedule it to run whenever you like.  I set mine to run every day at 1pm:</p>
<p><img src="http://toolboxdigital.com/wp-content/uploads/2009/09/cron.jpg" alt="cron" title="cron" width="630" height="394" class="alignnone size-full wp-image-389" /></p>
<p>And that's all there is to it - you now have an auto-backup schedule for your MySQL database!</p>

<p><small>(Thanks to <a href="http://paulbradley.tv/38/" target="_blank">Paul Bradley</a> for the original starting point for the Bash script)</small></p>]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2009/09/scheduling-a-mysql-database-backup-on-your-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
