Exemplo n.º 1
0
 function get_help()
 {
     extract(tep_load('defs', 'database', 'sessions'));
     $result = false;
     $zone_script = '';
     if (isset($_GET['zID']) && tep_not_null($_GET['zID'])) {
         $zone_query = $db->query("select seo_types_class from " . TABLE_SEO_TYPES . " where seo_types_id = '" . (int) $_GET['zID'] . "'");
         if ($db->num_rows($zone_query)) {
             $zone_array = $db->fetch_array($zone_query);
             $zone_script = $zone_array['seo_types_class'];
         }
     }
     if (!empty($zone_script)) {
         $file = DIR_FS_STRINGS . 'help/' . $zone_script . '.php';
     } else {
         $file = DIR_FS_STRINGS . 'help/' . $cDefs->script;
     }
     $result = tep_read_contents($file, $contents);
     if (!$result) {
         return $result;
     }
     echo $contents;
     $cSessions->close();
     return true;
 }
Exemplo n.º 2
0
 function html_start_sub2()
 {
     extract(tep_load('defs', 'database', 'languages', 'sessions', 'plugins_admin', 'message_stack'));
     $selected_box =& $cSessions->register('selected_box');
     $html = '';
     if ($cDefs->ajax) {
         $html .= '  <div id="ajax">' . "\n";
         $html .= '    <div id="wrapper">' . "\n";
         echo $html;
         return;
     }
     tep_output_media();
     $html .= '</head>' . "\n";
     $html .= '<body>' . "\n";
     $html .= '  <div id="wrapper">' . "\n";
     echo $html;
     if ($cDefs->script != FILENAME_DEFAULT) {
         require DIR_FS_INCLUDES . 'header.php';
         echo '    <div class="cleaner"></div>' . "\n";
         echo '      <div id="leftpane">' . "\n";
         require DIR_FS_INCLUDES . 'column_left.php';
         echo '      </div>' . "\n";
         echo '      <div id="mainpane">' . "\n";
     } else {
         echo '    <div class="homepane main">' . "\n";
     }
     // Display Script specific notices
     $msg->output();
 }
Exemplo n.º 3
0
 function get_entries($zone, $tflag = true, $dflag = true, $raw = false)
 {
     extract(tep_load('database'));
     $this->entries_array = array();
     $zone_id = $this->get_zone($zone);
     if (!$zone_id) {
         return $this->entries_array;
     }
     $select_string = '';
     if ($tflag) {
         $select_string .= ', image_alt_title';
     }
     if ($dflag) {
         $select_string .= ', image_title';
     }
     $this->entries_string = "select image_file" . $select_string . " from " . TABLE_IMAGE_ZONES . " where abstract_zone_id = '" . (int) $zone_id . "' order by sequence_order";
     if ($raw) {
         return $this->entries_string;
     } else {
         $tmp_array = $db->query_to_array($this->entries_string);
         if (!count($tmp_array)) {
             return $this->entries_array;
         }
         $this->entries_array = $tmp_array;
         return $this->entries_array;
     }
 }
Exemplo n.º 4
0
function tep_update_whos_online()
{
    extract(tep_load('http_validator', 'database', 'sessions'));
    if ($http->bot) {
        $wo_full_name = 'Bot: ' . $http->bot_name;
    } else {
        $wo_full_name = 'Visitor:' . $http->ua;
    }
    $wo_session_id = $cSessions->id;
    $wo_ip_address = $http->ip_string;
    $wo_last_page_url = getenv('REQUEST_URI');
    $current_time = time();
    $xx_mins_ago = $current_time - MAX_WHOS_ONLINE_TIME;
    // remove entries that have expired
    $db->query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
    $stored_query = $db->query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where ip_address = '" . $db->filter($wo_ip_address) . "'");
    $stored_array = $db->fetch_array($stored_query);
    if ($stored_array['count'] > 0) {
        $sql_data_array = array('full_name' => $db->prepare_input($wo_full_name), 'session_id' => $db->prepare_input($wo_session_id), 'time_last_click' => $db->prepare_input($current_time), 'last_page_url' => $db->prepare_input($wo_last_page_url), 'cookie_sent' => $cSessions->has_cookie() ? 1 : 0);
        $db->perform(TABLE_WHOS_ONLINE, $sql_data_array, 'update', "ip_address = '" . $db->filter($wo_ip_address) . "'");
    } else {
        $sql_data_array = array('full_name' => $db->prepare_input($wo_full_name), 'ip_address' => $db->prepare_input($wo_ip_address), 'time_entry' => $db->prepare_input($current_time), 'time_last_click' => $db->prepare_input($current_time), 'last_page_url' => $db->prepare_input($wo_last_page_url), 'session_id' => $db->prepare_input($wo_session_id), 'cookie_sent' => $cSessions->has_cookie() ? 1 : 0);
        $db->perform(TABLE_WHOS_ONLINE, $sql_data_array, 'insert');
    }
}
Exemplo n.º 5
0
 function html_end()
 {
     extract(tep_load('defs', 'plugins_admin', 'sessions'));
     if ($cDefs->ajax) {
         $cPlug->invoke('ajax_end');
         echo '    </div>' . "\n";
         echo '  </div>' . "\n";
         require DIR_FS_INCLUDES . 'application_bottom.php';
         return;
     }
     if ($cDefs->script != FILENAME_DEFAULT) {
         echo '    </div>' . "\n";
         require DIR_FS_INCLUDES . 'footer.php';
     } else {
         echo '    </div>' . "\n";
         echo '    <div class="homepane main">' . "\n";
         require DIR_FS_INCLUDES . 'footer.php';
         echo '    </div>' . "\n";
     }
     echo '  </div>' . "\n";
     $cPlug->invoke('html_end');
     if ($cDefs->script != FILENAME_DEFAULT) {
         $cDefs->media[] = '<div><script language="javascript" type="text/javascript">' . "\n" . '  var jqWrap = general;' . "\n" . '  jqWrap.launch();' . "\n" . '</script></div>';
     }
     tep_output_media();
     echo '</body>' . "\n";
     echo '</html>' . "\n";
     require DIR_FS_INCLUDES . 'application_bottom.php';
 }
 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;
 }
Exemplo n.º 7
0
 function set_html()
 {
     extract(tep_load('defs', 'database', 'languages', 'sessions', 'plugins_front', 'message_stack', 'breadcrumb'));
     $html_start_sub2 = array(DIR_FS_TEMPLATE . 'html_start_sub2.tpl');
     $cPlug->invoke('html_start_sub2');
     for ($i = 0, $j = count($html_start_sub2); $i < $j; $i++) {
         require $html_start_sub2[$i];
     }
 }
Exemplo n.º 8
0
 function set_html()
 {
     extract(tep_load('defs', 'plugins_front', 'sessions'));
     $html_start_sub1 = array(DIR_FS_TEMPLATE . 'html_start_sub1.tpl');
     $cPlug->invoke('html_start_sub1');
     for ($i = 0, $j = count($html_start_sub1); $i < $j; $i++) {
         require $html_start_sub1[$i];
     }
 }
Exemplo n.º 9
0
 function set_html()
 {
     extract(tep_load('defs', 'database', 'languages', 'plugins_front', 'sessions', 'message_stack', 'breadcrumb'));
     $html_end = array(DIR_FS_TEMPLATE . 'html_end.tpl');
     for ($i = 0, $j = count($html_end); $i < $j; $i++) {
         require $html_end[$i];
     }
     require DIR_FS_INCLUDES . 'application_bottom.php';
 }
Exemplo n.º 10
0
 function process_options()
 {
     extract(tep_load('defs', 'message_stack'));
     $cStrings =& $this->strings;
     // Prepare the options array for storage
     $options_array = array('max_cols' => isset($_POST['max_cols']) && $_POST['max_cols'] > 0 ? (int) $_POST['max_cols'] : $options_array['max_cols'], 'max_drop' => isset($_POST['max_drop']) && $_POST['max_drop'] > 0 ? (int) $_POST['max_drop'] : $options_array['max_drop'], 'max_width' => isset($_POST['max_width']) && $_POST['max_width'] > 0 ? (int) $_POST['max_width'] : $options_array['max_width'], 'border_width' => isset($_POST['border_width']) ? (int) $_POST['border_width'] : $options_array['border_width'], 'font_size' => isset($_POST['font_size']) && $_POST['font_size'] > 0 ? (int) $_POST['font_size'] : $options_array['font_size'], 'font_pad' => isset($_POST['font_pad']) ? (int) $_POST['font_pad'] : $options_array['font_pad']);
     // Store user options
     $this->save_options($options_array);
     $msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success');
     tep_redirect(tep_href_link($cDefs->script, tep_get_all_get_params('action') . 'action=set_options'));
 }
Exemplo n.º 11
0
 function display_links($max_page_links, $parameters = '', $style_class = 'pageResults')
 {
     extract(tep_load('defs'));
     $display_links_string = '';
     if (tep_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // previous button - not displayed on first page
     if ($this->current_page_number == 2) {
         if ($this->current_page_number > 1) {
             $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters, $cDefs->request_type) . '" class="' . $style_class . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . PREVNEXT_BUTTON_PREV . '</a>';
         }
     } else {
         if ($this->current_page_number > 1) {
             $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $cDefs->request_type) . '" class="' . $style_class . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . PREVNEXT_BUTTON_PREV . '</a>';
         }
     }
     // check if number_of_pages > $max_page_links
     $cur_window_num = intval($this->current_page_number / $max_page_links);
     if ($this->current_page_number % $max_page_links) {
         $cur_window_num++;
     }
     $max_window_num = intval($this->number_of_pages / $max_page_links);
     if ($this->number_of_pages % $max_page_links) {
         $max_window_num++;
     }
     // previous window of pages
     if ($cur_window_num > 1) {
         $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($cur_window_num - 1) * $max_page_links, $cDefs->request_type) . '" class="' . $style_class . '" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';
     }
     // page nn button
     for ($jump_to_page = 1 + ($cur_window_num - 1) * $max_page_links; $jump_to_page <= $cur_window_num * $max_page_links && $jump_to_page <= $this->number_of_pages; $jump_to_page++) {
         if ($jump_to_page == $this->current_page_number) {
             if ($this->number_of_pages > 1) {
                 $display_links_string .= '<b class="' . $style_class . '">' . $jump_to_page . '</b>';
             } else {
                 $display_links_string .= '<b>' . $jump_to_page . '</b>';
             }
         } elseif ($jump_to_page == 1) {
             $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters, $cDefs->request_type) . '" class="' . $style_class . '" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' ">' . $jump_to_page . '</a>';
         } else {
             $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . $jump_to_page, $cDefs->request_type) . '" class="' . $style_class . '" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' ">' . $jump_to_page . '</a>';
         }
     }
     // next window of pages
     if ($cur_window_num < $max_window_num) {
         $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($cur_window_num * $max_page_links + 1), $cDefs->request_type) . '" class="' . $style_class . '" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';
     }
     // next button
     if ($this->current_page_number < $this->number_of_pages && $this->number_of_pages != 1) {
         $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($this->current_page_number + 1), $cDefs->request_type) . '" class="' . $style_class . '" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' ">' . PREVNEXT_BUTTON_NEXT . '</a>';
     }
     return $display_links_string;
 }
Exemplo n.º 12
0
 function objectInfo($object_array, $strip = true)
 {
     extract(tep_load('database'));
     foreach ($object_array as $key => $value) {
         if ($strip) {
             $this->{$key} = $db->prepare_input($value);
         } else {
             $this->{$key} = $value;
         }
     }
 }
Exemplo n.º 13
0
 function set_get_array()
 {
     extract(tep_load('defs'));
     $args = func_get_args();
     foreach ($args as $key) {
         if (!isset($_GET[$key])) {
             continue;
         }
         $cDefs->link_params[$key] = $_GET[$key];
     }
     $_GET = $cDefs->link_params;
 }
Exemplo n.º 14
0
 function get($id = '')
 {
     extract(tep_load('database'));
     if (empty($id)) {
         return $this->data;
     }
     $check_query = $db->fly("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $id . "'");
     if (!$db->num_rows($check_query)) {
         return array();
     }
     return $db->fetch_array($check_query);
 }
Exemplo n.º 15
0
 function get_gtext_ids($zone)
 {
     extract(tep_load('database'));
     $this->text_ids_array = array();
     $zone_id = $this->get_zone($zone);
     if (!$zone_id) {
         return $this->text_ids_array;
     }
     $gtext_query_raw = "select gtext_id " . TABLE_GTEXT_TO_DISPLAY . " where abstract_zone_id = '" . (int) $zone_id . "' order by sequence_order";
     $this->text_ids_array = $db->query_to_array($gtext_query_raw);
     return $this->text_ids_array;
 }
Exemplo n.º 16
0
 function get_parent_zones($subzone_id, $enabled_flag = true)
 {
     extract(tep_load('database'));
     $zones_array = $db->query_to_array("select abstract_zone_id from " . TABLE_SUPER_ZONES . " where subzone_id = '" . (int) $subzone_id . "' order by sequence_order");
     if ($enabled_flag) {
         $tmp_array = tep_array_invert_from_element($zones_array, 'abstract_zone_id', 'abstract_zone_id');
         if (!empty($tmp_array)) {
             $zones_array = $db->query_to_array("select abstract_zone_id from " . TABLE_ABSTRACT_ZONES . " where abstract_zone_id in (" . $db->filter(implode(',', $tmp_array)) . ") and status_id='1'");
         }
     }
     return $zones_array;
 }
Exemplo n.º 17
0
 function process_options()
 {
     extract(tep_load('defs', 'database', 'message_stack'));
     $cStrings =& $this->strings;
     $remove_flag = $error = false;
     // Load existing options
     $options_array = $this->load_options();
     $front_popup_remove = isset($_GET['front_popup_remove']) ? $db->prepare_input($_GET['front_popup_remove']) : '';
     $back_popup_remove = isset($_GET['back_popup_remove']) ? $db->prepare_input($_GET['back_popup_remove']) : '';
     if (isset($options_array['front_scripts']) && !empty($front_popup_remove)) {
         unset($options_array['front_scripts'][$front_popup_remove]);
         $remove_flag = true;
     }
     if (isset($options_array['back_scripts']) && !empty($back_popup_remove)) {
         unset($options_array['back_scripts'][$back_popup_remove]);
         $remove_flag = true;
     }
     if ($remove_flag) {
         // Store user options
         $this->save_options($options_array);
         $msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success');
         tep_redirect(tep_href_link($cDefs->script, tep_get_all_get_params('action', 'front_popup_remove', 'back_popup_remove') . 'action=set_options'));
     }
     $front_common_selector = isset($_POST['front_common_selector']) && !empty($_POST['front_common_selector']) ? $db->prepare_input($_POST['front_common_selector']) : $this->front_common_selector;
     $back_common_selector = isset($_POST['back_common_selector']) && !empty($_POST['back_common_selector']) ? $db->prepare_input($_POST['back_common_selector']) : $this->back_common_selector;
     // Prepare the options array for storage
     $options_array = array('front_all' => isset($_POST['front_all']) ? true : false, 'back_all' => isset($_POST['back_all']) ? true : false, 'front_scripts' => isset($options_array['front_scripts']) ? $options_array['front_scripts'] : array(), 'back_scripts' => isset($options_array['back_scripts']) ? $options_array['back_scripts'] : array(), 'front_common_selector' => $front_common_selector, 'back_common_selector' => $back_common_selector);
     $filter = "/[^0-9a-z\\#\\-_\\.\\s]+/i";
     if (isset($_POST['script_entry']) && !empty($_POST['script_entry'])) {
         $key = $db->prepare_input($_POST['script_entry']);
         $selector = tep_create_safe_string($_POST['script_selector'], '', $filter);
         if (empty($selector)) {
             $selector = $this->front_common_selector;
             $msg->add_session(sprintf($cStrings->WARNING_PLUGIN_SELECTOR_EMPTY, $key), 'warning');
         }
         $options_array['front_scripts'][$key] = $selector;
     }
     if (isset($_POST['admin_entry']) && !empty($_POST['admin_entry'])) {
         $key = $db->prepare_input($_POST['admin_entry']);
         $selector = tep_create_safe_string($_POST['admin_selector'], '', $filter);
         if (empty($selector)) {
             $selector = $this->front_common_selector;
             $msg->add_session(sprintf($cStrings->WARNING_PLUGIN_SELECTOR_EMPTY, $key), 'warning');
         }
         $options_array['back_scripts'][$key] = $selector;
     }
     // Store user options
     $this->save_options($options_array);
     if (!$error) {
         $msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success');
     }
     tep_redirect(tep_href_link($cDefs->script, tep_get_all_get_params('action', 'front_popup_remove', 'back_popup_remove') . 'action=set_options'));
 }
Exemplo n.º 18
0
 function set_urls()
 {
     extract(tep_load('defs', 'database'));
     $seo_query = $db->query("select su.seo_url_get, su.seo_url_org, su.seo_url_priority, su.date_added, sgf.seo_frequency_name from " . TABLE_SEO_URL . " su, " . TABLE_SEO_FREQUENCY . " sgf where sgf.seo_frequency_id=su.seo_frequency_id order by su.seo_url_hits desc");
     while ($seo = $db->fetch_array($seo_query)) {
         $seo['seo_url_get'] = $cDefs->crelpath . $seo['seo_url_get'];
         $this->insert_entry('url');
         $this->insert_closed_entry('loc', htmlspecialchars(utf8_encode($seo['seo_url_get'])));
         $this->insert_closed_entry('lastmod', $seo['date_added']);
         $this->insert_closed_entry('priority', $seo['seo_url_priority']);
         $this->insert_closed_entry('changefreq', $seo['seo_frequency_name']);
         $this->insert_entry('url', true);
     }
 }
Exemplo n.º 19
0
 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' => '', 'POPUP_SELECTOR' => 'div.help_page a.heading_help');
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Exemplo n.º 20
0
 function html_end()
 {
     extract(tep_load('defs'));
     // Setup help script - default js help is loaded by system_base
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.heading_help');
     // process js template
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Exemplo n.º 21
0
 function html_end()
 {
     extract(tep_load('defs'));
     if (!$this->check_scripts()) {
         return false;
     }
     $contents = '';
     $launcher = $this->admin_path . 'back/launcher.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.plugins_help');
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Exemplo n.º 22
0
 function html_end()
 {
     extract(tep_load('defs'));
     $result = false;
     if ($this->options['back_all'] || isset($this->options['back_scripts'][$cDefs->script])) {
         $contents = '';
         $launcher = $this->admin_path . 'launcher.tpl';
         $result = tep_read_contents($launcher, $contents);
         if ($result) {
             if (isset($this->options['back_scripts'][$cDefs->script])) {
             } else {
                 $selector = $this->options['back_common_selector'];
             }
             $contents_array = array('POPUP_IMAGE_SELECTOR' => $selector);
             $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
         }
     }
     return $result;
 }
Exemplo n.º 23
0
 function display_links($parameters = '')
 {
     extract(tep_load('defs'));
     $display_links_string = $form_links_string = '';
     if ($this->number_of_pages > 1) {
         $view_max = 20;
         $range_gap = 5;
         $range_step = (int) ($this->number_of_pages / $view_max);
         $range_step = max($range_step, 1);
         $param_array = tep_get_string_parameters($parameters);
         $form_links_string = tep_draw_form('form_split_' . $this->page_name, $cDefs->script, '', 'get');
         for ($i = 1; $i <= $this->number_of_pages; $i++) {
             if ($this->number_of_pages > $view_max && $i > $range_gap && $i < $this->number_of_pages - $range_gap) {
                 if ($i + $range_gap < $this->current_page_number - $range_gap || $i - $range_gap > $this->current_page_number + $range_gap) {
                     $i = (int) min($i + $range_step, $this->number_of_pages);
                 }
             }
             $pages_array[] = array('id' => $i, 'text' => $i);
         }
         $form_links_string .= sprintf(TEXT_RESULT_PAGE, tep_draw_pull_down_menu($this->page_name, $pages_array, $this->current_page_number, 'class="change_submit"'), $this->number_of_pages);
         foreach ($param_array as $key => $value) {
             $form_links_string .= tep_draw_hidden_field($key, $value);
         }
         $form_links_string .= '</form>';
     }
     // previous button - not displayed on first page
     if ($this->current_page_number > 1) {
         if (tep_not_null($parameters) && substr($parameters, -1) != '&') {
             $parameters .= '&';
         }
         $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($this->current_page_number - 1)) . '" class="pageResults rpad" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . PREVNEXT_BUTTON_PREV . '</a>';
     }
     $display_links_string .= $form_links_string;
     // next button
     if ($this->current_page_number < $this->number_of_pages && $this->number_of_pages > 1) {
         if (tep_not_null($parameters) && substr($parameters, -1) != '&') {
             $parameters .= '&';
         }
         $display_links_string .= '<a href="' . tep_href_link($cDefs->script, $parameters . $this->page_name . '=' . ($this->current_page_number + 1)) . '" class="pageResults lpad" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' ">' . PREVNEXT_BUTTON_NEXT . '</a>';
     }
     return $display_links_string;
 }
Exemplo n.º 24
0
 function set_html()
 {
     extract(tep_load('defs', 'plugins_admin', 'sessions'));
     if ($cDefs->ajax) {
         return;
     }
     if (headers_sent()) {
         echo '<pre style="font-weight:bold; color: #FF0000;">' . ERROR_HEADERS_SENT . '</pre>';
         $cSessions->close();
     }
     header('Content-Type: text/html; charset=' . CHARSET);
     // Setup privacy header
     header('P3P: CP="NOI ADM DEV PSAi COM NAV STP IND"');
     $media_array = array();
     $media_array[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $media_array[] = '<html xmlns="http://www.w3.org/1999/xhtml" ' . HTML_PARAMS . '>';
     $media_array[] = '<head>';
     $media_array[] = '<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '" />';
     $media_array[] = '<base href="' . $cDefs->relpath . '"></base>';
     $html = '<title>';
     if (defined('HEADING_TITLE') && strpos(HEADING_TITLE, '%s') === false) {
         $html .= HEADING_TITLE . ' - ' . STORE_NAME;
     } else {
         $html .= TITLE;
     }
     $html .= '</title>';
     $media_array[] = $html;
     $media_array[] = '<link rel="stylesheet" type="text/css" href="stylesheet.css" />';
     $media_array[] = '<link rel="stylesheet" type="text/css" href="includes/javascript/jquery/themes/smoothness/jquery-ui.css" />';
     $media_array[] = '<script language="javascript" type="text/javascript" src="includes/javascript/jquery/jquery.js"></script>';
     //$media_array[] = '<script language="javascript" type="text/javascript" src="includes/javascript/jquery/jquery.dump.js"></script>';
     $media_array[] = '<script language="javascript" type="text/javascript" src="includes/javascript/jquery/jquery.ajaxq.js"></script>';
     $media_array[] = '<script language="javascript" type="text/javascript" src="includes/javascript/jquery/jquery.form.js"></script>';
     $media_array[] = '<script language="javascript" type="text/javascript" src="includes/javascript/jquery/ui/jquery-ui.min.js"></script>';
     $media_array[] = '<script language="javascript" type="text/javascript" src="includes/javascript/general.js"></script>';
     $cDefs->media = array_merge($media_array, $cDefs->media);
     $cPlug->invoke('html_start');
     tep_output_media();
     $cPlug->invoke('html_ready');
     tep_output_media();
 }
Exemplo n.º 25
0
 function html_end()
 {
     extract(tep_load('defs', 'database'));
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $title = HEADING_HELP_TITLE;
     $gID = isset($_GET['gID']) ? (int) $_GET['gID'] : 0;
     $group_query = $db->query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '" . (int) $gID . "'");
     if ($db->num_rows($group_query)) {
         $group_array = $db->fetch_array($group_query);
         $title .= ' - ' . $group_array['configuration_group_title'];
     }
     $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;
 }
Exemplo n.º 26
0
 function get_help()
 {
     extract(tep_load('sessions'));
     $help = isset($_GET['ajax']) && !empty($_GET['ajax']) ? $_GET['ajax'] : '';
     if (empty($help)) {
         $file = $this->admin_path . 'back/help_default.html';
     } else {
         $help = tep_create_safe_string($help, '', "[^0-9a-z\\-_]");
         $file = $this->admin_path . 'back/help_' . $help . '.html';
     }
     if (!is_file($file)) {
         return false;
     }
     $contents = '';
     $result = tep_read_contents($file, $contents);
     if (!$result) {
         return false;
     }
     echo '<div>' . $contents . '</div>';
     $cSessions->close();
     return true;
 }
Exemplo n.º 27
0
 function header_cookie($name, $value = '', $expire = 0)
 {
     extract(tep_load('defs'));
     $hd_string = 'Set-Cookie: ' . $name . '=';
     if (empty($value)) {
         $value = 'deleted';
     }
     if (empty($expire)) {
         $old_time = gmdate('D, d M Y H:i:s', time() - 86400) . ' GMT';
     } elseif ($expire > 0) {
         $old_time = gmdate('D, d M Y H:i:s', $expire) . ' GMT';
     }
     $hd_string .= $value . '; ';
     if ($expire >= 0) {
         $hd_string .= 'expires=' . $old_time . '; ';
     }
     $hd_string .= 'path=' . $cDefs->cookie_path . '; domain=' . $cDefs->cookie_domain;
     if ($this->secure) {
         $hd_string .= ' secure;';
     }
     header(trim($hd_string), false);
     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;
 }
Exemplo n.º 29
0
 function uninstall()
 {
     extract(tep_load('database', 'sessions'));
     $result = parent::uninstall();
     $db->query("delete from " . TABLE_SESSIONS . " where sesskey = '" . $db->filter($cSessions->id) . "'");
     return $result;
 }
Exemplo n.º 30
0
 function display_solo_box()
 {
     extract(tep_load('defs', 'database'));
     $content_id = $type_id = 0;
     if ($cDefs->gtext_id) {
         $content_id = $cDefs->gtext_id;
         $type_id = 1;
     }
     if ($cDefs->abstract_id) {
         $content_id = $cDefs->abstract_id;
         $type_id = 2;
     }
     if (!$type_id) {
         return false;
     }
     $box_query_raw = "select content_name, content_text from " . TABLE_RIGHT_TO_CONTENT . " where content_id = '" . (int) $content_id . "' and content_type='" . (int) $type_id . "' and status_id='1' order by sort_id";
     $box_items = $db->query_to_array($box_query_raw);
     for ($i = 0, $j = count($box_items); $i < $j; $i++) {
         $name = $box_items[$i]['content_name'];
         $text = $box_items[$i]['content_text'];
         // Skip empty entries
         if (empty($name) && empty($text)) {
             continue;
         }
         require $this->box_right;
     }
     return $j > 0;
 }