Archive for November, 2009

How to Mount an ISO Disk Image on Windows 7

I had previously been using daemon tools to mount image files, but there isn’t a version for Windows 7 yet.  Someone I work with needed to mount an ISO in Windows 7, so I found another way, using PowerISO.  Power ISO is easy enough to use and did the job on 7, so I’m happy with it for now.

Given that Daemon Tools has become a bit of bloatware, I might stick with PowerISO.  We’ll see.

Managed Software Betas

Are you spending valuable development time working on managing your online beta?  Prefinery has made this process a lot easier with managed solutions including adding a website splash page, taking sign ups and rolling out users when ready.  It even exports data to highrise if your group is using highrise for organization.

Prefinery is a complete outsourcing solution for the whole beta invite process.  Let your developers spend time on your product, not on the invite process.

Center an Unordered List

I’ve always thought centering LI elements was impossible. Here’s an basic example of how to do it:

#footer-menu { text-align:center; list-style-type:none; margin: 0; padding: 0; }
#footer-menu li { display:inline; padding: 0 10px; }
<ul>
     <li><a href="#">Page 1</a></li>
     <li><a href="#">Page 2</a></li>
     <li><a href="#">Page 3</a></li>
     <li><a href="#">Page 4</a></li>
     <li><a href="#">Page 5</a></li>
</ul>

Drupal vs. Wordpress

I’ve been working on a Drupal site this past week or two. I had done absolutely zero with Drupal before that and had to essentially power learn the CMS just for this project. As this was straying away from my comfort zone, Wordpress, I started keeping in mind comparisons to Wordpress. I have to admit I am still a noob to Drupal and don’t know all the tricks so the below opinions should be taken with my situation in mind.

Drupal
Pros:

Integrated PHP into Content - Wordpress has different plugins that let you use PHP in posts but Drupal is far and away more efficient at this.

Awesome User SystemThe user system on Drupal works really well and very extendable with really advanced permissions.

Integrated AdministrationContent administration is built right into the main theme. Wordpress has 2 different sides, the site and the admin backend.

BlocksThis is more a neutral than a pro. Blocks can get annoying to edit here and there when Wordpress sidebar widgets are much easier. This is more like Joomla, in that you set different sets of content into specific areas of the page called blocks.

Cons:

Manual Module InstallWordpress lets you search and automatically install plugins right from the backend

Complicated ThemingCreating themes was very complicated in Drupal, at least for me. There are a few strange things when you are new to Wordpress, The Loop for example. But I had a much harder time with drupal.

Lack of customization
This is the most frustrating thing for me. I like what modules do for me but I need to style the output I get back. For most of my issues I had to go in and edit functions inside the module files and even the core files itself. That is some really advanced stuff for a supposed user-friendly Content Management System. In Wordpress, I RARELY had to edit plugins since they offer enough css to style it or plenty of other options. If I did you could edit it in the backend or in dreamweaver in glorious COLOR. Drupal uses a .module extension which you have to add to Dreamweaver to tell it it is safe to even open it. Plus there is no color scheme to a .module extension even though its all php. Thanks for the hassle. Also, the Wordpress plugin/hook system is much easier to understand then the Drupal API layering.

Debugging
This might only be my case but I ran into multiple problems where what was showing is not even close to the logic used. What my source html and CSS code was listing contradicted what my eyes say. I have just noticed a weak error layer with Drupal.

Documentation/VersionsDrupal comes in a few different versions but the problem is many have drastic changes. How something is coded is changed in each version. You can’t say you know Drupal unless you know how to make a site in each version, 4, 5, AND 6. Wordpress has compatibility issues between versions, mainly in plugins, but change in actual core functions is VERY minimal in WP. Drupal’s multiple version also resonate a whole other problem. Documentation is HORRIBLE. Drupal’s home site will tell you how to do different functions in each version but not alot of example or variations or implementations, and most of all a huge lack of help when trying to find out what arguments a function takes and what they do. Worse yet, to find solutions for your issues on any other site is a nightmare since how you handle something in Drupal 5 could be completely different than 6.

Now if I got a little more comfortable in Drupal AND I had to build a huge community-type site, I would consider Drupal. Just the user system would save a bunch of time that way. But for any other type of site I can’t see any reason not to use Wordpress.

I guess this post wasn’t a very close argument in my mind. A more close comparison might have been Joomla vs. Drupal but I’m not sure if I could make a verdict on that. But the point of this post is…after a week or so of pure Drupal grinding all I could do was think about Wordpress as if she was the girl that got away.

PHP: Recursively chmod(), chown() and chgrp()

I recently needed a way to recursively modify file permissions.  I was able to accomplish this with a few basic recursive functions, chmodr(), chownr() and chgrpr():

chmodr()

function chmodr($path, $filemode)
{
    if (!is_dir($path))
        return chmod($path, $filemode);
 
    $dh = opendir($path);
    while (($file = readdir($dh)) !== false)
	{
        if($file != '.' && $file != '..')
		{
            $fullpath = $path.'/'.$file;
            if(is_link($fullpath))
                return FALSE;
            elseif(!is_dir($fullpath) && !chmod($fullpath, $filemode))
                    return FALSE;
            elseif(!chmodr($fullpath, $filemode))
                return FALSE;
        }
    }
 
    closedir($dh);
 
    if(chmod($path, $filemode))
        return TRUE;
    else
        return FALSE;
}

chownr()

function chownr($path, $owner)
{
    if (!is_dir($path))
        return chown($path, $owner);
 
    $dh = opendir($path);
    while (($file = readdir($dh)) !== false)
	{
        if($file != '.' && $file != '..')
		{
            $fullpath = $path.'/'.$file;
            if(is_link($fullpath))
                return FALSE;
            elseif(!is_dir($fullpath) && !chown($fullpath, $owner))
                    return FALSE;
            elseif(!chownr($fullpath, $owner))
                return FALSE;
        }
    }
 
    closedir($dh);
 
    if(chown($path, $owner))
        return TRUE;
    else
        return FALSE;
}

chgrpr()

function chgrpr($path, $group)
{
    if (!is_dir($path))
        return chgrp($path, $group);
 
    $dh = opendir($path);
    while (($file = readdir($dh)) !== false)
	{
        if($file != '.' && $file != '..')
		{
            $fullpath = $path.'/'.$file;
            if(is_link($fullpath))
                return FALSE;
            elseif(!is_dir($fullpath) && !chgrp($fullpath, $group))
                    return FALSE;
            elseif(!chgrpr($fullpath, $group))
                return FALSE;
        }
    }
 
    closedir($dh);
 
    if(chgrp($path, $group))
        return TRUE;
    else
        return FALSE;
}