category: wordpress

09
AUG
2008

Media Center Online!

Posted by Shane

I been putting it off for a while, but today I got my media center online. It is a flash based component that reads off a database and formats an XML “document” for the flash component to read correctly. I still haven’t done the back-end code yet — the current two images and one album where manually entered into the database.

All I want to do for that is select the files I want to upload, upload and then get a box to fill out the information that will submit it to the database. Since I am using WordPress as the back-end CMS, it’s very tough to design a back-end for a plugin now a days, but I know in the end I will get it. For those who are wondering, the system will be independent of WordPress’s “media” library, but will use the same components to upload.

So I still got work a head of me, but I think in the end I will be able to pull it off! :)

05
AUG
2008

Since this design have been evolving, I wanted a Live Comment Preview so you, the reader, would see the comment show up as you typed it. Now there was a number of plugins that did this. I downloaded and uploaded this one and even after I edited the PHP to format the code correctly, even to use Gravatar, I stepped back just for a moment. I just learned jQuery so there got to be a way to do it. Just as quickly as I had uploaded, I deleted it off the system.

So I did some searching and I found this post on the subject. The idea and concept on the post was good, however it lacked a few things that I required. One of them was formatting the preview to what your “comments” would look like when they were posted and when you removed all the content from the “comment” area the Live Preview stuff was still showing; the live comment area should be removed if we are not entering a comment.

For me, that just doesn’t work. So I went ahead and created by own style and built it in directly to my theme. After a number of tries I came up with code that works out perfectly where it has my formatting in place and also disappears if there is no comment.

Anyway, another win for jQuery (2 – 0, Prototyping) and one more section knocked off the “to-do” list for this theme.

03
AUG
2008

WordPress and Revisions

Posted by Shane

One of the new features of WordPress is the revision storage. Now I am very used to being a revision nut (Being part of the Battlestar Wiki and all..), but one thing Mediawiki excels on and not WordPress is where the revisions are stored.

Mediawiki has a separate database for all revisions which keeps the regular page table clear. (I like to point out I strongly object to Mediawiki coding style also….) WordPress places them inside the “posts” table and this makes it awfully huge. This post now is like post ID #268 even though there are less than 30 posts, 5 pages, and no more than 10 attachments — so far.

So I just cleared out the revisions by using Andrei Neculau SQL statement and it worked perfectly. However,  the next time you read this should be post #30 #32 as I plan on clearing the database and reloading it so the index is correct. If WordPress makes a separate database just for revisions I might re-enable the feature.

Update: After several tries, the database now reflect the correct index numbers as if revisions never existed in the first place.