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


PHP Link::Custom方法代码示例

本文整理汇总了PHP中Link::Custom方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::Custom方法的具体用法?PHP Link::Custom怎么用?PHP Link::Custom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Link的用法示例。


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

示例1: unset

<?php

//setlocale(LC_ALL, 'ru_RU');
// ---- center ----
unset($parsed_res);
$Page = new Page();
$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
$header = 'Результаты поиска';
$GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => Link::Custom('search'));
// Настройка панели действий ===============================
$list_controls = array('layout', 'sorting');
$tpl->Assign('list_controls', $list_controls);
// =========================================================
if (isset($_SERVER['HTTP_REFERER'])) {
    $referer = explode('/', str_replace('http://', '', $_SERVER['HTTP_REFERER']));
    if ($referer[1] != 'search') {
        unset($_SESSION['search']);
        unset($_SESSION['filters']);
    }
} else {
    unset($_SESSION['search']);
    unset($_SESSION['filters']);
}
// Получаем строку поискового запроса ======================
if (isset($_POST['query']) && !isset($_GET['query']) && $_POST['query'] != '') {
    $query = preg_replace('/[()*|,.*"^&@#$%\\/]/', ' ', $_POST['query']);
    $query = trim($query);
} elseif (isset($_GET['query']) && !isset($_POST['query']) && $_GET['query'] != '') {
    $query = preg_replace('/[()*|,.*"^&@#$%]/', ' ', $_GET['query']);
    $query = trim($query);
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:search.php

示例2: header

<?php

if ((!isset($GLOBALS['Rewrite']) || !is_numeric($GLOBALS['Rewrite'])) && !isset($GLOBALS['REQAR'][2]) && !isset($_POST['orders'])) {
    header('Location: ' . Link::Custom('404'));
    exit;
}
if (isset($_POST['orders']) || isset($_GET['orders'])) {
    if (isset($_GET['orders'])) {
        $orders = $_GET['orders'];
        // Получаем id контрагента
        isset($_GET['filial']) ? $filial = $_GET['filial'] : null;
    } else {
        $orders = $_POST['orders'];
        //Сюда приходит список всех задействованых заказов
    }
    unset($parsed_res);
    require $GLOBALS['PATH_model'] . 'invoice_c.php';
    foreach ($orders as $id_order) {
        $Order = new Orders();
        $Order->SetFieldsById($id_order);
        $ord = $Order->fields;
        $tpl->Assign("order", $ord);
        $Invoice = new Invoice();
        $User = new Users();
        $Address = new Address();
        // Получаем адреc доставки
        $addr = $Address->GetAddressById($ord['id_address']);
        // Получить данные покупателя
        $id_customer = $ord['id_customer'];
        $Customer = new Customers();
        $Customer->SetFieldsById($id_customer);
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:invoice_customer.php

示例3: ShowPages

 /**
  * возвращает макет пагинации
  */
 function ShowPages()
 {
     $tpl =& $GLOBALS['tpl'];
     // урл текущей страницы без page_id=N
     $res = explode("?", preg_replace('/\\/p[0-9]+/', '', $_SERVER['REQUEST_URI']));
     $base_url = preg_replace('/\\/$/', '', $res[0]);
     $get_string = isset($res[1]) ? $res[1] : null;
     $template = array();
     $pages = array();
     foreach ($this->pages as $key => $page) {
         // Если числовые страницы
         // if(is_numeric($key)){
         if ($this->active_page == $page) {
             $pages['main'][] = '<li class="page' . $page . ' active"><a href="#">' . $page . '</a></li>';
         } else {
             if (strstr($base_url, '/adm')) {
                 $url = $base_url . '/p' . $page;
             } else {
                 if ($GLOBALS['CurrentController'] == 'products') {
                     $url = Link::Category($GLOBALS['Rewrite'], array('page' => $page));
                 } else {
                     $url = $base_url . '/p' . $page;
                 }
             }
             $url .= isset($get_string) && !isset($_GET['search_subcategory']) ? '?' . $get_string : null;
             if (is_numeric($key)) {
                 $pages['main'][] = '<li class="page' . $page . '"><a href="' . $url . '" class="animate">' . $page . '</a></li>';
             } else {
                 if (in_array($key, array('prev', 'next'))) {
                     $page = '<i class="material-icons">more_horiz</i>';
                     if (strstr($base_url, '/adm')) {
                         $page = '...';
                     }
                 }
                 $pages[$key] = '<li class="' . $key . '"><a href="' . $url . '" class="animate">' . $page . '</a></li>';
             }
         }
     }
     $tpl->Assign('last_page', $this->pages_count);
     $tpl->Assign('pages', $pages);
     $parsed_content = $tpl->Parse($GLOBALS['PATH_tpl_global'] . 'paginator.tpl');
     // print_r(Link::Category($GLOBALS['Rewrite']));
     if (isset($GLOBALS['Rewrite'])) {
         if ($GLOBALS['CurrentController'] == 'products') {
             $page_base = Link::Category($GLOBALS['Rewrite'], array('page' => 1));
         } else {
             $page_base = Link::Custom($GLOBALS['CurrentController'], $GLOBALS['Rewrite']);
         }
         $GLOBALS['meta_canonical'] = Link::Category($GLOBALS['Rewrite']);
         if ($this->pages_count > 1) {
             $prev = Link::Category($GLOBALS['Rewrite'], array('page' => $this->active_page - 1));
             $next = Link::Category($GLOBALS['Rewrite'], array('page' => $this->active_page + 1));
             // $GLOBALS['meta_canonical'] = $page_base;
             if ($this->active_page == 1) {
                 $GLOBALS['meta_next'] = $next;
                 // $GLOBALS['meta_canonical'] = $page_base;
             } elseif ($this->active_page == $this->pages_count) {
                 $GLOBALS['meta_prev'] = $prev;
             } else {
                 $GLOBALS['meta_prev'] = $prev;
                 $GLOBALS['meta_next'] = $next;
             }
         }
     }
     // var_dump($GLOBALS['meta_canonical']);
     // print_r('<br>');
     // var_dump($GLOBALS['meta_next']);
     // print_r('<br>');
     // var_dump($GLOBALS['meta_prev']);
     // print_r('<br>');
     return $parsed_content;
 }
开发者ID:Arikito,项目名称:webking.xt,代码行数:75,代码来源:paginator_c.php

示例4: header

<?php

if (!G::IsLogged()) {
    $_SESSION['from'] = $_SERVER['REQUEST_URI'];
    header('Location: ' . Link::Custom('main', null, array('clear' => true)) . '#auth');
    exit;
}
G::metaTags();
$Page = new Page();
$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
unset($parsed_res);
// Блок навигации в кабинете
require $GLOBALS['PATH_block'] . 'sb_cabinet_navigation.php';
if (isset($parsed_res) && $parsed_res['issuccess'] == true) {
    $tpl_center .= $parsed_res['html'];
}
switch ($Users->fields['gid']) {
    case _ACL_CUSTOMER_:
        $header = 'Кабинет клиента';
        if (isset($_SESSION['member']['promo_code']) && $_SESSION['member']['promo_code'] != '') {
            require $GLOBALS['PATH_block'] . 'cp_cab_promo_customer.php';
        } else {
            if (isset($GLOBALS['Rewrite']) && $GLOBALS['Rewrite'] == 'orders') {
                $header = 'Мои заказы';
                $rewrite = $GLOBALS['Rewrite'];
            } elseif (isset($GLOBALS['Rewrite']) && $GLOBALS['Rewrite'] == 'settings') {
                $header = 'Настройки';
                $rewrite = $GLOBALS['Rewrite'];
            } elseif (isset($GLOBALS['Rewrite']) && $GLOBALS['Rewrite'] == 'feedback') {
                $header = 'Обратная связь';
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:cabinet.php

示例5: unset

unset($parsed_res);
if (isset($GLOBALS['Rewrite'])) {
    if (!$Page->SetFieldsByRewrite($GLOBALS['Rewrite'])) {
        header('Location: ' . _base_url . '/404/');
        exit;
    }
    $page = $Page->fields;
    G::metaTags($page);
    $header = $page['title'];
    $tpl->Assign('header', $header);
    $tpl->Assign('data', $page);
    $tpl->Assign('indexation', $page['indexation']);
    $title = explode(' | ', $header);
    $GLOBALS['IERA_LINKS'][] = array('title' => $title[0], 'descr' => $header, 'url' => Link::Custom('page', $page['translit']));
    $template = 'cp_page.tpl';
} else {
    $header = 'Статьи оптового торгового центра xt.ua';
    $tpl->Assign('header', $header);
    $GLOBALS['IERA_LINKS'][] = array('title' => $header, 'descr' => 'Подборка самых интересных статей от службы снабжения xt.ua. Все самое полезное о покупках, оптовой торговли, особенностях выбора. Здесь Вы найдете рекомендации, полезные советы от специалистов и постоянных покупателей', 'url' => Link::Custom('page'));
    if (!($pagelist = $Page->PagesListByType('katalog'))) {
        header('Location: ' . _base_url . '/404/');
        exit;
    }
    rsort($pagelist);
    $tpl->Assign('data', $pagelist);
    $template = 'cp_pages_list.tpl';
}
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . $template));
if (true == $parsed_res['issuccess']) {
    $tpl_center .= $parsed_res['html'];
}
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:page.php

示例6: array_shift

        } else {
            $GLOBALS['CurrentController'] = array_shift($rewrite_arr);
            $GLOBALS['Rewrite'] = array_shift($rewrite_arr);
            $GLOBALS['Rewrite'] = $GLOBALS['Rewrite'] == $GLOBALS['CurrentController'] ? false : $GLOBALS['Rewrite'];
        }
        // парсим строку с примененными фильтрами
        $GLOBALS['Filters'] = G::ParseUrlParams(array_pop($rewrite_arr));
    }
}
if (isset($_REQUEST['paginator_specific_page'])) {
    $rewrite_arr['page'] = $_REQUEST['paginator_specific_page'];
    header("HTTP/1.1 301 Moved Permanently");
    if ($GLOBALS['CurrentController'] == 'products') {
        header("Location: " . Link::Category($GLOBALS['Rewrite'], $rewrite_arr));
    } else {
        header("Location: " . Link::Custom($GLOBALS['CurrentController'], $GLOBALS['Rewrite'], $rewrite_arr));
    }
    exit;
}
if (isset($rewrite_arr) && count($rewrite_arr) > 0) {
    switch ($GLOBALS['CurrentController']) {
        case 'product':
            header("HTTP/1.1 301 Moved Permanently");
            header("Location: http://" . $_SERVER['SERVER_NAME'] . '/' . str_replace(implode('/', $rewrite_arr) . '/', '', $request_url));
            break;
        default:
            header("HTTP/1.1 301 Moved Permanently");
            header("Location: http://" . $_SERVER['SERVER_NAME'] . '/' . str_replace(implode('/', $rewrite_arr) . '/', '', $request_url) . '/');
            break;
    }
}
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:routes.php

示例7: Post

$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
$Post = new Post();
$GLOBALS['IERA_LINKS'][] = array('title' => 'Статьи', 'descr' => 'Подборка самых интересных статей от службы снабжения xt.ua. Все самое полезное о покупках, оптовой торговли, особенностях выбора. Здесь Вы найдете рекомендации, полезные советы от специалистов и постоянных покупателей', 'url' => Link::Custom('post'));
if (isset($GLOBALS['Rewrite'])) {
    unset($parsed_res);
    if (!$Post->SetFieldsByRewrite($GLOBALS['Rewrite'])) {
        header('Location: ' . _base_url . '/404/');
        exit;
    }
    $post = $Post->fields;
    $header = $post['title'];
    $tpl->Assign('header', $header);
    $tpl->Assign('data', $post);
    $tpl->Assign('indexation', $post['indexation']);
    $GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => Link::Custom('post', $post['translit']));
    $template = 'cp_post.tpl';
} else {
    $header = 'Статьи';
    $tpl->Assign('header', $header);
    $Post->SetList();
    $posts = $Post->list;
    if (!empty($posts)) {
        rsort($posts);
    }
    $tpl->Assign('list', $posts);
    $template = 'cp_post.tpl';
}
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . $template));
if (true == $parsed_res['issuccess']) {
    $tpl_center .= $parsed_res['html'];
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:post.php

示例8: array

$customers->SetFieldsById($Users->fields['id_user']);
$customer = $customers->fields;
$contragents->SetList();
$availablemanagers = $contragents->list;
$newsletters = $Newsletter->getNewsletterByIdUser($Users->fields['id_user']);
$tpl->Assign('newsletters', $newsletters);
if ($customer['id_contragent'] > 0) {
    $contragents->GetSavedFields($customer['id_contragent']);
    $savedmanager = $contragents->fields;
}
$Users->SetUser($_SESSION['member']);
$tpl->Assign('User', $Users->fields);
$tpl->Assign('Customer', $customer);
$tpl->Assign('availablemanagers', $availablemanagers);
$tpl->Assign('savedmanager', $savedmanager);
$tpl->Assign('msg', array('type' => 'info', 'text' => 'Что бы настроить уведомления и получать рассылку введите свой email в <a href="' . Link::Custom('cabinet', null, array('clear' => true)) . '">личных данных</a>.'));
if (isset($_POST['save_settings'])) {
    if ($Users->updateUser($_POST) && $customers->updateContragent($_POST['id_manager'])) {
        header("Location: /cabinet/settings/?t=basic&success");
    } else {
        header("Location: /cabinet/settings/?t=basic&unsuccess");
    }
} elseif (isset($_POST['save_password'])) {
    $_POST['passwd'] = $_POST['new_passwd'];
    if (isset($_POST['passwd']) && $_POST['passwd'] != '' && $_POST['passwd'] == $_POST['passwdconfirm']) {
        if ($Users->updateUser($_POST)) {
            header("Location: /cabinet/settings/?t=password&success");
        } else {
            header("Location: /cabinet/settings/?t=password&unsuccess");
        }
    } else {
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:cp_cab_settings_customer.php

示例9: Images

             // Проверяем загружен ли файл
             if (is_uploaded_file($_FILES['file']['tmp_name'])) {
                 // Проверяем объем файла
                 if ($_FILES['file']['size'] > 1024 * 3 * 1024) {
                     $res['message'] = 'Размер файла превышает три мегабайта';
                     $res['status'] = 3;
                 } else {
                     $folder_name = 'estimates/' . $_SESSION['member']['id_user'] . '/';
                     $pathname = $GLOBALS['PATH_root'] . $folder_name;
                     $images = new Images();
                     $images->checkStructure($pathname);
                     if (move_uploaded_file($_FILES['file']['tmp_name'], $pathname . $_FILES['file']['name'])) {
                         // Если все загружено на сервер, выполнить запись в БД
                         $file = '/' . $folder_name . $_FILES['file']['name'];
                         $Product->UploadEstimate($file, $_POST['comment']);
                         $res['message'] = '<h4>Загрузка прошла успешно!</h4><p>Загрузка сметы доступна только зарегестрированным пользователям.</p><br><p>Поэтому для Вас был создан аккаунт на сайте <span class="bold_text">xt.ua</span>.</p><br><p>На указанный при загрузке сметы номер телефона <span class="bold_text">' . $_POST['phone'] . '</span> отправлено <span class="bold_text">смс-сообщение</span> с временным паролем для входа в личный кабинет.</p><br><p>Перейдите в свой <a href="' . Link::Custom('cabinet', 'settings', array('clear' => true)) . '?t=password"><span class="bold_text">личный кабинет</span></a> для смены временного пароля на постоянный.</p>';
                         $res['status'] = 1;
                     } else {
                         $res['message'] = '<h4>Произошла ошибка.</h4><p>Повторите попытку позже!</p>';
                         $res['status'] = 4;
                     }
                 }
             } else {
                 $res['message'] = 'Файл не был загружен!';
                 $res['status'] = 5;
             }
         }
     }
     echo json_encode($res);
     break;
 case 'priceHelp':
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:product.php

示例10: forgetCart

 public function forgetCart()
 {
     global $db;
     global $tpl;
     $res = array();
     $sql = "SELECT c.id_cart, c.id_user, u.email, u.`name`,\n\t\t\t\tcr.first_name, cr.middle_name\n\t\t\t\tFROM " . _DB_PREFIX_ . "cart c\n\t\t\t\tLEFT JOIN " . _DB_PREFIX_ . "user u ON u.id_user = c.id_user\n\t\t\t\tLEFT JOIN " . _DB_PREFIX_ . "customer cr ON cr.id_user = c.id_user\n\t\t\t\tWHERE `status` = 0 AND u.active = 1 AND u.gid = 5 AND c.id_user = 22972";
     if (!($res = $db->GetArray($sql))) {
         return false;
     }
     foreach ($res as $k => $v) {
         $title = (!empty($v['first_name']) && !empty($v['middle_name']) ? $v['first_name'] . ' ' . $v['middle_name'] . ', ' : null) . 'Вы оставили незавершенную покупку';
         $sql = "SELECT p.art, p.name,\n\t\t\t\t\t(CASE WHEN i.src IS NOT NULL THEN i.src ELSE p.images END) AS src\n\t\t\t\t\tFROM xt_cart_product cp\n\t\t\t\t\tLEFT JOIN xt_product p ON cp.id_product = p.id_product\n\t\t\t\t\tLEFT JOIN xt_image i ON i.id_product = cp.id_product AND i.ord = 0\n\t\t\t\t\tWHERE id_cart = " . $v['id_cart'];
         $res[$k]['prod_list'] = $db->GetArray($sql);
         $tpl->Assign('title', $title);
         $tpl->Assign('cart', $res[$k]);
         $tpl->Assign('button', array('title' => 'Ппродолжить покупку', 'href' => Link::Custom('main') . '#cart'));
         $tpl->Assign('content', $tpl->Parse($GLOBALS['PATH_tpl_global'] . 'mail_cart.tpl'));
         $Email = array('html' => $tpl->Parse($GLOBALS['PATH_tpl_global'] . 'mail.tpl'), 'subject' => 'Незавершенная покупка', 'encoding' => 'UTF-8', 'from' => array('name' => $this->FromName, 'email' => 'administration@xt.ua'), 'to' => array(array('name' => $v['name'], 'email' => $v['email'])));
         $res = $this->oApi->send_email($Email);
         if (!$res) {
             return false;
         }
     }
     return true;
 }
开发者ID:Arikito,项目名称:webking.xt,代码行数:25,代码来源:mailer_c.php

示例11: array

<?php

$GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => _base_url . '/cabinet/agent/');
if (isset($_SERVER['HTTP_REFERER'])) {
    $referer = explode('/', str_replace('http://', '', $_SERVER['HTTP_REFERER']));
    $tpl->Assign('referer', $referer);
}
if (isset($_REQUEST['confirm_agent']) && !G::isAgent() && $Users->ConfirmAgent()) {
    header('Location: ' . Link::Custom('cabinet', 'agent', array('clear' => true)));
}
$orders = $Users->GetAgentInfo($_SESSION['member']['id_user']);
$total_bonus = 0;
if (!empty($orders)) {
    foreach ($orders as $order) {
        if ($order['id_order_status'] == 2) {
            if (!isset($history[date('d.m.Y', $order['creation_date'])]['orders_sum'])) {
                $history[date('d.m.Y', $order['creation_date'])]['orders_sum'] = $order['sum_discount'];
            } else {
                $history[date('d.m.Y', $order['creation_date'])]['orders_sum'] += $order['sum_discount'];
            }
            $total_bonus += $order['sum_discount'];
        }
        $history[date('d.m.Y', $order['creation_date'])]['orders'][$order['creation_date']] = $order;
    }
    krsort($history);
    foreach ($history as &$action) {
        krsort($action['orders']);
    }
    $tpl->Assign('history', $history);
}
$tpl->Assign('total_bonus', $total_bonus);
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:cp_cab_agent_customer.php

示例12: intval

    $id_order = intval($_POST['id_order']);
}
$Customer = new Customers();
$Customer->SetFieldsById($Users->fields['id_user']);
if (isset($_POST['save_bonus'])) {
    if ($Customer->registerBonus($_POST)) {
        header("Location: " . Link::Custom('cabinet', 'bonus', array('clear' => true)) . "?t=bonus_info&success");
        exit;
    }
    header("Location: " . Link::Custom('cabinet', 'bonus', array('clear' => true)) . "?t=change_bonus&error");
    exit;
} elseif (isset($_POST['update_bonus'])) {
    if ($Customer->updateBonus($_POST)) {
        header("Location: " . Link::Custom('cabinet', 'bonus', array('clear' => true)) . "?t=bonus_info&success");
        exit;
    }
    header("Location: " . Link::Custom('cabinet', 'bonus', array('clear' => true)) . "?t=change_bonus&error");
    exit;
}
$ii = count($GLOBALS['IERA_LINKS']) - 1;
$tpl->Assign('Customer', $Customer->fields);
if (!$Customer->fields['bonus_card'] && isset($_GET['t']) && $_GET['t'] == 'change_bonus') {
    $tpl->Assign('msg', array('type' => 'info', 'text' => 'Вы получили бонусную карту? Пришло время ее активировать!<br>Для этого заполните форму ниже, что поможет нам сделать Ваши покупки проще, а работу с нами - приятнее.'));
}
if (isset($_GET['success'])) {
    $tpl->Assign('msg', array('type' => 'success', 'text' => 'Бонусная карта сохранена'));
} elseif (isset($_GET['error'])) {
    $tpl->Assign('msg', array('type' => 'error', 'text' => 'Что-то пошло не так'));
}
$tpl->Assign('content', $tpl->Parse($GLOBALS['PATH_tpl_global'] . 'cab_' . (isset($_GET['t']) ? $_GET['t'] : 'bonus_info') . '.tpl'));
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_customer_cab_bonus.tpl'));
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:cp_cab_bonus_customer.php


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