function html_end() { extract(tep_load('defs', 'database')); // Setup help script - default js help is loaded by system_base $script_name = tep_get_script_name(); $contents = ''; $launcher = DIR_FS_PLUGINS . 'common_help.tpl'; $result = tep_read_contents($launcher, $contents); if (!$result) { return false; } $postfix = 'list'; switch ($cDefs->action) { case 'verify': $posfix = 'verify'; break; default: break; } $title = $this->get_system_help_title($postfix); $contents_array = array('POPUP_TITLE' => $title, 'POPUP_SELECTOR' => 'div.help_page a.heading_help'); // process js template $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array); return true; }
function html_end() { extract(tep_load('defs')); $script_name = tep_get_script_name(); $contents = ''; $launcher = DIR_FS_PLUGINS . 'common_help.tpl'; $result = tep_read_contents($launcher, $contents); if (!$result) { return false; } $contents_array = array('POPUP_TITLE' => HEADING_HELP_TITLE, 'POPUP_SELECTOR' => 'div.help_page a.' . $script_name); $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array); return true; }
function get_system_help_title($postfix) { extract(tep_load('database')); $result = TEXT_INFO_NA; $help = $postfix; if (strpos($postfix, '_') === false) { $help = tep_get_script_name() . '_' . $postfix; } $template_query = $db->query("select template_subject from " . TABLE_TEMPLATES . " where group_id = " . TEMPLATE_SYSTEM_GROUP . " and template_title='" . $db->input($help) . "'"); if (!$db->num_rows($template_query)) { return $result; } $template_array = $db->fetch_array($template_query); $result = $template_array['template_subject']; return $result; }
function &tep_load() { static $_objects = array(); static $_cross = array('database' => 'db', 'languages' => 'lng', 'http_headers' => 'http', 'message_stack' => 'msg', 'plugins_admin' => 'cPlug', 'config' => 'cfg'); $result_array = array(); $args = func_get_args(); if (empty($args)) { return $_objects; } foreach ($args as $name) { $result = false; $dir = DIR_FS_CLASSES . $name; $file = $dir . '.php'; if (isset($_cross[$name])) { $cname = $_cross[$name]; } elseif (strpos($name, '_') !== false) { $cname = $name; } else { $cname = 'c' . ucfirst($name); } if (!isset($_objects[$cname])) { include_once $file; if (!class_exists($name)) { die('Critical: Invalid Class File: ' . $file); } // Check for class overrides and load them if exist if (is_dir($dir)) { $overrides_array = array_filter(glob($dir . '/' . $name . '*.php'), 'is_file'); if (!empty($overrides_array)) { sort($overrides_array); for ($i = 0, $j = count($overrides_array); $i < $j; $i++) { include_once $dir . '/' . $overrides_array[$i]; if (!class_exists($name)) { die('Critical: Invalid Class File: ' . $overrides_array[$i]); } } $name = tep_get_script_name($overrides_array[$i]); } } $_objects[$cname] = new $name(); } $result_array[$cname] =& $_objects[$cname]; } return $result_array; }
function html_end() { extract(tep_load('defs', 'sessions')); $script_name = tep_get_script_name(); ob_start(); require PLUGINS_ADMIN_PREFIX . $script_name . '.tpl'; $contents = ob_get_contents(); ob_end_clean(); $cDefs->media[] = $contents; $contents = ''; $launcher = DIR_FS_PLUGINS . 'common_help.tpl'; $result = tep_read_contents($launcher, $contents); if (!$result) { return false; } $contents_array = array('POPUP_SELECTOR' => 'div.help_page a.heading_help', 'POPUP_TITLE' => ''); $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array); return true; }
function html_end() { extract(tep_load('defs', 'sessions')); if (!$this->check_scripts($this->scripts_array)) { return false; } $cStrings =& $this->strings; ob_start(); require $this->admin_path . 'back/jscripts.tpl'; $contents = ob_get_contents(); ob_end_clean(); $cDefs->media[] = $contents; $contents = ''; $launcher = $this->admin_path . 'back/launcher.tpl'; $result = tep_read_contents($launcher, $contents); if (!$result) { return false; } $script_name = tep_get_script_name(); $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.plugins_help'); $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array); return true; }
function get_meta_tags($params_array) { extract(tep_load('defs')); $tmp_array = array(); if (!tep_empty(META_GOOGLE_VERIFY) && $cDefs->script == FILENAME_DEFAULT) { $tmp_array['google_verify'] = '<meta name="google-site-verification" content="' . META_GOOGLE_VERIFY . '" />'; } $tags_array = $this->get_tags_info($params_array); if (!is_array($tags_array) || !count($tags_array)) { $string = tep_get_script_name(); $title = $this->create_safe_string($string, META_DEFAULT_WORDS_SEPARATOR, 0); $tmp_array['title'] = '<title>' . STORE_NAME . ' ' . $title . '</title>'; $tmp_array['author'] = '<meta name="author" content="' . STORE_NAME . '" />'; $meta_string = implode("\n", $tmp_array) . "\n"; return $meta_string; } $tmp_array['keywords'] = ''; $tmp_array['text'] = ''; $tmp_array['title'] = '<title>'; foreach ($tags_array as $key => $value) { // if( !isset($tmp_array['title']) && tep_not_null($value['title']) ) { // $tmp_array['title'] = '<title>' . ucwords($value['title']) . '</title>'; // } $tmp_array['title'] .= ucwords($value['title']) . '-'; $tmp_array['keywords'] .= $value['keywords'] . ','; $tmp_array['text'] .= $value['text'] . '.'; } $tmp_array['title'] = substr($tmp_array['title'], 0, -1); $tmp_array['title'] .= '</title>'; if (strlen($tmp_array['keywords'])) { $tmp_array['keywords'] = substr($tmp_array['keywords'], 0, -1); } if (strlen($tmp_array['text'])) { $tmp_array['text'] = substr($tmp_array['text'], 0, -1); } $tmp_array['keywords'] = '<meta name="keywords" content="' . $tmp_array['keywords'] . '" />'; $tmp_array['text'] = '<meta name="description" content="' . $tmp_array['text'] . '" />'; $tmp_array['author'] = '<meta name="author" content="' . STORE_NAME . '" />'; $tmp_array['generator'] = '<meta name="generator" content="META-G in I-Metrics CMS" />'; $meta_string = implode("\n", $tmp_array) . "\n"; return $meta_string; }
} $cSEO = new $zone_script(); $cSEO->process_saction(); $cSEO->process_action(); require DIR_FS_OBJECTS . 'html_start_sub1.php'; require DIR_FS_OBJECTS . 'html_start_sub2.php'; ?> <div class="maincell"<?php if (!$cSEO->is_top_level()) { echo ' style="width:100%;"'; } ?> > <div class="comboHeadingTop"> <div class="rspacer floater help_page"><?php echo '<a href="' . tep_href_link($g_script, 'action=help&zID=' . $zID) . '" class="' . tep_get_script_name() . '" target="_blank">' . tep_image(DIR_WS_ICONS . 'icon_help_32.png', BOX_OTHER_QUICK_HELP) . '</a>'; ?> </div> <div class="floater"> <?php echo '<h1>'; echo HEADING_TITLE; if (!empty($zID)) { echo ' » ' . $zone_array['seo_types_name']; } echo '</h1>'; ?> </div> </div> <?php echo $cSEO->display_html();
//---------------------------------------------------------------------------- // Released under the GNU General Public License //---------------------------------------------------------------------------- */ require 'includes/application_top.php'; if (!$current_gtext_id) { tep_redirect(); } $generic_query = $g_db->fly("select gtext_title, gtext_description, date_added from " . TABLE_GTEXT . " where gtext_id='" . (int) $current_gtext_id . "'"); $generic_array = $g_db->fetch_array($generic_query); $g_breadcrumb->add($generic_array['gtext_title'], tep_href_link($g_script, 'gtext_id=' . $current_gtext_id)); require DIR_FS_OBJECTS . 'html_start_sub1.php'; require DIR_FS_OBJECTS . 'html_start_sub2.php'; $heading_row = true; require DIR_FS_OBJECTS . 'html_body_header.php'; $template_file = DIR_WS_TEMPLATE . 'html_' . tep_get_script_name($g_script) . '.tpl'; if (is_file($template_file)) { include $template_file; } else { ?> <div><h1><?php echo TEXT_INVALID_PAGE; ?> </h1></div> <div><?php echo TEXT_INVALID_PAGE_INFO; ?> </div> <?php } require DIR_FS_OBJECTS . 'html_end.php';
$explain_array = $g_db->query_to_array($explain_query_raw); if (empty($explain_array)) { $messageStack->add_session(ERROR_EMPTY_QUERY); tep_redirect(tep_href_link($g_script)); } require DIR_FS_CLASSES . 'csv_core.php'; $csv = new csv_core(',', '"', "\r\n"); $csv->reset_buffer(); $csv->write_header($header_cols); //$header_cols = array_flip($header_cols); for ($i = 0, $j = count($explain_array); $i < $j; $i++) { //$explain_array[$i] = array_intersect_assoc($header_cols, $explain_array[$i]); $csv->write_data($explain_array[$i]); $csv->insert_line(1); } $filename = $g_db->prepare_input(tep_get_script_name($_GET['qs']), true) . '-' . gmdate("m-d-y"); $csv->output($filename); $g_session->close(); exit; break; default: break; } header("Cache-Control: public"); require DIR_FS_OBJECTS . 'html_start_sub1.php'; require DIR_FS_OBJECTS . 'html_start_sub2.php'; ?> <div class="maincell wider"> <div class="comboHeadingTop"> <div class="rspacer floater help_page"><?php echo '<a href="' . tep_href_link($g_script, 'action=help&ajax=list') . '" class="heading_help" title="' . HEADING_TITLE . '" target="_blank">' . tep_image(DIR_WS_ICONS . 'icon_help_32.png', HEADING_TITLE) . '</a>';
//---------------------------------------------------------------------------- */ require 'includes/application_top.php'; // split page-results via post require DIR_FS_CLASSES . 'post_page_results.php'; $error_script = FILENAME_DEFAULT; $result_array = $g_validator->post_validate(array('keywords' => array('max' => 100, 'min' => 2))); if (count($result_array['keywords'])) { $messageStack->add_session(ERROR_AT_LEAST_ONE_INPUT, 'error', tep_get_script_name($error_script)); tep_redirect(tep_href_link()); } $keywords = $_POST['keywords']; $adv_array = array('keywords' => $keywords); $keywords_array = $keywords_exclude_array = array(); if (!tep_parse_search_string($keywords, $keywords_array, $keywords_exclude_array)) { $messageStack->add_session(ERROR_INVALID_KEYWORDS, 'error', tep_get_script_name($error_script)); tep_redirect(tep_href_link()); } $g_breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT)); // $g_breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT)); $g_http->set_headers("Cache-Control: public"); require DIR_FS_OBJECTS . 'html_start_sub1.php'; require DIR_FS_OBJECTS . 'html_start_sub2.php'; $heading_row = true; require DIR_FS_OBJECTS . 'html_body_header.php'; ?> <div><h1><?php echo HEADING_TITLE_2; ?> </h1></div> <?php
function set($plugin_key = '') { extract(tep_load('system_base')); if (empty($plugin_key)) { $plugin_key = tep_get_script_name(); } if (isset($this->keys_array[$plugin_key])) { return true; } $executive = DIR_FS_PLUGINS . $this->prefix . $plugin_key . '.php'; if (!is_file($executive)) { $plugin_key = 'stub'; $executive = DIR_FS_PLUGINS . $this->prefix . $plugin_key . '.php'; } include_once $executive; if (!class_exists($this->prefix . $plugin_key)) { return false; } $index = count($this->plugins_array); $this->keys_array[$plugin_key] = $index; $this->plugins_array[$index] = array('plugins_key' => $plugin_key, 'status' => true, 'display_box' => false); $result = true; return $result; }
function newsletter_remove() { extract(tep_load('database', 'message_stack')); $cStrings =& $this->strings; $remove_id = isset($_GET['id']) ? $db->prepare_input($_GET['id']) : 0; $remove_array = explode('_', $remove_id); if (count($remove_array) != 3) { tep_redirect(); } $customer_id = (int) $remove_array[0]; $nID = (int) $remove_array[1]; $signature = $db->prepare_input($remove_array[2]); $customer_query = $db->query("select customers_name, customers_email from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "' and newsletter is not null"); if (!$db->num_rows($customer_query)) { $msg->add_session($cStrings->ERROR_CUSTOMER_NOT_FOUND, 'error', tep_get_script_name(FILENAME_DEFAULT)); tep_redirect(); } $customer_array = $db->fetch_array($customer_query); $newsletter_query = $db->query("select date_sent from " . TABLE_NEWSLETTERS . " where template_id = '" . (int) $nID . "'"); if (!$db->num_rows($newsletter_query)) { $msg->add_session($cStrings->ERROR_CUSTOMER_NOT_FOUND); tep_redirect(); } $newsletter_array = $db->fetch_array($newsletter_query); if ($signature != md5($customer_array['customers_name'] . $customer_array['customers_email'])) { $msg->add_session($cStrings->ERROR_CUSTOMER_NOT_FOUND); tep_redirect(); } $sql_data_array = array('newsletter' => 'null'); $db->perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id='" . (int) $customer_id . "'"); $msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_EMAIL_REMOVED, $customer_array['customers_email']), 'success'); tep_redirect(); }