WordCamp Utah

September 7th, 2008, 09:55 pm

A Utah WordCamp is coming up on September 27, 2008. I’m thinking of going. Only problem is that is the same day as the X96 Maverick Big Ass Show which I purchased tickets for. Who I was originally going to go with won’t be happening any more so now I need to decide whether to go rock out or be a nerd for a day.

If you are in the Utah area and would like to meet me then let me know. At this point I’m leaning towards going to Wordcamp since I want to get more involved in things like that and meet the creator of Wordpress. If atleast one person wants to meet me then I’ll forget about the Big Ass Show completely.

CSS Position Property

November 14th, 2007, 10:56 pm

Some people have a hard time figuring out the position property in CSS. It took me a while to fully understand it and use it to it’s full potential. Here is some information on it and hopefully you can understand it.

position: relative; positions the element relative to it’s nromal position. An elements normal position is its position in the flow of the page. So top: 5px and left: 30px; will move it down 5 pixels and left 30 pixels from it’s normal position on the page.

position: absolute; moves it to a certain spot within the first parent element that has been positioned before it. This is where it gets tricky. This defaults to the browser window if you haven’t positioned any parent elements. Examples will make this easier for me to explain.

<h1>Positioning Example</h1>
<div style="width: 500px; height: 500px; border: 1px #000000 solid;">parent element
<div style="position: absolute; bottom: 0px; left: 0px">child element</div>
</div>

View Example

In this example, child element will be in the bottom left corner of the browser window although the parent element doesn’t go below 500 pixels or the window is shorter than 500 pixels. The child element will be in the bottom left corner of the browser window even if you can scroll below the page.

<h1>Positioning Example</h1>
<div style="width: 500px; height: 500px; border: 1px #000000 solid; position: relative;">parent element
<div style="position: absolute; bottom: 0px; left: 0px">child element</div>
</div>

View Example

In this example, child element will be in the bottom left corner of the parent element. This is because parent element has now been positioned so it becomes the containing block and position: absolute will move elements around within that block.

Godaddy and mod_rewrite

August 21st, 2007, 04:31 pm

If you are considering using Godaddy to host your website, don’t. Run away as fast as you can and get a proper web host. The more I have used Godaddy for more only domains, the more I hate them. Godaddy is a domain company and nothing more. Yes, they are cheap and that is service you get. Cheap.

Today I found out that Godaddy doesn’t mod_rewrite files ending in .php. You can redirect other file types to php files but you can’t rewrite php files to other files.

I’m guessing this is because Godaddy parses php files before it even gets to your .htaccess file.

Godaddy, can you server setup be any more messed up? Why can’t you do it properly?

Update August 4, 2008

0w3w commented and said

I’m not native speaker, sorry for the grammar..

Well, I had the same problem u have, and after some googling I found the answer it is as simple as one instruction on the .htaccess:

Options -MultiViews

This is the .htaccess that worked for me:

Options +FollowSymLinks
Options -MultiViews
rewriteEngine On
rewriteRule ^test/(.*)\.php$ /test.php?variable=$1

If this do not work or your hosting is in the root directory try taking out the / on the second part of the rewrite rule, like this

rewriteRule ^test/(.*)\.php$ test.php?variable=$1

Hope I’d helped ^^

I have not tested this but others have said this works.

Updated Changing Avatar Script

August 13th, 2007, 11:22 am

I’ve updated my script that I previously blogged about that changes your avatar on different sites depending on what month it is.

Put the following to your website. In my example I’m naming it avatar.php

Add cases for the months you want to add or change. Change $avatar to the correct image. Change $type so that it is appropriate for the correct image. Gifs are image/gif. Jpgs are image/jpeg.

<?php

$month = strtolower(date('M'));

$avatar = '';
$type = '';
switch($month)
{
	case 'oct':
		$avatar = 'pumpkin.gif';
		$type = 'image/gif';
		break;

	case 'dec':
		$avatar = 'christmas-tree.gif';
		$type = 'image/gif';
		break;

	default:
		$avatar = 'elephant.gif';
		$type = 'image/gif';
		break;
}

header('Content-type: ' . $type);
readfile($avatar);

exit;

?>

In a .htaccess file add the following

RewriteRule avatar.jpg avatar.php
RewriteRule avatar.gif avatar.php

To use your dynamic avatar, you can link to either avatar.jpg or avatar.gif on your website. Preferably keep all of the image types the same.

If you have any questions, bugs or anything, let me know.

Are you a web programmer looking for a full time job?

February 21st, 2007, 01:22 pm

The studio I work for could use another programmer so ff you are a web programmer in the Salt Lake area looking for a full time job, contact me and I’ll get you some more information. Need to know XHTML, CSS, Javascript, PHP, and SQL. Pretty much the basics to web programming. Preferably you should be out of school.

Could possibly be part time. Can still be in school if part time.

My email is eric (< [at]>) ericfaerber (< [dot]>) com. Remove (< [ and ]>). Thanks.

Job Hunting

March 30th, 2006, 08:28 pm

I’m looking for a job. I’d like to work for company that does web development but that might not happen. I’ve applied to a few of places so hopefully one of those will work out. If you have any leads on a job, let me know ;)

Dynamic Avatar depending on the Month

October 3rd, 2005, 08:17 pm

If your like me and want to have a different avatar that deals with the holidays then you’ll like this script which can be used to change your avatar to a different one each month. You can see this script working on my account on phpBB.com. Of course if you want to see it change, you’ll have to wait until the new month ;)

Updated version of this script 13 Aug. 2007.

Part 1 – the PHP Code

Copy and paste the code below into a file on your website. I’d recommend naming the file avatar.php because of part two. To add or change months, add or alter the case and use the three letter abbreviation for the month (January is jan, March = mar, etc) in lowercase. What is under the default case is what will be shown when you haven’t specified an image for that month. For the images, change the part after location within the location function of each case.
[php]< ?php

$month = strtolower(date('M'));

switch($month)
{
case 'oct':
header('location: image1.gif');
break;

case 'nov':
header('location: image2.jpg');
break;

case 'dec':
header('location: image3.gif');
break;

default:
header('location: default_image.gif');
break;
}

exit;
?>[/php]
Part 2 – .htaccess

A lot of sites only allow you to put files that are image extensions as your avatar and not .php files. This is because of security so we’ll have to use .htaccess to get around this. Either place the following in your existing .htaccess file or create a new one. This .htaccess assumes that you named the PHP file from part 1 as avatar.php and that you put avatar.jpg in the spot where put your avatar.

# you only need RewriteEngine on once within each
# .htaccess file so if you already have it, you don't need to
# put it again
RewriteEngine on
# change avatar.jpg to what you use on the site where
# you are putting your avatar. change avatar.php to
# whatever you named the php file
RewriteRule avatar.jpg avatar.php

If you have any questions or problems, post a comment and I’ll try to help you out. Enjoy!

My Blogroll script

August 20th, 2005, 11:13 am

I was recently asked about my blogroll script which updates automatically. So this post is about that.

First off, I signed up at Blo.gs and started adding people to my favorites list. When you are done doing that, go into your settings and make it so that your favorites can be shared. Once that has been done, in the sidebar you’ll see a link named Shared, go there. Click on the favorites.xml file and take note of the number that is in the url. Should be something like http://blo.gs/12345/favorites.xml.

If you want, you can save this file to your computer and then upload it to your blog. It isn’t required but you may need to so you can chmod the favorites.xml file to atleast 666.

Next, change this script (you can also find it below, under Read More) so that it uses the number that I mentioned before. Upload it to the root directory of your blog. I’d name it blogroll.php.

Once it has been uploaded, put the following code on your site where ever you want your blogroll to be displayed.

[php]< ?php
include('blogroll.php');
?>[/php]

Now you will have a blogroll on your site that will update every hour. Be sure to edit it so that it is styled to match your site.

Read the rest of this entry »

Happy 4th of July …

July 7th, 2005, 12:17 am

… two days late, oh well. This year we did the same thing we do every year, go eat breakfast, watch the parade, hang out all afternoon, and then go to the fireworks at night with the relatives. The parade sucked, as usual, but the fireworks were good.

The next day I wake up and visit my site, mods.best-dev.com, and see this message:

LifeChamber Was Here! Your MySQL Database Username Is **** And The Password Is ****

My site was hacked. From the looks of it, all he/she did was get my MySQL username and password and then edit index.php. Everything else is fine. I still haven’t contacted the ISP of the person that did this nor have I fixed my site. I really need to do that soon. Probably tomorrow.

Getting hacked was my fault. I didn’t update to 2.0.16 of phpBB. I knew there was a critical security problem in it but I didn’t update. Well, I learned my lesson. I’m just glad it wasn’t as bad as it could have been.

I got the Halo 2 Map Pack today. I already had four of the new maps and spent today looking at the other five. I haven’t played any of them, just looked. Most of them seem really fun. Tomorrow evening I’ll for sure play them. I’ll post my impressions on them.

Recently I have been pretty busy working with clients. I really need to stop with this so I can validate some MODs. Tomorrow I’ll make time to validate MODs.

Time for bed.

New Layout Sneak Peak

May 8th, 2005, 11:50 pm

I have decided to go with this layout for the layout. The sidebar will be about the same as the middle content and what it is like now. When I get a chance, I’ll start coding it. Comments are welcome.

If you haven’t heard already, phpBB 2.0.15 was released, update your message boards ASAP! While you are at it, give your input on the XML MOD Template if you are a MOD Author. In order to make it perfect, we really would like the communities input.