AlanBarber.Org

Twitter Twitter Updates

Rocking out in cubicle land... http://t.co/trOKKOy5
Thu May 17, 2012 12:34 PM
New project to play with for the day. Writing a VS2010 plugin that runs on every build... this should be fun!
Thu May 17, 2012 11:48 AM
Today is *facepalm* day... Dev DB was rolled back without telling any developers. ugg!
Thu May 17, 2012 9:13 AM
Started watching Breaking Bad the other day. Little slow at first but it gets really good. Bryan Cranston turns into one serious badass :)
Wed May 16, 2012 8:52 PM

Follow me on TwitterTwitter

§ ExpressionEngine

Tuesday, September 21, 2004

How to make an ExpressionEngine test site

How to make an ExpressionEngine test site for module and plugin testing

If you currently are or planning to do module and/or plugin development work for ExpressionEngine you really should have a dedicated private test installation of EE that you can work with.  While you could use your public installation it’s not a good idea.  Do you really want to have your public blog throwing out errors or completely being wiped out because of a bug in the module or plugin you were working on? 

This tutorial will walk you through step by step on how to setup a test installation.  The ultimate goal being that once you follow these steps you’ll have a clean install of EE that you can test your modules or plugins with.  The benefit of following this guide is that at any time you can do a complete rollback to the fresh installation in just seconds.  Should you accidentally blow up your database or mangle the configuration all you’ll have to do is run a simple command line script and bingo it’s just like new again!

A few things to point out before we begin.  First off, this should work fine for any *nix OS but I am using FreeBSD for my server.  Second, you will need command line access to your server. IE you’ll need to use telnet, ssh, or be working locally.  Third, this does need to be a clean, private install.  The install you do should be completely separate from anything else including the use of MySQL databases and server directories.  Fourth, I’m using my real world setup as the example in the tutorial just to help make it clearer.  You should change the names and directories where appropriate to match your setup.

Step 1: Installing EE
There really is no need to explain this.  Just do a normal fresh install of EE.  Create a new database and use a new directory structure separate from anything else.  I created a new MySQL database and user account called “ee_test_site”.  I installed EE in a separate folder “/home/abarber/public_html/ee_test_site” too.  Just copy the EE image, system and user_guide folders into this new folder.  IE “home/abarber/public_html/ee_test_site/images”.

Step 2: Configure and Setup the EE test site
Just go through and setup the test site.  Set all the admin configurations, build the templates, create a few sample members, create a few sample entries, etc.  Basically, you want to have the site setup just how you want it to look and act every time you do a rollback. 

This is the most crucial step!  You need to have everything exactly as you want it.  We’ll be making a backup of the entire installation and the rollback will totally wipe out everything and reset it to how it is from the backup. 

If for example you forget to set template cacheing on but really do want it on.  Every time you do a rollback you’ll have to go in and turn on template cacheing because the backup had it off!

So take a few extra minutes to thoroughly check every single thing.  Yes even the directory contents.  If there are files you do or do not want in the backup manage them now.  It’ll make life much easier later.

Step 3: Create backup directory
Someplace you should make a directory to hold and run the rollback from.  I prefer to make a folder called “rollback” in my home directory.  “/home/abarber/rollback”

Step 4: Make the MySQL backup
We’re going to use mysqldump program to create the backup.

At the command prompt type:
mysqldump -u ee_test_site -p[enter password]—add-drop-table—databases ee_test_site > /home/abarber/rollback/ee_test_site.sql

Step 5: Make the EE installation backup
We’re just going to make a simple tar gziped file with the contents of the website folder.  That means the actual EE files, images, etc.  Remember what I said above?  This is your last chance to make any changes to the files in the backup!

At the command prompt type:
tar cvzf /home/abarber/ rollback/ee_test_site.tar.gz /home/abarber/ public_html/ee_test_site

Step 6: Create the rollback script
I call it rollback.sh and place it in the “/home/abarber/backups/rollback” directory.

—copy below—
#/usr/bin/sh
echo Rolling back EE Test Site blog…

echo Reloading database defaults into MySQL…
mysqladmin -u ee_test_site -p[enter password] -f drop ee_test_site
mysql -u ee_test_site -p[enter password]

< /home/abarber/rollback_data/ee_test_site.sql

echo Reloading EE installation…
rm -rf /usr/home/abarber/public_html/ee_test_site
cd /
tar xfz /home/abarber/rollback/ee_test_site.tar.gz

echo Resetting file and folder permissions…
chmod 777 /home/abarber/public_html/ee_test_site/images/captchas
chmod 777 /home/abarber/public_html/ee_test_site/images/uploads
chmod 777 /home/abarber/public_html/ee_test_site/system/cache
chmod 666 /home/abarber/public_html/ee_test_site/system/config.php
chmod 666 /home/abarber/public_html/ee_test_site/system/config_bak.php
chmod 666 /home/abarber/public_html/ee_test_site/path.php

echo Rollback finished!
echo
-- copy above --

Note - Remember to chmod the "rollback.sh" script to give it execution permission.

Step 7: Test the rollback script
Make a few changes in the control panel such as delete a few entries or delete a template or change a category name.

Now go to the rollback directory and type “./rollback.sh” at the prompt.  Check the control panel again.  The missing entries and changed categories should be back.  If not we have a problem and need to figure out what we did wrong.

Now lets try something a bit more crazy.  Just go in and start randomly deleting files until the website no longer works.  Oh no!  The site is ruined.  Wait lets use the mighty rollback again!  Sit back and watch in amazement as the backups are reloaded and your site is saved.

So what’s the point of all this you might ask?  Software development is a science.  When you’re working on a module or plugin it’s nice to always have a fresh clean install to do your tests.  That way whenever you make changes to your software you can rollback the system and have identical test parameters. This helps to keep bugs from cropping up that are not a result of your software but the test environment being changed from a previous test.

This you may realize comes in very handy for module development since modules make changes to several database tables and probably create their own.  That way you don’t get errors or bugs showing up because you have already installed 3-4 different versions of the module before.  When you’re working on that module you know you have a fresh clean install every time you start testing it.  It’ll make it just that much easier to debug!

I hope people find this useful.  I’ll admit it’s probably not the clearest written tutorial but you should get the idea of how to set this up.  I’m using it and it works great.  I can screw around with the test site to my hearts content then just run the rollback script and it’s back to normal in 30 seconds.

Posted by AlanBarber on 09/21/2004 at 07:30 AM
Bookmark and Share BloggingExpressionEngine • (0) CommentsPermalink

Monday, August 23, 2004

A Quick CSS Tip

Here’s something I just learned today…

When coding CSS for the pseudo-classes of the < a > tag, the states should always be coded in this specific order:

a:link
a:visited
a:focus
a:hover
a:active

If you don’t do it in this order it can cause issues with links in most browsers.  Including improper rendering or even failure to follow the CSS display settings for links.

I actually didn’t know it mattered.  However I know it does now.  The order of the link tags was wrong in the CSS for this site and I have had issues with link rendering.  Some links would not change colors when I would hover over them.  I had written it off as a stupid browser issue.  However, Sure enough soon as I changed the order in my CSS all the link problems went away.

A quick note that most of the included themes with ExpressionEngine do have improper ordering so all you EE users out there should go in and correct this.

But keep that in mind for all your web designers too.  Just a nice little tip to remember.

Posted by AlanBarber on 08/23/2004 at 10:09 PM
Bookmark and Share Computers & TechnologyTips & TricksBloggingExpressionEngine • (2) CommentsPermalink

Thursday, August 12, 2004

ExpressionEngine Version 1.1 Feature List

ExpressionEngine Version 1.1 is currently in beta testing right now.  Assuming test goes well this new version could be out as soon as next week.

There are over 50 new features and enhancements being released.  Below is the complete list which can also be found at http://www.pmachine.com/forum/threads.php?id=20023_0_13_0_C.

quote:


VERSION 1.1 NEW FEATURES

TEMPLATE FEATURES
- You can show/hide template groups for better organization.
- You can now adjust all of the preferences for all templates at once.
- Template Groups can now be cloned.
- Templates can now be saved as text files.  This allows programs like
  Dreamweaver to be used to upload changes via FTP rather than
  submitting the changes via the control panel.
  - Plugins can now be embedded inside other plugins.
  - EE tag variables can now be used as parameters in enclosed EE tags:
  {exp:weblog:entries}
  {exp:gravatar email=”{email}”}<img src=”{plugin_url}” />{/exp:gravatar}
  {/exp:weblog:entries}
- Custom 404 page. In the global template preferences page you can now
  specify a template to be served when someone tries to access an invalid URL.
- “On the fly” Variables. You can define global variables in each template
  using the {assign_variable} tag. These variables can be used to create
  generic templates that can be easily switched for each weblog.
- Added Template Export Feature.  You can now export entire template groups
  or combinations of templates.  NOTE:  The zip-encoded
  files generated by the export utility are not compatible with all
  zip decompression programs.  We’re trying to get to
  the bottom of this. In the mean time this feature is experimental.
- Templates can now be deleted by anyone with template editing
  privileges
- Template revision history is now viewable by anyone who has template
  editing privilege.

CATEGORY FEATURES
- Redesigned the Category Manager in the control panel.  You can now set
  your own custom order for categories.
- Added category description field in the control panel category
  manager.  This field is available in the following tags:
  {exp:weblog:category_heading}, {exp:weblog:categories},
  {exp:weblog:category_archives}.  Please consult user guide for more
  info.
- You can choose to display or not display categories that don’t contain data.
  This is done using the follwing parameter: show_empty=“yes” (or “no”)
  in these tags: {exp:weblog:categories} and {exp:weblog:category_archives}

PUBLISH PAGE FEATURES
- Added the capability to customize the layout of the control panel PUBLISH page.
  You can show/hide every element on the page now.
- Image thumb-nailing improvements:  The upload utility will now create
  a link to the full-size image.
- Added a DHTML Calendar in the PUBLISH page to make setting dates/times
  easier.
- Added “select all” button for ping servers (in publish page).
- Changed the logic so that the “ping server” checkboxes in the publish
  page will only be selected for new entries, not when editing existing
  entries.
- Replaced code in the Email button (PUBLISH page) with the encoded
  version {encode=“you@yoursite.com” title=“click me”}
- Added new global weblog preference:  Clear all caches when submitting
  new entries.

EDIT PAGE FEATURES
- Added search feature to control panel EDIT page.
- Added “per page” selection in EDIT page, allowing you to specify the
  number of results on a page

CONTROL PANEL HOME PAGE FEATURES
- Changed the behavior of the “recent entries” and “recent comment” table
  in the control panel home page. Based on the member group preferences
  of the particular member viewing the control panel, the list will either
  show only their own entries and comments of those of members as well.

WEBLOG MANAGEMENT FEATURES
- Added the ability to create new templates when creating a new weblog.

MEMBER PROFILE FEATURES
- Added a “subscription manager” in the member profile area, allowing
  you to manage any comments you are subscribed to.
- Added a “view all posts by this member” option in the public member
  profile page.
- Added a new tag: {exp:member:custom_profile_data}.  This tag allows
  custom profile information to be shown in any template. Please consult
  manual for more info. 

MEMBERSHIP FEATURES
- Added the ability to add a member login form in any template.
  Please consult manual for syntax.

SEARCH FEATURES
- Added {full_text} variable in the search results tag, allowing the
  complete result to be shown rather than only an excerpt.

WEBLOG FEATURES
- Added a new variable in the main weblog tag:  {member_search_path}.
  This variable creates a link that lets you search for all posts by a
  given member. Look in the parameters page of the manual for more info.
- Added {if no_results}{/if} variables in the {exp:weblog:entries} tag.
  This conditional variable lets you specify a message to be shown if
  the tag doesn’t return any data.
- Added a new parameter that allows entries posted in the future to show
  up: show_future_entries=“yes”  It is available in these tags:
  {exp:weblog:entries}, {exp:weblog:category_archive},
  {exp:weblog:next_entry}, and {exp:weblog:previous_entry}
- Added three new paths in the weblog preferences page.  These permit
  you to fine-tune where you would like search results, pings, and
  trackbacks pointed to.
- URL segments can now be used in conditional statements:
  {if segment_3 == “charlie”} {/if}
- Added “start_on” and “stop_before” variables in the
  {exp:weblog:entries} tag, allowing the weblog display to be limited by
  a date range.
- Added three new variables in the {exp:weblog:entries} tag, which
  permit you to build links to your comment pages.
  {comment_page_auto_path}
  {comment_url_title_auto_path}
  {comment_entry_id_auto_path}

COMMENTING FEATURES
- Added comment expiration feature.  You can define a master value in
  the Weblog Preferences page, or individual values when posting new
  entries. Comments will be closed when the date is met.
- Added {if no_results}{/if} variables in the {exp:comment:entries} tag.
  This conditional variable lets you specify a message to be shown if
  the tag doesn’t return any data.

SPAM PROTECTION FEATURES
- Added a new option that requires a valid IP addresses and User Agent
  when posting comments for better spam protection (Weblog Preferences
  page).
- Added an optional “rank denial” feature, providing another spam
  protection feature. This feature will prepend all links in comments
  so they point to an intermediary redirect server. (Admin > Session and
  Security page)
- Added “referrer throttling” feature, which will not allow the referrer
  page to accept more than 10 referrers a minute for any given IP address.

LOCALIZATION FEATURES
- Added a new preference (in My Account > Administrative Options) that
  allows the localization settings of any given member to be used as the
  site default for non-logged-in members.

MISCELLANEOUS NEW FEATURES
- Added a new option in the captcha prefs page:  Require Captcha with
  logged-in members
- Added several new CSS stylesheets that were contributed by our users.
- Changed the links in the {exp:weblog:category_archives} tag to utilize
  the url_title instead of the entry_id number.
- Made some CSS changes for better compatibility with Firefox 0.9 and
  Internet Explorer 5.5 Win.

NEW BLACKLIST MODULE
- New module based off of Referrer Blacklist.  Now used by Referrer Module
  and Trackback Module for blocking spam
- When updating the Blacklist, all new additions to the Blacklist will be
  used to delete any Trackbacks or Referrers matching the additions.
- Message explaining need for license number for pMachine Blacklist download
  if license number is not filled in

REFERRER MODULE
- Blacklist is its own module now
- Under View Referrers, you can select individual referrers to delete.
- When deleting individual referrers you have the option of adding their URL,
  IP Address, and User Agent to the blacklist automatically AND delete other
  referrers with similar values.

TRACKBACK MODULE
-  Now uses Blacklist Module to block incoming trackback spam.
- Sends trackbacks with pMCode rendered
- “Admin Notification of Trackbacks” email message template now allows three
  new variables: {trackback_ip}, IP of incoming trackback {delete_link},
  direct link for deleting trackback, {trackback_content}, the excerpt of
  the incoming trackback
- “Admin Notification of Trackbacks” email title template now allows all
  variables that email message template allows: {entry_title}, {comment_url},
  {sending_weblog_name}, {sending_entry_title}, {sending_weblog_url},
  {trackback_ip}, {delete_link}, {trackback_content}
- Word wrapping disabled for admin notification emails
- Bug fixed where {exp:trackbacks:entries} tag would not accept url_titles
  only entry_ids
- If trackbacks for an entry exist and yet trackbacks are not allowed
  (turned off at some point), trackbacks are still shown by
  {exp:trackbacks:entries} tag.

MOBLOG MODULE
- Older Windows server friendly.
- More compatibility with various phones and email clients
- Allows breaking up of email body content for various fields using
  {field:field_name format=“none”}Email content goes in here{/field:field_name}
  in the email.  Can also use greater than or lesser than:
 

.
- {entry_title}Moblog Email’s Title{/entry_title} or
 

Moblog Email’s Title

can be used in the email to specify
  the new entry’s title for the moblog.
- Fixed problem where Locked files were left on email server
- Email text is now corrected for email with format=flowed enabled
- Improved error messages
- Fixed a bug where the {exp:moblog:check} tag only checked one moblog at a time.
- Checking moblog is more efficient and uses up less PHP memory.



There are a lot of new features but more importantly many fixes to way things work.  Not to say EE was built wrong but many things didn’t work that should have.  Things like not being able to use many of the tag variables in the conditionals was very annoying.  You would instead have to use convoluted php code instead making things hard to work with.

Another great new feature that I’m glad to see is the comment expiration.  I was a big pusher for this feature when I first switched to EE.  I’m not to sure how they exactly have this feature set up but I hope they do let you set a day limit.  So you can for example have comments closed after 30 days.  It’s a great way to cut back on the comment spam since you don’t have to worry about having hundreds of open entries for spammers to attack.  Plus it’s just handy to keep people from posting to really old entries.  Although, a funny thing to point out.  I did make a big deal for this feature when I first switched becuase comment spam was so bad on my old MT blog.  However, since switching I’ve had almost no comment spam.  I think I’ve had maybe 3-4 obvious spam messages since I switched.  I really do think the spammers use automated bots that search out for the mt-comments.cgi scripts so my EE based blog flys under their radar.  *knock on wood*

Finally, the big thing that I’m happy to see if the creation of a Blacklist Module.  This new module will just provide a central place to store blacklisted domains and ip addresses.  The refererer and trackback modules have been rebuilt to use this blacklist module to block refererer and trackback spam.  Although I’m a bit surprised they haven’t also rebuilt the comment module to use the blacklist.  Still it’s a nice feature I’m happy to see.

Well I hope EE 1.1 gets released next week becuase I’ll be very happy to upgrade to it!

 

Posted by AlanBarber on 08/12/2004 at 06:50 PM
Bookmark and Share BloggingExpressionEngine • (0) CommentsPermalink

Friday, June 18, 2004

ExpressionEngine Control Panel Themes

I was bored the other day so I decided to crank out a few new themes for the ExpressionEngine control panel.  No offence to the people at pMachine but the default blue is rather boring and the other black and gold is just hideous.

So here are four new ones for EE users to try.  Basically, these are just color replacements of the default blue theme.  Fonts, layouts, styles, etc are all the same.  There is green, orange, purple and red to choose from.  I’ll admit I’m not exactly the artsy type but I’m going to try to create a few more original themes sometime just because variety is nice!


ab_green.css
Download: ab_green.css


ab_orange.css
Download: ab_orange.css


ab_purple.css
Download: ab_purple.css


ab_red.css
Download: ab_red.css

Posted by AlanBarber on 06/18/2004 at 10:20 PM
Bookmark and Share BloggingExpressionEngine • (0) CommentsPermalink

Wednesday, June 02, 2004

ExpressionEngine Powered!

Well it’s official… the blog is now powered by ExpressionEngine

As I stated in an earlier post after the big uproar about the new pricing structure of MovableType the fine folks at pMachines took advantage of the situation and gave away 1250 free copies of their ExpressionEngine bloging software.  I was one of those lucky 1250 and snagged a free copy.

So I’ve spent the last few weeks slowly learning EE and working to convert to this new system.  It’s very different from MT that’s for sure.  I’ll admit I still prefer certain features of MT over EE but the developers at pMachines are working on new features all the time.  I’m sure with time they’ll meet and exceed my ever wish.

There are three major areas worth focusing on in this post:
1) The template system is very different from MT.  Instead of separate templates for every page there is just one single template that morphs to fit the data that is requested.  As a result it can be rather overwhelming trying to get the page to display how you want for single posts as opposed to the homepage.

2) EE is PHP driven which means every page view is rendered on the fly from the database.  There are no static files that get rebuilt like MT did.  There are pros and cons to both styles but in the long run I believe on the fly rendering is better suited.

3) EE is way more complex of a package.  The amount of settings and features in EE blows MT out of the water.  I’ll be outright honest and tell you that this is not for the newbie or casual computer user wanting to start a blog.  Stick with the hosted services like LiveJournal because you’ll fell overwhelmed trying to work with EE.  However, if you’re up for a challenge then go ahead.  Challenges are fun!

Anyhoo, this is my first post and more of a test than anything else.  I still have lots of work to do on the site.  I need to convert over my other pages to match the new layout, there are still minor bugs and issues I’m sure hidden someplace that I need to try to track down, and I just need to spend time to learn more about EE.

As my girlfriend said when I said I was almost finished updating my site… Rock On!

Posted by AlanBarber on 06/02/2004 at 10:11 PM
Bookmark and Share BloggingExpressionEngine • (6) CommentsPermalink

Sunday, May 16, 2004

Get a free copy of ExpressionEngine!

pMachines is giving away free copies of their ExpressionEngine web publishing program.  Basically, it’s a weblog program.  It’s costs $149.00 for a non-commercial license and $199.00 for a commercial license.

In the wake of the MovableType debacle they offered to give away 1000 copies.  Long as you have been running a personal blog for more than 6 months you qualify.

Actually it’s a little too late now because they already gave out 1000 copies.  However, they are extending the offer so you have until midnight pacific time today to contact them.  They’ll pick another 250 random people to get copies.  So visit their site to read the rules.

I got lucky and got a copy!  So it’s official now.  I’m going to switch this blog over to ExpressionEngine.

Now before any of you poo poo me for using a commercial product let me restate the facts.  I mean yes I said in my last post that I would look for an open source and free blog program to replace MT but that’s just because I’m a cheap guy.  Why pay for something when there are perfectly good free ones out there.  I have no problem with the folks at SixApart wanting to charge for MoveableType.  I’m no open source, free software zelot.  Far from it!  My complaint stems from the fact that had promised that MT 3.0 would be free.  I quote from a December MT news post.

quote:


we’re focusing on releasing more personal features in the basic Movable Type package, and concentrating features for businesses, organizations, and large content-driven sites into Movable Type Pro (which, needless to say, has been delayed).

The next version of Movable Type will be version 3.0, a significant and free upgrade.
. .
. Movable Type 3.0 will be a free download and upgrade.


Now obviously I summarized but from reading that you get the jist that MT 3 will be just as free, as in price and lack of limitations, to use as MT 2 has been.  Some place between December and now they changed their view and they should have had the courtesy to tell everyone.

This is why I’m upset.  They didn’t show any support or respect to their users and the community.  I mean heck even big bad, evil Microsoft actually talks to their customers and tells them ahead of time that they’re going to change their license schemes and prices of software!  Sure the prices and license schemes are still horrible and screw the customers but at least they were given warning.

So anyways I’m going to install the ExpressionEngine on my test server.  I’ll spend some time learning how to use it, building templates, etc so I can make the conversion as painless as possible here.

Posted by AlanBarber on 05/16/2004 at 03:34 PM
Bookmark and Share BloggingExpressionEngine • (4) CommentsPermalink
Page 1 of 2 pages  1 2 >