当前位置: 首页>>代码示例>>PHP>>正文


PHP oos_get_pages函数代码示例

本文整理汇总了PHP中oos_get_pages函数的典型用法代码示例。如果您正苦于以下问题:PHP oos_get_pages函数的具体用法?PHP oos_get_pages怎么用?PHP oos_get_pages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了oos_get_pages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendSMS

    function sendSMS() {

      $aPages = oos_get_pages();

      if ((isset($_GET['page'])) && ($_GET['page'] == $aPages['checkout_process'])) {
        $referer = OOS_HTTP_SERVER;
        $user_agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";

        $message = "\n";
        $message .= "New order\n";

        $geturl = 'http://www.fittcom.de/cgi/smssend.pl?appid=2&id=' . MODULE_ORDER_TOTAL_ORDER2SMS_ID . '&pw=' . MODULE_ORDER_TOTAL_ORDER2SMS_PASSWORD . '&dnr=' . urlencode(MODULE_ORDER_TOTAL_ORDER2SMS_DNR) . '&snr=' . urlencode(MODULE_ORDER_TOTAL_ORDER2SMS_SNR) . '&msg=' . urlencode($message) . '&msgtype=text&deliverynotify=1&confirmemail=' . MODULE_ORDER_TOTAL_ORDER2SMS_SENDEREMAIL;

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        curl_setopt($ch, CURLOPT_REFERER, $referer);
        curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
        curl_setopt($ch, CURLOPT_URL,"$geturl");
        curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
        curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
        curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
        $pre_result = curl_exec ($ch);
        curl_close ($ch);

      }
    }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:26,代码来源:ot_order2sms.php

示例2: smarty_function_oos_back_link

function smarty_function_oos_back_link($params, &$smarty)
{

  $aPages = oos_get_pages();

  if (count($_SESSION['navigation']->path)-2 > 0) {
    $back = count($_SESSION['navigation']->path)-2;
    $link = oos_href_link($_SESSION['navigation']->path[$back]['page'], $_SESSION['navigation']->path[$back]['get'].'&history_back=true', $_SESSION['navigation']->path[$back]['mode']);
  } else {
    if (isset($_SERVER['HTTP_REFERER']) && strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) {
      $link = $_SERVER['HTTP_REFERER'];
    } else {
      $link = oos_href_link($aPages['main']);
    }
  }

  while ( (substr($link, -5) == '&') || (substr($link, -1) == '?') ) {
    if (substr($link, -1) == '?') {
      $link = substr($link, 0, -1);
    } else {
      $link = substr($link, 0, -5);
    }
  }

  return $link;

}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:27,代码来源:function.oos_back_link.php

示例3: create_plugin_instance

 function create_plugin_instance()
 {
     $aPages = oos_get_pages();
     if (isset($_GET['page']) && $_GET['page'] != $aPages['info_down_for_maintenance']) {
         MyOOS_CoreApi::redirect(oos_href_link($aPages['info_down_for_maintenance'], '', 'NONSSL', true, false));
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:8,代码来源:oos_event_down_for_maintenance.php

示例4: create_plugin_instance

 function create_plugin_instance()
 {
     if (!isset($_SESSION['customer_id']) || !is_numeric($_SESSION['customer_id'])) {
         $aPages = oos_get_pages();
         if (isset($_GET['page']) && $_GET['page'] != $aPages['login']) {
             $_SESSION['navigation']->set_snapshot();
             MyOOS_CoreApi::redirect(oos_href_link($aPages['login'], '', 'SSL'));
         }
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:11,代码来源:oos_event_customer_must_login.php

示例5: smarty_function_css_back_button

/**
 * Smarty {css_back_button} function plugin
 *
 * Type:     function
 * Name:     css_back_button
 * @Version:  $Revision: 1.1 $ - changed by $Author: r23 $ on $Date: 2008/01/09 22:03:20 $
 */

function smarty_function_css_back_button($params, &$smarty)
{
    global $oEvent, $spider_kill_sid;

    MyOOS_CoreApi::requireOnce('lib/smarty/libs/plugins/shared.escape_special_chars.php');

    $title = '';
    $color = 'btnR green';


    foreach($params as $_key => $_val) {
      switch($_key) {

        case 'title':
            $$_key = (string)$_val;
            break;

        case 'color':
            $$_key = (string)$_val;
            break;

        default:
          break;
       }
    }

    $aPages = oos_get_pages();

    if (count($_SESSION['navigation']->path)-2 > 0) {
      $back = count($_SESSION['navigation']->path)-2;
      $link = oos_href_link($_SESSION['navigation']->path[$back]['page'], $_SESSION['navigation']->path[$back]['get'].'&history_back=true', $_SESSION['navigation']->path[$back]['mode']);
    } else {
      if (strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) {
        $link = $_SERVER['HTTP_REFERER'];
      } else {
        $link = oos_href_link($aPages['main']);
      }
    }

    while ( (substr($link, -5) == '&') || (substr($link, -1) == '?') ) {
      if (substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
      } else {
        $link = substr($link, 0, -5);
      }
    }


    $title = decode($title);

    return '<a href="' . $link . '" title="' . $title . '" class="' . $color . '">' . $title . '</a>';


  }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:62,代码来源:function.css_back_button.php

示例6: create_plugin_instance

 function create_plugin_instance()
 {
     $aPages = oos_get_pages();
     if (isset($_GET['page']) && $_GET['page'] != $aPages['login'] && !isset($_SESSION['customer_id'])) {
         $cookie_url_array = parse_url((ENABLE_SSL == true ? OOS_HTTPS_SERVER : OOS_HTTP_SERVER) . substr(OOS_SHOP, 0, -1));
         $cookie_path = $cookie_url_array['path'];
         if (isset($_COOKIE['email_address']) && isset($_COOKIE['password'])) {
             // Get database information
             $dbconn =& oosDBGetConn();
             $oostable =& oosDBGetTables();
             $customerstable = $oostable['customers'];
             $sql = "SELECT customers_id, customers_gender, customers_firstname, customers_lastname,\n                         customers_password, customers_wishlist_link_id, customers_language,\n                         customers_vat_id_status, customers_email_address, customers_default_address_id,\n                         customers_max_order\n                  FROM {$customerstable}\n                  WHERE customers_login = '1'\n                  AND customers_email_address = '" . oos_db_input($_COOKIE['email_address']) . "'";
             $check_customer_result = $dbconn->Execute($sql);
             if ($check_customer_result->RecordCount()) {
                 $check_customer = $check_customer_result->fields;
                 if (oos_validate_password($_COOKIE['password'], $check_customer['customers_password'])) {
                     $address_booktable = $oostable['address_book'];
                     $sql = "SELECT entry_country_id, entry_zone_id\n                      FROM {$address_booktable}\n                      WHERE customers_id = '" . $check_customer['customers_id'] . "'\n                        AND address_book_id = '1'";
                     $check_country = $dbconn->GetRow($sql);
                     if ($check_customer['customers_language'] == '') {
                         $sLanguage = oos_var_prep_for_os($_SESSION['language']);
                         $customerstable = $oostable['customers'];
                         $dbconn->Execute("UPDATE {$customerstable}\n                                  SET customers_language = '" . oos_db_input($sLanguage) . "'\n                                  WHERE customers_id = '" . intval($check_customer['customers_id']) . "'");
                     }
                     $_SESSION['customer_wishlist_link_id'] = $check_customer['customers_wishlist_link_id'];
                     $_SESSION['customer_id'] = $check_customer['customers_id'];
                     $_SESSION['customer_default_address_id'] = $check_customer['customers_default_address_id'];
                     if (ACCOUNT_GENDER == '1') {
                         $_SESSION['customer_gender'] = $check_customer['customers_gender'];
                     }
                     $_SESSION['customer_first_name'] = $check_customer['customers_firstname'];
                     $_SESSION['customer_lastname'] = $check_customer['customers_lastname'];
                     $_SESSION['customer_max_order'] = $check_customer['customers_max_order'];
                     $_SESSION['customer_country_id'] = $check_country['entry_country_id'];
                     $_SESSION['customer_zone_id'] = $check_country['entry_zone_id'];
                     if (ACCOUNT_VAT_ID == '1') {
                         $_SESSION['customers_vat_id_status'] = $check_customer['customers_vat_id_status'];
                     }
                     $_SESSION['member']->restore_group();
                     setcookie('email_address', $email_address, time() + 365 * 24 * 3600, $cookie_path, '', getenv('HTTPS') == 'on' ? 1 : 0);
                     setcookie('password', $check_customer['customers_password'], time() + 365 * 24 * 3600, $cookie_path, '', getenv('HTTPS') == 'on' ? 1 : 0);
                     $customers_infotable = $oostable['customers_info'];
                     $dbconn->Execute("UPDATE {$customers_infotable}\n                                SET customers_info_date_of_last_logon = '" . date("Y-m-d H:i:s", time()) . "',\n                                    customers_info_number_of_logons = customers_info_number_of_logons+1\n                                WHERE customers_info_id = '" . intval($_SESSION['customer_id']) . "'");
                     $_SESSION['cart']->restore_contents();
                     // restore cart contents
                 }
             }
         }
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:51,代码来源:oos_event_autologon.php

示例7: smarty_function_product_info_link

/**
 * Smarty {product_info_link} function plugin
 *
 * Type:     function<br>
 * Name:     product_info_link<br>
 * Date:     Aug 24, 2004<br>
 * Purpose:  URL for the products info<br>
 * Input:<br>
 *         - products_id
 *
 * Examples: <{product_info_link products_id=17}>
 * Output:   http:// ... index.php?page=product_info&amp;products_id=17
 * @author   r23 <info@r23.de>
 * @version  1.0
 * @param array
 * @param Smarty
 * @return string
 * @uses smarty_function_html_href_link()
 */
function smarty_function_product_info_link($params, &$smarty)
{
    require_once $smarty->_get_plugin_filepath('function', 'html_href_link');
    $aPages = oos_get_pages();
    $result = array();
    $link_params = array();
    $link_params = array('page' => $aPages['product_info']);
    if (is_array($params)) {
        $result = array_merge($link_params, $params);
    } else {
        $smarty->trigger_error("products_info_link: extra attribute '{$params}' must an array", E_USER_NOTICE);
    }
    return smarty_function_html_href_link($result, $smarty);
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:33,代码来源:function.product_info_link.php

示例8: sendFax

 function sendFax()
 {
     global $email_order;
     $aPages = oos_get_pages();
     if (isset($_GET['page']) && $_GET['page'] == $aPages['checkout_process']) {
         $message = "\n";
         $message .= "sender: " . MODULE_ORDER_TOTAL_ORDER2SENDEREMAIL . "\n";
         $message .= "subject: order\n";
         $message .= "user: " . MODULE_ORDER_TOTAL_ORDER2FAX_USERNAME . "\n";
         $message .= "password: " . MODULE_ORDER_TOTAL_ORDER2FAX_PASSWORD . "\n";
         $message .= "job: send\n";
         $message .= "faxnumber: " . MODULE_ORDER_TOTAL_ORDER2FAX_FAXNUMBER . "\n";
         $message .= "message: " . $email_order;
         $header = 'From: ' . MODULE_ORDER_TOTAL_ORDER2SENDEREMAIL . "\r\n" . 'Reply-To: ' . MODULE_ORDER_TOTAL_ORDER2SENDEREMAIL;
         mail('mail2fax@tecspace.net', 'order', $message, $header);
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:17,代码来源:ot_order2fax.php

示例9: create_plugin_instance

 function create_plugin_instance()
 {
     global $oBreadcrumb, $aLang, $aCategoryPath;
     $dbconn =& oosDBGetConn();
     $oostable =& oosDBGetTables();
     $aPages = oos_get_pages();
     // include the breadcrumb class and start the breadcrumb trail
     MyOOS_CoreApi::requireOnce('classes/class_breadcrumb.php');
     $oBreadcrumb = new breadcrumb();
     if (isset($_GET['page']) && $_GET['page'] == $aPages['main'] || !isset($_GET['page'])) {
         $oBreadcrumb->add($aLang['header_title_top'], oos_href_link($aPages['main']), bookmark);
     } else {
         $oBreadcrumb->add($aLang['header_title_top'], oos_href_link($aPages['main']));
     }
     // add category names or the manufacturer name to the breadcrumb trail
     if (isset($aCategoryPath) && count($aCategoryPath) > 0) {
         $nLanguageID = isset($_SESSION['language_id']) ? $_SESSION['language_id'] + 0 : 1;
         $nArrayCountCategoryPath = count($aCategoryPath);
         $nCount = $nArrayCountCategoryPath;
         for ($i = 0, $n = $nArrayCountCategoryPath; $i < $n; $i++) {
             $nCount = $nCount - 1;
             $categories_descriptiontable = $oostable['categories_description'];
             $categories_sql = "SELECT categories_name\n                                   FROM {$categories_descriptiontable}\n                                   WHERE categories_id = '" . intval($aCategoryPath[$i]) . "'\n                                   AND categories_languages_id = '" . intval($nLanguageID) . "'";
             $categories = $dbconn->Execute($categories_sql);
             if ($categories->RecordCount() > 0) {
                 if (isset($_GET['page']) && $_GET['page'] == $aPages['shop'] && $nCount == 0) {
                     $oBreadcrumb->add($categories->fields['categories_name'], oos_href_link($aPages['shop'], 'categories=' . implode('_', array_slice($aCategoryPath, 0, $i + 1))), bookmark);
                 } else {
                     $oBreadcrumb->add($categories->fields['categories_name'], oos_href_link($aPages['shop'], 'categories=' . implode('_', array_slice($aCategoryPath, 0, $i + 1))));
                 }
             } else {
                 break;
             }
         }
     } elseif (isset($_GET['manufacturers_id']) && is_numeric($_GET['manufacturers_id'])) {
         $manufacturers_id = intval($_GET['manufacturers_id']);
         $manufacturerstable = $oostable['manufacturers'];
         $manufacturers_sql = "SELECT manufacturers_name\n                                  FROM {$manufacturerstable}\n                                  WHERE manufacturers_id = '" . intval($manufacturers_id) . "'";
         $manufacturers = $dbconn->Execute($manufacturers_sql);
         if ($manufacturers->RecordCount() > 0) {
             $oBreadcrumb->add($aLang['header_title_catalog'], oos_href_link($aPages['shop']));
             $oBreadcrumb->add($manufacturers->fields['manufacturers_name'], oos_href_link($aPages['shop'], 'manufacturers_id=' . intval($_GET['manufacturers_id'])), bookmark);
         }
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:46,代码来源:oos_event_breadcrumb.php

示例10: oos_customer_greeting

/**
 * Return a customer greeting
 *
 * @return string
 */
function oos_customer_greeting()
{
    global $aLang;
    $aPages = oos_get_pages();
    $personal_text = '';
    if (isset($_SESSION['customer_lastname']) && ACCOUNT_GENDER == '1') {
        if ($_SESSION['customer_gender'] == 'm') {
            $personal_text = $aLang['male_address'] . ' ' . $_SESSION['customer_lastname'];
        } else {
            $personal_text = $aLang['female_address'] . ' ' . $_SESSION['customer_lastname'];
        }
    }
    if (isset($_SESSION['customer_lastname']) && isset($_SESSION['customer_id'])) {
        $sGreeting = sprintf($aLang['text_greeting_personal'], $personal_text, oos_href_link($aPages['products_new']));
    } else {
        $sGreeting = sprintf($aLang['text_greeting_guest'], oos_href_link($aPages['login'], '', 'SSL'), oos_href_link($aPages['create_account'], '', 'SSL'));
    }
    return $sGreeting;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:24,代码来源:main.php

示例11: oos_secure_input

/**
 * Protects better diverse attempts of Cross-Site Scripting
 * attacks, thanks to webmedic, Timax, larsneo.
 *
 * Lets validate the current php version and set globals
 * accordingly.
 * Do not change this value unless you know what you are
 * doing you have been warned!
 */
function oos_secure_input()
{
    $aPages = oos_get_pages();
    # Cross-Site Scripting attack defense - Sent by larsneo
    # some syntax checking against injected javascript
    # extended by Neo
    /**
     * Lets now sanitize the GET vars
     */
    if (count($_GET) > 0) {
        foreach ($_GET as $secvalue) {
            if (!is_array($secvalue)) {
                if (eregi("<[^>]*script*\"?[^>]*>", $secvalue) || eregi(".*[[:space:]](or|and)[[:space:]].*(=|like).*", $secvalue) || eregi("<[^>]*object*\"?[^>]*>", $secvalue) || eregi("<[^>]*iframe*\"?[^>]*>", $secvalue) || eregi("<[^>]*applet*\"?[^>]*>", $secvalue) || eregi("<[^>]*meta*\"?[^>]*>", $secvalue) || eregi("<[^>]*style*\"?[^>]*>", $secvalue) || eregi("<[^>]*form*\"?[^>]*>", $secvalue) || eregi("<[^>]*window.*\"?[^>]*>", $secvalue) || eregi("<[^>]*alert*\"?[^>]*>", $secvalue) || eregi("<[^>]*img*\"?[^>]*>", $secvalue) || eregi("<[^>]*document.*\"?[^>]*>", $secvalue) || eregi("<[^>]*cookie*\"?[^>]*>", $secvalue) || eregi("\"", $secvalue)) {
                    MyOOS_CoreApi::redirect(oos_href_link($aPages['main']));
                }
            }
        }
    }
    /**
     * Lets now sanitize the POST vars
     */
    if (count($_POST) > 0) {
        foreach ($_POST as $secvalue) {
            if (!is_array($secvalue)) {
                if (eregi("<[^>]*script*\"?[^>]*>", $secvalue) || eregi("<[^>]*object*\"?[^>]*>", $secvalue) || eregi("<[^>]*iframe*\"?[^>]*>", $secvalue) || eregi("<[^>]*applet*\"?[^>]*>", $secvalue) || eregi("<[^>]*window.*\"?[^>]*>", $secvalue) || eregi("<[^>]*alert*\"?[^>]*>", $secvalue) || eregi("<[^>]*document.*\"?[^>]*>", $secvalue) || eregi("<[^>]*cookie*\"?[^>]*>", $secvalue) || eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) {
                    MyOOS_CoreApi::redirect(oos_href_link($aPages['main']));
                }
            }
        }
    }
    /**
     * Lets now sanitize the COOKIE vars
     */
    if (count($_COOKIE) > 0) {
        foreach ($_COOKIE as $secvalue) {
            if (!is_array($secvalue)) {
                if (eregi("<[^>]*script*\"?[^>]*>", $secvalue) || eregi(".*[[:space:]](or|and)[[:space:]].*(=|like).*", $secvalue) || eregi("<[^>]*object*\"?[^>]*>", $secvalue) || eregi("<[^>]*iframe*\"?[^>]*>", $secvalue) || eregi("<[^>]*applet*\"?[^>]*>", $secvalue) || eregi("<[^>]*meta*\"?[^>]*>", $secvalue) || eregi("<[^>]*style*\"?[^>]*>", $secvalue) || eregi("<[^>]*form*\"?[^>]*>", $secvalue) || eregi("<[^>]*window.*\"?[^>]*>", $secvalue) || eregi("<[^>]*alert*\"?[^>]*>", $secvalue) || eregi("<[^>]*document.*\"?[^>]*>", $secvalue) || eregi("<[^>]*cookie*\"?[^>]*>", $secvalue) || eregi("<[^>]*img*\"?[^>]*>", $secvalue)) {
                    MyOOS_CoreApi::redirect(oos_href_link($aPages['main']));
                }
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:52,代码来源:function_input.php

示例12: create_plugin_instance

 function create_plugin_instance()
 {
     global $oLang, $aLang;
     $dbconn =& oosDBGetConn();
     $oostable =& oosDBGetTables();
     $aPages = oos_get_pages();
     if (!isset($_SESSION['language']) || isset($_GET['language'])) {
         MyOOS_CoreApi::requireOnce('classes/class_language.php');
         $oLang = new language();
         if (isset($_GET['language']) && oos_is_not_null($_GET['language'])) {
             $oLang->set($_GET['language']);
         } else {
             $oLang->get_browser_language();
         }
     }
     $sLanguage = oos_var_prep_for_os($_SESSION['language']);
     include 'includes/languages/' . $sLanguage . '.php';
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:19,代码来源:oos_event_language.php

示例13: process_button

 function process_button()
 {
     global $oOrder, $oCurrencies;
     if (MODULE_PAYMENT_MONEYBOOKERS_LANGUAGE == 'Selected Language') {
         $my_language = 'EN';
     } else {
         $my_language = MODULE_PAYMENT_MONEYBOOKERS_LANGUAGE;
     }
     if (MODULE_PAYMENT_MONEYBOOKERS_CURRENCY == 'Selected Currency') {
         $my_currency = $_SESSION['currency'];
     } else {
         $my_currency = substr(MODULE_PAYMENT_MONEYBOOKERS_CURRENCY, 5);
     }
     if (!in_array($my_currency, array('EUR', 'USD', 'GBP', 'HKD', 'SGD', 'JPY', 'CAD', 'AUD', 'CHF', 'DKK', 'SEK', 'NOK', 'ILS', 'MYR', 'NZD', 'TWD', 'THB', 'CZK', 'HUF', 'SKK', 'ISK', 'INR'))) {
         $my_currency = 'EUR';
     }
     $aPages = oos_get_pages();
     $process_button_string = oos_draw_hidden_field('pay_to_email', MODULE_PAYMENT_MONEYBOOKERS_ID) . oos_draw_hidden_field('language', $my_language) . oos_draw_hidden_field('amount', number_format($oOrder->info['total'] * $oCurrencies->get_value($my_currency), $oCurrencies->get_decimal_places($my_currency))) . oos_draw_hidden_field('currency', $my_currency) . oos_draw_hidden_field('detail1_description', STORE_NAME) . oos_draw_hidden_field('detail1_text', 'Order - ' . date('d. M Y - H:i')) . oos_draw_hidden_field('firstname', $oOrder->billing['firstname']) . oos_draw_hidden_field('lastname', $oOrder->billing['lastname']) . oos_draw_hidden_field('address', $oOrder->billing['street_address']) . oos_draw_hidden_field('postal_code', $oOrder->billing['postcode']) . oos_draw_hidden_field('city', $oOrder->billing['city']) . oos_draw_hidden_field('country', $oOrder->billing['country']['moneybookers']) . oos_draw_hidden_field('pay_from_email', $oOrder->customer['email_address']) . oos_draw_hidden_field('return', oos_href_link($aPages['checkout_process'], '', 'SSL')) . oos_draw_hidden_field('cancel_return', oos_href_link($aPages['checkout_payment'], '', 'SSL'));
     return $process_button_string;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:20,代码来源:moneybookers.php

示例14: smarty_function_categories_link

/**
 * Smarty {categories_link} function plugin
 *
 * Type:     function<br>
 * Name:     categories_link<br>
 * Date:     Oct 27, 2008<br>
 * Purpose:  URL for the categorie info<br>
 * Input:<br>
 *         - categories
 *
 * Examples: {categories_link categories=17}
 * Output:   http:// ... index.php?page=shop&amp;categories=17
 * @author   r23 <info@r23.de>
 * @version  1.0
 * @param array
 * @param Smarty
 * @return string
 * @uses smarty_function_html_href_link()
 */
function smarty_function_categories_link($params, &$smarty)
{

  MyOOS_CoreApi::requireOnce('lib/smarty-plugins/myoos/function.html_href_link.php');

  $aPages = oos_get_pages();

  $result = array();
  $link_params = array();
  $link_params = array('page' => $aPages['shop']);

  if (is_array($params)) {
    $result = array_merge($link_params, $params);
  } else {
    $smarty->trigger_error("categories_link: extra attribute '$params' must an array", E_USER_NOTICE);
  }

  return smarty_function_html_href_link($result, $smarty);

}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:39,代码来源:function.function_categories_link.php

示例15: collect_posts

 function collect_posts()
 {
     global $oCurrencies, $coupon_no, $aLang;
     // Get database information
     $dbconn =& oosDBGetConn();
     $oostable =& oosDBGetTables();
     $aPages = oos_get_pages();
     if ($_POST['gv_redeem_code']) {
         $couponstable = $oostable['coupons'];
         $gv_query = $dbconn->Execute("SELECT coupon_id, coupon_type, coupon_amount FROM {$couponstable} WHERE coupon_code = '" . oos_db_input($_POST['gv_redeem_code']) . "'");
         $gv_result = $gv_query->fields;
         if ($gv_query->RecordCount() != 0) {
             $coupon_redeem_tracktable = $oostable['coupon_redeem_track'];
             $redeem_query = $dbconn->Execute("SELECT * FROM {$coupon_redeem_tracktable} WHERE coupon_id = '" . $gv_result['coupon_id'] . "'");
             if ($redeem_query->RecordCount() != 0 && $gv_result['coupon_type'] == 'G') {
                 $_SESSION['error_message'] = $aLang['error_no_invalid_redeem_gv'];
                 MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_payment'], '', 'SSL'));
             }
         }
         if ($gv_result['coupon_type'] == 'G') {
             $gv_amount = $gv_result['coupon_amount'];
             // Things to set
             // ip address of claimant
             // customer id of claimant
             // date
             // redemption flag
             // now update customer account with gv_amount
             $coupon_gv_customertable = $oostable['coupon_gv_customer'];
             $gv_amount_query = $dbconn->Execute("SELECT amount FROM {$coupon_gv_customertable} WHERE customer_id = '" . intval($_SESSION['customer_id']) . "'");
             $customer_gv = false;
             $total_gv_amount = $gv_amount;
             if ($gv_amount_result = $gv_amount_query->fields) {
                 $total_gv_amount = $gv_amount_result['amount'] + $gv_amount;
                 $customer_gv = true;
             }
             $couponstable = $oostable['coupons'];
             $gv_update = $dbconn->Execute("UPDATE {$couponstable}\n                                         SET coupon_active = 'N'\n                                         WHERE coupon_id = '" . $gv_result['coupon_id'] . "'");
             $remote_addr = $_SESSION['session_ip_address'];
             $coupon_redeem_tracktable = $oostable['coupon_redeem_track'];
             $gv_redeem = $dbconn->Execute("INSERT INTO  {$coupon_redeem_tracktable}\n                                        (coupon_id,\n                                         customer_id,\n                                         redeem_date,\n                                         redeem_ip) VALUES ('" . $gv_result['coupon_id'] . "',\n                                                            '" . intval($_SESSION['customer_id']) . "',\n                                                            '" . date("Y-m-d H:i:s", time()) . "',\n                                                            '" . oos_db_input($remote_addr) . "')");
             if ($customer_gv) {
                 $coupon_gv_customertable = $oostable['coupon_gv_customer'];
                 // already has gv_amount so update
                 $gv_update = $dbconn->Execute("UPDATE {$coupon_gv_customertable}\n                                           SET amount = '" . $total_gv_amount . "'\n                                           WHERE customer_id = '" . intval($_SESSION['customer_id']) . "'");
             } else {
                 // no gv_amount so insert
                 $coupon_gv_customertable = $oostable['coupon_gv_customer'];
                 $gv_insert = $dbconn->Execute("INSERT INTO {$coupon_gv_customertable}\n                                           (customer_id,\n                                            amount) VALUES ('" . intval($_SESSION['customer_id']) . "',\n                                                            '" . $total_gv_amount . "')");
             }
             $_SESSION['error_message'] = $aLang['error_redeemed_amount'] . $oCurrencies->format($gv_amount);
             MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_payment'], '', 'SSL'));
         }
     }
     if ($_POST['submit_redeem_x'] && $gv['coupon_type'] == 'G') {
         MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_payment'], 'error_message=' . urlencode(decode($aLang['error_no_redeem_code'])), 'SSL'));
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:57,代码来源:ot_gv.php


注:本文中的oos_get_pages函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。