Example #1
0
        $is_html = $db->f("is_html");
        $custom_page_id = $db->f("page_id");
        $page_type = $db->f("page_type");
        $page_url = $db->f("page_url");
        $page_path = $db->f("page_path");
        if (strlen($page_url)) {
            header("HTTP/1.0 302 OK");
            header("Status: 302 OK");
            header("Location: " . $page_url);
            exit;
        }
        $page_title = get_translation($db->f("page_title"));
        $page_title = get_currency_message($page_title, $currency);
        $page_body = get_translation($db->f("page_body"));
        $page_body = strlen($page_path) ? @join("", file($page_path)) : $page_body;
        $page_body = get_currency_message($page_body, $currency);
        if (get_setting_value($settings, "php_in_custom_pages", 0)) {
            eval_php_code($page_body);
        }
        $page_body = $is_html ? $page_body : "<div align=\"justify\">" . nl2br(htmlspecialchars($page_body)) . "</div>";
    } else {
        //$page_title = "Page Error";
        //$page_body = "<div align=\"center\"><font color=\"red\"><b>Page '" . htmlspecialchars($custom_page_code) . "' was not found</b></font></div>";
        header("Location: index.php");
        exit;
    }
} else {
    header("Location: index.php");
    exit;
}
if ($page_type == 2) {
$current_date = va_time();
$cc_start_years = get_db_values("SELECT start_year AS year_value, start_year AS year_description FROM " . $table_prefix . "cc_start_years", array(array("", YEAR_MSG)));
if (sizeof($cc_start_years) < 2) {
    $cc_start_years = array(array("", YEAR_MSG));
    for ($y = 7; $y >= 0; $y--) {
        $cc_start_years[] = array($current_date[YEAR] - $y, $current_date[YEAR] - $y);
    }
}
$cc_expiry_years = get_db_values("SELECT expiry_year AS year_value, expiry_year AS year_description FROM " . $table_prefix . "cc_expiry_years", array(array("", YEAR_MSG)));
if (sizeof($cc_expiry_years) < 2) {
    $cc_expiry_years = array(array("", YEAR_MSG));
    for ($y = 0; $y <= 7; $y++) {
        $cc_expiry_years[] = array($current_date[YEAR] + $y, $current_date[YEAR] + $y);
    }
}
set_options($cc_start_years, $cc_start_year, "cc_start_year");
set_options($cc_expiry_years, $cc_expiry_year, "cc_expiry_year");
$cc_months = array_merge(array(array("", MONTH_MSG)), $months);
set_options($cc_months, $cc_start_month, "cc_start_month");
set_options($cc_months, $cc_expiry_month, "cc_expiry_month");
$r->set_parameters();
$intro_text = trim($cc_info["intro_text"]);
$intro_text = get_translation($intro_text);
$intro_text = get_currency_message($intro_text, $currency);
if ($intro_text) {
    $t->set_var("intro_text", $intro_text);
    $t->parse("intro_block", false);
}
$t->set_var("billing_address", "test");
$block_parsed = true;
$t->parse("block_body", false);
     $t->set_var("article_date_block", "");
 }
 if (strpos($details_fields, ",date_end,")) {
     $date_end = $db->f("date_end", DATETIME);
     $date_end_string = va_date($datetime_show_format, $date_end);
     $t->set_var("date_end", $date_end_string);
     $t->global_parse("date_end_block", false, false, true);
 } else {
     $t->set_var("date_end_block", "");
 }
 if (strlen($article_date_string) || strlen($date_end_string)) {
     $t->global_parse("date_block", false, false, true);
 }
 for ($i = 0; $i < sizeof($article_fields); $i++) {
     $field_name = $article_fields[$i];
     $fields[$field_name] = get_currency_message(get_translation($db->f($field_name)), $currency);
     if (strlen($fields[$field_name]) && strpos($details_fields, "," . $field_name . ",")) {
         $t->set_var($field_name, $fields[$field_name]);
         $t->global_parse($field_name . "_block", false, false, true);
     } else {
         $fields[$field_name] = "";
         $t->set_var($field_name, "");
         $t->set_var($field_name . "_block", "");
     }
 }
 if (strlen($fields["author_name"]) || strlen($fields["author_email"]) || strlen($fields["author_url"])) {
     $t->global_parse("author_block", false, false, true);
 } else {
     $t->set_var("author_block", false);
 }
 if (strpos($details_fields, ",full_description,")) {
 if ($product_individual_notification) {
     $all_products_have_notifications = true;
     $sql = " SELECT item.item_id ";
     $sql .= " FROM " . $table_prefix . "orders_items AS item";
     $sql .= " LEFT JOIN " . $table_prefix . "items AS fullitem ON fullitem.item_id=item.item_id";
     $sql .= " WHERE item.order_id=" . $db->tosql($order_id, INTEGER);
     $sql .= " AND ( fullitem.mail_notify IS NULL OR fullitem.mail_notify=0 )";
     $db->query($sql);
     if ($db->next_record()) {
         $all_products_have_notifications = false;
     }
 }
 if (!$all_products_have_notifications) {
     $user_subject = get_final_message($order_final["user_subject"], $message_type);
     $user_subject = get_translation($user_subject);
     $user_message = get_currency_message(get_translation($user_message), $currency);
     $t->set_block("user_subject", $user_subject);
     $t->set_block("user_message", $user_message);
     $email_headers = array();
     $email_headers["from"] = get_setting_value($order_final, "user_mail_from", $settings["admin_email"]);
     $email_headers["cc"] = get_setting_value($order_final, "user_mail_cc");
     $email_headers["bcc"] = get_setting_value($order_final, "user_mail_bcc");
     $email_headers["reply_to"] = get_setting_value($order_final, "user_mail_reply_to");
     $email_headers["return_path"] = get_setting_value($order_final, "user_mail_return_path");
     $email_headers["mail_type"] = get_setting_value($order_final, "user_message_type");
     if (!$email_headers["mail_type"]) {
         $t->set_var("basket", $t->get_var("basket_text"));
         $t->set_var("links", $links["text"]);
         $t->set_var("serials", $order_serials["text"]);
         $t->set_var("serial_numbers", $order_serials["text"]);
         $t->set_var("vouchers", $order_vouchers["text"]);
Example #5
0
            $sub_menus[$submenu_id]["submenu_style_name"] = $db->f("submenu_style_name");
            $sub_menus[$submenu_id]["match_type"] = $db->f("match_type");
            $sub_menus[$parent_menu_id]["subs"][] = $submenu_id;
        }
    }
    set_session("session_last_menu_id", $active_menu_id);
    $submenu_style_name = "";
    if (isset($menus[$active_menu_id])) {
        $submenu_style_name = $menus[$active_menu_id]["submenu_style_name"];
    }
    if (!$submenu_style_name) {
        $submenu_style_name = "secondary";
    }
    set_menus($sub_menus, 0, 0, $active_submenu_id, $top_menu_type, "secondary_", $submenu_style_name);
}
$t->set_var("index_href", get_custom_friendly_url("index.php"));
$t->set_var("products_href", get_custom_friendly_url("products.php"));
$t->set_var("basket_href", get_custom_friendly_url("basket.php"));
$t->set_var("user_profile_href", get_custom_friendly_url("user_profile.php"));
$t->set_var("admin_href", "admin.php");
$t->set_var("help_href", get_custom_friendly_url("page.php") . "?page=help");
$t->set_var("about_href", get_custom_friendly_url("page.php") . "?page=about");
if (!isset($header_title)) {
    $header_title = "";
}
$t->set_var("header_title", $header_title);
$block_parsed = true;
$t->parse("block_body", false);
// clear previous block body content
$t->set_var("block_body", get_currency_message($t->get_var("block_body"), $currency));
Example #6
0
     $t->set_var("links", $links["text"]);
     // set serial numbers
     $t->set_var("serials", $order_serials["text"]);
     $t->set_var("serial_numbers", $order_serials["text"]);
     // set serial numbers
     $t->set_var("vouchers", $order_vouchers["text"]);
     $t->set_var("gift_vouchers", $order_vouchers["text"]);
     $t->parse("admin_sms_recipient", false);
     $t->parse("admin_sms_originator", false);
     $t->parse("admin_sms_message", false);
     sms_send($t->get_var("admin_sms_recipient"), $t->get_var("admin_sms_message"), $t->get_var("admin_sms_originator"));
 }
 if ($user_sms) {
     $user_sms_recipient = get_setting_value($order_info, "user_sms_recipient", $r->get_value("cell_phone"));
     $user_sms_originator = get_setting_value($order_info, "user_sms_originator", "");
     $user_sms_message = get_currency_message(get_translation(get_setting_value($order_info, "user_sms_message", "")), $currency);
     $t->set_block("user_sms_recipient", $user_sms_recipient);
     $t->set_block("user_sms_originator", $user_sms_originator);
     $t->set_block("user_sms_message", $user_sms_message);
     $t->set_var("basket", $items_text);
     $t->set_var("items", $items_text);
     // set download links
     $t->set_var("links", $links["text"]);
     // set serial numbers
     $t->set_var("serials", $order_serials["text"]);
     $t->set_var("serial_numbers", $order_serials["text"]);
     // set serial numbers
     $t->set_var("vouchers", $order_vouchers["text"]);
     $t->set_var("gift_vouchers", $order_vouchers["text"]);
     $t->parse("user_sms_recipient", false);
     $t->parse("user_sms_originator", false);
         $t->set_var($field_name, $fields[$field_name]);
         $t->global_parse($field_name . "_block", false, false, true);
     } else {
         $fields[$field_name] = "";
         $t->set_var($field_name, "");
         $t->set_var($field_name . "_block", "");
     }
 }
 if (strlen($fields["author_name"]) || strlen($fields["author_email"]) || strlen($fields["author_url"])) {
     $t->global_parse("author_block", false, false, true);
 } else {
     $t->set_var("author_block", false);
 }
 if (strpos($list_fields, ",full_description,")) {
     $full_description = get_translation($db->f("full_description"));
     $full_description = get_currency_message($full_description, $currency);
     if ($db->f("is_html") != 1) {
         $full_description = nl2br(htmlspecialchars($full_description));
     }
     $t->set_var("full_description", $full_description);
 } else {
     $t->set_var("full_description", "");
 }
 $image_small = $db->f("image_small");
 $image_small_alt = $db->f("image_small_alt");
 if (strpos($list_fields, ",image_small,") && strlen($image_small)) {
     if (preg_match("/^http\\:\\/\\//", $image_small)) {
         $image_size = "";
     } else {
         $image_size = @getimagesize($image_small);
         if (isset($restrict_articles_images) && $restrict_articles_images) {