From: Steve Sutton Date: Mon, 28 Nov 2016 20:41:16 +0000 (-0500) Subject: Update setup file X-Git-Tag: v1.0.0~5 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=1e89dda748bc15804e0a056cc2b246950fa5946e;p=web%2Fwww.mackinacislandpackage.com.git Update setup file Updating the setup file with path settings for newer version of PHP. Using $ENV['GLM_HOST_ID'] --- diff --git a/setup.phtml b/setup.phtml index b1eff56..35fd39e 100755 --- a/setup.phtml +++ b/setup.phtml @@ -12,1838 +12,1839 @@ ini_set('include_path', '/usr/share/pear' . ':' .ini_get('include_path')); if( !isset($SITEINFO) ) { - if(!isset($DEBUG)) - { - $DEBUG = (isset($mysecretcode) && $mysecretcode == 1234); - } - // setup for pages - define("HOME_ID",1); // change this if home page is other than id = 1 - $PAGES['default'] = 'index'; - define( "MEMBERS_CATEGORY", 57 ); // set this to the members only category. - define( "MEMBERS_LIST_RAND", false ); // set this to the members only category. - $PAGES[1] = 'index'; - //$DEBUG = TRUE; - - /* - * Customer Setup - */ - define("SITENAME","Mackinac Island Packages"); // used for outputing name of site in admin area - define("SITE_NAME",SITENAME); // same as SITENAME - define("DB_TYPE", "postgres"); // DB library only knows postgres (FUTURE EXPANSION) - define("DB_ERROR_MSG", "an error has occured with the database!"); // default error message - define("MULTIPLE_CAT",0); // weather or not to use many to many relations - define("CAT_LOCK",0); // If set to 1 or true will lock the categories - define("ENTRIES_PER_PAGE",10); // default per page number - define("HTML_HELP_CODE",1); // this is being depreciated for general help guides - define("PRODUCTION_MODE","ON"); // used in the email out for contact DB - define("HTML_EMAIL","ON"); // turn ON for html emails - define("ACTIVE_FLAG",1); // turn on if bus_category table has active bool field - define("DELUXE_TOOLBOX",1); // used for the toolbox deluxe vrs. - define("SEO_URL",1); // weather to use Search Engine Optimisezd url's requires .htaccess enabled - /* integration of different apps */ - define("SITEMAP_GENERATOR",false); - define("PHOTO_GALLERY",0); - define("GOOGLE_SEARCH",0); - define("MEMBERS_DB",0); - /** htmlarea plugins */ - define("HTMLAREA_TABLES",true); // weather to load the table plugin or not - define("HTMLAREA_CONTEXT_MENU",true); // weather to load the context menu plugin or not - define("HTMLAREA_IMAGE_MANAGER",true); - define("HTMLAREA_CHARACTER_MAP",false); - define("HOME_PAGE_EVENTS",0); - /* - * - * DO NOT EDIT THIS SECTION - * - */ - - // Find where this file is located - - $BASE_PATH = dirname( __FILE__ ); - extract($_SERVER); - - $CALLED_FROM_DIR = substr( dirname($HTTP_SERVER_VARS["PATH_TRANSLATED"]), strlen($BASE_PATH) ); - - if( ($x = strlen($CALLED_FROM_DIR)) > 0 ) - $base_url = $HTTP_HOST.substr( dirname($SCRIPT_NAME), 0, -strlen($CALLED_FROM_DIR) ); - else - { - $script_name_dir = dirname($SCRIPT_NAME); - if( $script_name_dir == "/" ) - $script_name_dir = ""; - $base_url = $HTTP_HOST.$script_name_dir; - } - $BASE_URL = "http://".$base_url; - // Indicate that this file has been referenced - $SITEINFO = TRUE; - /* - * - * Dynamic Configuration - Parameters that DO change based on location - * - */ - switch( $GLM_SERVER_ID ) - { - - case "devsys.gaslightmedia.com": - ini_set("display_errors","1"); - // Use the $BASE_URL for secure URL on Devsys - $BASE_SECURE_URL = $BASE_URL; - define("AUTH_TEST_MODE","TRUE"); - define("BASE_SECURE_URL", $BASE_SECURE_URL."/"); - define("BASE_INSECURE_URL", $BASE_URL."/"); - define("CONN_STR", "host=devsys dbname=mackinacislandpackages"); // DB connection string - define("OWNER_EMAIL", "jamie.kahgee@gmail.com"); // site owner's email address - define("FROM_NEWS_EMAIL", "info@gaslightmedia.com"); // site owner's email address - define("REPLY_TO", "info@gaslightmedia.com"); // the reply-to field for email's - break; - - case "ws1.gaslightmedia.com": - error_reporting(0); - ini_set("display_errors","0"); - $BASE_SECURE_URL = "https://".$base_url; - define("BASE_SECURE_URL", $BASE_SECURE_URL."/"); - $BASE_URL = "http://".$base_url; - define("BASE_INSECURE_URL", $BASE_URL."/"); - //define("BASE_INSECURE_URL", "http://www.mackinacislandpackage.com/"); - define("AUTH_TEST_MODE","FALSE"); - define("CONN_STR", "host=ds4 dbname=mackinacislandpackages"); // DB connection string - define("OWNER_EMAIL", "mackinacpackage@mict.com"); // site owner's email address - define("FROM_NEWS_EMAIL", "mackinacpackage@mict.com"); // site owner's email address - define("REPLY_TO", "mackinacpackage@mict.com"); // the reply-to field for email's - break; - default: - error_reporting( E_ALL ^ E_NOTICE ); - ini_set("display_errors","1"); - $BASE_SECURE_URL = "https://".$base_url; - // for some sites it is necesary to change base_url when in secure mode - if( $_SERVER['HTTPS'] == "on" ) - { - define("BASE_SECURE_URL", $BASE_SECURE_URL."/"); // url used for the secur site - $BASE_URL = "http://".$base_url; // This needs to be set to the real url ie. http://www.upnorth.net - } - define("BASE_INSECURE_URL", $BASE_URL."/"); - define("CONN_STR", "user=nobody dbname=mackinacislandpackages"); // DB connection string - define("OWNER_EMAIL", "mackinacpackage@mict.com"); // site owner's email address - define("FROM_NEWS_EMAIL", "mackinacpackage@mict.com"); // site owner's email address - define("REPLY_TO", "mackinacpackage@mict.com"); // the reply-to field for email's - break; - } - define("BASE_URL", $BASE_URL."/"); // url used for the root of site - define("URL_BASE", $BASE_URL."/"); // same as BASE_URL - define("BASE_PATH", $BASE_PATH."/"); // root directory path of site - define("BASE", $BASE_PATH."/"); // same as BASE_PATH - define("GOOGLE",BASE.'google/'); - define("CLASSES",BASE.'classes/'); - define("HELP_BASE", "help/"); // help guide base (depreciated) - define("UP_BASE", BASE."uploads/"); // uploads directory path - define("IMG_BASE", URL_BASE."images/"); // the images url path - define("POSTCARD_URL",URL."postcard.phtml"); // postcard url (used for postcard app) - define("LOGO_IMG",URL_BASE."images/logoicon.gif"); // used in admin area as the path to image logo - define("HELP_IMG",URL_BASE."images/help.gif"); // help image url (depriated) - define("ORIGINAL_PATH", BASE."images/original/"); // path of original images - define("RESIZED_PATH", BASE."images/resized/"); // path of first resized image - define("MIDSIZED_PATH", BASE."images/midsized/"); // path of half sized of resized - define("THUMB_PATH", BASE."images/thumb/"); // path of thumbnail directory - if( $_SERVER['HTTPS'] == "on" ) - { - define("ORIGINAL", $BASE_SECURE_URL."/images/original/"); // url of original images - define("RESIZED", $BASE_SECURE_URL."/images/resized/"); // url of resized - define("MIDSIZED", $BASE_SECURE_URL."/images/midsized/"); // url of midsized - define("THUMB", $BASE_SECURE_URL."/images/thumb/"); // url of thumbnail - } - else - { - define("ORIGINAL", URL_BASE."images/original/"); // url of original images - define("RESIZED", URL_BASE."images/resized/"); // url of resized - define("MIDSIZED", URL_BASE."images/midsized/"); // url of midsized - define("THUMB", URL_BASE."images/thumb/"); // url of thumbnail - } - - /** these are the image sizing defines USE THESE ONLY - only allowed string of 'WxH[<>]' [-quality Percentage] - */ - define("ITEM_RESIZED", "'287>'"); // used in convert call to resize images - define("ITEM_MIDSIZED", "'210>'"); - define("ITEM_THUMB","'120>'"); - - define("FOOTER_IMG", URL_BASE."images/logosmall.gif"); - define("FOOTER_URL", URL_BASE); - define("STYLE","main.css"); - - /** - These are defines for the photo gallery images - */ - define('PHOTO_LARGE_SIZE',"'700x450>'"); - define('PHOTO_LARGE_DIR',BASE.'images/photo-large/'); - define('PHOTO_LARGE_URL',BASE_URL.'images/photo-large/'); - - define('PHOTO_SMALL_SIZE',"'133x100>'"); - define('PHOTO_SMALL_DIR',BASE.'images/photo-small/'); - define('PHOTO_SMALL_URL',BASE_URL.'images/photo-small/'); - // [status_US] array of states and their abbr. - $states_US[""] = "- Choose State -"; - $states_US["AL"]= "Alabama"; - $states_US["AK"]= "Alaska"; - $states_US["AZ"]= "Arizona"; - $states_US["AR"]= "Arkansas"; - $states_US["CA"]= "California"; - $states_US["CO"]= "Colorado"; - $states_US["CT"]= "Connecticut"; - $states_US["DE"]= "Delaware"; - $states_US["DC"]= "District of Columbia"; - $states_US["FL"]= "Florida"; - $states_US["GA"]= "Georgia"; - $states_US["HI"]= "Hawaii"; - $states_US["ID"]= "Idaho"; - $states_US["IL"]= "Illinois"; - $states_US["IN"]= "Indiana"; - $states_US["IA"]= "Iowa"; - $states_US["KS"]= "Kansas"; - $states_US["KY"]= "Kentucky"; - $states_US["LA"]= "Louisiana"; - $states_US["ME"]= "Maine"; - $states_US["MD"]= "Maryland"; - $states_US["MA"]= "Massachusetts"; - $states_US["MI"]= "Michigan"; - $states_US["MN"]= "Minnesota"; - $states_US["MS"]= "Mississppi"; - $states_US["MO"]= "Missouri"; - $states_US["MT"]= "Montana"; - $states_US["NE"]= "Nebraska"; - $states_US["NV"]= "Nevada"; - $states_US["NH"]= "New Hampshire"; - $states_US["NJ"]= "New Jersey"; - $states_US["NM"]= "New Mexico"; - $states_US["NY"]= "New York"; - $states_US["NC"]= "North Carolina"; - $states_US["ND"]= "North Dakota"; - $states_US["OH"]= "Ohio"; - $states_US["OK"]= "Oklahoma"; - $states_US["OR"]= "Oregon"; - $states_US["PA"]= "Pennsylvania"; - $states_US["RI"]= "Rhode Island"; - $states_US["SC"]= "South Carolina"; - $states_US["SD"]= "South Dakota"; - $states_US["TN"]= "Tennessee"; - $states_US["TX"]= "Texas"; - $states_US["UT"]= "Utah"; - $states_US["VT"]= "Vermont"; - $states_US["VA"]= "Virginia"; - $states_US["WA"]= "Washington"; - $states_US["WV"]= "West Virginia"; - $states_US["WI"]= "Wisconsin"; - $states_US["WY"]= "Wyoming"; - - // [states] extended states array - $states[""] = "- Choose State -"; - $states["AL"] = "Alabama"; - $states["AK"] = "Alaska"; - $states["AB"] = "Alberta"; -// $states["AS"] = "American Samoa"; - $states["AZ"] = "Arizona"; - $states["AR"] = "Arkansas"; - $states["BC"] = "British Columbia"; - $states["CA"] = "California"; - $states["CO"] = "Colorado"; - $states["CT"] = "Connecticut"; - $states["DE"] = "Delaware"; - $states["DC"] = "District of Columbia"; -// $states["FM"] = "Federated States of Micronesia"; - $states["FL"] = "Florida"; - $states["GA"] = "Georgia"; -// $states["GU"] = "Guam"; - $states["HI"] = "Hawaii"; - $states["ID"] = "Idaho"; - $states["IL"] = "Illinois"; - $states["IN"] = "Indiana"; - $states["IA"] = "Iowa"; - $states["KS"] = "Kansas"; - $states["KY"] = "Kentucky"; - $states["LA"] = "Louisiana"; - $states["ME"] = "Maine"; - $states["MB"] = "Manitoba"; -// $states["MH"] = "Marshall Islands"; - $states["MD"] = "Maryland"; - $states["MA"] = "Massachusetts"; - $states["MI"] = "Michigan"; - $states["MN"] = "Minnesota"; - $states["MS"] = "Mississppi"; - $states["MO"] = "Missouri"; - $states["MT"] = "Montana"; - $states["NE"] = "Nebraska"; - $states["NV"] = "Nevada"; - $states["NB"] = "New Brunswick"; - $states["NF"] = "Newfoundland"; - $states["NH"] = "New Hampshire"; - $states["NJ"] = "New Jersey"; - $states["NM"] = "New Mexico"; - $states["NY"] = "New York"; - $states["NC"] = "North Carolina"; - $states["ND"] = "North Dakota"; -// $states["MP"] = "Northern Mariana Islands"; - $states["NT"] = "Northwest Territories"; - $states["NS"] = "Nova Scotia"; - $states["OH"] = "Ohio"; - $states["OK"] = "Oklahoma"; - $states["ON"] = "Ontario"; - $states["OR"] = "Oregon"; -// $states["PW"] = "Palau"; - $states["PA"] = "Pennsylvania"; - $states["PE"] = "Prince Edward Island"; - $states["PR"] = "Puerto Rico"; - $states["QC"] = "Quebec"; - $states["RI"] = "Rhode Island"; - $states["SK"] = "Saskatchewan"; - $states["SC"] = "South Carolina"; - $states["SD"] = "South Dakota"; - $states["TN"] = "Tennessee"; - $states["TX"] = "Texas"; - $states["UT"] = "Utah"; - $states["VT"] = "Vermont"; - $states["VI"] = "Virgin Islands"; - $states["VA"] = "Virginia"; - $states["WA"] = "Washington"; - $states["WV"] = "West Virginia"; - $states["WI"] = "Wisconsin"; - $states["WY"] = "Wyoming"; - $states["YT"] = "Yukon"; -// $states["Asia"] = "Asia"; -// $states["Australia"] = "Australia"; -// $states["Bahamas"] = "Bahamas"; -// $states["Caribbean"] = "Caribbean"; -// $states["Costa Rica"] = "Costa Rica"; -// $states["South America"] = "South America"; -// $states["South Africa"] = "South Africa"; -// $states["Europe"] = "Europe"; -// $states["Mexico"] = "Mexico"; - /* Libraries */ - /* Replaced with the actual functions instead of includes (2001-12-14) */ - - $cp1252_map = array( - "\xc2\x80" => "\xe2\x82\xac", /* EURO SIGN */ - "\xc2\x82" => "\xe2\x80\x9a", /* SINGLE LOW-9 QUOTATION MARK */ - "\xc2\x83" => "\xc6\x92", /* LATIN SMALL LETTER F WITH HOOK */ - "\xc2\x84" => "\xe2\x80\x9e", /* DOUBLE LOW-9 QUOTATION MARK */ - "\xc2\x85" => "\xe2\x80\xa6", /* HORIZONTAL ELLIPSIS */ - "\xc2\x86" => "\xe2\x80\xa0", /* DAGGER */ - "\xc2\x87" => "\xe2\x80\xa1", /* DOUBLE DAGGER */ - "\xc2\x88" => "\xcb\x86", /* MODIFIER LETTER CIRCUMFLEX ACCENT */ - "\xc2\x89" => "\xe2\x80\xb0", /* PER MILLE SIGN */ - "\xc2\x8a" => "\xc5\xa0", /* LATIN CAPITAL LETTER S WITH CARON */ - "\xc2\x8b" => "\xe2\x80\xb9", /* SINGLE LEFT-POINTING ANGLE QUOTATION */ - "\xc2\x8c" => "\xc5\x92", /* LATIN CAPITAL LIGATURE OE */ - "\xc2\x8e" => "\xc5\xbd", /* LATIN CAPITAL LETTER Z WITH CARON */ - "\xc2\x91" => "\xe2\x80\x98", /* LEFT SINGLE QUOTATION MARK */ - "\xc2\x92" => "\xe2\x80\x99", /* RIGHT SINGLE QUOTATION MARK */ - "\xc2\x93" => "\xe2\x80\x9c", /* LEFT DOUBLE QUOTATION MARK */ - "\xc2\x94" => "\xe2\x80\x9d", /* RIGHT DOUBLE QUOTATION MARK */ - "\xc2\x95" => "\xe2\x80\xa2", /* BULLET */ - "\xc2\x96" => "\xe2\x80\x93", /* EN DASH */ - "\xc2\x97" => "\xe2\x80\x94", /* EM DASH */ - - "\xc2\x98" => "\xcb\x9c", /* SMALL TILDE */ - "\xc2\x99" => "\xe2\x84\xa2", /* TRADE MARK SIGN */ - "\xc2\x9a" => "\xc5\xa1", /* LATIN SMALL LETTER S WITH CARON */ - "\xc2\x9b" => "\xe2\x80\xba", /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/ - "\xc2\x9c" => "\xc5\x93", /* LATIN SMALL LIGATURE OE */ - "\xc2\x9e" => "\xc5\xbe", /* LATIN SMALL LETTER Z WITH CARON */ - "\xc2\x9f" => "\xc5\xb8" /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/ - ); - /** - * is_utf8 - * - * @param mixed $string - * @access public - * @return void - */ - function is_utf8($string) { - return (preg_match('/^([\x00-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xec][\x80-\xbf]{2}|\xed[\x80-\x9f][\x80-\xbf]|[\xee-\xef][\x80-\xbf]{2}|f0[\x90-\xbf][\x80-\xbf]{2}|[\xf1-\xf3][\x80-\xbf]{3}|\xf4[\x80-\x8f][\x80-\xbf]{2})*$/', $string) === 1); - } - /** - * cp1252_to_utf8 - * - * @param mixed $str - * @access public - * @return void - */ - function cp1252_to_utf8($str) { - global $cp1252_map; - return strtr(utf8_encode($str), $cp1252_map); - } - /** - * myEncode - * - * @param mixed $string - * @access public - * @return void - */ - function myEncode( $string ) - { - if( is_utf8( $string ) ) - { - return( $string ); - } - else - { - return( cp1252_to_utf8( $string ) ); - } - } - - /** - * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no - card type is given, attempts to guess. Then, if a list of - accepted types is given, determines whether or not we'll - accept it - * @param $Num: Credit Card Number - * @param $Name = '': Type of Card - * @param $Accepted='' : Accepted array - * - * @return bool - * @access - **/ - function CreditVal($Num, $Name = '', $Accepted='') - { - $Name = strtolower( $Name ); - $Accepted = strtolower( $Accepted ); - $GoodCard = 1; - $Num = preg_replace("%[^[:digit:]]%", "", $Num); - switch ($Name) - { - - case "mastercard" : - $GoodCard = preg_match("%^5[1-5].{14}$%", $Num); - break; - - case "visa" : - $GoodCard = preg_match("%^4.{15}$|^4.{12}$%", $Num); - break; - - case "americanexpress" : - $GoodCard = preg_match("%^3[47].{13}$%", $Num); - break; - - case "discover" : - $GoodCard = preg_match("%^6011.{12}$%", $Num); - break; - - case "dinerscard" : - $GoodCard = preg_match("%^30[0-5].{11}$|^3[68].{12}$%", $Num); - break; - - default: - if( preg_match("%^5[1-5].{14}$%", $Num) ) $Name = "mastercard"; - if( preg_match("%^4.{15}$|^4.{12}$%", $Num) ) $Name = "visa"; - if( preg_match("%^3[47].{13}$%", $Num) ) $Name = "americanexpress"; - if( preg_match("%^6011.{12}$%", $Num) ) $Name = "discover"; - if( preg_match("%^30[0-5].{11}$|^3[68].{12}$%", $Num) ) $Name="dinerscard"; - break; - } - - // If there's a limit on card types we accept, check for it here. - if( $Accepted ) - { - $type_verified = FALSE; - $brands = explode_trim( ",", $Accepted ); - foreach( $brands as $brand ) - if( $Name == $brand ) - $type_verified = TRUE; - - if( !$type_verified ) return(FALSE); - } - - $Num = strrev($Num); - - $Total = 0; - - for ($x=0; $x -
- - - - - -
- - - - FOOTER_IMG -
- - - - - - - -
-
$msg"?>
-
- - '; - foreach( $nav as $link => $url ) - { - $out .= '
  • '.$link.'
  • '; - } - $out .= ''; - } - echo $out; - } - - /** - * html_header :Opens up the html tags, and includes the style sheet link - generates a header table on the top of the page it's called on. - * @param $title: Page Title - * @param $msg: message to display - * @param $$img : image to display - * - * @return void - * @access - **/ - function html_header($title, $msg, $img) - { - $header_table_width = "400"; - $header_table_align = "center"; - - ?> - - - - <?echo $title?> - - - - - - - - - - -
    - - <?echo HEAD?> - -
    -
    -
    - $value) - * - * @return void - * @access - **/ - function form_header($action, $method, $hidden = "") - { - echo "
    "; - if($hidden != "" && is_array($hidden)) - { - foreach($hidden as $key=>$value) - { - echo ""; - } - } - } - - /** - * text_area :Creates textarea with good default values for rows cols and wrap. - * @param $name: string form action string - * @param $value: string Method of form - * @param $$rows = 15: int4 number of rows in textarea box - * @param $$cols = 50: int4 number of cols in textarea box - * @param $$wrap = "virtual" : string the wrap value for the textarea box - * - * @return void - * @access - **/ - function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" ) - { - echo ""; - } - - /** - * text_box :Creates a input box for text with 35 as default size - * @param $name: string name of text box - * @param $value: string value of text box - * @param $$size = 35 : string size of text box - * - * @return void - * @access - **/ - function text_box($name, $value, $size = 35) - { - echo ""; - } - - /** - * form_footer :Closes up the form tag, and includes the submit button - * @param $name: string form action string - * @param $$suppress = 0: string Method of form - * @param $$cs : int colspan for td - * - * @return void - * @access - **/ - function form_footer($name, $suppress = 0, $cs) - { - echo " - "; - if($suppress == 1) - { - echo ""; - } - /* echo "";*/ - echo ""; - } - - /* Graphics Libraries */ - /** - * process_image - * NOTES: - * This function does the following: - * - * 1) places image into original folder - * - * 2) makes three images from original size and places them - * into the RESIZED, MIDSIZED, and THUMB folders - * - * @param mixed $image - * @param mixed $image_name - * @access public - * @return string - */ - function process_image( $image, $image_name ) - { - if(!defined("ORIGINAL_PATH")) - { - html_error("this not defined original_path",1); - } - if(!defined("RESIZED_PATH")) - { - html_error("this not defined resized_path",1); - } - if(!defined("MIDSIZED_PATH")) - { - html_error("this not defined midsized_path",1); - } - if(!defined("THUMB_PATH")) - { - html_error("this not defined thumb_path",1); - } - $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH); - //img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],ITEM_ORIGINAL); - img_resize(ORIGINAL_PATH.$image_upload_array[0],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED); - img_resize(RESIZED_PATH.$image_upload_array[0],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED); - img_resize(MIDSIZED_PATH.$image_upload_array[0],THUMB_PATH.$image_upload_array[0],ITEM_THUMB); - $image_name = $image_upload_array[0]; - return($image_name); - } - - /** - * img_resize - * resized based on imagick widthxheight given - * to scale by maxwidth of 280 use '280>' - * which will keep it from making image larger - * - * @param mixed $path2image - * @param mixed $path2thumb - * @param mixed $size - * @access public - * @return string - */ - function img_resize( $path2image, $path2thumb, $size ) - { - exec( "which convert", $output, $return ); - if( $return == 0 ) - { - $CONVERT = $output[0]; - } - else - { - return( $error = array('convert path uknown') ); - } - $imageName = basename($path2image); - $thumbName = basename($path2thumb); - - exec("$CONVERT -quality 100 -scale $size $path2image $path2thumb"); - - $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb"); - return($img_resize_array); - } - - /** - * img_upload - * simplified to use the file_upload function with restricted set to true - * which will return an array instead of string (as in files) - * and only allow png,gif,jpg images to be uploaded - * - * @param mixed $form_field - * @param mixed $img_name - * @param mixed $destination_path - * @access public - * @return string - */ - function img_upload( $form_field, $img_name, $destination_path ) - { - return( file_upload( $form_field, $img_name, $destination_path, true ) ); - } - - /** - * file_upload - * this will replace the older version and that of img_upload which calls this with extra - * restricted of true - * - * @param mixed $form_field - * @param mixed $file_name - * @param mixed $destination_path - * @access public - * @return string - */ - function file_upload( $form_field, $file_name, $destination_path, $restricted = false ) - { - $file_name_in_use = false; - $file_name = preg_replace( "%[!@#$\%^&()+={};:\'\"\/ ]%", "-", $file_name ); - if( $restricted ) - { - $size = getImageSize( $form_field ); - if( !in_array( $size[2], array( 1, 2, 3 ) ) ) - { - echo '

    ' - .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files' - .'
    ' - .'

    ' - ."Hit your browser's back button to continue" - .'

    '; - $error[0] = "ERROR"; - return($error); - } - } - if( file_exists( $destination_path.$file_name ) ) - { - $file_name_in_use = true; - } - if( $file_name_in_use == true ) - { - $new_file_name = mktime().$file_name; - $new_file_location = $destination_path.$new_file_name; - copy( $form_field, $new_file_location ); - $file_upload = $new_file_name; - $file_upload_array = array( $new_file_name, $new_file_location ); - } - else - { - $new_file_name = $file_name; - $new_file_location = $destination_path.$new_file_name; - copy( $form_field, $new_file_location ); - $file_upload = $new_file_name; - $file_upload_array = array( $new_file_name, $new_file_location ); - } - if( is_file( $new_file_location ) ) - { - chmod( $new_file_location, 0666 ); - } - if( $restricted ) - { - return( $file_upload_array ); - } - else - { - return( $file_upload ); - } - } - - /* Misc. Functions */ - - /** - * http_strip :Strips the http:// part from start of string - * @param $&$string : $string - * - * @return string $stirng minus http:// in front - * @access - **/ - function http_strip(&$string) - { - $test_string = strtolower($string); - if(substr($test_string,0,7) == "http://") - { - $string = substr($string,7); - } - } - - /** - * footer : used for admin page footer to close out the top function - * - * @return void - * @access - **/ - function footer() - { - $out = ' - - - '; - echo $out; - } - - /** - * top :Output the starting html and admin table tags - * @param $message: The title - * @param $hp: The help file to use - * @param $$hp2 = NULL : The help file to use (links to gaslightmedia.com) - * - * @return void - * @access - **/ - function top($message, $hp,$hp2 = NULL) - { - if($hp2 != "") - { - $help_guide = '

    '; - /* - $help_guide = '
    Online Help Guide '; - */ - $help_guide .= 'Printable Help Guide
    '; - } - $out = ' - - - - Untitled - - - - -

    '.$message.'

    - '.$help_guide.' - '; - echo $out; - } - - /** - * top2 : alias to top() - * @param $message: message title - * @param $hp: help file - * @param $$hp2 = NULL : gaslight help file - * - * @return - * @access - **/ - function top2($message, $hp,$hp2 = NULL) - { - // make this an alias to top() - // by calling top instead of adding extra code - top($message,$hp,$hp2); - - } - - /******************************************************************************** - * - * DO NOT EDIT THIS SECTION - * - ********************************************************************************/ - - if( $DEBUG ) - { - echo '
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Portable Site Data - setup.phtml

    CVS Version Id:$Id: setup.phtml,v 1.10 2011/06/13 12:42:22 matrix Exp $
    SITENAME'.SITENAME.'
    BASE'.BASE.'
    UP_BASE'.UP_BASE.'
    HELP_BASE'.HELP_BASE.'
    IMG_BASE'.IMG_BASE.'
    URL_BASE'.URL_BASE.'
    CONN_STR'.CONN_STR.'
    STYLE'.STYLE.'
    ORIGINAL_PATH'.ORIGINAL_PATH.'
    RESIZED_PATH'.RESIZED_PATH.'
    MIDSIZED_PATH'.MIDSIZED_PATH.'
    THUMB_PATH'.THUMB_PATH.'
    ORIGINAL'.ORIGINAL.'
    RESIZED'.RESIZED.'
    MIDSIZED'.MIDSIZED.'
    THUMB'.THUMB.'
    $CALLED_FROM_DIR'.$CALLED_FROM_DIR.' 
    $BASE_PATH'.$BASE_PATH.'
    $BASE_URL'.$BASE_URL.'
    $BASE_SECURE_URL'.$BASE_SECURE_URL.'
    -   -

    -


    -

    -

    - '; - - } - /** - * htmlcode: Output code to enable htmlarea for the page - * MUST BE CALLED AFTER TEXTAREAS ON PAGE - * @param $$w = 570: width of htmlarea in px - * @param $$h = 400: height of htmlarea in px - * - * @return void - * @access - **/ - function htmlcode( $w = 570, $h = 400, $textarea = array('description') ) - { - echo ' - - - - '; - echo ' - + + '; + echo ' + - '; - } - - /** - * date_entry : Generate the select boxes for date entry - * month-day-year as drop down select - * @param $month: - * @param $day: - * @param $year: - * @param $month_name: name of select month - * @param $day_name: name of select day - * @param $$year_name : name of select year - * - * @return - * @access - **/ - function date_entry($month,$day,$year,$month_name,$day_name,$year_name,$onChange = NULL) - { - $cur_date = getdate(); - - if($month == "") - { - $month = $cur_date['mon']; - } - if($day == "") - { - $day = $cur_date['mday']; - } - if($year == "") - { - $year = $cur_date['year']; - } - $date = '"; - for($i=1;$i<=12;$i++) - { - $time .= "