The Blog of a Programmer
Archive for April, 2009
New Page – Installing Laconica
Apr 27th
I finally got around to posting a rather bare-bones version of my own “Installing Laconica” page. I’ll add to it when I get more time but I couldn’t sleep so I figured I’d get it live.
Updated Laconica Installer – Installing 0.7.3
Apr 23rd
Just finished testing the updated installer for laconica version 0.7.3 codenamed “You Are The Everything“. I’ve gone ahead and cleared out the old laconica install at http://laconica.gimmesoda.com and tested the installer there with no problems. Also, there was a bug which allowed the installer to continue running even after failing to select the database. This has been fixed as well.
The installer can be downloaded from the usual location:
http://www.gimmesoda.com/laconica_installer.zip
One last thing, you have to call the install script from gimme_install.php instead of install.php (laconica now has it’s own installer at that location).
If people still need help with this I do offer an install service, just contact me.
NextGEN Gallery – Feature Addition – Import Zip From URL
Apr 21st
So I work with the NextGEN Gallery plugin pretty often for various websites and one of the things we constantly find ourselves doing is downloading zip files of content, then uploading them to the system in order to import them. From time to time I would run into a max upload size problem which meant uploading outside the usual interface or doing things in portions.
I decided I needed to get around this problem so I went ahead and made what turned out to be a pretty simple modification of the NextGEN Gallery plugin. Here’s what I did:
- I modified admin/functions.php and added a function:
import_zipfile_from_url($galleryID) - I modified admin/addgallery.php in various spots
The first modification is easiest, I just took the code from the import_zipfile function and modified it so that rather then expecting the file from the $_FILES variable I used curl to grab the zip file from the URL, save it to the /tmp directory with a random name, then followed the process from the original function. Easy!
The only other modification that was needed was the admin form for adding a gallery. The file that handles that is admin/addgallery.php and after taking a look at it I found it really wasn’t a complex form at all. I did the following:
- I modified the <ul> with the id “tabs” adding the following pointing the link to the following: <a href=”#zipimport”>
- Then I added a div with the actual form with the id “zipimport” – it takes in the url for the zip file and the gallery selection
- Finally I added another POST variable check: $_POST['zipimport'] which executes the new function which was added to functions.php
Test it out, as long as PHP was compiled with cURL this should work pretty smoothly. You can grab a copy of the files I modified from here:
http://files.gimmesoda.com/nextgen/nextgen_gallery_mod.zip
Let me know if you have any questions!
Recent Laconica Install
Apr 19th
I had to do another install of laconica the other day and because of that I figured I would try out the installer that it comes with.
I’m sorry to say I was actually pretty disappointed. The config file that was generated had just a few lines in it, and when I loaded the site everything was basically broken theme wise.
I had to manually go in and fix up the config file. Looks like I will be updating my own installer after all – expect a release real soon.
Forcing MP3 Downloads on Apache
Apr 6th
I keep seeing this more and more often. Apparently the proper mime-types keep getting set for mp3 files and browsers are properly responding – so rather then downloading (depending on your setup) the file might just end up playing from your browser! The horror! (People, just save the target file!)
Anyhow, if your application is meant to send the file as a download you really should be forcing it rather then relying on your visitor’s settings. Put the following into your .htaccess file to force the download:
AddType application/octet-stream .mp3
You can also add more extensions to that line in order to force the download of more file types such as:
AddType application/octet-stream .mp3 .flv .mov .wav
You get the idea! Any questions? Enjoy!
Recent Comments