Saturday 27 March 2010

Websiting

Yesterday evening I noticed a problem on my photo website where category names with brackets in them had been cut off before the open bracket. This is because of the way I structure my categories in the XMP, like Category name (alternate name 1; alternate name 2). In my website code, I then split the string at the open bracket to separate it into the Category name and any alternate names.

However, this causes a problem if the category name has any brackets in it itself e.g. Euljiro 1(il)-ga (을지로1가; 乙支路1街), so this morning I changed my code so that instead of just splitting the category string at the open bracket, it now splits it at the last occurence of an open bracket.

After getting that working, I went into the database to add in / update the alternate category names for those categories that would have been affected by this problem. However, I found that the alternate categories table was messed up, and none of the alternate category names in there were referring to the correct category that they were an alternate name for.

So I spent quite a while going through the alternate categories table and manually changing the number of the category that they were alternate names for, so that it was correct. When I'd done this, I had a look at my code and it looked like it was adding the alternate category names with the id of the parent/sibling/child the category was being added as a child/sibling/parent of instead of the id of the added category.

Weirdly, I'd written the code that called the function to pass it the correct id, but then I'd written the actual function wrong, and it wasn't taking any parameters. Anyway, it was relatively easy to fix. I haven't tested my fix, but don't see why it shouldn't work correctly now.

The rest of the morning and all afternoon I did more work on my panos website.

In the evening I watched 'New Dragon Gate Inn' with Mauser. It was quite good, but the fight scenes had lots of quick cuts and people were wearing similar clothes, so it was hard to tell what was going on sometimes. The ending was totally skill and random though.

The weather was a mixture of sun and clouds all day, with more clouds than sun. I don't think it actually rained today.

Food
Breakfast: Orange Marmalade Toast Sandwich; Cup o' Tea.
Lunch: Peppered Ham Sandwich made with Bakery Bread; ½ Honey Sandwich made with Bakery Bread; Banana; Clementine; Chocolate Mint Sandwich Biscuit; Cup o' Tea.
Dinner: Yorkshire Puddings; Gravy; Fried Red Onion; 2x Posh Sausages; Mashed Swede; Ground Black Pepper; Potatoes; Roast Parsnips. Coffee.

No comments: