King Rat (gkr) wrote,
King Rat

Personal programming project

I don't know whether to count it or not, but given that last year I resolved to complete a personal programming project, and that I had actually started on something but didn't finish it, I finished it tonight. Granted, it's not much of a programming thing, but it is in a language I previously didn't know, PHP. Anyway, what I did was create a plug-in for WordPress that inserts an advertisement for a book into the post. When I first set up Rat's Reading I went to the Amazon Associates site the cut and pasted the link code into every entry. Then I decided to get smart and added a custom post value to each entry, containing the ISBN. Along with that, I modified the presentation template in 4 places to display the ad. Three showed the iframe version. One had an image version (cause many web based feed readers strip out iframes).

But the smart way to do it would be to create a WordPress plug-in that filters every post rather than edit the presentation side, which I might want to replace. I'm using pretty much the default look and feel and I might want something fancier later. So that's what I did tonight. This meant I had to actually learn some PHP, rather than just insert some text into the template. The entire project is one function in one file. However, I did need to learn some basic operators like concatenation and variables and such.

Not much, but something. So now I can sort of cross something off last year's list.


  • Last post

    I don't plan to delete my LJ (I paid for permanent status, dammit), but this will be the last post. I don't plan to read it anymore, either…

  • Unemployed

    Turns out my insurance is cut off at midnight tonight, not the end of the month. In a way, that's a good thing. Now I'll move my appointment…

  • Home from the cruise, off to Sunnyvale

    A week off, but tomorrow I head to the home office for a week there.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened