computer chip



home
archive

suggestions
help page
future features



View current page
...more recent posts

Yesterday I slightly broke the comment system in the case where you are leaving a comment from a /new_comment page. In those cases line breaks were not being converted to html break tags.

This is now fixed.
- jim 2-29-2004 9:25 pm [link] [7 comments]

The active page owners on the site can now create top level pages. Let me know if you want this and I've overlooked your account.
- jim 2-29-2004 3:37 am [link] [3 comments]

I've been putting it off all week, but this morning I finally dove in and made changes to the picture uploading system. I'm 90% done, and it has gone fairly well so far.

Don't panic too much, all photos still exist in their old location, and I'm leaving the /getpic/ scripts in place for the foreseeable future. So everything will continue to work as it always has.

But I'm bringing the new system up in parallel, so the new way will start to work alongside the old way, and maybe eventually we'll get rid of the old way (but we'll always leave /getpic/ in place so no external links will ever break.)

The goal here is to get PHP completely out of the equation when an HTTP request is for an image file.

There is a new directory /library. Inside /library are folders for each user id (well, for each user id that has uploaded pictures.) A copy of every picture you have uploaded is now inside that directory. In the old folder (kept outside the webserver domain) the files had unique numeric filenames corresponding to the id for that picture in the database. All file information (name,date,user,etc...) was in the database. In the new system the info is still in the database, but the filename is kept the same as when you uploaded it (except in the case of duplicates where the system appends _1, _2, _3 as necessary, as well as replacing spaces with underscores.)

So where img src="/getpic/123" would request picture 123 (which had, say, the real filename 'test.jpg' when uploaded,) the new tag would be img src="/library/5/test.jpg".

The /5/ in the above example is my user id number.

The thumbnail is still at img src="/getthumb/123", but now it is also at img src="/library/5/thumbnail/test.jpg".

But remember /getpic/123 will continue to work, so nothing is going to break. When you upload new pictures they go to both the old directory and the new directory (same for thumbnails.)

Next I am going to update the post script to do some substitution. I am thinking of using this shorthand for inserting pictures: <[xxx]> where xxx is either the picture number or the exact text of the description you gave the picture when uploading. When you post an entry with that code in it, the post script will replace it with the appropriate img src="/library/n/xxx" format.

If that seems to work I'll write something to go back through the database and change all the /getpic/ statements to the new form.

This will be much more efficient. And it also will solve the weird problems we sometimes encounter because the file extension is not visible in the html. Some browsers get confused and download the file to disk rather than displaying it in the browsers. This will become even more of a problem as we move to dealing with many more mime types (moving images and such.)
- jim 2-28-2004 9:31 pm [link] [19 comments]