Posts Tagged ‘tips’

Setting A default image with PHPThumb

Posted in Programming, Websites on August 7th, 2009 by Jason – Be the first to comment

For one of the larger projects that I work on, I use phpThumb, which will create a thumbnail of the requested image and cache it for fast downloads. This is great when you have a large number of images that will be viewed at various sizes and you dont want to export all the various sizes.

One of the problems I ran into recently is setting a default image that will appear if for some reason your source file cannot be located. When you are pulling images from a separate provider, this can become a concern.

PhpThumb has made this easy as their is a setting in the config file as shown below.

phpthumbconfig

All you have to do is add the local path to the file you want as a default into the config and then to test it you can set phpThumb to attempt to load a bad source file and it should display your image. If you are having issues seeing the file, make sure that the names match up, and that you have a forward slash before the path. You can also try doing an absolute path with the entire url to the image.

Post to Twitter Tweet This Post

Changing your default homepage

Posted in Programming, Websites on April 23rd, 2009 by Jason – Be the first to comment

There is a quick and simple way that you can change the default page that is loaded when you open up a website. For almost every server, the default value is to first look for the index file. On my server it will first look for an index.php file, if that is not found, it will then look for the index.html file and if neither are found, it will just say page cannot be found, or something to that effect.

If you want to change those settings, your can do it with the server files… or a much easier way, especially for a temp page during website construction is to define the default file within the .htaccess file.

Working with the .htaccess file can be tricky at times, depending on what you are wanting to accomplish, but luckily changing the default start page is simple. First you will need to create a .htaccess file within the root directory of you website. Likewise you can create one inside subfolders, and change the default page for a subfolder as well.

Once you have your file created, you must add the following code.

DirectoryIndex filename.html index.cgi index.pl default.htm

Within this code is where you can specify what you want the default page to be. If you only want one option, just specify one file. If you want multiple options as listed, this will first check for the “filename.html” and if not found it will then check the next file “index.cgi” and so on. Upload that .htaccess file to your server and your in business.

I should clarify that this is for a server with an apache web server, usually that is a linux server.

Post to Twitter Tweet This Post

EE Users post with status Closed

Posted in Ramblings, Websites on April 22nd, 2009 by Jason – Be the first to comment

I recently had a problem where all the users added to expression engine would post to weblogs with a closed status and they did not have the option to change it to open even though they had permissions to do so. It took me a while to figure this one out, but like many things with expression engine, I have found that their are simple solutions to almost all of the issues that I have found, it was just a matter of finding the solutions.

If your having problems with other members publishing as closed status and cant figure out why, try checking the following setting. Select publish and then edit weblogs. For the weblog that you are having problems with, and this could be all of them, you will need to select to edit groups, and from there you will need to make sure that the default option is NOT None, but set to either the Default Status Group or a custom one.

Default Status Group

Post to Twitter Tweet This Post

Quick EE tip, RSS feed not working

Posted in Ramblings, Websites on April 22nd, 2009 by Jason – Be the first to comment

This is not so much a tip for what to do but what not to do. I recently had an RSS page that was giving some strange errors in expression engine. The fix was simple, when you create your template, make sure you select it to be an RSS page. Seems simple enough, but if you select it to be a webpage, everything will look as it should with the exception of just one thing.

When I created the template, I would get the following error in the safari web browser, and would not get results in other web browsers.

The error was: “The feed could not be loaded because the content is not in a known feed format.” (PubSub:2)

After looking at the source code, the only thing that I could see which was different than that of a standard RSS feed was the following line of code.

<ee:last_update>

Why expression engine adds that line, I dont know, but if you see this, be sure to check that your template is set to be an RSS template and not a webpage.

Post to Twitter Tweet This Post

Tips to Refilling Ink Cartridges

Posted in Ramblings on February 9th, 2009 by Jason – Be the first to comment

Over the weekend our printer once again ran out of black ink… A common occurance since my wife and I are still in school. About a six months ago we decided to give the ink refills a try and bought a kit ($14). We previously had bought new cartridges and had two black ink cartridges at empty at home. One cartridge we have already refilled two or three times without incident while the second cartridge just sat around being empty.

A couple weeks ago we ran out of ink yet again and my wife decided to be brave and refill the cartridge herself. She did a great job, but the cartridge didnt work. When I got home I checked the fill level, tried cleaning the head, but after several tries I could not get it working. So I decided to try my luck with the second cartridge… which had been sitting around (without ink) for about 6 months. After filling the cartridge (following the instructions) and cleaning the print head, to my amazement… it didnt work. I tried a couple tricks, setting the head on a papertown that has been dabbed with rubbing alcohol, which helps to loosen any hardened ink in the print head. After both cartridges sat for over an hour I gave them a try, and still didnt work.

To get the ink flowing you will need to clean the top of the cartridge with alcohol and made sure there is no ink on the top of the cartrige. Very carefully and while holding the cartridge level with a paper towl on the print head you will need to create a seal over the opening where you fill the cartridge with your mouth and create a fairly strong air pressure to help push the ink through the print head. Be very careful not to inhale any ink or get any on your skin as it will stain and could be toxic. This trick worked like a charm for both cartridges, and now I have two topped off cartridges which have many more uses in them.

Post to Twitter Tweet This Post