<?php
/*
  PHP version 5
  Copyright (c) 2002-2018 ECISP.CN、EarcLink.COM
  警告：这不是一个免费的软件，请在许可范围内使用，请尊重知识产权，侵权必究，举报有奖
  作者：黄祥云 E-mail:6326420@qq.com  QQ:6326420 TEL:18665655030
 */

namespace inc_application\link;


class SKULink {


    public static function key_id_link($read = array(), $ispath = false) {
        global $espcms_command;
        if ($espcms_command['IS_REWRITE']) {

            $action_key_str = 'Article_List_' . $read['tid'];
            if (espcms_islongfig($read['url_key'], '/^[\d]+\-[\d]+[\d\-_]*$/i')) {
                $action_key_str .= '_' . $read['url_key'];
            }
            $action_key[] = $action_key_str;
            if ($espcms_command['IS_URLSTERN']) {
                $action_key[] = urlencode(str_replace('/', '_', $read['typename']));
            }
            $link = espcms_url_out($action_key, true);
        } else {

            $action_key['ac'] = 'Article';
            $action_key['at'] = 'List';
            $action_key['tid'] = $read['tid'];
            $action_key['sku_key'] = $read['url_key'];
            $link = espcms_url_out($action_key, false, false, $ispath);
        }
        return $link;
    }
}