Monday, August 19, 2013

Make Subdomain a Variable with PHP

I wanted to create a dynamic page using a subdomain as a variable. What a user would do is put in a subdomain and it would pull up a page based off of that subdomain. For example: A user would type in http://car.file-drive.com and it would pull up a picture of a car. Of course car could be anything. It could be a list of names or anything at all. The way that it works is with a Wildcard subdomain. Here are the steps to do this.

1. Setup Wildcard Subdomain at your domain Registrar

You can skip this step if you host your dns record locally or with your hosting provider. I don't so I had to add the Wildcard record. My registrar is Godaddy so I just logged in, edited my DNS record and added a new CNAME record. I set the Host to * and it POINTS TO @

2. Setup Wildcard Subdomain with Web Host

My web host is Host Gator. I had to log in to the CPANEL and navigate to the subdomain settings. I added a new wildcard subdomain here for File-drive.com. So the settings again were * which is the character that means "any" just like a wild card in poker which can be any card. If this is an "add on" domain you'll need to point the subdomain to the proper root directory of your domain. File-drive is an add on so I had to point * to public_html/file-drive.com

3. Use PHP to Pull out the Variable

Now that the wildcard subdomain is set my domain can have any and as many subdomains as I want. What we have to do from this point is to break apart the url and get the variable from the subdomain. Will use
<?php $subdomain = array_shift(explode(".",$_SERVER['HTTP_HOST'])); ?>
to get the subdomain and set it to $subdomain.

At this point you can do all sorts of things. You could echo or print out the subdomain. You could make a database call using the subdomain variable. You could do pretty much anything you want to.
Enjoy!

Tuesday, August 13, 2013

Add A Google Map to Wordpress Contact Page

This tutorial is assuming you know how to create a page or a post in Wordpress. Additionally this will provide info to add a map to any page, not just a contact page.

Get your Map code

  1. Goto Google and Google the address you want to get your map for - click on the map picture that results. If that doesn't work goto https://maps.google.com/ and do your search.
  2. Once the result is displayed change your view to whatever you want to display on your page. You might change to a satellite view or a traffic. You may want to tweak other settings in this window. If it is displaying on this page then it will display on your page
  3. Click the Link Icon (photo below 1.)
  4. Click and copy the <iframe> code (Photo above 2.)
  5. Go to WordPress and click to edit the page/post you want to add your map to
  6. In your editor Click "Text" tab (Photo above 1.) If you have content on this page already you will need to place your cursor after/before the content you would like the map displayed
  7. Update or Save your page/post

To Resize the Google Map

If your map isn't the size you want you can edit the code that Google supplies and change the size.
  • In the code that you pasted above look for the Width and Height Parameters. It should look like: <iframe width="425" height="350" . . . . These parameters describe the size of the map that displays
  • To make the width larger type in a larger number. I changed mine from 425 to 800. This is in Pixel increments. This number should be less that 1028
  • To make the height of your map larger edit the height="350" value. Change the 350 to something larger. I used 700.
  • Once you've set the correct sizes click Update and save your post
  • Be sure to leave the "Quotation Marks" around the numerical value
Good Luck!

Add Photo to a Word Press Post or Page

To add pictures to posts and pages go to the edit page of the post/page. Put your cursor in the text area where you want your picture. Above your text editor is a button that says “Add media” . Go through the dialogue that it prompts to either upload a new image or to choose one from the media gallery.

Here is a video: http://www.youtube.com/watch?v=FxxFt3a0T5w

Monday, August 12, 2013

Customizr Slider: Create and edit new slider


The customizr Theme for Wordpress features a very large slider on the home page that is somewhat difficult to edit. The theme has a demo slider installed with little to no direction on how to edit it. below are the steps necessary for creating and editing the slider.

1. Create and image for the slider

The dimensions the default slider is 1200 X 500

2. Upload the image

Click the "Add new" link under Media.
Select your file and upload (you can upload more sliders if you want to at this time. Adding them to the slider is the same once the slider has been created)

3. Click "Edit"

Editing Media: In this window you can add captions, descriptions and add this media to your slider. We first need to create a new slider. Near the bottom of the page there will be a section called "Slider Options"
  1. By default this will be set to "No" - Change it to yes.
  2. The title - this will be the Main title of your slide
  3. Description - is the text below the title on the slide
  4. Link - You can choose the slide to link to a page of the site
  5. Choose a Slider - If this is your first time creating a slider you will have to make a slider to add your photo to. In the box type out the name of your slider and hit "Add a slider"
Once you've completed your first media upload and created your new slider. you can just repeat the process on the rest of your slide items.

4. Add a slide from Media Library

Upload your new image and from the media library click "Edit". From the new window navigate to the slider options at the bottom. You can Add a title and description like described in number 3. above. This time though:

  1. Instead of creating a new slider, use the drop down to select the slider
  2. You can delete the entire slider from this screen
  3. To arrange the items in the slide, just drag and drop them into order
Finally once you've finished editing the slider be sure to save that slide's information before navigating away. Click the "Update" button

Set Your New Slider to the Home Page

  1. Click Appearance on the left Bar - then select Customiz'it.
  2. Next Click "Front Page" from the left Nav
  3. choose your new slider from the "SLIDER OPTIONS".
  4. Save and close
For more information check out the links below.
Message board on theme

Thursday, August 08, 2013

Ambrotype Repair: Part 4

I've spent the majority of the time cloning healthy parts of the photo to cover damaged parts. My main photoshop tools are the spot heal and clone. I've also had to use the dodge tool to lighten shadows created by the glass cracks. This is gonna take some time!

Overall now:

Theseus ship and teleportation

The act of teleportation is questionable. It might happen it may not. Some scientist believe it could take quadrillions of years to accurately beam a human being to another place in space (link). This problem alone makes the feat problematic since the universe isn't even a fraction of a quadrillion years old. Basically teleporting using current technology is like trying to download the entire Lost series over dial up internet
The idea behind teleportation is interesting. The process is to take the atoms that make up a person, pull them apart separately, then put them together again in a completely new location. Seems straight forward, but that brings up the philosophical issue; is rebuilding a person atom by atom creating the same person or just creating a copy. Is that copy the same person.

This problem first surfaced with philosopher Plutarch in a story called the ship of Theseus.
The ship of Theseus, also known as Theseus's paradox, is a paradox that raises the question of whether an object which has had all its components replaced remains fundamentally the same object. The paradox is most notably recorded by Plutarch in Life of Theseus from the late 1st century. Plutarch asked whether a ship which was restored by replacing all and every of its wooden parts, remained the same ship. Wiki Page
Just something to think about. Do you think a teleported person would be the same after transmission or would the current arrangement of atoms that make us up be lost in transmission?
This was inspired by Reddit: What are the most mindblowing recent advancements most people still don't know about?

Wednesday, August 07, 2013

Deep Purple Song



So interesting to see all the different renditions of this song. In one instant it is very jazzy, the next very pop, and lastly it is very embellished and almost a waltz.
Deep Purple was written by Peter DeRose and published in 1933. It was originally just a piano composition however it was soon converted to big band orchestra.

The song took on another personality when Nino Tempo and April Stevens made song a pop hit. It hit number one on the US Pop charts in 1963 and actually won a Grammy for Best Rock and roll record. Aside from Nino Tempo and April, Donny and Marie Osmond recorded the song in 1976 and it hit the charts again.

Other interesting facts:
  • Deep Purple was supposedly Babe Ruth's favorite song.
  • The Band Deep Purple got their name from the song because of constant requests for the song from the guitarist's grandmother.
  • The Beach boys covered the song - Brian Wilson may have been seriously inebriated. It is laughable
  • Ambrotype Repair: Part 3

    Crack Repair

    The most obvious damage to the photo is the enormous cracks that came when it was broken. Additionally there are some scratches and general wear that has occurred to the photos sensitive image. All of these things will be fixed as I use photoshop to clone and replace damaged parts of the image with parts that are not damaged. It is kind of like how a plastic surgeon might graft healthy skin to repair scarred skin. This process is rather laborious so there may be some delays in posts.

    Ambrotype Repair: Part 2

    The first step was to run adjustments and curves on the photo. Ambrotypes don't have much contrast in them by nature, so running curves on the photo really allow much more depth to the photo. I also added a desaturation layer to pull out some of the weird colors that came with pumping up the contrast. There was a little rose pigment added to the original on the cheeks and chin of my great great grand parents. I want to leave that in, however I don't want the ugly greens and browns that seep in from the background. Adding the adjustment layer allows me to reduce some of those ugly colors without degrading the original photo.

    Ambrotype Photo Repair: Part 1


    Mary and Aaron Kinslow were my Great-Great Grand parents on my Grand Mother's side. They had Ambrose Kinslow who had a daughter Ma (Not her name) Kinslow who married a Nunn who had a bunch of daughters. One daughter was Susie Nunn who married Gill Harbison. They had two kids, Kay and David Harbison. David was my dad. SOOOOOO yeah, I'm related to the old folks and I'm going to be fixing this picture. I'll post the progress here.

    About the Photo

    This Ambrotype was taken around 1840-60. Ambrotypes are a type of photograph that is taken on glass. The light-sensitive chemical compound is put on the glass, then exposed to the light through the camera lens. The actual picture is a positive image that is white. You wouldn't be able to tell much by holding the glass to light. In order to see the details you must put the glass over a dark background like black cloth or paper.
    This particular picture was broken and therefore was in many pieces. Since the photo has to be lit from the front, scanning was not an option.
    To get the photo digitized I piece the broken picture together over a piece of black cardboard. I put a florescent light directly above the glass at an angle and took a picture of the photo using my Canon 6D. To repair the photo I will be using Photoshop.

    Monday, August 05, 2013

    Brachiopod 419.2–358.9 million years ago


    Devonian, Silurian Period or Ordovician fossil of Frankfort kentucky. Probably found in limestone. Brachiopods were marine animals. Brachiopod wiki
    Kentucky fossil Regions

    Crinoid 358.9–298.9 million years ago


    Mississippian Period of South Central Kentucky. Crinoids and blastoids are echinoderms. There still are crinoids in the present day oceans however over 600 varieties are extinct. The Mississippian period would have been Early Carboniferous which was 358.9–298.9 million years ago.
    South Central Kentucky would have been shallow sea with lots of shallow sea plants. Crinoids are the fossil remnants of stems of flower like animals. Carboniferous period
    Crinoids
    Missippian Period of Kentucky

    Syro Hittite Idol: 1180 - 700 BC


    Small Syro Hittite Idol 1180 - 700 BC. Sadigh
    Ancient Resources Syro Hittite on Wikipedia

    Celtic bracelet 400 BC - 600 BC


    This celtic bracelet served as both adornment as well as money. Celtic tribes used various items like rings or bells as currency. A bracelet would have served as well.

    Sadigh Gallery
    Ancient Resources Celtic

    Raven Run Hike Lexington KY

    Reb and I hiked Raven Run just outside of Lexington Sunday Aug 4, 2013. The hike was mostly covered which was nice. There were some great views of the Kentucky River. There were a few muddy spots but tennis shoes would work pretty good. The paths were very rocky so expect a good work out on the knees. To do the entire loop took about 2 hours. You could probably do it faster and some hikers were even running. It was hilly so expect to go down the hill, then back up. There is a nature center there as well. I was really impressed. From Lexington it was about a 20 minute drive. Will definitely do this hike again.

    Dick Contino: An Accordion in Paris

    Accordion music from the 60s. French flair. This record has it all. Sweeping strings. The song choices are great and make a fantastic smooth sounding record that just screams for lovers to kiss. I like it.
    Two Loves Have I (J'Ai Deux Amours)  2:15  
    Mam'Selle  2:59  
    The Petite Waltz  2:15  
    Comme Ci Comme Ca  2:40  
    My Man  2:12  
    The Song From Moulin Rouge (Where Is Your Heart)  2:45  
    Beyond The Sea (La Mer)  2:55  
    Under The Bridges Of Paris  2:23  
    Symphony  2:46  
    Domino  2:43
    
    Here is some interesting Dick Contino trivia. He was drafted during the Korean War. He ended up fleeing his post at Fort Ord and got labled as a draft dodger. He was jailed but ended up serving in the Air Force and finally getting honorably discharged.
    He was born in January 1930 and as far as I know is still living in Las Vegas.

    Andre Kostelanetz and his Orchestra: Today's Golden Hits

    Originally released 1966. Another fantastic symphonic arranged pop record. This record features Michelle (Beatles) Yesterday (Beatles) Help (Beatles) Unchained Melody (Nat King Cole) A taste of Honey (Herb Alpert) and more.
    The weirdest rendition is Unchained Melody. The beat is strange and it features odd instrument choices like marching toms and a balalaika.
    Overall this is a great little snap shot of hit songs arranged with 60s orchestras.

    Andre Kostelanetz and his Orchestra: I Wish You Love

    Pop strings. Cake. Champagne Music. Whatever you want to call it this stuff is sugary goodness. Andre Kostelanetz was a Russian orchestral conductor / arranger with the gift of converting pop hits of the day into orchestral pieces. I Wish You Love came out in 1964 and features many hits like Blue Velvet (originally Bobby Vinton), I will Follow Him ( Little Peggy March) I Wish You Love (Nat King Cole) Fools Rush In (Elvis).

    Chances are you won't find this on iTunes or Rhapsody because they are symphonic covers to popular 60s songs. Licensing for the originals are hard enough in this digital age, so a cover is just going to get lost in the mix. That is what makes this record so fantastic.