Loading...   


		/* Build Table of Contents... */
		$data = explode("\n", $Content); $TOC = array(); $n = 0;
		foreach($data as $line) {
			if(preg_match('/<h1|<h2|<h3|<h4|<h5|<h6/i', $line)){
				preg_match_all("/(<h1[^>]*>)(.*?)(<\/h1>)/", $line, $matches);  foreach ($matches[2] as $v => $k){  $TOC[$n] = array(strip_tags($k), 1); $n++; $line2 = str_replace($matches[1][0], '<div id="' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" style="display:inline;" class="anchor"></div><h1 class="toc-linked" tocl="' . $n . '" id="ac_' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '"><a href="#' . TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" id="toc_' . $n . '" class="icon-link toc-link"><span class="visuallyhidden">*</span></a>', $line); $Content = str_replace($line, $line2, $Content); } 
				preg_match_all("/(<h2[^>]*>)(.*?)(<\/h2>)/", $line, $matches);  foreach ($matches[2] as $v => $k){  $TOC[$n] = array(strip_tags($k), 2); $n++; $line2 = str_replace($matches[1][0], '<div id="' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" style="display:inline;" class="anchor"></div><h2 class="toc-linked" tocl="' . $n . '" id="ac_' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '"><a href="#' . TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" id="toc_' . $n . '" class="icon-link toc-link"><span class="visuallyhidden">*</span></a>', $line); $Content = str_replace($line, $line2, $Content); }
				preg_match_all("/(<h3[^>]*>)(.*?)(<\/h3>)/", $line, $matches);  foreach ($matches[2] as $v => $k){  $TOC[$n] = array(strip_tags($k), 3); $n++; $line2 = str_replace($matches[1][0], '<div id="' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" style="display:inline;" class="anchor"></div><h3 class="toc-linked" tocl="' . $n . '" id="ac_' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '"><a href="#' . TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" id="toc_' . $n . '" class="icon-link toc-link"><span class="visuallyhidden">*</span></a>', $line); $Content = str_replace($line, $line2, $Content); }
				preg_match_all("/(<h4[^>]*>)(.*?)(<\/h4>)/", $line, $matches);  foreach ($matches[2] as $v => $k){  $TOC[$n] = array(strip_tags($k), 4); $n++; $line2 = str_replace($matches[1][0], '<div id="' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" style="display:inline;" class="anchor"></div><h4 class="toc-linked" tocl="' . $n . '" id="ac_' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '"><a href="#' . TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" id="toc_' . $n . '" class="icon-link toc-link"><span class="visuallyhidden">*</span></a>', $line); $Content = str_replace($line, $line2, $Content); }
				preg_match_all("/(<h5[^>]*>)(.*?)(<\/h5>)/", $line, $matches);  foreach ($matches[2] as $v => $k){  $TOC[$n] = array(strip_tags($k), 5); $n++; $line2 = str_replace($matches[1][0], '<div id="' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" style="display:inline;" class="anchor"></div><h5 class="toc-linked" tocl="' . $n . '" id="ac_' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '"><a href="#' . TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" id="toc_' . $n . '" class="icon-link toc-link"><span class="visuallyhidden">*</span></a>', $line); $Content = str_replace($line, $line2, $Content); }
				preg_match_all("/(<h6[^>]*>)(.*?)(<\/h6>)/", $line, $matches);  foreach ($matches[2] as $v => $k){  $TOC[$n] = array(strip_tags($k), 6); $n++; $line2 = str_replace($matches[1][0], '<div id="' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" style="display:inline;" class="anchor"></div><h6 class="toc-linked" tocl="' . $n . '" id="ac_' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '"><a href="#' . TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" id="toc_' . $n . '" class="icon-link toc-link"><span class="visuallyhidden">*</span></a>', $line); $Content = str_replace($line, $line2, $Content); }
				# preg_match_all("/<h6>(.*?)<\/h6>/", $line, $matches);  foreach ($matches[1] as $v => $k){ $TOC[$n] = array(strip_tags($k), 6); $n++; $line2 = str_replace('<h6>', '<div id="' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" style="display:inline;" class="anchor"></div><h6 class="toc-linked" tocl="' . $n . '" id="ac_' .  TOASCII(HR_Desc_To_URL(strip_tags($k))) . '"><a href="#' . TOASCII(HR_Desc_To_URL(strip_tags($k))) . '" id="toc_' . $n . '" class="icon-link toc-link"><span class="visuallyhidden">*</span></a>', $line); $Content = str_replace($line, $line2, $Content); }
			}
		}

Raw Paste Data