WWW posts page 41

Done with school

School

I’m done with school. The semester is over, finished on Wednesday.  I also happened to have finished the last classes for my degree.  For all intents and purposes, I have graduated.  I’m not sure when it is official or what not.  In fact, I’ve received almost no information on graduation, the ceremony, anything.  As I recall at Kent, they were sure to tell us not only about the upcoming graduation but about the cap and gown we needed to purchase, etc.  I was much more aware of what was going on.  At Tri-C, I’ve only recently come to the conclusion that the ceremony is most likely only done once a year, in May.  Not sure if I get my degree before then or what.

So now I have little to do.  I have no job and no school, two of the more time consuming parts of my life thus far.  I am considering taking another web-based class or two next semester.  That could be nice if they aren’t too hard.  If they are, it might be hard to enter into a full-time job (hopefully), work some freelance projects (hopefully), etc, and still do alright.  If they are too easy, I might as well just get books and use online resources instead, and be able to learn exactly what I want at my own pace.  I’m still thinking on this.

Jobs

As my monetary reserves drain, I am in the process of looking for a job, and will look much harder now than I had while still in school.

I did have promising possibilities come up at a recent Tri-C IT event.

Continue reading post "Done with school"

Stearns: Internet Explorer workarounds

We’ve had to do a bit of work to get our site working properly in IE, mostly version 6. I’ve recently started using a conditional stylesheet just for IE6 on my own site, like:

<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url')?>/styleIE6.css" />
<![endif]-->

and we did the same for Stearns.

Box Model

One issue we dealt with for IE6 in the conditional stylesheet was box model issues. IE6 handles margins, padding, and borders differently than other browsers, so we compensated for this in some places. One big issue was with our floated columns: The third would float below the second on some wide pages.

Continue reading post "Stearns: Internet Explorer workarounds"

Worpress Page Template Next & Previous Links

I ran into this problem on the Stearns events and recipes pages, which both use custom templates pulling in posts from a particular category.  We use the query_posts() function on those pages.  The next_posts_link() and previous_posts_link() functions are used on normal multi-post pages to navigate through more items than appear on one page.  Using the query_posts() function without the paging, such as:

query_posts("cat=4&limit=5")

the paging doesn’t work at all: It just shows the same results for each page. To get this to work, you must tack on the “paged” parameter with the “$paged” wordpress php variable, like:

query_posts("cat=4&limit=5&paged=".$paged)

and pagination will work just fine. You can only do this for one set of items, but you’d want to break out to a separate page for multiple anyway.


Stearns: Slideshow, Media Tags

We wanted an image slideshow for our sidebar. I looked at some of the plugins available for doing this, but none looked to be exactly what we wanted, nor did they look very simple. I’ve worked with jQuery before with various image things, so I used it to build my own slideshow (building it in OO added to the development time, but it should be fairly versatile now). Then I had to get the appropriate images from WordPress to work with my javascript, which was quite a bit of work as well.

We want the images to easily be updatable by Stearns.  I don’t know why I was dead-set on having them be able to use the media library, but I was.  They could FTP files into a folder, which would be much easier for me.  But they might not even know how to do this, and letting them handle everything through the wordpress interface is preferable.  They’d have to crop and size them properly.  The images in the folder also wouldn’t have captions.  So I pressed on.

I thought perhaps I could have them update a gallery on a particular page, after having thought the gallery function wass very neat.  But it seems there is no way to add items from the media library to a gallery for a page (not in regular wordpress anyway) and I’m not sure that the “delete” link does what I want for removing items from the gallery (and I’m not willing to try).

Continue reading post "Stearns: Slideshow, Media Tags"

Stearns: Two Content Columns Per Page

Our layout has some pages with a three column layout and some pages with only two columns.  The left column is always the same, but the other two will have one or two columns based on individual page content.  For a while, we’ve had the third column on the home page and an empty third column on other pages, but we ran into troubles when we wanted to add the third column content to the other pages.

The columns use float to get their positioning and can’t be inside each other or the text from one would flow under the other.  A few options came to mind.  We tried closing template divs and opening others in the HTML editor of the page content: this did not work for us, somehow removing the background that was supplied by a wrapper.  It would be trouble for Stearns anyway.  We also tried removing the container for the center column from the template and putting one div into two column pages, two into three column pages.  This gave some difficulties with the editor, would require the divs on every page, and would be difficult for Stearns and us to work with.

Continue reading post "Stearns: Two Content Columns Per Page"

Stearns: Flutter now Magic Fields, Adminimize

Flutter/Magic Fields

Magic Fields is a fork of Flutter that is open source GPL and seems to have more active development going on.  It also seems to be much more streamlined and simplified.  It doesn’t have all of the features of Flutter, but I didn’t know what those features were anyway and wasn’t using them.  I switched to it for these reasons and in hopes that it would fix a problem I’m having.

The problem is that posts created outside of the Flutter write panels do not appear inside of that panels “Manage” pane, nor do posts on write panels that have no custom fields.  Two of the panels had no custom fields, and some items were not added with the write panel at all, so the “manage” panels were not working for us.  I discovered that Flutter associates its custom fields with posts in a particular table, and the “manage” pane only shows items in that table.

Moving to Magic Fields, I thought it might fix this.  They provide a script to move all panels and items from Flutter, which made that easy.  Unfortunately, the plugin still uses the same method of populating the “manage” panes, and so didn’t fix my problem at all.

I really just want that pane to have all items from the related category, whether they have populated custom fields or not, whether they were added through the write panel or the posts panel.  I may have to modify the plugin to make this happen.  Otherwise, I will have to somehow craft a script to find unassociated items from a given category, insert a custom field with the relevant name for that type, and then insert the cross-reference row.  That would be a complicated affair and would do nothing for new items created after the script is run.  But I am worried that not having an associated field set in the database will cause problems when those items are displayed.  We’ll see what I can manage and have time for.

Adminimize

This plugin was recommended by Kevin Behrens, maker of Role Scoper.  It allows removal of panels and individual items from the admin section based on role/group.  So far, I only have used it to remove the “Add New” pane of the posts section, but I think it will allow me to remove the HTML tab from TinyMCE as well as a few other things to clean up the interface for the Stearns folk.  The easier we make it for them, the better.


Stearns: Move, Menu, Flutter and Permissions

The Move

We finally bought the domain name and hosting account for Stearns, at stearnshomestead.com.  We were expecting them to want a .org due to their nonprofit status, but I guess they wanted the familiarity of the .com.  They have no company credit card, so Angela had to set up the account and will bill them for a check.  I don’t know what they’ll do in the future:  They’ll probably have to have one of their members do a similar thing.

We moved our WordPress install from its temporary location in a subfolder of one of Angela’s sites to the root of the new site.  There was perhaps a bit of trouble moving the site, but once we figured it out, the install worked perfectly.  To move, we transferred from one site to the other via FTP all site files.  We then used PHPMyAdmin to export the site data as SQL and then import it to the new site (didn’t have to use PHPMyAdmin for the new site, as the host has an import function in their control panel).  We then had to update the config file for WordPress to reference the new database.  Finally, we had to change two URLs in the options table in the database.  Everything now works.

Continue reading post "Stearns: Move, Menu, Flutter and Permissions"

Stearns: WordPress Custom Queries

For the Stearns site, we need to list upcoming events on the home page.  Using Flutter, I created a custom write panel for the events (and other items).  The events are simply posts that have a custom date field attached to them.

I was attempting to use the “query_posts()” function to get the posts I need.  I discovered that it is possible to use this function multiple times on a single page.  I previously thought you were unable to because of “the loop”, but you only have to make a few accommodations for the page name and other such WordPress variables getting changed.  I was able to use this to output the page data on our home page plus two categories of posts.

Unfortunately, “query_posts()” allows limiting by category and sorting by a custom key, but no less than, greater than, or other such comparisons with the meta key [wrong, see end of post].  So I decided to make my own SQL query, to be run with the “$wp_db->get_results()” function.  The function allows a straight SQL query to be run.  Then some other functions are used to put the result set into “the loop”.  So, the code to run my custom query looks like the following:

Continue reading post "Stearns: WordPress Custom Queries"

Javascript: Literal value function parameters

I’ve been messing around with Javascript a bit lately, creating an AJAX object just now, doing stuff for school as well. One of my classes is very much focused on Javascript. I’ve noticed JQuery and some other examples making use of a single JSONesque (javascript literal values, of which JSON is a subset) parameter for functions to allow many parameters to be entered. They are all potentially optional and can be in no particular order. Seems wonderful, especially for Javascript, where there’s no overloading of functions. This is sort of what I thought Objective C would allow, since it requires naming of all variables. Unfortunately, objective C requires them to be named as well as in the exact order, and none can be missing unless they’re optional and at the end, so it is really just a pain there. But in Javascript, this method does indeed allow what I want. So you do have to know the exact parameter names, but don’t have to remember order, and can just as easily not put in parameters if the function will operate without.

It’s rather simple to handle. I was even able to modify an already in use function to use one literal value parameter or the many that it originally used, simply by checking the arguments.length function property to see if it is one, and populating the appropriate variables if so. So to handle the properties, they are appended to the argument and accessed by the key in dot notation. Example function:

function ExampleFunction(argJson){
    document.write("Key1 = " + argJson.key1);
    document.write("Key2 = " + argJson.key2);
}
Continue reading post "Javascript: Literal value function parameters"

Lynda JQuery Certificate

We had the day off for Veteran’s Day, so I’ve had some extra free time.  I spent part of it doing some of the other Lynda tutorials.  I worked on the SEO and JQuery ones.  The SEO one is crazy long and it felt like I was making no progress.  The JQuery one was about double the length of the Worpress one, but I finally finished it.  Yeah!  Here is my certificate for that one (Link no longer working).

I already knew most of the basics of JQuery, but the tutorial filled in many blanks for me.  It went over all of the main parts and functions of JQuery fairly well.

It also introduced me to JQuery UI.  That looks very neat for sure, but the full plugin, with the theme and what not, is something like 312kb.  That’s crazy huge for a web site.  Some (92kb) of that is images which would only load when needed, but the CSS for the theme is 28kb and the script itself is 192kb.  Definitely a good thing that it is so easy to customize what parts you want.  I generally try to keep my entire page loads, or at least the home page, under 100kb.  That is becoming harder and harder as more images and functionality are expected, but it’s good to keep load times fast.

I took some notes on this one, a lot of notes.  It’s really just as a reference for me.  I forget the specifics of this stuff very easily and am always having to look it up, even sometimes for things I do frequently.  I’m somewhat dependent on my notes.  So, if I can figure out how, I will attach them as a text file.  No point in adding them directly to this post, they will make it huge.  But I’ll have to worry about that later:  I have a usability event to go to (Link no longer working).