discuz内容页目录代码研究
xiao9469
2022/05/30 07:57:43
- function parseindex($nodes, $pid) { global $_G; $nodes = dhtmlspecialchars($nodes); $nodes = preg_replace('/(\**?)\[#(\d+)\](.+?)[\r\n]/', "<a page="\\2" sub="\\1">\\3</a>", $nodes); $nodes = preg_replace('/(\**?)\[#(\d+),(\d+)\](.+?)[\r\n]/', "<a tid="\\2" pid="\\3" sub="\\1">\\4</a>", $nodes); $_G['forum_posthtml']['header'][$pid] .= '<div id="threadindex">'.$nodes.'</div><script type="text/javascript" reload="1">show_threadindex('.$pid.', '.($_GET['from'] == 'preview' ? '1' : '0').')</script>'; return '';}