Archive for the ‘Web Design’ Category

How to Password Protect Part of a Post

The question came up about how to Password Protect part of a Wordpress post but still allow a description or some other explanatory text to be displayed. It seemed like a pretty straightforward request but it’s not something that Wordpress handles right out of the box. You can easily password protect a post, but you can’t see anything so can’t give details about why the rest of the text is hidden. For example you want to provide links to family pictures that only your real family can get to. Or you want to offer photos or a download to specific groups.

In searching around for a solution I came across multiple sites (all related I’m sure) that wanted to rip me off for $50 to $150 for a plugin that would solve the problem. Egad, are you serious?! They wanted to make some sort of user level management system within Wordpress that would allow me to charge users or fleece people for money in some other way. That’s not quite what I was going for.

I did however discover a very simple and easy to implement solution that is also free. I tested this out on Wordpress 3.0+ and it works fine. It requires a simple change to the Wordpress files and uses the MORE function to hide the secondary text with a password. So basically everything before the MORE tag everyone can read. Everything after it requires a password. And this should work from any blogging client.

First off, find /wp-includes/post-template.php in your Wordpress install directory.

Find the following text:

$output = get_the_password_form();
return $output;

Replace it with this:

$content = $pages[$page-1];
$content = explode(‘<!–more–>’, $content, 2);
$output = "";
$output .= $content[0];
$output .= get_the_password_form();
return $output;

That’s it. Now you can write your post as you normally would and then if there’s a section you would like to restrict to specific people, just add the MORE tag and then give the post a password. I tried this with Windows Live Writer 2011 and it worked just fine.

I have to say this is a pretty simple solution and unless you have some greater need this should work very well.

This idea was taken from the instructions at this page:

http://www.dagondesign.com/articles/show-the-intro-to-password-protected-posts-in-wordpress

Rapid PHP 2010

As my final web development tool I have Rapid PHP 2010 which I got for a pretty hefty discount off Bits Du Jour. I do quite a bit of editing to both HTML and PHP files and wanted an editor that designed exclusively to handle multiple language types. Ironically, Rapid PHP looks and works in very similar fashion to Notepad++. Notepad++ handles dozens of file formats and has a slew of tools for cleaning up code, checking syntax and getting your code sorted. Not to mention it’s free.

So how does Rapid PHP compare? Ironically they’re very similar. Rapid PHP is an excellent editor with a lot of tools to help get the coding done. You can create code libraries, you get a preview window to see how your code work, you can create projects with multiple web files and it has several verification tools to keep things in order. For example, if you forget the closing tag or don’t start the syntax off correctly Rapid PHP will let you know. It also has editors for SQL, CSS and Javascript. It is extremely multi-functional. Plus it also works as just a regular text editor.

But the big question is, is Rapid PHP worth it when Notepad++ is free? That is actually a tough question. Quite honestly, Notepad++ is one hell of a text editor. And quite frankly, for my needs Notepad++ works just as well and handles my simple coding needs. I edit Wordpress files quite frequently and Notepad++ does an admirable job. I got Rapid PHP for around $17 and think that was a good price to pay. It offers a lot of features and the Code Library and Preview options are very handy. It does lack some drag and drop functionality so that is a bit frustrating.

If I had to do it all over again and didn’t get Rapid PHP on sale, I think I would just stick with Notepad++. Rapid PHP is a great editor, there is no doubt about that and I use it quite a bit, but for casual coding or just to make some updates to Wordpress or make an adjustment to an HTML page, Notepad++ will certainly handle the job. I certainly don’t regret Rapid PHP, but then again, it might just be a bit of overkill at the moment. But I do like that it has an editor at the ready regardless of what language my project is in.

It’s kind of funny when you think about it, I really don’t do that much coding yet I have some of the most powerful and robust web editors out there. Between all these tools there is very little I wouldn’t be able to build.

You can check out Rapid PHP 2010 at: http://www.blumentals.net/rapidphp/

You can check out Notepad++ at: http://notepad-plus-plus.org/

Artisteer as a Web Development Tool

I’m not a web developer by any means. I can’t take a web editor with a blank page and create something wondrous and magical. It’s fairly rare for me to create anything wondrous or magical regardless of whether or not a web editor is involved. I can edit page elements once they’ve been created, but starting from scratch isn’t something I do well. Unless you count making pages that say "Hello World"

on them. I’m champion at that.

But anyway, with the new release of Artisteer 3.0 not only does it allow for the creation of blog themes but you can use it as an actual web page design tool. I had a simple project in mind so I thought I would give Artisteer a try and see how it faired. I wanted to create several static pages that all linked together through a very simple Nav menu just under a banner. Its layout would be very similar to this blog in that it had a header, a nav menu and then the content. The content would be laid out in a table. It sounded pretty simple. And no hissing it as using a table this way. It’s the simplest way.

As far as the design goes, Artisteer worked wonderfully well. I was able to pick a nice design, set the layout, remove the sidebar, customize the banner, set up my menu, and create lots of interlinked pages within just a few minutes. I even created the table on the page and got the layout set. Quite frankly I wish all HTML tools were this quick and easy.

If I was going to stick with just entering some text and a graphic here and there things would have worked out quite nicely. However, I had lots of graphics to add and currently there is no drag and drop operation into Artisteer. This means I had to select each cell, go through the menus to insert a picture and then scroll to find the file. All very doable but extremely slow. So slow in fact that after the structure of the page was made there was no point in continuing with Artisteer. The layout was simple but it didn’t allow for my repetitive actions. Even though Artisteer offers the ability to directly edit the code I really felt this had put the brakes on. Hopefully that gets changed in the future since I think there is a lot of potential in using Artiseer this way. Being able to have that level of freedom and control to create pages is really quite exciting. It’s not quite drag and drop, but you don’t have to enter the code yourself to make something happen.

But once I was out of Artisteer I loaded the completed pages into Expression Web and Rapid PHP 2010 to make my final edits. Unfortunately Rapid PHP doesn’t allow drag and drop of images either so that brought its use to a halt. Into Expression Web I went and the drag and drop worked very well.

However, the code behind the page was an overwhelming jumble of syntax. The sheer volume of definitions was staggering! And even though the page looked good in the browser, when loaded into the editor it was nearly impossible to work with. I couldn’t tell which way was up and spent quite a bit of time just deciphering all the injected Artisteer tags.

I did finally tame the code beast and was soon back on track adding my images and linking files together. With the amount of time I spent sifting through the code I’m not sure I actually saved myself any time. The page looks good, but once you jump out of Artisteer editing your work may be beyond the scope of most casual designers.

I think I have a handle on how Artisteer works its magic so the next time I have a project like this it shouldn’t take nearly as long to start editing. In fact, I’m still editing those same pages and they don’t look nearly as daunting as they did originally. However, I would love to see Artisteer expand the HTML portion of this app. It’s still in the "Preview" stage so they have plenty of time to keep working. They’ve made huge strides and if they can add a few more features like drag and drop and a decent HTML editor within the app itself I think they will have a top notch web design tool for the casual web designer. If nothing else using Artisteer gives you a really nice framework in just mere moments. You can create the layout, select the colors and choose fonts without having to write all the code and stylesheets by hand.

There is a lot to like, but just keep in mind that if you have to edit the code manually you’re going to need to take it slow and easy so you don’t get lost in there.