已搞定,奉上方法给其他需要的朋友使用:
twcms/view/parseurl_control.class.php:
// 标签URL
$len = strlen($cfg['link_tag_pre']);
if(substr($uri, 0, $len) == $cfg['link_tag_pre']) {
$len2 = strlen($cfg['link_tag_end']);
if(substr($uri, -$len2) == $cfg['link_tag_end']) {
$newurl = substr($uri, $len, -$len2);
$u_arr = explode('_', $newurl);
if(count($u_arr) >= 1) {
$_GET['control'] = 'tag';
$_GET['action'] = 'index';
//$_GET['mid'] = $u_arr[0];
$_GET['name'] = $u_arr[0];
isset($u_arr[2]) && $_GET['page'] = $u_arr[1];
return;
}
}
}
twcms/model/cms_content_model.class.php:
// 标签链接格式化
public function tag_url(&$mid, &$name, $page = FALSE) {
// hook cms_content_model_tag_url_before.php
if(empty($_ENV['_config']['twcms_parseurl'])) {
$s = $page ? '-page-{page}' : '';
return $this->cfg['webdir'].'index.php?tag--mid-'.$mid.'-name-'.urlencode($name).$s.$_ENV['_config']['url_suffix'];
}else{
return $this->cfg['webdir'].$this->cfg['link_tag_pre'].urlencode($name).($page ? '_{page}' : '').$this->cfg['link_tag_end'];
}
}