Thu 26th Apr 2012 at 21:30

Fixing, tweaks and other stuff

Well I've had a busy day of tweaks, fixes, enhancing and some tidying up after a site migration.

It all started due to coding in my sleep (again) , after Richard (of Ringo's World) started mithering me that the everComments system did not allow him to configure his website so that he could enable the commenting of individual blog posts, rather than "pages", meaning the comments would follow the article where ever it was displayed. I had realised the other week that all I needed to do was to enhance the everComments system to allow the passing of a page reference that could over-ride the HTTP Referer value that the system uses. However, this presented a security issue, that of being able to essentially post to pages from other pages. OK, it's probably not such a big risk, but it's a risk none the less. While I lay asleep in bed, the solution struck me. MCRYPT!

Using PHP's mycrypt functions and a seed stored against each account, I was able to allow the passing of the pageRef in an encrypted fashion. My initial code was complex and didn't work, so I decided go on the scavenge and found a perfect little script on the Code Away Blog. A few tweaks to the code later, I had the client and server functions in place. As the code I used is 99% the same as that on Code Away's blog, so I'll not bother to post the code here.

Next step, install comments on this site... Ta-Da! Check out the form under this article.


While trying to refresh my memory of all things everComments, I headed over to my wedding site and noticed that there were MySQL errors all over the place and the gallery was down! This was cause by a recent server migration and the database behind the site going AWOL. luckily for me, I am quite good about backing up stuff and there sitting in my archive folder was the old database. After a quick tweak of the database structure (the move also involved an upgrade from MySQL4 to 5) we had some content back. Then the next problem struck! I have lost my backwards compatible database library and the new library, while 80% of the methods are the same, it was still 20% different and that caused me about 30mins of headaches as I trawled through the gallery code to find all references. Anyway, the long and short of the matter is that the site is now back up, all content working and the gallery all looking swish. Next task, is to merge my recent play with galleries, with the front-end code that I used on that site.

This site uses cookies, please read my cookie policy.