SVN access available! – phpWebSite

Version control access has been restored to the phpWebSite project.

SVN access available! – phpWebSite

I had a bright idea last week.  One of the annoying aspects of phpWebSite maintenance is downloading individual modules, expanding them, and copying them over the existing modules. Why not use Subversion to update the core and mod  directories of phpWebSite? The procedure would be the same as that advocated by WordPress here. Since I recently added the Subversion client capability to my remote host, the update process would be much smoother, less error prone, and consume less bandwidth.

As a test I checked out a copy of the development version of phpWebSite to my PC. I run a local test site under Windows using XAMPP. Yea, I know I am weird thinking I can run phpWebSite under windows. I then copied over the files I needed from my existing configuration and renamed the directories. Then I went into Boost and updated the modules. After fixing the windows specific errors with updating FileCabinet and menu(i.e. creating directories did not work) modules, all of the modules are now updated and I am ready to update the site using subversion next time.

Now to make this whole scenario work for a production site we need a little help from the folks maintaining the Subversion repository. I would like to use Subversion to get the stable version rather than the development version. If they would create a tag for the stable release like the folks at WordPress, then I could use the Subversion “switch” command to update to the latest stable version. I use the switch command with WordPress to update my test blog and this is a slick way to update the files.

Updated phpWebSite Bleuprint theme

In a previous post I started creating a phpWebSite theme based on Blueprint. My plan is to convert an existing phpWebSite to the latest version but a theme for the latest phpWebSite(1.3.0) is not ready yet. Since my idea of humor is frequently referred to as cheesy I am calling this new theme, Bleuprint.The theme has a lot of neat stuff since I incorporated a lot of toys into the theme. However, it is not ready yet. It is still a work in progress. At this time I have both the web page and article module pages on my front page. I am leaning to using the Article module for most of my content but I am still working through various annoyances. Make me a believer, Eloi!

My demo site is at http://demo1.wehuberconsultingllc.com/.

  1. Merged Blueprint into the default phpWebSite theme.
  2. Fixed phpWebSite annoyances.
    1. Create new module templates to replace the <h1> element with the more search engine friendly <h2>.
      1. Sitemap
      2. Blog
    2. Create a tabbed menu for the new site. I want to keep the tabbed menu design from the old site.
    3. Change the calendar colors and layout.
    4. Fix control panel layout problem for form designer with Firefox.
  3. Add new features to the template.
    1. Add jQuery support(http://jquery.com/) so I can use ThickBox for viewing photos(http://jquery.com/demo/thickbox/). Thanks to Cody and the folks supporting jQuery development.
    2. Add zebra table suppport via jQuery(http://tablesorter.com/). Thanks Christian! Note: You must edit the /config/core/textsettings.php file to allow <thead> tags. No thead, no worky!
    3. Add drop shadows to photos. I ported this visual toy from one of my favorite WordPress themes, Misty Look(http://wpthemes.info/misty-look/). Thanks to Sadish for creating a great theme!
    4. Add a rounded corner search box with jQuery field replacement. Thanks Brian! http://blog.reindel.com/2007/08/13/howto-spruce-up-your-search-box-with-css-and-a-background-image/
    5. Add CSS liquid rounded corner box to template. Thanks Mark! http://www.search-this.com/2007/02/12/css-liquid-round-corners
  4. Evaluate module support.
    1. Article 4.0 module(Remember to patch the control panel per the instructions).
    2. Mailto module(Not supported)
  5. Bugs and Redesign(?!)
    1. Where is Coming Soon in Calendar?
    2. Where is What’s Popular block for Articles
    3. See if I can create a list menu template of just simple <li> links.
    4. Redesign comment template to be more like copyblogger.  

Updating PHPUnit on XAMPP

I have decided to do some playing around with unit tests for PHP. I saw a video on Getting Involved in WordPress and it reminded me of my interest in unit testing. Now I almost want to create some unit tests for verifying WordPress plugins or phpWebSite code. Fortunately, common sense will prevail and I will restrict my activities to playing. The instructions at Chapter 3. Installing PHPUnit looked pretty easy but since I wanted to do my testing under XAMPP I knew there would be problems. Hopefully the problems would be minor.

Confirm the PEAR configuration

The first thing I did was to open a command window in the PHP directory under xampp and ran the following command.

pear show-config

This command prompting elicited an error about improperly set environment variables. So I edited the file and inserted the full path to the XAMPP directory. I tried the command again and it showed the PEAR configuration. I checked the installed packages and it showed PHPUnit to be version 1.3.2. I would like to use the latest version so I am going to follow the instructions from the documentation.

Update the channel and install the PHPUnit

The next commands I tried were to update the channel and install PHPUnit.

pear channel-discover pear.phpunit.de

pear install phpunit/PHPUnit

The channel command worked. The install command did not work since it wanted the a dependency updated, GraphViz. After updating the dependency I ran the install command again. It installed 3.1.7 and it said I could also install pdo_sqlite and xdebug. I tried to install these extensions but they ended with a DSP error.

Test the PHPUnit

To test the installation I created a new folder under htdocs called phpunit so that I would have all of the unit test files in one spot. I quickly found out that I needed a copy of the phpunit.bat file in that directory, too. This file is in the PHP folder and it has the correct path to the php.exe file. I copied the example ArrayTest from the documentation into a file called ArrayTest.php and ran the command, “phpunit ArrayTest“. It worked. Now I can move on to more sophisticated unit tests.

Final Fixups

After a little searching I found that the xdebug and pdo_sqlite extenstions already exist in the extensions folder. XAMPP installs all of the extensions but only enables a couple of them in the default installation. All I had to do was to edit the php.ini file, remove the semi-colon in front of these extensions, and restart the web server.

Communication Styles and the Future of phpWebSite

I have been pondering for some time whether to convert existing web sites from phpWebSite to WordPress. It is difficult for me to think about these things since I quickly jump to the implementation details. So I decided to back off and look at the problem from the viewpoint of communication styles. For this quick analysis I am going to compare the diary, magazine, and product brochure formats to their Internet counterparts. These communication styles have existed for a long time in printed form. I think a little pondering on where these formats came from and where the web site versions of these formats are going will give me a better strategic view.

Diary Format

  • History – The diary format is the model that blogs originally copied.
  • Frequent Updates – One of its characteristics is that it generally involves short posts on a daily basis. This feature of blogs was quickly adopted by news organizations for syndicating news over the Internet.
  • Conversational tone – A key characteristic of both diaries and blogs is that they have a conversational tone.

Magazine Format

  • History – The magazine format came about as printed magazines established a presence on the Internet.
  • Monthly Updates – Originally the web sites mimicked the printed version and were updated on a monthly basis. As magazine publishers adapted to the positive and negative impacts of the Internet on their business, they eventually adopted RSS syndication for more frequent news updates(daily) and email newsletters for less frequent updates(weekly).
  • Both formal and conversational tones – The magazine format has traditionally had a mixture of both a formal tone and a conversational tone. The articles had a professional/formal tone while the editorials has a more personal tone.

Product Brochure Format

  • History – The product brochure format came about as businesses wanted a web presence to support their sales operation. Originally these sites were fairly static web sites that reproduced the sales information that already existed in brochure form.
  • Infrequent Updating – Most of these sites were static sites. It was commonly understood that if you wanted current information you need to call them on the phone. Many business site have since migrated to dynamic content. FAQs became an easy and quick way to support customers after the sale.
  • Primarily a formal tone – For the most part the tone used by these sites can be described as professional.

So how does WordPress and phpWebSite stack up in these areas?

  1. WordPress
    • The origin of WordPress is as a blog and it is one of the best blogs out there. It has a great development community out there.
    • WordPress has shown a lot of versatility and has expanded into the magazine format. Here is an example of the magazine format, Darren Hoyt Dot Com » Blog Archive » Mimbo v1.1 Released.
    • Although you can use WordPress as a simple product brochure or Internet sales site, it does not scale up as well as other packages. A few months ago I wrote a post in which I said that a nonprofit with a “product brochure” styled site might be better served by going to a more conversational format.
  2. phpWebSite
    • The blog portion of phpWebSite was originally called Announcements. phpWebSite can function as a blog but WordPress is free and a better blog.
    • The magazine format is probably the best use for phpWebSite. The “What’s Related” feature is a great feature. Similar features can be added in WordPress via plugins. I think that articles and calendars are the areas of with the greatest potential over WordPress but the phpWebSite development community is more limited.
    • Like WordPress you can use phpWebSite as a simple product brochure site but it does not scale up as well as other packages. Using the template system for product brochures is tempting because it may integrate the key data while allowing it a bit more scalability.

So there you have it. Both WordPress and phpWebSite are pursuing the magazine formats but phpWebSite is a more natural fit for the magazine format at this time. WordPress has a much larger development community but it has many diverse interests. The primary interests for WordPress is the blog format so it is hard to tell who has the better development community in the magazine format area.

Creating a new theme for phpWebSite 1.3.0

I finally bit the bullet and decided to create a new theme for the new version of phpWebSite. Part of my problem with starting this project is that I think that WordPress might be a better solution for these web sites. One of the big advantages that WordPress is an abundance of good looking, standards compliant themes. It probably would not be that hard to migrate one of the old phpWebSite sites into WordPress. The other site has a couple of features that would require a lot more research so I opted to proceed with the theme redesign project.

In a previous post I talked about the “Blueprint: A CSS framework”. I would like the new theme to most like Misty Look. In a previous post I mentioned that I have used this for a charity blog in the past. For kicks I want try out the Copyblogger theme, too. I also want to add jQuery support so that I can use ThickBox. So here is my plan.

Phase 1

  1. Create a new theme which merges Blueprint into the default phpWebSite theme.
  2. Fix phpWebSite annoyances.
    1. I will create new module templates to replace the <h1> element with the more search engine friendly <h2>.
    2. See if I can create a list menu template of <li> links.
    3. Create a tabbed menu for the new site. I want to keep the tabbed menu design from the old site.
    4. Change the calendar colors and layout.
  3. Add zebra tables, drop shadow, and ThickBox support.
  4. Redesign comment template to be more like copyblogger.
  5. Evaluate Article 4.0 module.

Status

At this point I have a workable replacement for the original site. Most of the stuff works but I am still checking it out. I have not made the changes to the comment template, the list menu template, or checked the new version of Article. I will probably be updating to the latest version(1.3.0) of phpWebSite on the demo site in the next couple of days. To view the results go to my demo site at http://demo1.wehuberconsultingllc.com/.

Phase 2

Now it is time for me to separate the specific theme data from the common theme data. I expect to create four theme variations and a theme to display a design grid.

  1. Default Blueprint
  2. Misty Look
  3. Copyblogger
  4. Copyblogger organic.
  5. Display grid

Phase 3

Convert the old data into the new phpWebSite format.

Using CSS Page Breaks in phpWebSite

I spent some time this week fixing up the print versions of some html pages. You could call the pages, product pages, and they are the most likely candidates to be printed by a customer. They looked okay in the browser but they suffered when printed. IE had the most problems. I thought a print.css would help but it didn’t. FireFox and IE disagreed how the printed page should look. I ended up tinkering with them to get them both to print acceptably. Forcing page breaks helped out considerably. Initially I created a new section in phpWebSite in put a paragraph with a css class that would force a page break. This worked but it was kind of clunky. So my final solution was to modify an existing phpWebSite section template to give me a page break after the section. This way I can select the modified template for those sections I want a page break after. I looking forward to the day when I migrate this phpWebSite system over the new version and use a regular html page. I learned to use sections in phpWebSite to get the site up but I am not a fan. I have enough experience with them now to say I would be more productive without them.

I really want a nicely formatted Acrobat version of the web page but that is a project for a different week.

Technorati tags:

One-pixel table border with CSS

Problem

I want to have a one-pixel one-color solid border around a table and its cells. Adding border="1" to the table tag isn’t suitable, because it looks horrific in most of the browsers.

Source: One-pixel table border with CSS

I was confronted with this same problem in phpWebsite. I was using a table to display the pedigree of a horse with the border set by using border="1". I am not sure what it was doing but it looked pretty ugly. His solution for a default one-pixel border looked pretty simple and elegant and I was determined to figure out a way to use it.

table
{
    border-color: #600;
    border-width: 0 0 1px 1px;
    border-style: solid;
}

td
{
    border-color: #600;
    border-width: 1px 1px 0 0;
    border-style: solid;
    margin: 0;
    padding: 4px;
    background-color: #FFC;
}

When I tried to use this code as the default definitions for table and td elements used by phpWebsite I found it affected multiple areas I did not want changed. I needed to refine its use via selectors and the ID selector was my first choice. I had used the Class selector before and it involved a lot more work adding it on table and td elements. The design of phpWebsite uses section templates for creating formatted content on web pages. So I added the above CSS code to my site CSS but prefaced it with the #mytable ID so that I would override the default table definitions only in #mytable blocks. Then I created a new section template to wrap a <div id="mytable"> around the existing content. All I needed to do was go back and update the existing sections containing the tables to use the new template. Within a fairly short time all of my tables had their ugly border replaced with a simple 1 pixel border.

Technorati tags: ,

phpWebSite 1.0.0 and XAMPP

I just finished installing phpWebSite on XAMPP . I am a fan of phpWebsite and use it as inexpensive CMS for a couple of web sites. Probably the biggest problem with phpWebSite that I have found is that it is not supported by some web host providers. WordPress on the other hand is supported by most web host providers that I have checked. In some cases WordPress can accomplish the same CMS-like features with less fuss.

For those people who are not familiar with XAMPP, it is an easy way to install an Apache web server, MySQL, PHP and Perl on a windows box. I installed XAMPP when I was tweaking a new theme for WordPress. The installation process was quick and simple. The editing environment was more convenient than a LAMP server on a cheap, local PC or a virtual machine.

There were a few ambiguities to deal with in installing phpWebSite 1.0.0 on XAMPP.  XAMPP installs the latest versions of Apache, PHP, and Mysql. This can cause some problems.

  1. Most people had success if they installed using PHP version 4. What this new version work with PHP version 5. The problems seem to be centered around support for the PEAR libraries.
  2. What are we supposed to do about file and directory security? The phpWebSite installation directions talk a lot about running shell scripts.

After researching XAMPP and phpWebSite I decided to go ahead and follow the instructions provided here. Since the instructions were a little sparse I decided to take notes.

  1. Download phpWebSite 1.0.0 and extract the contents. I placed the contents in a subdirectory called “phpwebsite” under the “htdocs” directory.Create User
  2. Edit the Apache configuration file, “httpd.conf”, and around line 118 remove the # in front of “LoadModule rewrite_module…”. This will turn on the Apache rewrite feature and get rid of the server error message.
  3. Verify the changes by entering http://localhost/phpwebsite/setup/ into your favorite browser. You should get the phpWebSite 1.0.0 – Site Setup screen if everything works correctly.
  4. Before proceeding with the setup you need to create the database and database user. In my case I am going to create a userid and database called phpwebsite. Enter http://localhost/phpmyadmin into your browser and login into phpMyAdmin with your root userid and password.
  5. About the middle of the screen click on the Privileges link. This will take you to the User Overview screen.
  6. Click on the Create New User link. This will take you to the Add a new User screen.
  7. Enter phpwebsite as the username. Use the drop down box to select local for the host. Enter a new password for the user in both boxes. Write down the password if the password is hard to remember. You will need it later. In the box called Database for user, click on radio button to create database with same name and grant all privileges. Now scroll down to the bottom of the page and click on the Go button. If all goes as expected, the database and user are created and you are ready to install phpWebSite.
  8. Enter http://localhost/phpwebsite/setup/ into your favorite browser to get the phpWebSite 1.0.0 – Site Setup screen. At the end of the text click on Begin Installation link.
  9. You should now see the Create Config File screen. I accepted the default values and clicked on the Continue button.
  10. Default Create Config FileOn the next screen you will need to make sure that phpwebsite is entered in the box for Database Name and Database User. You will need to enter the User’s password you created above into the Database password box. The Host Specification should be localhost and the other boxes can be blank. Click on the Continue button to go to the next screen.
  11. The installation process should begin and it will present you with a series of screens showing the log file of the installation process. At the bottom of the screen there is a Continue Installation link you need to click on to go to the next screen. Eventually it will ask you to create a phpWebSite user. Otherwise I kept clicking on the link until the installation was complete.
  12. I went to website page and it worked. Evidently I can install and run phpWebSite with PHP version 5. I logged in using the phpWebSite user and password I just created.
  13. My next step was to download new Core and Boost modules from the phpWebSite. Here is the link, http://phpwebsite.appstate.edu/blog/1215. I expanded these files onto my Desktop and then copied the files over the existing phpWebSite files. Finally I went back to my browser and updated the Core and Boost modules using Boost. Next I checked the versions of all of the core modules by clicking on the Check all link at the bottom of the page. I downloaded the new module versions, extracted them onto my desktop, copied them over the original files, and updated them using boost.
  14. Next I installed all of the Other modules. You can be more selective and only install the modules you want but I installed all of them. Then I check their status and updated them the same way I updated the Core and Boost modules.
  15. At this point you can start installing third party modules. I installed the Wiki module since I have one site that use it.
  16. The phpWebSite portion of the installation is essentially complete. However, the site is not ready to use. I still need to do major surgery on my old themes and convert the data.

So here is where I will stop. Converting the themes and data will require some thinking and planning. There have been some significant changes in this version so the changes required are not obvious. I hope this post has helped you.

More phpWebsite theme changes and hacks v2

Well I finally went after the rest of the annoyances I have with my website layout for the farm. I had been thinking about modifying the color scheme so one thing led to another. The first thing I went after was cleaning up my positioning in the mast head. As a quick fix I had thrown in a blank line to fix the positioning of the divs. I meant to go back and take it out but I never got around to it. Positioning divs can get pretty funky. By using float:left and a large enough width on the top div I can get correct positioning. Now I have the horse jumping over the navigation bar in both IE and Firefox.

The tough part was fixing up my right content. I have a two column design with a fluid left content column. The problem appeared in several differnt ways but the best example was the dotted bottom border would wrap to the left content. I would get about 10px of border on my left content. I think I solved this problem with right padding on the right content. Now I had a positioning problem. My right content was right next to my left border. In some cases it would overlap my left content and it seemed oblivous to left margin or padding. After some playing around I found that increasing the right margin on my “left content” moved the text in my right content to the right and gave me a faux left margin on my right content. Oh well!

My final fixup was the linkman module. phpWebSite uses tables to display url link info. The default setup overlapped my right content when I viewed it using FireFox. Despite my efforts to convince FireFox that my table was only 600 pixels, it ignored me and calculated the table width. IE was a little better. It resized my divs to make everything fit. Not what I asked for but it was a better looking failure. I played with a lot of stuff but ended up reformatting the table to a smaller size by removing the url column. With the remaining columns FireFox and IE would calculate a smaller width for the table. I put the url field in its own row that spanned the columns and reduced the font size. So for every link I used three rows rather than two rows. The first row had the Title, Visits, and Date Posted. The second row had the url and the third row had the link description. Now the Links page was truly usable.

More phpWebsite theme changes and hacks

Well it took me a long time but I finally got around to researching and fixing some annoyances. This all started with some text in the right column that flowed over into the center/left column. In this case it was a calendar event. So I went looking for the likely suspect, an unnecessary table, and replaced it with a div in my theme. One of the nice things about phpWebsite is that you can overide the default layout in your theme.

Since I was mucking around I decided to go after some other annoyances. In this case I cleaned up the layout for the Announcements and Article summaries by getting rid of extra fields. The “Read” field does not a value for Announcements and the “Print” and “Email” icons are annoyances for the articles especially since I have a print.css and the icons cause the page to not validate. In this case less is more.

While I was at it I turned off the login block since I am the only one who uses it and I know how to get to it.

My final fix was to modify the template for the backend feed. I was not getting my feed graphic to show up in RSS Bandit. I found that the variable in the template was specified incorrectly for the URL feed. The module creates a thumbnail for the feed and it was too small for me. So I faked it out by manually replacing the thumbnail with a slightly larger one.

phpWebSite/Mysql problem

One of my websites had a corrupt database two days ago. When I went to cPanel to check and repair it, the process never completed. I ended up submitting a trouble ticket to
bluehost.com
. They replied in a couple of hours and offered to restore the database from the weekly backup. I told them to go ahead and restore while I downloaded the backup. The site is fairly static for the last couple of weeks so I am sure I did not lose any data. The site is back up but I need to do some investigation work on why mysql got corrupted in the first place. I have occasionally had this problem with this site but I always was able to fix the problem using the repair facility. I think I will expedite the move to phpWebSite 10.0.

More additions to PHPwebsite

It looks like the latest version of Article manager is now 3.0. I will check it out in the next couple of days. A new plugin, xwysiwyg, caught my attention. You have to read the comments on the post to find its features.

FEATURES
========
-HtmlArea included 3.0 RC1
-FCKeditor included 2 beta 2
-Some plugins for HtmlArea
-Some Skins for FCK
-Settings for both editors
-Only one PhpWebSite file (wysiwyg.php) is to hack
-Easy install
-For PhpWebSite since 0.9.3-4
-Should work with IE5.5+ , Mozilla1.4+ , Firefox0.10.0+

You can find both of these at: https://sourceforge.net/projects/phpwebsite-comm/
(section files)

Mysql error

DB Error: unknown error
delete from cache where mod_title = 'layout' [nativecode=1030 ** Got error 127 from table handler]

I got this error at the Legacy Farm website his morning on the mysql database used by phpwebsite. I ran a check via cpanel on the database and an error popped up complaining about the cache table. I ran a repair via cpanel to fix this problem. I have had this problem before and fixed it the same way. I do not know what triggers this problem but I found a can minimize the effects of it by checking the website each morning.

I am back at Article Manager 2.7

I found several bugs in Article Manager 2.8 yesterday so I went back to 2.7. This first bug appears on the home page as a separate block. It says it cannot find an article in a red font and then proceeds to create normal looking Article Manger block below it with all of the current articles. Then I tried to create a new article it said the template was missing. I do not know why I did not find these bugs earlier.

While trying to identify the source of the bug, I ended up screwing up the tables and had to selectively restore the tables from backup. It sure is nice that bluehost.com performs daily, weekly, and monthly backups.

Article Manager 2.8

Eloi has continued to refine Article Manager. The latest verions is 2.8. I have used it on two sites and I like the results. Most of the documents I want to publish fit into the style he supports so we are a good match. I am sure I could use a different style with Article Manager but I feel a need to publish more before going back to playing.

print.css for phpWebsite

I finally got around to creating a print.css for one of my phpWebsite-based websites. The site is an almost table-less design so all I had to do was turn off the blocks I did not want to see on the print document. I was kind of forced into creating it since the default print icon provided by article manager and elsewhere created a printable document with too much of the basic formatting stripped out. Now the printed documents are pretty usable.

Updating phpWebsite the easy way!

Yesterday I decided to update one of my sites to the latest version of phpWebsite. I had already transferred the file to website when I accidentally went into the Fantastico script facility. I had used Fantastico to install phpWebsite successfully. I assumed Fantastico was used to “just” install new applications. Updates are much harder than clean installs. So I was surprised to see it tell me that some of my applications were out of date and that I could update them. I know I had gone into Fantastico before and never saw these messages. Since I had a current backup and already had a copy of the config.php and my customized theme directory I decided to give it a try. It worked! Better yet my customized theme and my third party mods still worked despite the disclaimer messages from Fantastico. Fantastico is great!