Image Conversion
Initially, I had created a script that had two pipes that opened up to the console. The first pipe would access imagemagick and make the conversion from the source file to a lower res, compressed file. Then, the second pipe would remove the source image after the conversion is complete. Initially it worked just fine, but for whatever reason, it's no longer working. Now, it appears that the two pipes run in quick succession, so Linux attempts to delete the file before Imagemagick has completed its operation.
I've built a work around that builds a batch file and then uses a pipe that runs the batch. This appears to work just fine, I've had no problem with that.
My next concern is figuring out how to name the files. With comment and journal entries, the id number is entered, but not utilized anywhere else except during search and retrieval. However, with images, I'd need to utilize the id# in order to name the image as well. So, for an image with ID # 200, I'd expect to name the image 000200.jpg. When naming the image, I'll either have to:
A) Use "null" for the ID # like I usually do, and then do a search immediately afterward for the latest image and use that number or
B) Do a search of the SQL table, find the latest entry and use a ++ increment for everything.
It would seem to me that either option has equal efficiency. I'll have to decide which is easier to write.
Posted on June 28, 2009 at 12:13 pm. 0 comments. Tags: website dev admin imagemagick
Whitelist
I realized that I had the Whitelist function in multiple places. So, I removed the whitelist function I had in my comment script. I then edited the whitelist function I wrote to accept any generic whitelist in array form. Finally, I added a bunch of functions to the whitelist script to accept numerous common whitelist arrays. I also gave the ability to use your own custom array if need be.
Posted on June 26, 2009 at 10:59 am. 0 comments. Tags: website dev
Mobility
The good thing about redesigning my website is that it functions correctly on my blackberry phone. Previously, I had a javascript implementation of SHA-1 that didn't work on blackberry's browser combined with javascript functions I wrote that didn't work very well. Fixing all of that let's me post on my blackberry now. Soon I'll design a mobile version of my browser.
Posted on June 25, 2009 at 05:42 pm. 0 comments. Tags: website blackberry mobile
Done for now
Well, I've systematically altered all the main files and scripts of the website to add comments, make the scripts more efficient, trim the code and fix some of the issues I had before that resulted in odd bugs and anomalies in the way the code worked.
I think I've worked out a lot of the problems that existed before. Now, I just need to integrate my development page into my live page, as both are disparate. Soon, I hope, I can actually start on my image gallery scripts. I've already worked out the way I'm going to organize the galleries. At this point, I just need to start putting the disparate scripts I've been working on together.
Posted on June 25, 2009 at 10:44 am. 0 comments. Tags: website dev server
Adding a Post
I've updated the post script to incorporate many fixes and have everything operate in a single php file
Posted on June 21, 2009 at 01:11 pm. 0 comments. Tags: website
adding a post
Previously, I had the script that added posts or entries as two different scripts. The first script was fairly basic. It called the authentication function. If the user is logged in, they're presented with a fairly basic HTML form in which they can type whatever they want to add. Afterward, they press the "submit" button. The next script analyzed the data, authenticated the user, added the post into the SQL database and displayed a message to the user.
Now, I want to add a preview function and I'm getting the impression that this may be difficult with what I have right now. Thus, I'm going to have to combine both scripts into a single file.
This shouldn't be too difficult. I will just need a lot more testing to determine different conditions, for instance:
-Did the user press submit? If so, add the data to an SQL table and display a message
-Did the user press preview? If so, display the preview and form with previous entries already in the fields.
-Did the user visit this page for the first time? Then do none of the above and show the form.
I'll get started on that this weekend.
Posted on June 19, 2009 at 01:44 pm. 0 comments. Tags: website server admin
Gallery Organization idea
I had a new idea for organizing my photos. Instead of creating multiple tables of galleries of categories and sub categories, I'm going to have one single table of all categories and sub categories. Each category will have an entry called "master category" or something similar. This will indicate which category it is a part of. So, the main category would be Category #0. Then, I would have a few sub categories, like "vacation", "downtown", etc. Vacation would be category #1 and downtown would be category #2. Though both will have a master category listing of "0", indicating that they're sub categories of the main category. Then, something like "miami 2008" would be category #3, but have a master category listing of "1", indicating that it's a sub category of category #1, vacation.
Hopefully this system will cut down on confusion and allow me to expand my categories much further than otherwise.
Posted on June 18, 2009 at 11:50 pm. 0 comments. Tags: admin website server SQL
Renovation Work
I've renovated the code of my blog quite a bit so far. Namely, I've commented a LOT of my code. Before, comments were only used in the more complex or confusing portions of my code. Now, however, I've taken to commenting all but the most obvious. This has helped immensely, because I've seen quite a few glaring problems with my code as I've gone through it. I've had variables here and there that were confusing. After some work and cleaning up, I've removed some of the more superfluous code and replaced it with far more competent functions.
I've also fixed a few problems I had with the code. Most notably, when I tried to log in, I couldn't use a cookie immediately after setting it, so my login page would tell me that I had typed an incorrect username and password, even though it wasn't incorrect. Once I clicked on the "home" link, everything would change to the logged in functionality. Now, however, I refresh the page immediately after logging in before anything is displayed on the page so that the login information is correctly displayed.
Also, the index page used to only change the "previous" and "next" links if it was the first page. If it were anything other than page 1, it would say "previous" and "next", including if it were the last page. I've changed that so that the "next" link is removed if it's the last page.
Other issues on my agenda:
- I need to add a preview function for adding a post. I have a preview function for when I edit a post, but not for when I add a post.
- The amount of comments that need to be screened is displayed on the right side of my page. When I delete a comment for screening, it doesn't immediately count down. I'll need to figure out why it doesn't do that.
I will still go through the rest of my code to renovate for improved clarity and efficiency. I'll see how that works.
Posted on June 18, 2009 at 10:54 am. 0 comments. Tags: Website admin server
6000 Refreshes
Since I had the counter running a few months ago, my pages have been viewed/refreshed 6000 times. This, of course, counts multiple views, refreshes and doesn't discount for a single person viewing every page.
Nonetheless, it seems a feat, considering I wasn't expecting many views at all.
Posted on June 10, 2009 at 10:32 am. 2 comments. Tags: website
Down time
Unfortunately, there was a problem with my main hard drive on my computer. On Sunday, I restarted my main desktop computer because it had been running just shy of 2 weeks and I had been doing a lot of work, so I thought a good restart was in order. However, after I restarted, my computer was hanging at "verifying DMI pool data". This, of course, was a problem. Now, I had feared that it was my hard drive that was at fault, my motherboard, my power supply and any number of things. Through testing, I was at ease to find that I could boot from CDs and DVDs (though, Ubuntu didn't want to boot correctly). I got boot errors from HDDs that had no installation on them, indicative that the computer was attempting to boot from it. I had attempted to fix the MBR, among other things.
In the end, in desperation, I just installed Windows XP on a spare HDD so that I could access and back everything up to another HDD. I reinstalled Vista, wiping and repartitioning the entire HDD. Moreover, my Linux virtual HDD wasn't playing nice with VirtualBox. It, for whatever reason, wasn't finding my ethernet adapter nor acquiring an IP address. Rather than fuck around with it, I just reinstalled Linux and reset everything.
Altogether, a pretty shitty couple of days, computer-wise.