WWW posts page 40

New Theme Again

It wasn’t long with that last theme. It had some undesirable issues, such as the cut off code blocks, no page tabs, and a few general appearance things. I had looked at this Monochrome theme before and skipped over it because it lacked differentiation for “code” blocks. However, I’ve discovered that it does put any “pre” blocks into boxes, and they have overflow set so that any cut off width can be scrolled to. So now I’ll just have to go back and put everything in “pre” blocks, and it should be much more readable.

The theme is very clean and simple and almost monochromatic, fitting better with the current theme on my own site. I like how post meta information is set to the side in such a way that makes it more readable as well as the post. I don’t like the dates on pages, but I’ll live with that. There is a fair amount of “white” space, making things more readable, comfortable, airy.

I would like it to have a flexible width, so that my code blocks don’t have to be so scrunched if they don’t need to be. It lacks header differentiation, but it doesn’t seem to matter as much since the headers stand out less in general and the break in meta information differentiates posts. It uses a fair amount of medium-gray on semi-dark gray, which does not pass WCAG luminosity ratio requirements and thus can be hard to read: I’ll live with that for the other benefits I’m getting.


PHP Functions: Array as Argument

A while back, I wrote about using the JSONesque literal value parameters in Javascript, like jQuery does. This allows arguments to be passed: with names, in no particular order, all being optional. I set it up so that multiple arguments could be used as well, allowing for existing functions to still work or people who prefer that syntax to have it. I will now write about something similar for PHP.

In PHP, it is not quite as elegant, but almost. An array with key-value pairs is passed as the single argument for named argument mode. So you could call like this:

testFunction(array("arg1"=>"value1","arg3"=>"value3","argCallback"=>"testCallback"));

or with regular arguments:

testFunction("value1",null,"value3","testCallback");
Continue reading post "PHP Functions: Array as Argument"

Awstats

I am using Awstats for my site statistics on both my home server and my dreamhost host. Dreamhost provides statistics with Analog automatically installed, but I prefer Awstats. Awstats is very good at accounting for robots and has a nicer interface. It is also more configurable since I have access to the full configuration files.

I used the following method to use one install of Awstats for the multiple sites I have hosted on each server. I use SSH. If you don’t have that available, you can modify the instructions to work with FTP. The symbolic link (ln -s) bits would have to be modified. You’d simply put the actual configuration files in the cgi-bin directory (the conf directory was merely a convenience for upgrades) and probably put the actual “wwwroot” directory in the proper location on the site.

These are just my setup notes, so apologies if they are cryptic:

Continue reading post "Awstats"

WordPress.com: Webmaster Tools and Site Explorer

I’ve been using Google’s Webmaster Tools and more recently Yahoo’s Site Explorer for my other sites.  They allow me to see crawl errors, keywords and some query ranking info, crawl statistics, and some other search engine related info as well as set some settings for how these engines handle my sites.

Because of the way these sites validate ownership of submitted sites (an uploaded file or a meta tag), I didn’t think I’d be able to use them with WordPress.com.  However, with a little searching, I found this page, which says how to do it.  In fact, had I payed more attention when exploring the admin section of my account, I might have noticed that the capability is built into the “Tools” page.

You just submit the URL like for other sites, then choose to validate with the meta tag.  Copy the meta tag and paste it into a specified field in that “Tools” page.  “Save Changes” and then press the validate button on Google or Yahoo.

This worked instantly on Google.  For some reason, Yahoo is just saying “Failed”.  Since it says it may take 24 hours to validate, I guess I’ll have to wait.  You’d figure a message other than failed would be used to say that it hasn’t been validated yet, but I’ve looked at the source of the page and verified the meta tag was there.

[Update 1/24/10] Finally Yahoo has validated by retrying. I had done this a few times spaced out after the initial setup, but it had just failed. I’m not sure why it finally worked. [update]


New WordPress.com Theme

I searched through every 2-column theme with widget support in WordPress.com’s repository (there were 58) in an attempt to improve the appearance of my blog. The main problems with the old one were that levels of headers weren’t differentiated well enough (the second level ones looked like first level) and the code blocks weren’t separated from other content well enough. I couldn’t find one template that I was fully happy with. Every one had something I didn’t like, and very few even had both good code block separation and good header differentiation.

This theme (Neat!) is one of the few that did well enough with those issues and overall for me to choose. It has nice distinct code blocks and I can easily tell the difference between headers. I’m not big on the colors or the header (though that’s configurable). It removed my tabs for pages, but that was no biggie. A few other minor issues. I may stick with it for my tenure at WordPress.com.

Continue reading post "New WordPress.com Theme"

Lynda.com Training Again

Since I am not in school or working at the moment, I think I am going to learn some more using Lynda.com, with a normal subscription this time. Hopefully I’ll be able to pick up some skills that will help me get a job, or maybe help make me more attractive for freelance work.

Lynda isn’t as much into development as design courses, but they do have some that’ll help me. I plan to learn Drupal, Joomla, and ASP.NET, which are popular items in the job postings I find. I could learn some of this without paying any money, but Lynda I can just sit and go through without searching and reading random articles or reading large books, and I can still do those as well if the Lynda course isn’t giving me enough.

I considered picking up a class or two at Tri C. However, one class would cost more than a year of Lynda, and the classes are on a rigid time schedule, not at my own pace where I can start and stop as I please. The classes I wanted are all online there anyway, so I wouldn’t get the classroom benefit.

Continue reading post "Lynda.com Training Again"

WordPress: XML Sitemap with XSLT WordPress Theme

For the Canine site, we wanted to have an XML sitemap to help search engines index the site. The sitemap can help search engines find all content on the site as well as tell it which pages are most important, how often they are updated, and when they were last modified.

There seems to be a number of plugins to generate the sitemap automatically for WordPress, but the Google XML Sitemaps plugin seems to have the highest rating and have gotten the most mention in blogs. Jason had used this plugin already for his site, so we knew a little about it already, thus we went with it.

After some minor configuration, it worked just fine. It regenerates a static file every time a page or post is updated. Not as dynamic, but it saves processor time. I doubt the plugin will work with Pods at all, since that’s outside the posts/pages dataset. Our Pods content probably won’t be as important anyway. I could potentially look into modifying the plugin if need be for that.

Continue reading post "WordPress: XML Sitemap with XSLT WordPress Theme"

WordPress: Multiple Dynamic Sidebars

I’m making a “blank” type template for WordPress that I’ll be able to modify for sites as I develop them.  I wanted to make sure my template was compliant with the dynamic sidebars feature of WordPress and have multiple sidebars already there for quick creation with new sites.  I wanted the first to have some default content, while the others would not be displayed unless they have dynamic content.  I suppose that might not end up being useful for the fixedness of the one-off designs I’ve been doing, but we’ll see…

The tutorials I found didn’t discuss how to make the container for each of multiple sidebars display only if the sidebar had dynamic widgets.  The is_dynamic_sidebar() function is what was needed.  So I register my sidebars like normal, in “functions.php”:

if(function_exists('register_sidebar')){
register_sidebars(2, array(
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
}
Continue reading post "WordPress: Multiple Dynamic Sidebars"

Canine Lifeline: Meeting and Start

Jason and I have begun work on the Canine Lifeline site I had mentioned as a freelance project.  It will be for free (they are a non-profit) but will be good experience and we will get our names and links in the footer.  As our first project outside of school together and my first real freelance project altogether, the experience should be great and free should make it more relaxed.

We met with the clients on Sunday to discuss the project.  We met at Yours Truly in Valley View and discussed the site over lunch.  They all were very nice and seemed to know a good bit about websites and what they want, which should help a lot.  They gave a good idea of the functionality and content they wanted, as well as some basic thematic ideas.

Their current site is a simple four pager built with a template and hosted for free with adverts.  We will be building a many-page CMS for them, using WordPress after our experiences with the Stearns project, so they can make frequent updates.  They want a dynamic site that entices people to visit frequently for updates.  They, like Stearns, will need some custom data types, so I will be using Magic Fields again as well as trying out Pod CMS, which should allow for more complex uses of data.  We shouldn’t need multi-column pages for this site, so we hopefully won’t run into the TinyMCE editor troubles we had with Stearns.

Stylistically, they want a blend of professional looking with bright and colorful.  Since Jason is the designer of our duo, I will let him handle most of the theme design while I work on the functionality of the site.  I do want to at least give a try at a couple of hand drawn mockups though.

Since this is about all I have going on, I will continue to post about this project, how its going, and anything I discover from it.


PHP Parser for RSS Feed From WordPress.com

I’ve been working on my own site a bit since getting out of school. I’ve been pulling an RSS feed from this blog onto my homepage for a while now, using something based off of this script. I try to keep the markup valid. The feed has given me a bit of troubles for valid markup, mainly with escaping ampersands. One problem was that I was using this function:

function pagFixRSSEncoding($argString){
    return mb_convert_encoding($argString,'HTML-ENTITIES', 'UTF-8');
}

which I had gotten from somewhere. I’m not sure what it does, but it seems to do nothing for me. I removed it, though I’ll reinstate it or look for something else if characters other than ampersands give me trouble.

I was also using this function:

function pagFixLinks($argString){
    return str_replace("&", "&amp;", $argString);
}

to fix the ampersands in the “link”. This simply replaces all ampersands with the proper HTML entity in the passed string, works just fine.

Continue reading post "PHP Parser for RSS Feed From WordPress.com"