With Wings As Eagles: Craig P. Steffen's Blog

a delicate balance

2005 April 02 09:30

My photo linking thing works, and I've updated the only other entry with photos in it. It's a delicate process that to wedge some raw php into the file that blogger is going to put out. I go to the "edit html" tab, input the php, and then hit "publish" without previewing or anything. It seems to work. I'm not sure if I'll ever be able to edit those entries without screwing up the photo links, but I guess I'll burn that bridge when I come to it.

Work this week went from my being very angry and annoyed on Wednesday to yesterday, when I reached a peak of being interested and excited about work which I haven't acheived certainly since late summer of 2003, and possibly since the summer of 2000 when I was in graduate school.

What I'm working on now in a way is much more immediate than anything I've worked on before. My graduate school work and what I worked on in 2003 were somewhat niche projects, and I knew that at the time I was working on them. What I'm doing now is immediately relevant, and with luck could be very far-reaching in my field.

[Editorial note: Yes, I'm being utterly non-specific about what I'm working on, or even what my job is or where I work. This blog is a personal thing, not to be mixed up with work considerations.]

In case anyone's wondering, here's the function that I'm using to link to photos:

<?php 
  function csdnimage($arg1){
    
    if(file_exists("blog_root_dir")){
      $mystring=sprintf("<img src=\"../blog_photos/%s\"><br/>",
                       $arg1);
    }
    else if(file_exists("../../blog_root_dir")){
      $mystring=sprintf("<img src=\"../../../blog_photos/%s\"><br/>",
                       $arg1);
    }
    else{
      $mystring=sprintf("<font color=red>photo missing: %s</font>\n",$arg1);
    }
    print($mystring);
  }
?>
I pasted this function into the template in my blogger settings. To function, it requires a file called "blog_root_dir" to be in the root of the blog structure. The above checks for the existence of that function at two different places, and then prints a correctly formed <img...> tag into the resulting html. (And yes, it took a little messing about to get the above text to look like raw html when the native language of the page is html.)

To link to a function, I put something like this into the "edit html" window: <?php ffbimage("my-image.jpg" alt="" border=3>