Get Jet Alerts
Be the first to know about the aircraft for sale, news & events.

How to Buy a Used Airplane

Thereare a number of questions that can be asked on how to buy a used airplane. Through clubs or private organizations you can rent a plane on almost any given day. However, owning provides the pride of ownership, increased flexibility in flight times, and increased control over upkeep. Which choice makes the most sense for you? The costs of buying an airplane include a down payment, principal and interest on a loan, insurance, storage, the annual inspection, regular maintenance, taxes and fuel. How much can you afford? Are you interested in acrobatics, sightseeing, fun flying, short trips or cross-country trips? The best type and model depends on how you plan to use the plane. Once you've decided on a model and a price range, how do you find, inspect and buy a used airplane?

Used Airplane versus Airplane rental/borrow

To help clarify the trade-offs, add up how much you currently spend on rentals, and compare this number to the annual cost for owning an airplane. If you fly 50 to 75 hours a year and spend $50/hour on rentals, you are already spending $2,500 to $3,750/year. An inexpensive plane with a grass tie down might even cost you less to buy a used airplane. Besides the financial aspect, there are other trade-offs to consider. With rentals, you can fly different planes and don't have to worry about maintenance. With owning a used airplane, you almost always have access to your plane on your schedule and you can control maintenance and upkeep.

Used Airplane Financing

If you are borrowing the money from a bank, calculate yoiur down payment and the monthly payment based on current interest rates. If you are buying a used airplane 100% with your own money, don't forget to include the opportunity cost. That is, how would you have invested the money if you buy a used airplane, and how much interest are you forgoing through this purchase.

Used Airplane Insurance

There are two types, liability and hull. The liability protects your assets against claims arising from an accident involving the use of your plane. It may be required in your state. The hull insurance covers physical damage to your aircraft and is often required by lending institutions. Insurance may range from $700 to $2,000/year for a small, inexpensive airplane depending on the options chosen.

Used Airplane Storage

Options range from grass tie downs to heater hangers. Tie downs are cheaper, but hangars provide protection from sun, precipitation, wind and vandalism. Tie downs range from grass spots where you'll have to install your own anchors to marked stalls on concrete pavement. There are several choices in hangars- the most common is the T-hangar. Planes are arranged in rows facing in alternating directions. Some hangars are two walls with a roof, providing limited protection from wind and vandalism. Some are heated but cost more. Some are chaotic cramming in as many aircraft as possible. An additional cost may be "hangar rash" when the tips of the wings of one aircraft brush against another. Prices vary based on the type of amenities and the location. Check with your local air strip for more specific rates.

Used Airplane Operations

Airport fees and fuel. The actual amount depends on usage for your used airplane.

Used Airplane Maintenance

Includes the annual inspection and other yearly maintenance. The annual inspection may cost from $500 to $1,000 for a small plane. Other maintenance may cost from $800 and up.

Other Includes taxes and fees.

Your Used Airplane Objective

Before you start shopping, defining exactly what you need can help narrow the field on how to buy a used airplane. How many passengers will you typically carry? How far will you fly? How fast do you need to get there? What type of airstrips will you land on? Will you be flying in congested airspace? Are there certain styles such as antiques and classics that you find more appealing? How will your needs change over the next 3-5 years?

Jets versus Propellers

Jets are obviously much faster, but are more expensive to buy and operate used.

New Versus Used

Used planes cost less than new planes, but may have more mechanical problems. This does not mean that used planes are unsafe. The average general aviation airplane is over 20 years old.

Homebuilt versus Popular

Homebuilt planes often are faster, lighter and may cost less to operate (if you built it yourself, you may be able to do your own maintenance). However if you built it yourself, there is work in assembling, you need a place to put it together, and if you sell it, you may be liable for any problems the future owner has. If you buy it used and fully assembled, you are somewhat at the mercy of the mechanical skills of the previous owner.

Classics and Antiques

Older planes have stylistic appeal and are popular at air shows. Classic usually refers to planes built between 1945 and 1955. Antique usually refers to planes built before 1945.

Which used Airplane? Attributes on used Airplanes

Performance

What is the range? Manufacturers calculate the maximum distance the plane can fly at 75% power without refueling. Will the used airplane be able to land at your local airport? Standard airports have 3,000 to 4,000 feet runways, local strips may be smaller.

Cruise

How fast do you need your used aircraft to travel? Cruise speed is measured as the speed at 75% power, and is usually expressed in statute miles per hour.

Number of Seats

How many seats will you need? Most planes can effectively carry fewer passengers and luggage than the number of seats they have.

Seating Configuration

What is your seating preference, Tandem v. Side-by-side? Tandem may be faster due to narrower configuration and may give the pilot more visibility and more legroom. However, side-by-side seating makes communication between occupants easier in your used airplane.

Avionics Level

What are the level and condition of the instruments and other electronics? Multiple communication radios are helpful for longer flights or flying in congested airspace.

Construction

Low wing generally have better flight visibility for flying in crowded airspace; High-wing airplanes may be better for sightseeing. Whish is more appropriate for your personal objective?

Landing Gear

Which type of gear do you prefer, Conventional or Tricycle Gear Landing gear- Conventional is more rugged and may have lower wind resistance, however a tricycle gear is less complex and may have lower maintenance costs.

Other Attributes on used Airplanes

Age

How old is the plane? Will you easily be able to find replacement parts?

Physical Condition

Look for rust, cracked paint, and warn parts.

Engine

Note the manufacturer and size. Continental and Lycoming are the most common, and therefore the least expensive to find replacement parts. Also consider fuel consumption. Will you easily and cheaply be able to fill up with the right kind of fuel?

Gross

What is the capacity of the plane? It's measured as the allowable total weight of the plane, passengers and cargo.

Useful Load

Similar to gross, the useful load measures carrying capacity. It's the gross weight minus the weight of the empty plane.

Stall

What is the stall speed (usually expressed in statute miles per hour)?

Cost

How much will it cost you every year? Include purchase costs, storage costs, maintenance costs, ad flight costs.

Where to find a Plane

There are basically four sources of information on where to find used airplanes for sale:

Aircraft Dealer/ Broker

Contact General Aviation Services. They are a leader in the corporate used aircraft industry. General Aviation knows how to buy used airplanes because they buy for themselves, not just their clients.

Word of mouth

Join clubs at you local airstrip, look at the bulletin boards, and ask around.

Print Classifieds

Look in the classifieds sections of local papers, or look in your local boodstore for classified magazines specializing in small aircraft.

Online

Check out the online classifieds.

The Purchase Process

Phone Screen

Ask about the aircraft before you decide to see it.

Buyer Inspection

Have an experienced mechanic look the plane over.

Title Search

Verify that the seller has legal rights to sell the plane. Names of the title search companies can usually be found in classified sections next to the listings of aircraft for sale.

Close

Transfer ownership or have a qualified representative from General Aviation Services do all the work for you.

Phone Screen

Before you make a trip to see a plane, make sure you ask the following questions:

  • Flight time for the airframe and engine.
  • Date of the last major overhaul, last annual inspection and last anvionics check.
  • List of all applicable airworthiness directives and whether or noth the plane is in compliance.
  • Compression readings for each cylinder at the last time measurements were taken.
  • Damage history, major and minor (if any).
  • Overall condition of the interior and exterior.
  • Price

Buyer Inspection

Walk around the plane, look to see if the plane sits level. Look at paint for consistency; it may be an indicator of replacement parts. Make sure the paint's not cracking or flaking. The wear on the paint is a good indicator of how the plane has been treated. Has it been left outside baking in the sun and buried under snow, or has it been stored in a covered hangar? Also look for dents, rust and missing pieces to get a general sense for how well the plane has been maintained.

Go inside the cabin. How well do the doors close? What is the general feel of the interior? Is it well worn? Does it have an odor? Look at the avionics. Does the plane have a Mode C transponder? Does the plane have an emergency locator transmitter? If it is missing either, find out why.

As a final step of the buyer's inspection, examine the log boods. Look for the frequency of flights, repairs and inspections.

Test Flight

Open the windows during the start to listen to the engine. Does it sound normal? If it sounds rough, don't even take the plane up, walk away. Watch all the gauges during takeoff. Do the engines operate smoothly? Do a few turns. How does the aircraft feel? Check all the avionics.

Prepurchase Inspection

It is strongly recommended that you have a mechanic inspect the plane before you buy it. In this inspection, make sure you confirm that the Ads (airworthiness directives) are up to date, all maintenance was preformed and recorded correctly, and all inspections are current. Make sure you find a mechanic who is familiar with the make and model so the he/she knows which areas to focus in on. Also ask for estimated repair cost for anything found wrong.

Instead of trying to figure out on your own how to buy a used airplane, consider having an aircraft dealer help you out. General Aviation Services has saved their clients a lot of money instead of the client buying an airplane on their own. General Aviation knows a lot of "hidden treasures" in the aviation industry. GAS has been in the airplane marketplace for over 37 years with established partnerships worldwide. Why deal with the hassle of airplane homework? Have someone like GAS who has been in your shoes, do the homework for you. GAS will show you how to buy a used aircraft.



What Are the Necessary Files?
Files to Download:

jquery




What Code Do I Need to Add?
Directions:

Replace .question below with the #id or .class of the question. It will automatically show/hide whatever div is following this when clicked.

 

Header:

<script type="text/javascript" src="/resources/js/jquery.js"></script>
<script>

//JQUERY INITIALIZING
$(document).ready(function(){
      $('.question').click(function() {
     $(this).next().toggle();
     return false;
     }).next().hide();
});
</script>

 

Class Extension

    function faqs() {
        $sql = "SELECT * from faqs WHERE hidden = 'No' ORDER BY sequence ASC";
        $res = mysql_query($sql);
        
        while($data = mysql_fetch_array($res)) {
            $return .= '<div class='question'><h4>'.$data[display_name].'</h4></div>';
            $return .= '<div class='answer'>'.$data[html_data].'<br /><br /><hr /></div>';
        }
        return $return;
    }




What is Required in the Database?
FAQs Table

CREATE TABLE `faqs` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `hidden` enum('No','Yes') default 'Yes',
  `updated` datetime default NULL,
  `user_access_id` int(11) default NULL,
  `display_name` varchar(255) default NULL,
  `html_data` longtext,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

 

Join Table

CREATE TABLE `faqs~page` (
  `id` int(11) NOT NULL auto_increment,
  `page_id` int(11) default NULL,
  `faqs_id` int(11) default NULL,
  `updated` datetime default NULL,
  `user_access_id` int(11) default '1',
  `sequence` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;




What Needs to Be Added to the Database?
DATABASE

Add fields "flickr_username" & "flickr_setname" varchar 255 to the "page" table




What Needs to Be Added to the Page?
TEMPLATE

Set page template to "gallery.php"
In "gallery.php" change the Flickr API key

IMPORTANT! Flickr is echoed out using pageData not html_data for display purposes. Make sure you are outputting it on your page as well.




What is the Default CSS?
Default CSS Setup

/* FLICKR */
#flickrNavLeft {
    float:left;
}
#flickrNav {
    float:right;
    padding:0 15px 0 0;
    text-align:right;
}
#flickrNav a {
    padding:0 2px 0 0;
}
#FlickNav img {
    margin:11px 11px 0 0;
}




How Do I Add PrettyPhoto?
Add files to template:

<link rel="stylesheet" href="<?=$php_funcs->configData["sitepath"]?>filebin/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
<script src="<?=$php_funcs->configData["sitepath"]?>filebin/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>

Note: In order for PrettyPhoto to display correctly in IE6 (and infrequently IE7) the CSS for the theme you have chosen should also be copied over to the 'Light Square' theme. Open up prettyPhoto.css and copy & paste from your theme, and then make sure to change any 'dark_rounded''s (for example) back to 'light_square'.




What Javascript Needs to Be Added to the Page?
Javascript

Ensure the template includes flickr.js

This file initializes PrettyPhoto and allows the AJAX "View More" functionality to work.




What AJAX Files Need to Be Available?
AJAX PHP

Ensure flickrAJAX.php is available in resources/js/ajax_php
In "flickrAJAX.php" change the Flickr API key




What Classes Need to Be Available?
Classes

Ensure class.phpFlicker.php is available in library

Ensure class.phpFlickr_ext.php is available in resources/class_ext




What is Required in the Database?
DATABASE TABLE
Should have a 'Login' table created with username, password, hidden, user_access_id, and updated added.


What is the Demo Login?
Demo Login

U: Jessica@orbitmedia.com
P: test




What Should the Template Be Set To?
Template

The login page should be set to login.php and restriction table set to the database table created above.




What PHP Functions Are Being Called?
PHP Functions

Uses functions restrictedPage, isTable, and getFirstPage.




What PHP/HTML Needs to be Added?
PHP (to be added to template after <body>)

<?php echo $php_funcs->isRestrictedPage(); ?>

PHP (to be added where Logout is placed)

$php_funcs->outputLogOutLink("login-pages-62.php");

HTML (Output by login.php)
<div id="login">    
        <div>
            <form method="post" action="/login-pages-62.php">
                <table><tbody><tr><td align="right"><label for="username">Username:</label> </td><td><input type="text" id="username" value="" name="username"/></td></tr>
                <tr><td align="right"><label for="password">Password:</label> </td><td><input type="password" value="" id="password" name="password"/> </td></tr>
            <tr><td align="right" colspan="2">    <input type="submit" align="right" value="submit"/></td></tr>
                </tbody></table>
            </form>
        </div>
    </div>


How do we batch latitude and longitude values?
Batching Latitude and Longitiude

like this!» (new window)




What is the Default CSS?
CSS

#login input.input {
    border:1px solid #333;
    padding:2px;
    color:#858585;
    font-family:Arial,Helvetica,sans-serif;
    font-size:11px;
    width:150px;
}
#login input.submit {
    background:#EEE;
    font:10px Arial, Helvetica, sans-serif;
    color:#000;
    border:1px solid #333;
    padding:3px;
}




Where Do I Go After Logging In?
AFTER LOGIN LANDING PAGE

Will go to first page underneath the Login page in sequence.




What Files are Required?
  • sitemap_html_template.php
  • rightColumnSitemapHTML.php

  • class.template_ext.php



What Are the Necessary Files?
Files to Download:
  • resources/class_ext/class.template_ext.php
  • filebin/template/modules/modules.php
  • filebin/css/layout.css



What is Required in the Database?
Map Locations Table
CREATE TABLE `location` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `location_type` enum('Store Locator','Google Map') default 'Store Locator',
  `address` varchar(255) default NULL,
  `address2` varchar(255) default NULL,
  `city` varchar(255) default NULL,
  `state` varchar(255) default NULL,
  `zip` varchar(12) default NULL,
  `country` varchar(255) default NULL,
  `phone` varchar(15) default NULL,
  `fax` varchar(255) default NULL,
  `email` varchar(255) default NULL,
  `lat` float default NULL,
  `lng` float default NULL,
  `hidden` enum('Yes','No') default 'No',
  `updated` datetime default NULL,
  `user_access_id` int(11) default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;




What Code Do I Need to Add?
Module
// GOOGLE MAPS
       $outputPageData .= '
             <div id="google_map">
                 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=' . $php_funcs->configData["google_api_key"] . '" type="text/javascript"></script>
                 ' . $php_funcs->outputGooglemap() .'
             </div>
       ';
       // Location driving directions
       if (isset($_GET['location']) && $_GET['location']) {
             $outputPageData .= $php_funcs->getGoogleMapDrivingDirections($_GET['location']);
       }

 

Class Extension

/**
 * Google Map function to display on page
 *
 * @access       public
 * @author       Erin Byrne
 *
 */
function outputGooglemap() {
    $returnStr = '
        <script type="text/javascript" language="javascript">
            //<![CDATA[
            var coordLat;
            var coordLng;
       
            function createMarker(point) {
                var marker = new GMarker(point, icon);
                var html = \'<div style="width:180px; height: 110px; margin: 0; padding: 5px 5px 5px 5px;" align="left"><p style="font-size: 12px; line-height: 1.25; color: #434343;"><strong>\'+name+\'</strong><br />\'+address1+\'<br />\'+address2+\'<br /><br /><strong>Phone:</strong> \'+phone+\'<br /><strong>Fax:</strong> \'+fax+\'<br /><strong>Email:</strong> <a href="mailto:\'+email+\'">\'+email+\'</a><br /><\/div>\';
                GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
                return marker;
            }
       
            var bounds = new GLatLngBounds();
       
            function showAddress(id,address1,address2,name,phone,fax,email) {
                address = address1+" "+address2;
                if (geocoder) {
                    geocoder.getLatLng(
                        address,
                        function(point) {
                            if (!point) {
                                alert(address + " not found");
                            } else {
                                var marker = new GMarker(point, {draggable: false});
                                var coord = marker.getLatLng();
                                map.addOverlay(marker);
                               
                                coordLat = coord.lat();
                                coordLng = coord.lng();
                                bounds.extend(new GLatLng(parseFloat(coordLat), parseFloat(coordLng)));
                                zoom = map.getBoundsZoomLevel(bounds);
                                if(zoom > 13) zoom = 13;
                                map.setCenter(bounds.getCenter(), zoom);
                                //alert(coordLat);
                                GEvent.addListener(marker, "click", function() {
                                    var html = \'<div style="width:180px; height: 110px; margin: 0; padding: 5px 5px 5px 5px;" align="left"><p style="font-size: 12px; line-height: 1.25; color: #434343;"><strong>\'+name+\'</strong><br />\'+address1+\'<br />\'+address2+\'<br /><br /><strong>Phone:</strong> \'+phone+\'<br /><strong>Fax:</strong> \'+fax+\'<br /><strong>Email:</strong> <a href="mailto:\'+email+\'">\'+email+\'</a><br /><a href="'.$_SERVER['SCRIPT_URL'].'?location=\'+id+\'">get driving directions &raquo;</a><\/div>\';
                                    marker.openInfoWindowHtml(html);
                                    return coordLat;
                                });
                            }
                        }
                    );
                }
            }
            var map = new GMap(document.getElementById("google_map"));
            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl(true), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT));//
           
            geocoder = new GClientGeocoder();
    ';
       
    $sql = "
        SELECT *
        FROM location
        WHERE hidden='No'
        AND (location_type='Google Map' OR location_type='Both')
    ";
    
    $result = mysql_query($sql);
    while ($row = mysql_fetch_array($result)) {
        $full_img = $row["full_image"];
        $returnStr .= "showAddress('".str_replace("'","\'",$row["id"])."','".str_replace("'","\'",$row["address"])."','".str_replace("'","\'",$row["city"]).", ".str_replace("'","\'",$row["state"])." ".str_replace("'","\'",$row["zip"])."','".str_replace("'","\'",$row["name"])."','".str_replace("'","\'",$row["phone"])."','".str_replace("'","\'",$row["fax"])."','".str_replace("'","\'",$row["email"])."');";
    }
    $returnStr .= '
        //]]>
        </script>
    ';
    
    return $returnStr;
}
/* function to output driving directions for the location requested
  * @param id  id of the location requested from the google map
  * @return string  form for driving directions that goes to googlemaps to view
*/
function getGoogleMapDrivingDirections($locationId) {
    //GET LOCATION INFORMATION
    $sql = "
        SELECT address, city, state, zip
        FROM location
        WHERE
            id = '". mysql_real_escape_string($locationId) ."'
            AND (location_type = 'Google Map' OR location_type = 'Both')
        LIMIT 1
    ";
    $result = $this->getQueryResult($sql);
    if ($result) {
        //SIMPLE FORM TO GET DRIVING DIRECTIONS
        $return .= '        
            <div class="locatorDirectionsForm">        
                <strong>Need driving directions?</strong>
                <form action="http://maps.google.com/maps" method="get" name="drivingForm" style="margin: 5px 0px 10px 0px; padding: 0px;" target="_blank">
                    <table cellspacing="0" cellpadding="0" >
                        <tr>
                            <td>
                                <input type="text" name="saddr" id="saddr" class="textField" value="Starting Address" class="checkTextBox" onfocus="if (this.value==\'Starting Address\'){this.value=\'\';};return false;" onblur="if (this.value==\'\'){this.value=\'Starting Address\';return false;}" />
                            </td>
                            <td>
                                <input type="submit" class="submitBtn" value="GO"/>
                            </td>
                        </tr>
                    </table>
                    <input type="hidden" name="daddr" value="'. htmlentities($result['address']) .', '. htmlentities($result['city']) .', '. htmlentities($result['state']) .', '. htmlentities($result['zip']) .'" />
                    <input type="hidden" name="hl" value="en" />
                </form>
            </div>
        ';
    }
    return $return;
}

// GOOGLE MAPS
if ($page_id == 114) {
       $outputPageData .= '
             <div id="google_map">
                 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=' . $php_funcs->configData["google_api_key"] . '" type="text/javascript"></script>
                 ' . $php_funcs->outputGooglemap() .'
             </div>
       ';
       // Location driving directions
       if (isset($_GET['location']) && $_GET['location']) {
             $outputPageData .= $php_funcs->getGoogleMapDrivingDirections($_GET['location']);
       }
}



What pages and templates are required?

The site should have a search page (probably hidden) that serves as the destination for search inputs and as the landing page. This search page should be designated as such in the config record.

The search page also needs the "search_template.php" template. 




What is Required in the Database?
Calendar Table
CREATE TABLE `calendar_category` (
 `id`
int(11) NOT NULL auto_increment,
 `name`
varchar(255) default NULL,
 `hidden` enum(
'Yes','No') default 'No',
 `updated` datetime
default NULL,
 `user_access_id`
int(11) default '1',
 
PRIMARY KEY (`id`)
);

CREATE TABLE `calendar_event` (
 `id`
int(11) NOT NULL auto_increment,
 `name`
varchar(255) default NULL,
 `display_name`
varchar(255) default NULL,
 `hidden` enum(
'Yes','No') default 'Yes',
 `updated` datetime
default NULL,
 `start_date`
date default NULL,
 `end_date`
date default NULL,
 `start_time`
time default NULL,
 `end_time`
time default NULL,
 `phone`
varchar(20) default NULL,
 `contact`
varchar(255) default NULL,
 `html_data` longtext,
 `user_access_id`
int(11) default '1',
 `url`
varchar(255) default NULL,
 
PRIMARY KEY (`id`)
) ;

CREATE TABLE `calendar_event~calendar_category` (
 `id`
int(11) NOT NULL auto_increment,
 `calendar_event_id`
int(11) NOT NULL,
 `calendar_category_id`
int(11) NOT NULL,
 `
sequence` int(11) default NULL,
 `updated` datetime
default NULL,
 `user_access_id`
int(11) default '1',
 
PRIMARY KEY (`id`),
 
KEY `calendar_event_id` (`calendar_event_id`),
 
KEY `calendar_category_id` (`calendar_category_id`)
) ;

CREATE TABLE `calendar_event~location` (
 `id`
int(11) NOT NULL auto_increment,
 `calendar_event_id`
int(11) NOT NULL,
 `location_id`
int(11) NOT NULL,
 `
sequence` int(11) default NULL,
 `updated` datetime
default NULL,
 `user_access_id`
int(11) default '1',
 
PRIMARY KEY (`id`),
 
KEY `calendar_event_id` (`calendar_event_id`)
);

CREATE TABLE `location` (
 `id`
int(11) NOT NULL auto_increment,
 `name`
varchar(255) default NULL,
 `location_type` enum(
'Store Locator','Google Map','Both') default 'Both',
 `address`
varchar(255) default NULL,
 `address2`
varchar(255) default NULL,
 `city`
varchar(255) default NULL,
 `
state` varchar(255) default NULL,
 `zip`
varchar(12) default NULL,
 `country`
varchar(255) default NULL,
 `phone`
varchar(15) default NULL,
 `fax`
varchar(255) default NULL,
 `email`
varchar(255) default NULL,
 `lat`
float default NULL,
 `lng`
float default NULL,
 `hidden` enum(
'Yes','No') default 'No',
 `updated` datetime
default NULL,
 `user_access_id`
int(11) default '1',
 
PRIMARY KEY (`id`)
) ;




What files do I need and where do they go?

uploadify.css - goes in the filebin/css/ folder. This is used to style the plugin. See the comments in the file.

uploadify.swf - goes in the filebin/flash/ folder.  Flash is necessary for multiple simultaneous uploads.

uploadify.php - goes in the filebin/template/modules/uploadify/ folder.

check.php - goes in the filebin/template/modules/uploadify/ folder.

cancelImg.png - goes in the filebin/template/modules/uploadify/ folder. Style as necessary.

filebin/uploads/ - folder to upload to. This can be whatever you want. Chmod permissions to 774.

 




What is required in the database?

Should have a table called "current_search" with the following fields:

  1. id
  2. session_id
  3. result
  4. show_string

Also, the "meta_data" table should include the "search_score" field.




What Code is Required?
/**
* Method to return sitemap formatted for HTML
*
* @param array Array with root level page ids
* @return string String of HTML code for output
* @access public
* @author Paul Weinstein, Erin Byrne, Brian Bass
* @todo enforce $hiddenChildren in page discovery processes
*
*/

function outputSiteMapHTML( $topLevel, $hiddenChildren = 'true', $headers = 'Yes')

Example Usage:
//SITEMAP - Define top level   
echo ''.$php_funcs->outputSiteMapHTML($topLevel, "HTML", "No").'';



What Code Do I Need to Add?
Directions:

Place following code before html_data is outputted.

 

Code:

 

// CALENDAR
if ($page_id == 59) {

    
include('library/class.calendar.php');
    $calendar =
new Calendar();

    $outputPageData .= $calendar->outputCalendar();
}

 

//THIS IS DEPRICATED
/*
include("library/class.calendar.php");
$calendar = new calendar;
$calendar->monthYear="calMonth";
$calendar->preNext="calPreNext";
$calendar->dayHead="calDayHead";
$calendar->mainDates="calMainDates";
$calendar->emptyDates="calEmptyDates";
$calendar->defaultDates="calDefaultDates";
$calendar->currentDate="calCurrentDate";
$calendar->eventDates="calEventDates";
$calendar->eventLink="calEventLink";
$calendar->outputBox="calOutputBox";
$calendar->outputBoxLinks="calOutputBoxLinks";

$php_funcs->configData['record_data']["html_data"] .= '
<script language="javascript" type="text/javascript" src="resources/calendar/public_calendar_aj.js"></script>
<script language="javascript" type="text/javascript" src="resources/js/overlay.js"></script>
<style type="text/css">
 @import url("filebin/css/overlay.css");
 @import url("resources/calendar/calendar.css");
</style>
';

$php_funcs->configData['record_data']["html_data"] .= $calendar->display_calendar_big();
$php_funcs->configData['record_data']["html_data"] .= "<div style='clear:both;'></div><br />";

*/




What Are the Necessary Files?
Files to Download:

/library/class.calendar.php
/resources/calendar/event_ical.php
/resources/calendar/subscribe_ical.php
/resources/js/ajax_php/calendarAJAX.php
/resources/js/ajax_php/loadAJAX.php

/resources/js/calendar.js
/resources/js/jquery.loadmask.min.js
/resources/js/fullcalendar/fullcalendar.min.js

/filebin/css/fullcalendar.css

CSS for load mask is in layout.css




How Do I Implement Google Maps for a Location?
  • Database and all necessary files should be set up by default (See below for further explanation.)
  • Modules.php must be updated
    • Determine how map relates to page; by default, hard-coded to a single page; if some other logic determines if map should appear on the page, you will need to write a custom script.
    • Enter the correct Google Map API into the config record.
    • Add locations in the "location" table and they should appear.
    • Uses address data to appear on the map, not lat/lng; check to ensure accuracy.
  • If driving directions are required, update current script; not a useful implementation as currently built.
  • CSS must be updated
  • Test
// GOOGLE MAPS
if ($page_id == 114) {
       $outputPageData .= '
             <div id="google_map">
                 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=' . $php_funcs->configData["google_api_key"] . '" type="text/javascript"></script>
                 ' . $php_funcs->outputGooglemap() .'
             </div>
       ';
       // Location driving directions
       if (isset($_GET['location']) && $_GET['location']) {
             $outputPageData .= $php_funcs->getGoogleMapDrivingDirections($_GET['location']);
       }
}



What Code Do I Need to Add?
Directions

Change colors and settings in ammap_settings.xml.



CSS
/* Ammap */

input#rep_zip {
    border:solid 1px #bfbfbf;
    width:162px;
    height:15px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:11px;
    color:#515050;
    margin:0;
    padding:2px 5px 1px 5px;
}
.hideDiv {
    display:none;
}

/* end */


Template
<? echo $php_funcs->outputAmmap(); ?>



Class Extension

   function outputAmmap() {
        $returnStr .= '';
        if ($this->configData["template_file"] == 'ammap_template.php') {
                $returnStr .= '
                        <div id="find_rep">
                                <div id="contact_header">
                                   <h2>by Zip Code or State</h2>
                                <input name="rep_zip" size="20" value="zip code or state" id="rep_zip" onfocus="if (this.value=='zip code or state'){this.value='';};return false;" onblur="if (this.value==''){this.value='zip code or state';return false;}" type="text">
                                <img src="filebin/images/go_btn_rep.gif" alt="Go" title="Go" style="vertical-align:middle;" onclick="show_rep_zip('rep_zip');return false;" />
                          </div>
                          <div>
                                   <h2>by US Map</h2>
                          </div>
                          <div id="flashcontent">
                                   <img src="filebin/images/us_map.jpg" alt="US Map" title="US Map" />
                          </div>
                          <script type="text/javascript">
                           // <![CDATA[
                                   var so = new SWFObject("'.$php_funcs->configData["sitepath"].'filebin/flash/ammap.swf", "ammap", "375", "270", "8", "#F3F2E9");
                                   so.addVariable("path", "'.$php_funcs->configData["sitepath"].'filebin/flash/");
                                   so.addVariable("settings_file", escape("'.$php_funcs->configData["sitepath"].'resources/xml/ammap_settings.xml"));
                                   so.addVariable("data_file", escape("'.$php_funcs->configData["sitepath"].'resources/xml/ammap_data.xml"));
                                           so.write("flashcontent");
                                // ]]>
                          </script>
                          <div id="loading_reps"><img src="filebin/cart_images/loading.gif" alt="" style="vertical-align:middle;" /> Finding Representatives...</div>
                          <div id="repDataContainer"></div>
                 </div><br />
                ';
        }
        return $returnStr;
}




What is Required in the Database?
Representatives Table
CREATE TABLE `representatives` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `display_name` varchar(255) default NULL,
  `organization` varchar(255) default NULL,
  `phone` varchar(255) default NULL,
  `email` varchar(255) default NULL,
  `location` varchar(255) default NULL,
  `mc_states_id` int(11) default NULL,
  `zip_code` varchar(10) default NULL,
  `hidden` enum('No','Yes') default 'No',
  `updated` datetime NOT NULL default '0000-00-00 00:00:00',
  `user_access_id` int(11) default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;




What Are the Necessary Files?
Files to Download:

Template files (for reference):
filebin/template/ammap_template.php
filebin/template/modules/rightColumn.php

Javascript:
resources/js/ammap_show_rep.js
resources/js/show_reps.php

XML
resources/xml/ammap_data.xml
resources/xml/ammap_settings.xml

Flash:
filebin/flash/ammap.swf
filebin/flash/ammap_key.txt
filebin/flash/maps/usa.swf




What code do I need to add?

Add the following code to your jQuery ready block:

jQuery('#uploadify').uploadify({
    'uploader': '/filebin/flash/uploadify.swf',
    'script': '/filebin/template/modules/uploadify/uploadify.php',
    'folder': '/filebin/uploads',
    'cancelImg': '/filebin/images/uploadify/cancel.png',
    'checkScript': '/filebin/template/modules/uploadify/check.php',
    'auto': false,
    'multi' : true
});

This is a very basic implementation. The 'auto' option makes files upload as soon as they are selected. The 'multi' option allows or disallows multiple simultaneous uploads. For full documentation of options, visit http://www.uploadify.com/documentation/

 

Add the following code where you'd like the uploadify plugin to appear:

<input type="file" name="uploadify" id="uploadify" />
<p><a href="javascript:jQuery('#uploadify').uploadifyClearQueue()">Cancel All Uploads</a></p>
<p><a href="javascript:jQuery('#uploadify').uploadifyUpload()">Upload all files</a></p>

 

If you are getting a progress bar, but the files are not reaching the upload folder, double check that the permissions on the upload folder are set to 775.

Style as necessary and enjoy!




What PHP functions are used?

There are many PHP functions used with the search (because it is fancy).

However, you start with just one call: $php_funcs->getSearchData($_GET, $search_arr, 'Search', FALSE);

The parameters are: method (usually get), config array, keywords to block (from the search input field; usually "search" or "search keywords", etc.), and whether or not the results from different tables should be mixed or separated (unless e-commerce, this should probably be true) 




What is the config array and how is it used?

The config array allows the developer to customize the search for any site without changing the code.

There are two basic forms for this array. 

 

Simple Array

First, an array element is created for each table that needs to be searched; the element is an array of every field within the table that should be searched. If the search is simple, just the name of the field can be used and a basic search will be performed on those fields.

NOTE: Simple arrays do not allow for any logic; therefore, they are generally not appropriate for page searches because we do not search hidden pages.

Sample config array with two simple arrays:

$search_arr['page'] = array("name", "meta_keywords", "html_data", "meta_title", "meta_description");
$search_arr['mightycart_product'] = array("name", "meta_keywords", "html_data", "meta_title", "meta_description"); 

 

Complex Array

First, an array element is created for each table that needs to be search; the element is an array of every field within the table that should be search. If the search is simple, just the name of the field can be used and a basic search will be performed on those fields.

If the search needs to be more complex (e.g., includes data from joined tables), use an array instead with the following elements: "tableName" (name of the table for the field; allows joined content to be searched), "fieldName" (name of field), "fieldAlias" (alias of field if necessary; optional), "sqlPartEnd" (additional conditions needed for this field; only if not hidden, for instance; optional).

If the search is complex, you will also want to include a "query" element in the table array, which contains the query to be used for that table - use "AND ({sqlParts})" to designate where the additional query conditions will be placed and where the user-entered search words will be processed.

Please note that a search can include both complex and simple table arrays - see below.

Sample config array with simple and complex arrays: 

$arr['page'][] = array('tableName'=>'page~testimonial', 'fieldName'=>'html_data', 'fieldAlias'=>'testimonial_data', 'sqlPartEnd'=>'`page~testimonial`.name is not null');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'meta_description', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'meta_title', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'html_data', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'meta_keywords', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'name', 'fieldAlias'=>'', 'sqlPartEnd'=>''); 
$arr['page']['query'] = "SELECT page.id, page.name, page.meta_keywords, page.html_data, page.meta_title, page.meta_description, 'page' as table_for_search, GROUP_CONCAT(DISTINCT `page~testimonial`.html_data) as testimonial_data FROM page LEFT JOIN `page~testimonial` on `page~testimonial`.page_id=page.id WHERE page.hidden='No' AND ({sqlParts}) GROUP BY page.id";  

$arr['event'][] = "meta_description";
$arr['event'][] = "meta_title";
$arr['event'][] = "html_data";
$arr['event'][] = "meta_keywords";
$arr['event'][] = "name";

 

Basic Page Search

Below is a sample array for a basic page search. Because we generally need to exclude hidden pages, we can't use the simple array.

$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'html_data', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'meta_description', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'meta_title', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'meta_keywords', 'fieldAlias'=>'');
$arr['page'][] = array('tableName'=>'page', 'fieldName'=>'name', 'fieldAlias'=>''); 
$arr['page']['query'] = "SELECT page.id, page.name, page.meta_keywords, page.html_data, page.meta_title, page.meta_description, 'page' as table_for_search FROM page WHERE page.hidden='No' AND ({sqlParts})";  




How do I submit my Sitemap to Google?
XML Sitemaps can be submitted to Google using the webmaster tools: http://www.google.com/webmasters/tools/


What Are the Necessary Files?
Files to Download:

/resources/js/popup.js
/resources/js/share.js
/resources/js/sendform.js
/resources/js/php_ajax/shareAJAX.php




What Code Do I Need to Add?
Output

Script:

// DIALOG POPUPS    
    
    // #dialogLayer - holds dialog content to be filled in using a JSON call
    $(document.body).append('<div id="dialogLayer"></div>');
    
    // #dialogRefreshLayer - special dialog needed for refreshing the page when closed (ex: logged in or logged out)
    $(document.body).append('<div id="dialogRefreshLayer"></div>');
        
    initializePopups();


HTML:

<a href="#" onclick="startPop({
                    url: 'resources/js/ajax_php/shareAJAX.php',
                    vars: 'action=form',
                    title: 'Share with a Friend',
                    content: 'loading...'
                    }); return false;">Share</a>

 


shareAJAX.php

Change "$content_id" at top of shareAJAX.php to the id of the page that holds the content of the email.


sendform.js

/**
 * VALIDATE SHARE WITH A FRIEND FORM
 * @param  object  contactForm  form to validate
 * @return  bool  whether the form is valid
 */
function validateShareForm(form){

    // An array of objects describing the required fields
    // name is the input field name
    // title is a human-readable description of that field
    var requiredFields = [
        {name: 'your_name', title: 'Your Name'},
        {name: 'your_email', title: 'Your Email'},
        {name: 'friend_name', title: "Friend's Name"},
        {name: 'friend_email', title: "Friend's Email"},
        {name: 'comments', title: 'Comments'}
    ];
    
    
    // An array of objects describing the fields which must be valid email addresses
    var emailFields = [
        {name: 'your_email', title: 'Your Email'},
        {name: 'friend_email', title: "Friend's Email"},
    ];
    
    return validateForm(form, requiredFields, emailFields);
}


Class Extension

Functions needed:

outputShareForm()
sendShareForm()
sendMail()
isValidEmail()

 




How do I implement this?

Add code:

$php_funcs->outputFaqPage();

This outputs all the non-hidden FAQs regardless of what page they're joined to.

 

$php_funcs->outputPageFaqs($page_id);

This outputs only the FAQs joined to the current page.




What is Required in the Database?

CREATE TABLE `carousel` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `hidden` enum('Yes','No') default NULL,
  `thumb_image` varchar(255) default NULL,
  `full_image` varchar(255) default NULL,
  `html_data` longtext,
  `updated` datetime default NULL,
  `user_access_id` int(11) default '1',
  PRIMARY KEY  (`id`)
)

CREATE TABLE `page~carousel` (
  `id` int(11) NOT NULL auto_increment,
  `page_id` int(11) default NULL,
  `carousel_id` int(11) default NULL,
  `sequence` int(11) default NULL,
  `updated` datetime default NULL,
  `user_access_id` int(11) default '1',
  PRIMARY KEY  (`id`)
)

 




What Files are Required?
  • sitemap_xml_template.php



What Code is Required?
/**
* Method to return sitemap formatted for HTML
*
* @param        array   Array with root level page ids
* @return       string  String of HTML code for output
* @access       public
* @author       Paul Weinstein, Erin Byrne, Brian Bass
* @todo         enforce $hiddenChildren in page discovery processes
*
*/


function outputSiteMapHTML( $topLevel, $hiddenChildren = 'true', $headers = 'Yes')

Example Usage:
//SITEMAP - Define top level
echo ''.$php_funcs->outputSiteMapHTML($topLevel, "HTML", "No").'';



What JS functions are used?

Just the one (I think): getMoreSearchResults




How do I update the number of records that display?
In class.template_ext.php, update the class var $rowsToShow. Defaults to 20. 



How Do I Setup MightySite for WordPress?
  1. Copy most similar template, save as wordpress.php and upload
  2. Create wordpress page, set to wordpress.php, redirect to /blog.
  3. In database, create wordpress_page_id in config table.
  4. In Mightysite Config, set to page created earlier.



What do I change in WordPress?
  1. Create /wordpress to /blog link via SSH. (ln -s wordpress blog)
  2. Change permissions/owner on wordpress folder
  3. Go to yousite.mighty-site.com/blog and follow on-screen directions. Admin account should not use 'admin' as the username. Please change the default table name as well. (ex. wp_ should become wpOrbit_)
  4. Create an account for the client using their info from Sputnik
  5. Save the admin account info to the hosting record 'blog' fields, save the client's username/password and a link to login in the hosting notes.
  6. Activate/Install Akismet plugin, set API key to e26790913cf9
  7. Install any additionally needed plugins. Ensure they are functional and fully activated.
  8. UPDATE UPDATE UPDATE. All Plugnis and WordPress core should be as current as possible.
  9. Via Appearance > Theme, set active template to Orbit. If it does not current exist, copy the 'Orbit Theme by Orbit Media Studios' folder from the MSS0 sandbox.
  10. Create a 50x50px icon for the site (usually the same as the favicon) named 'default_wordpress_avatar.jpg' saved to filebin/images.
  11. Via Settings > Discussion, make sure the default.jpg icon is the default Gravatar
  12. Via Settings > Permalinks, set posts to /%postname%
  13. Insert & Upload an image to a post via the client's username/password to ensure option is availble.
  14. On Dashboard, change screen options (top right), remove 'Yoast, WordPress Blog, Other News' and any other unnecessary widgets for client.
  15. Use Appearance > Widgets to set any necessary sidebar features. (Ex. Sidebar categories, archives, recent comments.)
  16. Ensure 'Meta' or 'Admin' section is not on sidebar.



What files do I need to Edit?
  • To alter 'Read More' text: wordpress/wp-content/orbit/functions.php
  • To alter Comments area: wordpress/wp-content/orbit/comments.php
  • Copy WordPress code from MSS0 wordpress.php template into your wordpress.php
To note: If not using the 'Orbit' theme, functions in the 'Orbit' theme should be copied over to new template as necessary. This includes programming for Post thumbnails, default Gravatars, alternate Read More text, standard sidebar changes.


Why aren't my Photos displaying?

There are a couple things that could be wrong.

  1. Ensure 'hide my stuff from public searches' is not enabled - check this by clicking the username at the top and then choosing Privacy & permissions. 'Hide your photos from searches on 3rd party sites that use the API, including Yahoo! Image Search?' should be unchecked.
  2. Make sure photos are not individually hidden. Go to the set, and then choose 'Batch Edit' and change permissions to anyone.
  3. Make sure the display name has not changed. Whatever is shown at the top ex. 'Signed in as orbit media studios' should be used as the flickr username.



What Javascript is Required?

Uses javascript required in the template:

$php_funcs->addJS('jquery.cycle/jquery.cycle.min.js');


What HTML is Required?

$php_funcs->outputPageSlideshow($page_id);

Transition time, variables may be changed in class.template_ext.php at the outputPageSlideshow function.




What functions are required?
function outputPageSlideshow($pageID, $transitionTime = 800, $timePerSlide = 5000, $slideShowID = 'slideshow', $navID = 'navButtons' );

Note: Assumes usage of combined CSS & combined JS scripts.



What CSS is Required?
.ss_left {
    position:absolute;
    z-index:10;
    padding:15px 20px 0 20px;
    color:#FFF;
    font-size:20px;
    font-weight:700;
}
.ss_left a {
    color:#FFF;
    font-size:20px;
    font-weight:700;
    text-decoration:none;
}
.ss_right {
    z-index:5;
}

.ss_right img{
    width:1000px;
    height:284px;
}
div#slideshow_actions {
    background:url(../images/featuredStatic.png) repeat-x scroll 0 0 transparent;
    display:block;
    position:relative;
    overflow:hidden;
    margin-top:-3px;
    z-index:100;
}
div#slideshow_actions ul {
    display:block;
    margin:0;
    padding:0;
}
div#slideshow_actions ul li {
    display:block;
    float:left;
    list-style:none;
    margin:0;
    padding:0;
}
div#slideshow_actions ul li a {
    background:url(../images/featuredStatic.png) repeat-x scroll 0 0 transparent;
    display:block;
    font-size:12px;
    font-weight:normal;
    color:#3f3f3f;
    text-align:center;
    text-decoration:none;
    padding:12px 20px 9px 20px;
}
div#slideshow_actions ul li a:hover,
div#slideshow_actions ul li.activeSlide a {
    background:#fff;
    font-size:12px;
    font-weight:normal;
    color:#c7543b;
    text-decoration:none;
    background:#fff;
    font-size:12px;
    font-weight:normal;
    color:#c7543b;
    text-decoration:none;
}

/*This rule is a fix for slideshows with a single slide*/
/*If multiple slides exist, this width will be pulled in dynamically*/
/*And this rule will be unnecessary*/
#slideshow .ss_left{
    width: 1000px;
}





What Classes Need to Be Available?
Classes
Add to class.template_ext.php:

/**
 *   Method for displaying the News section
 *   @return string  the news section to display on the page
 */
 
    function displayNewsTable($rows_to_show) {
        $sqlAll = "SELECT count(id) as totalArticle FROM news WHERE hidden = 'No'";
        $resAll = $this->getQueryResults($sqlAll);
        
        $numArticle = 0;
        
        if ($resAll) {
            $numArticle = $resAll[0]['totalArticle'];
        }
        $url =     $this->formatMightySiteURL($this->configData['record_data']['id'], $this->configData["record_data"]["name"], "pages");
            
            
        $return .= '<div id="numArticles">';
        if($numArticle == 1) {
            $return .= $numArticle.' Recent News Article Found';
        } else {
            $return .= $numArticle.' Recent News Articles Found';
        }
        $return .= '</div>';
        
        
        $sql = "SELECT id, name, thumb_image, short_desc, article_date  FROM news WHERE hidden = 'No' ORDER BY article_date DESC LIMIT ".mysql_real_escape_string($rows_to_show);
        $res = $this->getQueryResults($sql);
        if ($res) {
            $return .= '<table cellpadding="0" cellspacing="0" width="100%">';
            foreach($res as $data) {
                $return .= '<tr>';
                    if($data['thumb_image']) {
                        $return .= '<td width="130" align="center" valign="top"><a href="'.$url.'?id='.$data['id'].'"><img src="'.$data['thumb_image'].'" /></a></td>';
                        $return .= '<td valign="top"><a href="'.$url.'?id='.$data['id'].'"><strong>'.$data['name'].'</strong></a>'.$data['short_desc'].'</td>';
                    } else {
                        $return .= '<td colspan="2" valign="top" style="padding-left:10px;"><a href="'.$url.'?id='.$data['id'].'"><strong>'.$data['name'].'</strong></a>'.$data['short_desc'].'</td>';
                    }
                    $return .= '<td valign="top" align="right"><a href="'.$url.'?id='.$data['id'].'"></a><strong>'.date("m/d/y",strtotime($data['article_date'])).'</strong></td>';
                $return .= '</tr>';
            }
            $return .= '</table>';
            $return .= '<div id="extra_search_result"></div>';
            
            if ($numArticle > $rowsToShow) {    
                $return .= '<div id="extra_search_button" style="margin:10px 0 0 0;text-align:center;"><a href="#" onclick="return getMoreNewsResults(''.$rows_to_show.'','1', ''.$numArticle.'', ''.$_GET['sort'].'', ''.$url.'')"><img src="/filebin/images/get_more_results.gif" alt="title" title="title" /></a></div>';
            }
        }
        return $return;
    }
    
/*    Method to output News/Article
*
*/
    function outputNewsArticlesData($newsID) {
        $retStr = '';
        if(!$newsID){
            //add JS here
            $this->addJS('
            
            $("table.newsPage td").click(function(){
                window.location=$(this).find("a").attr("href");return false;
                });
                $("table.newsPage tr.article").hover(
                function() { // mouseover
                $(this).addClass("rollover");
                },
                function() { // mouseout
                $(this).removeClass("rollover");
                }
                );
                $("table.newsPageMore td").live("click", function(){
                window.location=$(this).find("a").attr("href");return false;
                });
                $("table.newsPageMore tr.article").live("mouseover", function(){
                $(this).addClass("rollover");
                });
                $("table.newsPageMore tr.article").live("mouseout", function(){
                $(this).removeClass("rollover");
                });

            ', 'load');
            $retStr .= '<div id="newsContent">';
            $rowsToShow = '10';
            $retStr .=  $this->displayNewsTable($rowsToShow);
            $retStr .=  '</div>';
        } else {
            $retStr .=  '
                <!-- news content -->
                <a href="'.$this->formatMightySiteURL($php_funcs->configData['record_data']['id'], $this->configData['record_data']['name'], "pages").'"><img src="/filebin/images/back.jpg" /></a><br /><br /><hr />
            ';
            $sql = "SELECT id, name, article_image, html_data FROM news WHERE id='".mysql_real_escape_string($newsID)."' limit 1";
            $res = $this->getQueryResults($sql);
            
            if ($res) {
                $data = $res[0];
                $retStr .=  '<h1>'.$data['name'].'</h1><br />';
                if($data['article_image']) {
                    $retStr .=  '<img src="'.$data['article_image'].'">';
                }
                $retStr .= htmlentities($data['html_data']);
                $retStr .=  '</div>';
            }
        }
        return $retStr;
    }    
    
    function getMoreNewsResults() {
        $rows_to_show = $_POST[rows];
        $iteration = $_POST[iteration];
        $start = $rows_to_show*$iteration;
        $sort = $_POST[sort];
        $url = $_POST[url];
        //if(!$sort) $sql = "SELECT * FROM news WHERE hidden = 'No' ORDER BY article_date DESC LIMIT $start, $rows_to_show";
        $sql = "SELECT * FROM news WHERE hidden = 'No'  ORDER BY article_date DESC LIMIT $start, $rows_to_show";
        $res = mysql_query($sql);
        $return .= '<table cellpadding="0" cellspacing="0" width="100%">';
        while($data = mysql_fetch_assoc($res)) {
            $short_desc = utf8_encode($data[short_desc]);
            $return .= '<tr>';
                if($data[thumb_image]) {
                    $return .= '<td width="130" align="center" valign="top"><a href="'.$url.'?id='.$data[id].'"><img src="'.$data[thumb_image].'" /></a></td>';
                    $return .= '<td valign="top"><a href="'.$url.'?id='.$data[id].'"><strong>'.$data[name].'</strong></a>'.$short_desc.'</td>';
                } else {
                    $return .= '<td colspan="2" valign="top" style="padding-left:10px;"><a href="'.$url.'?id='.$data[id].'"><strong>'.$data[name].'</strong></a>'.$data[short_desc].'</td>';
                }
                $return .= '<td valign="top" align="right"><a href="'.$url.'?id='.$data[id].'"></a><strong>'.date("m/d/y",strtotime($data[article_date])).'</strong></td>';
            $return .= '</tr>';
        }
        $return .= '</table>';
        
        return $return;
    }
    function displaySearchNewsBtn() {
        $rows_to_show = $_POST[rows];
        $iteration = $_POST[iteration]+1;
        $total = $_POST[totalRows];
        $sort = $_POST[sort];
        $url = $_POST[url];
        $viewedNum = $rows_to_show*$iteration;
        if ($total > $viewedNum) {
            return '<a href="#" onclick="return getMoreNewsResults(''.$rows_to_show.'',''.$iteration.'',''.$total.'',''.$sort.'',''.$url.'')"><img src="/filebin/images/get_more_results.gif" alt="title" title="title" /></a>';
        }
    }



What is the Default CSS?
Add to layout.css:

/* News */

div#numArticles {
    border-bottom:1px dotted #d6d6d6;
    font-size:12px;
    font-style:italic;
    padding:0 0 5px 0;
}
.newsPage th {
    border-bottom:1px dotted #d6d6d6;
    font-size:11px;
    padding:0 0 5px 0;
}
.newsPage td {
    border-bottom:1px dotted #d6d6d6;
    cursor:pointer;
    font-size:12px;
    vertical-align:top;
    padding:20px 10px 20px 0;
}
.newsPage img {
    border:1px solid #bdad8d;
}
.headline {
    display:block;
    font-size:14px;
    margin:0 0 8px 0;
}
.hidden {
    visibility:hidden;
}
.rollover {
    background:#f9f2eb;
}
.date {
    color:#000;
}
.articleImage {
    border:1px solid #bdad8d;
    float:left;
    margin:0 10px 10px 0;
}

/* end */




What Needs to Be Added to the Database?
DATABASE

Add (or copy) "news" and "news_trash" tables.




What Javascript Needs to Be Added to the Page?
Javascript
Add to resources/js/search.js:

function getMoreNewsResults(rows, iteration, totalRows, sort, url) {
    if (document.getElementById('extra_search_button')) {
        document.getElementById('extra_search_button').innerHTML = '<img src="filebin/images/getting_results.gif" alt="Retrieving..." style="border:0;margin-top:20px;display:block" />';
    }
    var callVars = "action=getMoreNewsResults&iteration="+iteration+"&rows="+rows+"&totalRows="+totalRows+"&sort="+sort+"&url="+url;
    ajax_json_call('resources/js/ajax_php/searchAJAX.php', 'POST', callVars, '');
    return false;
}



Add to resources/js/ajax_php/searchAJAX.php:

// custom case for news and designers
    case "getMoreNewsResults":
        $return['extra_search_result'] = array('jAction'=>'before', 'jContentReturn'=>$php_funcs->getMoreNewsResults());
        $return['extra_search_button'] = array('jAction'=>'html', 'jContentReturn'=>$php_funcs->displaySearchNewsBtn());
            break;
    }



What Needs to Be Added to the Page?
TEMPLATE
Add to modules.php:

// NEWS/ARTICLES
$outputPageData .= $php_funcs->outputNewsArticlesData($_GET['id']);




What tables are required?
The video player requires the `page~video` join table, as well as the video table.


How do I add Videos to the page?
Video can be output anywhere on the page using $php_funcs->outputPageVideos(page id here);



What functions are used?

The functions required are:

outputPageVideos($page_id);

ouputPrettyPhotoFLV($name, $caption, $height, $width, $location, $thumb, $i);

outputPrettyPhotoViddler($name, $thumbnail, $height, $width, $embed, $caption, $i);

outputPrettyPhotoVideo($name, $thumb, $height, $width, $location, $caption);

 




What files are needed?

As the video popup used PrettyPhoto as flickr does, most/all files may already be included. Required are:

JS:
resources/js/flickr.js
reources/js/jQuery.prettyPhoto/prettyPhoto.js

CSS:
filebin/css/prettyPhoto.css

IMAGES:
filebin/images/prettyPhoto

FLASH:
filebin/flash/player.swf

 




How do I change the theme, or other settings?

Video's PrettyPhoto overlaps with Flickr's prettyPhoto, and as such can be changed in resources/js/flickr.js

NOTE: prettyPhoto may be used more then once on a page as seperate galleries. To do this, duplicate the prettyPhoto initialization function, with the name of your div added to the begining.

Example:

    $("#photos a[rel^='prettyPhoto']").prettyPhoto({
        opacity: 0.80, /* Value between 0 and 1 */
        showTitle: true, /* true/false */
        default_width: 500,
        default_height: 344,
        counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
        theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
        overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
        callback: function(){}, /* Called when prettyPhoto is closed */
    });

    $("#video a[rel^='prettyPhoto']").prettyPhoto({
        opacity: 0.50, /* Value between 0 and 1 */
        showTitle: true, /* true/false */
        default_width: 500,
        default_height: 344,
        counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
        theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
        overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
        callback: function(){}, /* Called when prettyPhoto is closed */
    });




What Is the Necessary CSS?
/* Google Map */

div#google_map {
    border:solid 1px #ccc;
    width:274px;
    height:413px;
    overflow:hidden;
    margin:0;
    padding:0;
}

/* end */


What Are the Necessary Files?
  • resources/js/carousel.js
  • resources/js/ajax_php/carouselAJAX.js
  • resources/jquery.carousel/jquery.carousel.js
  • filebin/css/jquery.carousel.css




What Code Do I Need to Add?
Module
//CAROUSEL
$outputPageData .= $php_funcs->outputPageCarousel( $page_id );

Template Class Extension
/**
 * Method to return Carousel images from page~carousel
 *
 * @param  int  $pageID     Page ID
 * @param  int  $itemsToScroll  The number of item positions to move when next of prev is pressed
 * @param  int  $scrollTime  The time in milliseconds it takes to animate slides
 * @return  string  carousel HTML
 * @access  public

*/ 

function outputPageCarousel( $pageID, $itemsToScroll = 1, $scrollTime = 500 ) { ... }

/**
 * Method to return each carousel slide HTML
 * @param  array  $slideArr data of single array to output
 * @param  int  $slideIndex  The number placement of the slide in relation to other slides
 * @param  string  $selectedClass  class of each slide holder, special case if selected
 * @return  string  carousel slide HTML
 */

function outputIndividualSlideHtml( $slideArr, $slideIndex, $selectedClass ) { ... }

/**
 * Method to add carousel initial js function
 * @param  int  $itemsToScroll  The number of item positions to move when next of prev is pressed
 * @param  int  $scrollTime  The time in milliseconds it takes to animate slides
 *
 * @return array  of carousel data
*/

function addCarouselInitJS( $itemsToScroll, $scrollTime ) { ... }

/**
 * Method to return the array of carousels attached to the page
 * @param id $pageID  ID of page on
 * @return array  of carousel data
*/

function outputCarouselArr( $pageID ) { ... }

/**
 * Method to return carousel totals "currentIndex of total"
 * @param id $slideIndex  ID of selected index
 * @param number $slideTotal  number of slides in carousel
 * @return string  "currentIndex # of total #"
*/

function outputSlideTotals( $slideIndex, $slideTotal ) { ... }

/**
 * Method called from carouselAJAX.php to output data of selected slide
 * @return string  current selected slide to show
*/

function outputSelectedSlide() { ... }

/**
 * Method to return the data from array in outputSelectedSlide
 * @param array $currentSlideArr  array of data to add to html
 * @return string html of current selected slide to show
*/

function outputSlideData( $currentSlideArr ) { ... }





What Code Do I Need to Add?
Template
// Constanct Contact sign up form
// Id special to clients constant contact account is passed
echo $php_funcs->outputConstantContactForm( '1101222677879', '_self' );

Template Class Extension
/**
* function used to output the constant contact form
* @param id  the constant contact id of the clients account
* @param string  target of the form exp. _blank or _self
* @return string  the cc form to display anywhere on the page
*/

function outputConstantContactForm( $id, $target='_blank' ) {
       $return = '<div>
                <form name="ccoptin" action="http://visitor.constantcontact.com/d.jsp" target="'
. $target .'" method="post" onSubmit="return validateNewsletterForm(this);">
                    <input type="text" name="ea" id="ea" value="Newsletter Sign-up" onfocus='if (this.value=="Newsletter Sign-up") this.value="";' onblur='if (this.value=="") this.value="Newsletter Sign-up";'/>    
                    <input type="submit" name="go" value="SIGN-UP" >        
                    <input type="hidden" name="m" value="'
. $id . '" style="visibility:hidden">
                    <input type="hidden" name="p" value="oi" style="visibility:hidden">
                </form>
            </div>';

       return $return;
}

Javascript

/**
 * Function to validate email address for constanct contact newsletter signup form
 * @param  object form to validate
 * @return  bool  whether the form is valid
*/

function validateNewsletterForm( form ) {
    var err ="";
    if ( !isEmailAddress( form.ea.value ) ) {
        err += "Your E-mail is invalid"+"rn";
    }
    if ( err != "" ) {
        alert( err );
        return false;
    }
    return true;
}

/**
 * Validate email address
 * @param  string  email address
 * @return  whether the email address is valid
 */

function isEmailAddress ( string ) {
    var addressPattern = /^w+((-w+)|(.w+))*@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+)*.[A-Za-z0-9]+$/;
    return addressPattern.test( string );
}

 





What Code Do I Need to Add?
Output

// SENDFORM
$outputPageData .= $php_funcs->outputSendForm($page_id);

Make sure you echo $outputPageData.

 

sendform.js

/**
 * VALIDATE CONTACT FORM
 * (copy this function for every sendform you want to validate
 * @param  object  contactForm  form to validate
 * @return  bool  whether the form is valid
 */
function validateContactForm(form){

    // An array of objects describing the required fields
    // name is the input field name
    // title is a human-readable description of that field
    var requiredFields = [
        {name: 'gender', title: 'Gender'},
        {name: 'first_name', title: 'First name'},
        {name: 'last_name', title: 'Last name'},
        {name: 'email', title: 'Email'},
        {name: 'comments', title: 'Comments'},        
        {name: 'heard_about[]', title: 'How did you hear about us'},
        {name: 'terms', title: 'I agree to the terms'}
    ];
    
    
    // An array of objects describing the fields which must be valid email addresses
    var emailFields = [
        {name: 'email', title: 'Email'}
    ];
    
    return validateForm(form, requiredFields, emailFields);
}

 

Class Extension

/**
 *   Method for returning joined event data
 *   @param int $page_id  id of the page pulling sendform form from.
 *   @return string  form html
 */
     function outputSendForm($page_id) {
          $return='';
          $sql = '
            SELECT form_html
            FROM send_form
            WHERE page_id = "'. mysql_real_escape_string($page_id) .'"
        ';
          $results = $this->getQueryResults($sql);
          if ($results) {
               foreach ($results as $data) {
                    $return .= $data["form_html"];
               }
          }
          return $return;
     }




What Are the Necessary Files?
Files to Download:

/resources/js/sendform.js




How do I view the reporting?
Analytics

http://sharethis.com/account/reporting

  • Clients will login with their username or email and then they will have access to sharing reports.




Reporting
Analytics

http://addthis.com/analytics

  • Clients will login with their username or email and then they will have access to sharing reports.




How do I implement the search?
  • Database and all necessary files should be set up by default (See below for further explanation.)
  • Modules.php must be updated
    • Set page id to search page (search page must be set and locked in MS)
    • Config array must be updated to match tables/fields to be searched - see "What is the config array and how is it used?" below
    • Make sure you are searching meta keywords - allows client to enter alternate spellings and plural forms
  • CSS must be updated
  • Test
  • NOTE: please do not change the GET variable for searching ("search_term" by default) - this will be used by Google Analytics to track searching.



What is The Difference Between ShareThis and AddThis?
  • AddThis pops up on hover, where as ShareThis is onclick.
  • No functionality difference, just different looks. They both do the same thing.
  • ShareThis requires you to register, AddThis is optional.
  • ShareThis allows you to add/remove social networking icons.




How do I add Video to Sitemap XML?

The sitemap function will include video information for any videos joined to a page. As such, to insure that a video is including in the XML sitemap, make sure the video is joined properly and that the relevant information has been populated in the video table.




How do I validate Sitemap XML?
On can validate a Sitemap XML prior to submission to Google's Webmaster Tools, or after, if Webmaster Tools reports a format/syntax error. There are a number of XML validators, but the most straightforward for validating Sitemap XML files is XML Sitemap Validator;


How do I make sure Google knows about videos?

Google has outlined three "best practices" to address the most common problems they have when crawling and indexing videos on a site.

In summary they are:

  • Verify video URLs are crawlable: Check robots.txt
  • List what countries a video can be viewed
  • Indicate when videos are removed

Details can be found in the Google Webmaster Central Blog posting titled "Google Videos best practices"




What files are needed?

resources/js/jquery.tweet.js
filebin/css/jquery.tweet.css




What code is needed?

 

class.template_ext.php:

/**
*    Output Twitter Feed with Follower/Following count
*    @param string $username twitter username
*    @param int $count tweets to display
*    @return Twitter Feed
*    @author Andi Perruzzi
*    @version 1.0
*/

function outputTwitterFeed($username, $count) {
    // Twitter JS & CSS
    $this->addJS('jquery.tweet.js', 'file');
    $this->addCSS('jquery.tweet.css','file');
    
    // INIT JS
    $this->addJS('
               
        //JS FOR TWITTER FEED
         $(".tweet").tweet({
               username: "'.$username.'",
               count: '.$count.',
               loading_text: "loading tweets..."
          });
        
    ', 'load');
    
    // GET XML FEED TO USE FOR FOLLOWERS/FOLLOWING
    $twitter = file_get_contents('http://twitter.com/users/show/'.$username.'.xml');
    
    //Get Follower Count
    $beginFollower = '<followers_count>'; $endFollower = '</followers_count>';
    $page = $twitter;
    $parts = explode($beginFollower,$page);
    $page = $parts[1];
    $parts = explode($endFollower,$page);
    $followerCount = $parts[0];
    if($followerCount == '') $followerCount = '0';
    
    //Get Following 'Friend' count
    $beginFriend = '<friends_count>'; $endFriend = '</friends_count>';
    $pageF = $twitter;
    $partsF = explode($beginFriend,$pageF);
    $pageF = $partsF[1];
    $partsF = explode($endFriend,$pageF);
    $friendCount = $partsF[0];
    if($friendCount == '') $friendCount = '0';
    
    //If Friend & Followers both = 0, assume Twitter is down, and display follow link
    if($friendCount != 0 and $followerCount != 0){
        $returnStr = '
        <div id="twitter">
            <div id="followers"><strong><a href="http://twitter.com/'.$username.'">@'.$username.'</a></strong><br />
                '.$followerCount.'
                Followers /
                '.$friendCount.'
                Following<br />
                <a href="http://twitter.com/'.$username.'">+ follow us</a>
                <div></div>
            </div>
            <!-- Tweets Feed -->
            <div></div>
        </div>';
    } else {
        $returnStr .= '<div id="twitter">Follow us on Twitter: <a href="http://twitter.com/'.$username.'"></a></div>';    
    }
    
    return $returnStr;
}

modules.php example usage:

$outputPageData .= $php_funcs->outputTwitterFeed('orbittracker',7);




What if Twitter isn't working?
  • In the case of "Fail Whale" the twitter div will still be display with just the follow link showing. (Note: Easily changable in the function.)
  • Twitter use must be at least following / is followed by 1 person in order to display.
  • Twitter API will only show Tweets up to 1 week old.



Where is a code?
redirect_export.php in mightysite folder



Database requirement

Tables:

CREATE TABLE `redirects` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `other_content` longtext,
  `url_to_exclude` varchar(255) default NULL,
  `htaccess_name` varchar(255) default '.htaccess',
  `config_id` int(11) default NULL,
  `user_access_id` int(11) default NULL,
  `updated` datetime default NULL,
  PRIMARY KEY  (`id`)
)

CREATE TABLE `redirects~page` (
  `id` int(11) NOT NULL auto_increment,
  `old_url` varchar(255) default NULL,
  `page_url` varchar(255) default NULL,
  `redirects_id` int(11) default '1',
  `page_id` int(11) default NULL,
  `updated` datetime default NULL,
  `user_access_id` int(11) default NULL,
  PRIMARY KEY  (`id`)
)




How This Stuff Works?

Nobody knows...

But just in case:

  • In Mightysite -> Redirects -> 301 Redirects populate Join Redirects / Page or it could be populate from any page Edit
  • You can use all Old Url - redirect from and Redirect to is Page URL or Page (Page will be used if set)
  • Set config
  • Htaccess Name - usualy .htaccess
  • URL to Exclude (optinal) needed only if we need to strip down from Old URL - has to have full domain name: http://do.not.go.there.com
  • Other content place #{redirects} in where it needs to go this will be replace by redirects lines. If missing redirects lines will attached at the end
  • Save
  • Go To View ->Redirects Report
  • Click <Archive and upload new .htaccess file>



What is required in the database?
page~facebook_like is the only required table.


How do I customize the like button?

You can customize the color scheme, font, size, layout, etc. of the facebook like button. For a full explanation, see facebook's documentation.

You'll want to look at the function outputFbLike() in class.template_ext. There are two basic parameters (width and height) you can pass from modules.php, but all other customization should be done within the function. Fortunately, it should be very self-explanatory.

You can also customize the URL of the link, give it an image, change its title, and other stuff. For example, if you set the like type to "movie," the like page will show up in the liker's "favorite movies" section of his Facebook page. See facebook's open-graph documentation. This metadata goes straight into the join record.




What is required in the database?
page~facebook_fan is the only required table. It contains the id of the facebook fanpage.


How do I customize the fanpage box?

There is very limited customization available for the facebook fanpage box. You can pass a width and height to outputFbFan() in modules.php. See outputFbFan() in class.template_ext. For customization options, see facebook's documentation. Customizing the function from there should be self-explanatory.




How do I name the file sitemap.xml?
To have sitemap.xml refer to the dynamiclly created XML file uncomment the following in the Redirects record and modfiy as documented:

# Change page id to page of dynamic XML sitemap
#RewriteRule ^sitemap.xml$ /sitemap-xml-pages-60.php 

To direct robots to the sitemap.xml file uncomment and edit the following in robots.txt:

# change-site-name-here with to domain 
#Sitemap: http://www.change-site-name-here with.com/sitemap.xml



How do I include blog (Wordpress) in XML sitemap?
There is a Wordpress plugin, Google XML Sitemaps that can generate a XML sitemap for blog entries. To use enable the plugin via Wordpress admin and follow the 'Settings' link to run the plugin for the first time. FAQs relating to the specific use of this plugin can be found at: Google Sitemaps FAQ (Sitemap Issues And Errors)


What Do I Need / How do I Implement Google Analytics?
  1. A Google User Account
  2. A "personalized" Google Analytics tracking code assigned to the Google User Account. The tracking code is profile-specific. Where can I find my tracking code?.
  3. Add Google Analytics tracking code into the site config table in Google Analytics Code (google_analytics_code) column



How do I add Event Tracking?

Per Google's Event Tracking OVerview, "Event Tracking is a method available in the ga.js tracking code that you can use to record user interaction with website elements, such as a Flash-driven menu system. This is accomplished by attaching the method call to the particular UI element you want to track."

First make sure the Google Analytics ga.js script is loading proplery on the page with the event one wishes to track. The specification for the _trackEvent() method is as follows (More details can be found at: http://code.google.com/intl/en-US/apis/analytics/docs/tracking/eventTrackerGuide.html)


_trackEvent(category, action, opt_label, opt_value)
  • category (required)

    The name you supply for the group of objects you want to track.

  • action (required)

    A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.

  • label (optional)

    An optional string to provide additional dimensions to the event data.

  • value (optional)

    An integer that you can use to provide numerical data about the user event.



Example:

<a href="#" onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'Baby's First Birthday']);">Play</a>

 




How do I edit the local host file on a Mac?
  • Launch Terminal
  • At command line type 'sudo vi /etc/hosts' ( vi cheat sheet or use another text editor such as pico )
  • Enter your user's password if prompted for it
  • At a new line press 'i' to insert text
  • First enter the IP address of the site you wish to reach
  • Then, on the same line, enter the domain name of the site


  • Press 'esc' to exit insert mode. Type ':w' and press return to write new file. To quit, type ':q'



How do I edit the local host file on a Windows?
  • Login using an administrator level account
  • Launch Notepad
  • Select File->Open
  • Select 'All Files'
  • Look in: 'c:windowssystem32driversetchosts'
  • At a new line first enter the IP address of the site you wish to reach
  • Then, on the same line, enter the domain name of the site


  • File->Save



How do I implement this?

Add Slideshow code to modules.php:

$php_funcs->outputPageSlideshow($page_id);

Pass in the page id of the page it should be showing on. 

 

Enter Content:

The slideshow requires more then one slide to function, and should have alt & titles but all other fields are not required.

Navigation can be hidden.

 

CSS:

Change as needed. Be sure to include height in slideshow div dimensions.




Straightfoward Implementation
Sign up

http://sharethis.com/publishers/getbutton

  • Go through the set up widget to custamize what you would like your button to look like and which social networking icons you woud like to include.
  • Sign up using the site name as the name and using the clients email address.
  • Finally, place the required embed code in a desinated area on your template.

Page Information
  • ShareThis uses the Meta Title and Meta Description to display the information of the page being shared. So keep this im mind when adding ShareThis to a site.




Straightfoward Implementation
Sign up

http://addthis.com

  • Go through the set up widget to custamize what you would like your button to look like.
  • Sign up using the site name as the name and using the clients email address if you want to have the client view analytics. It is not required to get the embed code for the AddThis button.
  • Finally, place the required embed code in a desinated area on your template.

Page Information
  • AddThis uses the Meta Title and Meta Description to display the information of the page being shared. So keep this im mind when adding AddThis to a site.




Straightfoward Implementation

Login to Constant Contact

1) Sign on with the clients login information

 

Get Constant Contact ID

2) Go to Contacts > Join My Mailing List

3) Click link in the first box "Start Wizard to generate HTML code"

4) Click next and next till you arrive at "Get HTML Code"

5) Look for this hidden input field of m in the HTML Code: "<input type="hidden" name="m" value="1103685264170">"

 

Add Method

6) Add $php_funcs->outputConstantContactForm( '1101222677879', '_self' ); in the appropriate place

7) Replace numbers with the value in step 5.

8) Replace "_self" with what target you want to use.

 

Customize Mailing List Form Page

9) Go back to the "Join My Mailing List" page.

10) Click the link in the second box "Edit Join My Mailing List Form"

11) Customize the email signup form to match the site. (Logo / background color / text color)

 

Overall

12) And have fun with it!

 




What code do I need to add to the modules file?
<?php
// STORE LOCATOR
if ($page_id == 79) {
   
    // STORE LOCATOR
    include_once("library/class.locator.php");
    $locator = new store_locator;
    $outputPageData .= $locator->outputFullLocator();
}
?>



How do I implement the Facebook Like button?

The implementation of the Facebook Like button is very simple. Add a one-sided join record on the page~facebook_like table. Just adding the join will make the Facebook like button show up with default settings: using the current page url and page title.




Where do I store the locations?
  • Put locations in the location table in mightysite with their lat/lon.

 




What about the Google API key?
  • Google API key must be set in site config



How do I implement this?

Copy WordPress files:

SSH -

cd to your site. 

mkdir wordpress

cd wordpress

cp -r /home/0ssm/www/mss0.mighty-site.com/wordpress/ .

cd ..

cp -r /home/0ssm/www/mss0.mighty-site.com/config.wordpress.php .

ln -s /blog /wordpresss

 

Database:

In wpOrbit_options -

Change siteurl & home values to reflect the path to your site.

 

Files:

/wordpress/wp-config.php

Change DB_NAME, DB_USER & DB_PASSWORD to reflect your site's configurations.

 

Mightysite:

Ensure WordPress is an option under 'View' in Mightysite and takes you to the correct WordPress configuration.

In config, set wordpress_page_id to the Blog Page.

 

WordPress Admin:

Create an account for the client, set user level to Editor.

Ensure Theme is set to Orbit

Update any/all files.




How Do I Implement the Flickr Gallery?
  • Database and all necessary files should be set up by default (See below for further explanation.)
  • Modules.php must be updated
    • Determine how Flickr gallery relates to page; by default, hard-coded to a Flickr page; likely will need to write own script to determine whether or not to display the gallery (possibly as simple as looking for Flickr username/setname in the record data array)
    • Enter the correct Flickr API key
    • Make sure the script is pulling the username/setname correctly; by default, pulls from the config record data
    • If you want to display a different number of photos on the page (per iteration), go into class.phpFlickr_ext.php and update two class variables: $numberPerColumn (width of photo column; defaults to 6); $numberPerPage (total number of photos on the page per iteration; defaults to 18); $numberPerPage must be a multiple of $numberPerColumn.
  • CSS must be updated
  • Test



How to Implement?
Define an array of top level parent page id(s) that mark the starting point of pages (parent and child) to be including in the sitemap. Note using the page_id of 0 will start with all pages with a parent_page_id of 0 and include all their children. Two optional arguments are to include hidden child pages (or not) and to include <ul> "header" or not. By default the header for the unordered list will be included (hiddenhildren has yet to be implemented at this time)
$topLevel = array( 0 );
echo $php_funcs->outputSiteMapHTML( $topLevel );



What files do I need?
  • JS is in resources/js/locator.js
  • HTML for left column results is in resources/xml/map_xml.php
  • Letter marker images are in filebin/images/icons
  • Locator class: library/class.locator.php
  • XML parse class: library/class.xml2arr.php

 




How to Implement?
Define an array of top level parent page id(s) that mark the starting point of pages (parent and child) to be including in the sitemap in sitemap_xml.php. Note using the page_id of 0 will start with all pages with a parent_page_id of 0 and include all their children. One optional arguments are to include hidden child pages (or not) however hiddenhildren has yet to be implemented at this time.
$topLevel = array( 0 );
echo $php_funcs->outputSiteMapXML( $topLevel );



How Do I Implement the News Archive?
  • Database and all necessary files should be set up by default (See below for further explanation.)
  • Modules.php must be updated
    • Determine how archive relates to page; by default, hard-coded to a single page; if some other logic determines if archive should appear on the page, you will need to write a custom script.
    • Add articles in the "news" table and they should appear.
    • By default, show 10 articles per iteration; if you want to use a different number, send a second optional parameter in the function call: outputNewsArticlesData(id of article[optional], number of artlcles per iteration[optional]);
  • CSS must be updated
  • Test



How do I customize the player?
To customize the player you can add variables to the swf in ouputPrettyPhotoFLV. The variables are:

file = your flv path
autostart = true to start automatically, false to not. True is default.
color1 = primary color
color2 = color of rollovers and played part of scrub bar
color3 = color of rollovers and loaded part of scrub bar
colorText = color of text and unloaded part of scrub bar
background1 = top gradient color of player background
background2 = bottom gradient color of player background

To add a logo, create the file: filebin/images/playerLogo.png


How do I implement the Facebook Fan box?

The implementation of the Facebook Fan box is very simple. Add a one-sided join record on the page~facebook_fan table. The name is just for organization in MightySite and isn't necessary to get the fan box to work. The only thing you really need is the Facebook Fan id, which can be a little tricky to find. I would tell you myself, but its easier to show you:

 

http://crenk.com/where-do-i-find-my-facebook-fan-page-public-profile-id/

 

 

facebook fan

 

facebook fan

 

facebook fan

 




Straightfoward Implementation

Applying the Method

1) Apply  $php_funcs->outputPageCarousel( $page_id );  to the appropriate place.


Populate the Table

2) Populate carousel table and join it the the appropriate page(s).


Customize Carousel

3) Read the rest of the FAQs for where to customize.





Straightfoward Implementation

Assigning Login Page

1) Login page would be on the root. The login page is the parent page of the subpages which are the restricted by login pages.

2) Go to the page where you want the login form to appear and in the "Restricted Table" field input the login table name.

Apply to Moduels (checks if $login_page_id is set to page - if so then outputs login form) 

4) Add code to modules

5) Replace $login_page_id with the login page ID

// BASIC LOGIN
$login_page_id = 62;

// Check to see if the current page's top parent is the login page.  If so,
// this page is restricted.
if( $php_funcs->isRestrictedPage( $page_id, $login_page_id )) {
   
    // Are we logged in?
    if ( $php_funcs->isLoggedIn( $_COOKIE['lType'], $_COOKIE['lToken'] )) {

        // Yes, output the logout option       
        $outputPageData .= $php_funcs->outputLogoutLink( $login_page_id, $_COOKIE['lType'], $_COOKIE['lToken'] );
       
    } else {

        // No, shame on you, back to the login page for you
        header( 'Location: '. $php_funcs->formatMightySiteURL( $login_page_id, 'Login', "pages" ).'?redirect_id='. $page_id ); 
        exit;  
   
    }

}





How do I add Search Tracking?
  1. Log in to your Google Analytics account.

  2. Click 'Edit' in the Website Profiles summary box for the profile you would like to enable Site Search for.

  3. Click 'Edit' from the 'Main Website Profile Information' section of the Profile Settings page.

  4. Select the 'Do Track Site Search' radio button in the Site Search section of the Edit Profile Information page.

  5. Enter your 'Query Parameter' in the field provided, which is usually "search_term".

  6. Select whether or not you want Google Analytics to strip out the query parameter from your URL. Please note that this will only strip out the parameters you provided, and not any other parameters in the same URL. This has the same functionality as excluding URL Query Parameters in your Main Profile - if you strip the query parameters from your Site Search Profile, you don't have to exclude them again from your Main Profile.

  7. Click 'Save Changes' to finish.


You will now find your Site Search reports underneath the 'Content' section of your profile.




Go To Top