1 0 Tag Archives: web design
post icon

Bearclaw Invitational website

Been pretty busy in the last few weeks. Just finished a new site for a friend, who holds a Mountain Bike contest on Mount Washington Alpine Resort. Used WordPress and a theme from the themes repository that I modified a bunch. Looks pretty cool so check it out! Bearclaw Invitational.

Leave a Comment
post icon

Ajax loading gif generator

Ajaxload.info is a site that allows you to customize your own ajax loaders. They have a bunch of different types and also let you pick colors too. Then you just download and use in your own project.

Leave a Comment
post icon

Convert between bits bytes kilobits kilobytes megabits megabytes gigabits gigabytes

A not so eye pleasing but “get the job done”, data size converter. Here’s another sweet converter!

Leave a Comment
post icon

Random quote generator using javascript

Here’s a simple way to generate random quotes on you webpage. Like the one I’m using on the right side of my Home page under the navigation.

//first create a new array
//here it's called pullQuote
//you can specify how ever many values you like ie: 5 here
var pullQuote = new Array(5);
//use the random generator to pick the array values randomly
var randomNumber = Math.floor(Math.random() * 5);
//write out the values you want in the array
pullQuote[ 0] =  "I like Internet Scripting, but it is very hard and sometimes makes my brain hurt!";
pullQuote[ 1] =  "Internet Scripting is the best course in the DMT program!";
pullQuote[ 2] =  "Learning JavaScript will help me become a better web designer!";
pullQuote[ 3] =  "I think JavaScript is for the monkeys!";
pullQuote[ 4] =  "JavaScript makes me go loopy!";
//create a new variable called quote
//make quote equal to the id of the element you want to put your values in
var quote = document.getElementById('quote');
//specify the variable and write into it using innerHTML
//use the pullQuote array and specify the array key to be random
quote.innerHTML = (pullQuote[randomNumber]);

That’s all! Pretty simple stuff! If you don’t have a clue what any of this means you can pretty much copy and paste this code. Just create and element on your page that has an id=”quote”. You also have to make sure those script tags get placed back in there properly. Here’s the js file.

Leave a Comment
post icon

WordPress File Upload Error Security Fix

This is an UPDATE to snuff out all the whiny people that have been complaining about how this?‘old school fix’ isn’t the right way. When I wrote this it was around 5 years ago before wordpress had any nifty ways to get around this and before there were any cool plugins to solve the issue.

New ways

Thanks to @mikes comment… you can add this into your themes functions.php file which will allow text/x-vcard

add_filter(?upload_mimes?,'add_vcard_upload_support?));
function add_vcard_upload_support($mimes) {
$mimes['vcf|vcard'] = ?text/x-vcard?;
return $mimes;

Or you can just install a plugin like: http://wordpress.org/extend/plugins/pjw-mime-config/

Old way

Here’s how to fix the “WordPress File Type does not meet security guidelines” error you get from trying to upload certain files.

First find out what the mime type of the file you were trying to upload is. You can go to w3schools or mozdev

Write down the file type ie: (application/x-shockwave-flash, or video/x-m4v) you also need the extension ie: (swf or m4v)

For WP 2.0 and up open up the wp-includes/functions.php file and goto around line 1069 All you have to do is follow the coding conventions in there and add your file types you want. Because they use a foreach loop to go through all the listed file types you can add as many as you like as long as they follow the convention there. For older versions of WP I think the correct file is: wp-admin/admin-functions.php

Look for this:

function wp_check_filetype($filename, $mimes = null) {
 // Accepted MIME types are set here as PCRE unless provided.
 $mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array (
  'vcf' => 'text/x-vcard',
  'jpg|jpeg|jpe' => 'image/jpeg',
??'gif' => 'image/gif',
??'png' => 'image/png',
??'bmp' => 'image/bmp',
??'tif|tiff' => 'image/tiff',
Leave a Comment