Posts Tagged ‘PHP’

FancyFlickr Authentication

Posted in: Web | Tags: , , ,

There have been a few people that have already let me know that FancyFlickr doesn’t work with hidden/private photos. Unfortunately the class that I’m using to power the plugin doesn’t have any way to authenticate. This isn’t a huge problem, as I’ve found other classes that do authenticate. The only problem is that the only one that I’ve found and like so far requires PHP5 and PEAR. Here I’d like to ask what the users of the plugin think. Should I continue on the current path — without authentication, or should I switch to a new class with these strict requirements. I’m have no idea how many shared hosting companies support PEAR, but it should be hard to find out if your hosting company does. I’d also like to hear from other developers to get their take on which route to take.

Continue Reading »

Dec
02
2009
2 Comments »

Addicted to Flickr

Posted in: Web | Tags: ,

When I started working on FancyFlickr recently, I needed a PHP class to handle the flickr API. I quickly found that I didn’t like many of the classes that I found, for various reasons. I got lucky when I found Addicted to Flickr. The only problem with this one, was that he wrote the class over four years ago and there was some stuff that was quite outdated. The original URLs that it created were broken, which was the biggest problem for me. I rewrote it a little bit, at least so that part works now. So I’m putting it back out there for people to download if they want.

If you run into any problems let me know. If you rewrite any other parts of it, or write a new version, let me know. I’d love to have it for the fancyflickr plugin and to be able to link to it here.

Note: This is not FancyFlickr.

Download

Nov
21
2009
No Comments »

Setup a Mailing List

Posted in: Web | Tags: , , ,

Apparently nobody needs to know how to setup a mailing list anymore. Try checking google, there’s not much to look through, unless you know what your looking for. A client wanted a mailing list, so this is what I found. The IMAP extension for PHP is what you need. Here is the basic script that I found to work:

<?php

$subscribers = “you@gmail.com, sub@scriber.com”;

//Open a POP3 Inbox
$stream = imap_open(“{localhost:110/pop3}INBOX”, “username”, “password”);
//Get the content of the first email
$content = imap_body($stream, 1);

//Send the mail to your subscribers
mail($subscribers, “Subject”, $content, “From: me@mysite.com”);

//Delete the Email so the script is ready for the next time
imap_delete($stream, 1);

?>

You have to setup an email account somewhere, preferably on your webserver, that would be the easiest place to get access, and send an email there. Run this script and it grabs the email and sends it to all of your subscribers and deletes the email so that it’s empty for the next time you send the script.

Now obviously you wouldn’t want to store the list of your subscribers in the script. I’ll end up storing them in a database and pulling all the email addresses out when I call the script.

Remember, this will only work if you have the IMAP extension installed on your server and you have to run this after you send the email so it might be a good idea to setup a cron job to run this at least a couple of times a day, depending on how important the emails are that you are sending out and how time sensitive they are. For a regular mailling list that is sent out weekly or maybe even less frequently than that a couple of times a day should be just fine. If you are going to use this as a listserv, you might want it to run more like once a minute.

Jun
07
2008
No Comments »

Family Tree

Posted in: Asides | Tags: ,

I’ve decided to try PHP. I’m creating an application to display genealogy information on your website. I’ve got the basic format down, finally, after buying “The PHP5 and MySQL Bible“. There is defiantly a lot of information in there. I should have this app done by tomorrow afternoon or Sunday, hopefully no later than that.

Update: I’ve decided that this might not be the first project that I want to take on… At first it seemed like a good idea, but as I’ve been sitting here reading my book, and thinking of different ways that I can use some of the code in here I’ve been wanting to start all different things and this Family Tree thing just doesn’t seem as interesting as it did yesterday. I think I’m going to start another project though.

Jun
08
2007
No Comments »

Big Problems

Posted in: Tech | Tags: ,

Well I don’t know what caused this all to start, but whatever it was, it caused me a whole lot of trouble.

First, I couldn’t get the blog to show up. So I just restarted IIS and tried again. It didn’t work. So I restarted the server… Still nothing. Then I had an idea. I checked my home page and confirmed that something was wrong with my PHP installation. So I tried reinstalling it. I still couldn’t get it to work. For some reason it’s not easy to get PHP installed on an IIS server. I uninstalled and reinstalled PHP several times before deciding that this method wouldn’t work.

Then, I thought, if I can somehow get Apache installed on this server it would probably save me a lot of trouble. The only problem was that I’ve never been able to successfully install Apache on a Windows system — or on any system for that matter. I tried testing it on my computer. The first couple times I tried it didn’t really install. It would install the Apache Monitor, but no services would be installed. So I Googled it. I never really found the real reason why no services would install, but eventually I found a guide to installing Apache, and it gave me a different download site than the one I had been using. It was still Apache’s website, just a different page, with a list of a couple different versions.

After that, I installed Apache on my server, successfully, setup the default directory and default documents and it worked. Then I had to install PHP. I uninstalled the PHP that was already on there. Got rid of all the files, and then reinstalled it for an Apache server. Once I setup the extensions directory and added all the extensions it worked.

WordPress worked right away. I was very happy. Some of my other PHP scripts still don’t work yet. Like PHP weather, and Gallery2. It doesn’t really matter though, becuase PHP weather didn’t work right before anyway, so maybe now I’ll get it working properly. And I still have all the pictures that were in my gallery, and I still have the theme that I was using, so all I have to do is reinstall the Gallery and put the photos back in and put the theme back on there. It shouldn’t take too long.

Overall I’m not really mad that this happend. Other than the two hours or so of down time of course. But I finally got Apache installed and that will really help me a lot. If anybody knows what the download site I was talking about is, please post it on here. If anybody needs it, and nobody else has posted it yet, I could probably find it again.

Jun
06
2007
1 Comment »