November 14, 2002

I was going to work on the BlogMan documentation and research B2 BloggerAPI stuff yesterday (since I know Greg would like to use BlogMan :p) but I got sidetracked by another project (aren’t you getting tired of hearing me say that? <vbg>) This one’s in Perl BTW 🙂 I was looking into CGI tagboards for Jen since she wanted one that was hosted on her own server and I found several that looked nice but came across this simple and elegant solution that I really liked because it was small and fast. However, it was missing a few features that *I* really wanted – such as the ability to convert text smilies to graphical ones and the ability to ban IP’s. Till recently, I had not even looked at installing any scripts or extras on any of my sites let alone code anything CGI based since to me that is just too much bother :p I’d go with a pre-packaged solution that somebody else offers and I’dl be happy with it – as can be seen from the tagboard on Solipsistic Meanderings :p However, the Perl code on the tagboard caught my attention and I just felt this need to change it and make it better … and that was that :p

Perl incidentally is probably the only language that I come back to after a while and have to relearn all over again 🙂 I’ve worked with Perl before (about two or three years ago the last time I think) but when I look at the regular expressions and stuff, my eyes just glaze over <vbg> So I did some reading on Perl last night and I think now I might be more up to the task 🙂 It’s going to be quite a bit of work (especially to do it the way *I* want to do it) but I think the final results would be worth it. So here comes another project for me – though I’m not sure I will distribute the scripts for this particular one once I’m done – not if I have to write a separate installation script for the stuff that I might set up by hand. But I’ll probably switch to using this script on Solipsistic Meanderings since I like it – plus, I would have coded it :p

In the meantime, there have been several questions raised about the changes to the preview feature by Edward and Nigel. To answer Nigel’s question first (about whether the temporary directory would be full of images), no the temporary directory would only contain the template images but I’m really not in favor of that idea since you currently get any images in an entry (if you created the entry just now and linked the images – but not if it is an old entry) copied over to the temporary directory for previewing. However, this would not work for anybody who has images in a location other than the same folder as the blog itself. For instance, if you have the images in a folder called Images off the blog folder, then you’ll probably link to them as Images/mypic.jpg and so would not show up since both the temporary preview blog and the images will be in the same folder. This is basically my problem with setting up some sort of template preview facility too since the images necessarily won’t be in the same location as the blog and then Blog has to do a lot of work to figure out where the images go.

Edward suggested that I copy the images over to the temporary folder once and that I delete them later – or at least I think that’s what he suggested, unfortunately, I deleted the e-mail of his comment and am offline now and so I can’t check on what he said exactly :p I guess my reluctance to do so is more philosophical than anything – I hate a program to do extra work if not necessary :p The best solution would be to have a location for template images specified on a per blog basis and then copy the files over when Blog starts to the temporary folder and then delete the contents of the temp folder when Blog shuts down. I don’t like to do all the work of copying files if nobody previews their entries at all – or they don’t do a preview during that particular run … so why do all that work? On the other hand, if you copy the images over only when they preview, then you might be duplicating the work since they might hit the preview button after every few words! Yes, I know I’m looking at extreme scenarios but the bottom line is that I don’t like to slow down the computer unless it is really necessary. I think the solution actually suggested itself when I wrote that :p I should have a flag indicating whether the image files were copied over or not and then copy them over when preview is first initiated and then set the flag so that they will not be copied over again for the current run of Blog 🙂

The world not being as simple as it could be, I just realized that this will not work either :p The problem is with the way that templates are assigned in Blog and the fact that you can publish the same blog to multiple sites with different templates! When you are writing an entry, that entry might be displayed using several different templates and each one might have the images in a different location! I guess the only way we can go about this is to give an option when you click Preview which asks you to specify the template to apply to the preview (or rather the upload site to preview since the image locations are specified by upload site) and then copy the images over and take it from there. Of course, this nullifies the whole image copy flag idea since the next time the user previews s/he might want to use a different upload site and that might have the images in a different location. Oh the complexities of giving people options :p

Tags: General
Posted by Fahim at 5:21 am   Comments (3)

3 Responses to

Subscribe to comments with RSS

#1
Gravatar Image
Edward McCain 13 November 2002 at 3:40 pm

Edward suggested that I copy the images over to the temporary folder once and that I delete them later – or at least I think that’s what he suggested, unfortunately, I deleted the e-mail of his comment and am offline now and so I can’t check on what he said exactly

Yeah, that’s what I suggested – copy the images to a specified temp folder when preview is kliked, then delete it when blog is shut down.

However, to be honest about the whole matter, I just make changes to the template and then upload the blog and view it in the browser of my choice. Once it all looks fine, I upload the archives to check them out.

If you were to put it to a vote, I’d nominate a button to pass the template to the browser of my choice. That way I can see it in living colour right on my machine, so to speak. I’m not much for tiny little view screens – 800×600+ or nothing I say 🙂

Speaking of browsers, I’ve been using MSIE since Spyglass leased their technology to MS and only occasionally played with Netscape. I pulled the latest build of Mozilla the other day from nonags, and I must say that I am impressed … maybe enough to convert.



Edward.

on decaf since 11.11.02

#2
Gravatar Image
DeViLbOi 13 November 2002 at 4:33 pm

instead of doing all this stuff why don’t you just keep a local copy of the template and post the blog into it locally and over-write the blog every time it is updated instead of deleting stuff.

#3
Gravatar Image
velvet 20 November 2002 at 1:35 pm

hey wicked site love kate moss you rock

velvet

Leave a response

:mrgreen: :neutral: :twisted: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad: