Amazing 3D artwork

July 26, 2010 by Adam · Leave a Comment 

http://www.radoxist.com/artworks/56

The detail on these images is amazing, check it out

The best blog article I’ve read in a long time (and I found it totally accidentally)

July 23, 2010 by Adam · Leave a Comment 

http://retinart.net/graphic-design/secret-law-of-page-harmony

and following on from that:

http://51elliot.blogspot.com/2009/12/canons-of-layout.html

Well worth taking 30 minutes to properly read both of these.

p.s. I’m writing this on a monitor which is 1440 by 900, guess what 1440/900 is :)

Setup LAMP stack on Ubuntu 10.04 the easy way…

July 20, 2010 by Adam · Leave a Comment 

Open up a terminal session, type the following:

sudo apt-get install phpmyadmin

Everything else will be taken care of with dependencies. That’s all!

Creating a sub-category left menu in Magento (that behaves itself)

April 20, 2010 by Adam · Leave a Comment 

I just had to do this, and couldn’t find any code anywhere that did it, and due to the lack of documentation with Magento it wasn’t fun to put together, so this may help someone:

<div class="leftnav-container">
<?php
if (!Mage::registry('current_category')) return;
$_categories = $this->getCurrentChildCategories();
$_count = is_array($_categories) ? count($_categories) : $_categories->count();
$_current = Mage::registry('current_category');
$_parent_id = $_current->parent_id;
$_parent_level = $_current->getLevel() - 1;
if($_count): ?>
	<ol>
	<?php foreach ($_categories as $_category): ?>
		<?php if($_category->getIsActive()): ?>
		<li>
			<a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a>
		</li>
		<?php endif; ?>
	<?php endforeach ?>
	</ol>
<?php elseif($_parent_level > 1): ?>
	<?php $_categories = Mage::getModel('catalog/category')->load($_parent_id)->getChildren(); $_categories = explode(',' ,$_categories); ?>
	<ol>
	<?php foreach ($_categories as $_category): $_category = Mage::getModel('catalog/category')->load($_category); ?>
		<?php if($_category->getIsActive()): ?>
		<li>
			<a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a>
		</li>
		<?php endif; ?>
	<?php endforeach; ?>
	</ol>
<?php endif; ?>
</div>

CakePHP on Webfusion, Ubuntu 8.04, suPHP

April 20, 2010 by Adam · Leave a Comment 

If you install any CakePHP App on a Web Fusion Dedicated Server running Ubuntu 8.04 and suPHP you will likely get the following message:

Forbidden, perhaps you need to change the file permissions for this document or upload an index page.

This is because you need to add:

Options +FollowSymLinks

To the top of your .htaccess file inside the webroot folder.

Your homepage should then start loading after this, but clicking on any links will present you with a new error:

Internal Server Error, this is an error with your script, check your error log for more information.

You will need to modify .htaccess again and change the line:

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

to

RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]

The first is needed because suPHP/pretend root stops you from setting Options +FollowSymLinks in your httpd.conf file, I don’t really know why the second one is needed, but it seems to work.

Edit: Adding:

RewriteBase /

before

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

will also work, instead of adding the / to the above line

Next Page »