King Rat (gkr) wrote,
King Rat
gkr

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.

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 0 comments