<?php require_once 'AMP/System/Lookups.inc.php'; AMP_config_load('content'); class AMPContent_Lookup extends AMPSystem_Lookup { function AMPContent_Lookup() { $this->init(); } function &instance($type, $instance_var = null, $lookup_baseclass = "AMPContentLookup") { return parent::instance($type, $instance_var, $lookup_baseclass); } } class AMPContentLookup_Class extends AMPContent_Lookup { var $datatable = "class"; var $result_field = "class"; function AMPContentLookup_Class() { $this->init(); } } class AMPContentLookup_Classes extends AMPContentLookup_Class { function AMPContentLookup_Classes() { $this->init(); } }
function _RDF_trackbacks($article_id) { if (!AMP_CONTENT_TRACKBACKS_ENABLED) { return false; } require_once 'AMP/Content/Article.inc.php'; AMP_config_load('urls'); $article = new Article($this->comment_set->dbcon, $article_id); return '<!-- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> <rdf:Description rdf:about="' . AMP_SITE_URL . $article->getURL() . '" dc:identifier="' . AMP_SITE_URL . $article->getURL() . '" dc:title="' . $article->getTitle() . '" trackback:ping="' . AMP_Url_AddVars(AMP_SITE_URL . AMP_CONTENT_URL_TRACKBACKS, 'id=' . $article_id) . '" /> </rdf:RDF> -->'; }
<?php AMP_config_load('permission', 'AMP_permission'); // why do you seek the living among the dead? // go to Config/permission.ini.php // there you will find your answers /* define('AMP_PERMISSION_CONTENT_ACCESS', 73); define('AMP_PERMISSION_CONTENT_EDIT', 1); define('AMP_PERMISSION_CONTENT_DELETE', 2); define('AMP_PERMISSION_CONTENT_PUBLISH', 98); define('AMP_PERMISSION_CONTENT_SECTION_LIMIT', 97); define('AMP_PERMISSION_CONTENT_SECTION_DELETE', 6); define('AMP_PERMISSION_CONTENT_SECTION_EDIT', 9); define('AMP_PERMISSION_CONTENT_CLASS_EDIT', 8); define('AMP_PERMISSION_CONTENT_CLASS_DELETE', 7); define('AMP_PERMISSION_CONTENT_DOCUMENTS_EDIT', 85); define('AMP_PERMISSION_CONTENT_IMAGES_EDIT', 85); define('AMP_PERMISSION_CONTENT_FILES_ACCESS', 85); define('AMP_PERMISSION_CONTENT_RSS_ACCESS', 102); define('AMP_PERMISSION_CONTENT_RSS_AGGREGATOR', 102); define('AMP_PERMISSION_CONTENT_RSS_PUBLISH', 300); define('AMP_PERMISSION_CONTENT_NAVIGATION', 47); define('AMP_PERMISSION_CONTENT_TEMPLATE', 49); define('AMP_PERMISSION_CONTENT_CSS', 48); define('AMP_PERMISSION_CALENDAR_ACCESS', 11); define('AMP_PERMISSION_CALENDAR_PUBLISH', 12); define('AMP_PERMISSION_CALENDAR_DELETE', 13); define('AMP_PERMISSION_FAQ_ACCESS', 22); define('AMP_PERMISSION_FAQ_PUBLISH', 24); define('AMP_PERMISSION_FAQ_DELETE', 23);
function AMP_config_write($constant_name, $write_value, $prefix = 'AMP') { $config_id = strtolower($constant_name); if ($prefix && strpos(strtolower($constant_name), strtolower($prefix) . '_') === 0) { $config_id = strtolower(substr($constant_name, strlen($prefix) + 1)); } $current_config = AMP_config_load('site', 'AMP', $cache = false); if (empty($current_config)) { return AMP_config_update(array($config_id => $write_value)); } foreach ($current_config as $id => $value) { if (is_array($value) && strpos($config_id, str_replace(' ', '_', $id) . '_') === 0) { unset($current_config[$config_id]); $current_config[$id][substr($config_id, strlen($id) + 1)] = $write_value; return AMP_config_update($current_config); } } $current_config[$config_id] = $write_value; return AMP_config_update($current_config); }
<?php require_once 'AMP/BaseDB.php'; require_once 'AMP/Content/Article/Trackback.php'; AMP_config_load('urls'); if (!AMP_CONTENT_TRACKBACKS_ENABLED) { print 'Sorry, trackbacks are currently disabled due to abuse.'; exit; } $article_id = 0; if (isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id']) { $article_id = intval($_GET['id']); } $headers = apache_request_headers(); if (!isset($headers['Content-Type']) || strpos($headers['Content-Type'], 'application/x-www-form-urlencoded') !== 0) { $response =& new ArticleTrackback_Response(1, "Content-Type header must be 'application/x-www-form-urlencoded'"); print $response->execute(); exit; } if (!isset($_POST['url'])) { $response =& new ArticleTrackback_Response(1, "No URL given"); print $response->execute(); exit; } $trackback =& new ArticleTrackback($dbcon); $trackback->setDefaults(); $allowed_tags = $trackback->getAllowedTags(); $trackback_data = array_combine_key($allowed_tags, $_POST); $trackback_data['article_id'] = $article_id; if (isset($headers['charset'])) { $trackback_data['charset'] = $headers['charset'];
<?php require_once 'AMP/System/Data/Item.inc.php'; AMP_config_load('dia', null); class Calendar_Event extends AMPSystem_Data_Item { var $datatable = "calendar"; var $name_field = "event"; var $_class_name = 'Calendar_Event'; var $_exact_value_fields = array('id', 'typeid', 'region', 'uid', 'modin'); var $_sort_auto = false; var $_owner; var $_legacy_fields = array('shortdesc' => 'blurb', 'fulldesc' => 'description', 'laddress' => 'event_address', 'lcity' => 'event_city', 'lstate' => 'event_state', 'lzip' => 'event_zip', 'lcountry' => 'event_country', 'org' => 'endorsers', 'typeid' => 'event_type_id', 'contact1' => 'public_contact_name', 'email1' => 'public_contact_email', 'phone1' => 'public_contact_phone', 'lname2' => 'Last_Name', 'fname2' => 'First_Name', 'orgaznization2' => 'Company', 'organization2' => 'Company', 'address2' => 'Street', 'city2' => 'City', 'state2' => 'State', 'country2' => 'Country', 'zip2' => 'Zip', 'email2' => 'Email', 'phone2' => 'Work_Phone', 'fporder' => 'front_page_order', 'fpevent' => 'front_page_event', 'datestamp' => 'entered_at'); var $_zip_distance_expected = false; var $_zip_distance = array(); function Calendar_Event(&$dbcon, $id = null) { $this->init($dbcon, $id); } function _adjustSetData($data) { foreach ($this->_legacy_fields as $old_name => $new_name) { $this->legacyFieldname($data, $old_name, $new_name); } /* $this->legacyFieldname( $data, 'shortdesc', 'blurb' ); $this->legacyFieldname( $data, 'fulldesc', 'description' ); $this->legacyFieldname( $data, 'laddress', 'event_address' ); $this->legacyFieldname( $data, 'lcity', 'event_city' ); $this->legacyFieldname( $data, 'lstate', 'event_state' );
function AMP_load_site_command_line() { $local_path_pattern = '/home/%s/public_html/'; #$local_path_pattern = '/home/%s/'; $site_folder = $_SERVER['argv'][1]; if (!$site_folder) { trigger_error('Usage: login_link.php sitename'); return false; } define('AMP_LOCAL_PATH', sprintf($local_path_pattern, $site_folder)); #define( 'AMP_SYSTEM_CACHE', false ); $config_file_path = sprintf($local_path_pattern, $site_folder) . 'custom/'; $lib_file_path = sprintf($local_path_pattern, $site_folder) . 'lib/'; $include_path = sprintf($local_path_pattern, 'amp') . 'include/'; $include_path = '/home/amp/public_html/include/'; define('AMP_BASE_INCLUDE_PATH', $include_path); $config_file1 = 'SiteConfig.php'; $config_file2 = 'config.php'; $incpath = ini_get('include_path'); // Search local paths for includes. ini_set('include_path', $include_path . ':' . $config_file_path . ':' . $lib_file_path . ':' . ini_get('include_path')); if (!file_exists($config_file_path . $config_file1) && !file_exists($config_file_path . $config_file2)) { trigger_error('path not found: ' . $config_file_path . $config_file2); return false; } require_once 'utility.system.functions.inc.php'; require_once 'utility.functions.inc.php'; require_once 'AMP/System/Flash.php'; if (file_exists($config_file_path . $config_file1)) { require_once $config_file_path . $config_file1; } else { require_once $config_file_path . $config_file2; if (isset($MM_DBTYPE)) { define('AMP_DB_TYPE', $MM_DBTYPE); } define('AMP_DB_HOST', $MM_HOSTNAME); define('AMP_DB_USER', $MM_USERNAME); define('AMP_DB_PASS', $MM_PASSWORD); define('AMP_DB_NAME', $MM_DATABASE); } require_once 'adodb/adodb.inc.php'; if (!defined('AMP_DB_TYPE')) { define('AMP_DB_TYPE', 'mysql'); } ADOLoadCode(AMP_DB_TYPE); $dbcon = ADONewConnection(AMP_DB_TYPE); if (!$dbcon->Connect(AMP_DB_HOST, AMP_DB_USER, AMP_DB_PASS, AMP_DB_NAME)) { trigger_error('database connection failed'); return false; } require_once 'AMP/Registry.php'; $registry = AMP_Registry::instance(); $registry->setDbcon($dbcon); //define( 'AMP_SYSTEM_CACHE', false ); define('AMP_SITE_CACHE_TIMEOUT', 0); require_once 'AMP/System/Config.inc.php'; require_once 'AMP/System/Language/Config.php'; require_once 'AMP/Base/Debug.php'; //require_once( 'AMP/System/Cache/Config.inc.php'); AMP_config_load('cache'); require_once 'AMP/Base/Setup.php'; //require_once( 'AMP/System/User/Config.php'); AMP_config_load('tools'); require_once 'AMP/Base/Lookups.php'; AMP_config_load('site'); AMP_config_load('content'); require_once 'AMP/Content/Map.inc.php'; return $site_folder; }
require_once 'AMP/Content/Map.inc.php'; //custom includes if (file_exists_incpath('custom.layouts.inc.php')) { include_once 'custom.layouts.inc.php'; } if (file_exists_incpath('custom.sources.inc.php')) { include_once 'custom.sources.inc.php'; } if (file_exists_incpath('custom.includes.inc.php')) { include_once 'custom.includes.inc.php'; } if (file_exists_incpath('custom.translations.inc.php')) { include_once 'custom.translations.inc.php'; } //stylesheets AMP_config_load('css', 'amp_content_css'); //old legacy settings if (!(isset($no_legacy) && $no_legacy)) { require_once 'AMP/LegacyRegistry.inc.php'; } /* foreach( $_REQUEST as $rkey => $rvalue ) { if( !is_array( $rvalue )) { if ( $rkey != 'body' && preg_match( '/union.{1,8}select|insert.{1,8}into|delete.{1,8}from/', $rvalue )) { trigger_error( 'SQL injection detected in '. $_SERVER['SCRIPT_NAME'].' '.$rkey.': '. $rvalue ); exit; } } } */
function _readXML($file_name) { $config_values = AMP_config_load($file_name); $this->_config_text = array_merge($this->_config_text, $this->parse_file_comments($file_name)); return $this->make_fields($config_values); }
<?php AMP_config_load('cache'); // why do you seek the living among the dead? // go to Config/cache.ini.php // there you will find your answers /* define( 'AMP_CACHE_TOKEN_URL_CONTENT', '__URL__' ); define( 'AMP_CACHE_TOKEN_XML_DATA', '__XML__' ); define( 'AMP_CACHE_TOKEN_DIR', '__DIR__' ); define( 'AMP_CACHE_TOKEN_LOOKUP', '__LOOKUP__' ); define( 'AMP_CACHE_TOKEN_ADODB', '__ADODB__' ); define( 'AMP_CACHE_TOKEN_ACTION_OUTPUT', '__ACTION__%s__' ); define( 'AMP_CACHE_TOKEN_IMAGE', '__IMAGE__' ); define( 'AMP_CACHE_TOKEN_COMPONENT', '__COMP__%s__' ); if ( !defined( 'AMP_CACHE_KEY_STYLESHEET')) define( 'AMP_CACHE_KEY_STYLESHEET', '%s.css' ); if ( !defined( 'AMP_CACHE_KEY_JAVASCRIPT')) define( 'AMP_CACHE_KEY_JAVASCRIPT', '%s.js' ); if ( !defined( 'AMP_CACHE_KEY_OUTPUT')) define( 'AMP_CACHE_KEY_OUTPUT', '%s.html' ); */
<?php require_once "AMP/System/Permission/Manager.inc.php"; //permission config file require_once 'AMP/System/Permission/Config.inc.php'; AMP_config_load('permission', 'AMP_PERMISSION'); require_once 'AMP/System/Flash.php'; //legacy setup from < 3.5.9 function AMP_init_user() { if (!isset($_SERVER['REMOTE_USER'])) { return false; } $AMP_Permission =& AMPSystem_PermissionManager::instance(); $AMP_CurrentUser = false; $AMP_CurrentUser =& $AMP_Permission->readUser($_SERVER['REMOTE_USER']); if ($AMP_CurrentUser) { if (!defined('AMP_SYSTEM_USER_ID')) { define('AMP_SYSTEM_USER_ID', $AMP_CurrentUser->id); } $content_roots = AMP_lookup('userSiteRoots'); if (isset($content_roots[AMP_SYSTEM_USER_ID])) { if (!defined('AMP_CONTENT_MAP_ROOT_SECTION')) { define('AMP_CONTENT_MAP_ROOT_SECTION', $content_roots[AMP_SYSTEM_USER_ID]); } $sections = AMP_lookup('sections'); if (!defined('AMP_CONTENT_SECTION_NAME_ROOT')) { if (AMP_CONTENT_MAP_ROOT_SECTION != AMP_CONTENT_SECTION_ID_ROOT) { define('AMP_CONTENT_SECTION_NAME_ROOT', $sections[AMP_CONTENT_MAP_ROOT_SECTION]); } else { define('AMP_CONTENT_SECTION_NAME_ROOT', AMP_SITE_NAME);
<?php //standard system pages AMP_config_load('urls'); require_once 'Config/Dynamic.php'; AMP_config_load('system'); /* $system_values = parse_ini_file( 'Config/system.inc', true ); foreach( $system_values as $chunk_label => $items ) { foreach( $items as $label => $value ) { $constant_name = str_replace( ' ', '_', strtoupper( 'AMP ' . $chunk_label . ' ' . $label )); if ( !defined( $constant_name )) { define( $constant_name, $value ); trigger_error( $constant_name . ' :: ' . $value ); } } } /* if ( !defined( 'AMP_CONTENT_MAP_ROOT_SECTION' )) define( 'AMP_CONTENT_MAP_ROOT_SECTION' , 1 ); if ( !defined( 'AMP_SYSTEM_UNIQUE_ID')) define ( 'AMP_SYSTEM_UNIQUE_ID', AMP_DB_NAME ); //if ( !defined( 'AMP_SITE_MEMCACHE_ON' )) define ('AMP_SITE_MEMCACHE_ON', true); if ( !defined( 'AMP_SYSTEM_MEMCACHE_SERVER' )) define ('AMP_SYSTEM_MEMCACHE_SERVER', 'localhost' ); if ( !defined( 'AMP_SYSTEM_MEMCACHE_PORT' )) define ('AMP_SYSTEM_MEMCACHE_PORT', '11211' ); //if ( !defined( 'AMP_SITE_MEMCACHE_TIMEOUT')) define ( 'AMP_SITE_MEMCACHE_TIMEOUT', 180 ); if ( !defined( 'AMP_SYSTEM_INCLUDE_PATH' )) define( 'AMP_SYSTEM_INCLUDE_PATH', 'AMP/System'); if ( !defined( 'AMP_CONTENT_INCLUDE_PATH' )) define( 'AMP_CONTENT_INCLUDE_PATH', 'AMP/Content'); if ( !defined( 'AMP_MODULE_INCLUDE_PATH' )) define( 'AMP_MODULE_INCLUDE_PATH', 'Modules'); if ( !defined( 'AMP_COMPONENT_MAP_FILENAME' )) define( 'AMP_COMPONENT_MAP_FILENAME', 'ComponentMap.inc.php'); if ( !defined( 'AMP_COMPONENT_MAP_CLASSNAME' )) define( 'AMP_COMPONENT_MAP_CLASSNAME', 'ComponentMap');