]*href\s*=\s*[\"\']?([^\'\" >]+)[\'\" >]/i"; preg_match_all ("/a[\s]+[^>]*?href[\s]?=[\s\"\']+". "(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/", $content, &$matches); $total = count($matches[0]); $links = array(); for($i=0;$i<$total;$i++){ $links[$i]['html'] = $matches[0][$i]; $links[$i]['href'] = $matches[1][$i]; $links[$i]['link'] = $matches[2][$i]; } return $links; } function replace_urls($content) { $links = extract_urls($content); $_link_count = count($links); $_links = $links; $footerHTML=""; $counter=1; if ($_link_count>0){ $footerHTML = "

Links"; for($i=0;$i<$_link_count;$i++){ if (!preg_match('#\.(jpg|png|gif)$#', $_links[$i]['href'])){ $_new_links = $_links[$i]['html']."[".$counter."]"; $content = str_replace($_links[$i]['html'],$_new_links,$content); if (strlen($_links[$i]['href'])>64){ $ahref = TinyURL($_links[$i]['href']); } else { $ahref = $_links[$i]['href']; } $footerHTML = $footerHTML."
[".$counter."] ".$ahref.""; $counter = $counter + 1; } } $footerHTML = $footerHTML."

"; } $content = $content.$footerHTML; return $content; } // addQRCode modified from (a) QR Code Anton Shevchuk (Author URI: http://anton.shevchuk.name) function addQRCode($chl, $chs = '150', $choe = 'UTF-8', $chld = 'L', $margin = '4') { $chl = urlencode($chl); if ($chs > 546) $chs = 546; $chs = $chs .'x'. $chs; $chld = strtoupper($chld); switch ($chld) { case 'L': case 'M': case 'Q': case 'H': break; default: $chld = 'L'; break; } $chld = $chld .'|'. $margin; $url = 'QR Code'; return $url; } function process($content,$perm_link,$showqr){ if ($showqr=='true'){ $content .= "

QR Code
You can read this post online by scanning this barcode (or visiting ".$perm_link.")
".addQRCode($perm_link)."

"; } $output = replace_urls($content); echo $output; } ?> '; ?> > <?php bloginfo_rss('name'); wp_title_rss(); ?> <?php the_title_rss() ?> ]]> post_content ) > 0 ) { $content = get_the_content(); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); ?> ]]> ]]>