Interstitial Ads v

For information and updates, please visit:
http://www.dagondesign.com/articles/interstitial-ads-plugin-for-wordpress/

">
Ad Code

The code you enter here will automatically be added to all links on your site.

Example: <a href="page.php" ADDEDCODE >page</a>

'; $staglen = strlen($stag); $etaglen = strlen($etag); for ($i = 0; $i < ($clen - $etaglen); $i++) { if (strtolower(substr($content, $i, $staglen)) == strtolower($stag)) { $excludes[$ei]['s'] = $i; } else if (strtolower(substr($content, $i, $etaglen)) == strtolower($etag)) { $excludes[$ei]['e'] = $i + $etaglen; $ei++; } } // mark code blocks for exclusion $stag = ' $row) { $s[$key] = $row['s']; $e[$key] = $row['e']; } if (is_array($s) && is_array($e)) { array_multisort($s, SORT_ASC, $e, SORT_ASC, $excludes); } // split content into array $ncontent = array(); $ei = 0; $ecount = count($excludes); $tmp = ''; $echk = FALSE; for ($i = 0; $i < $clen; $i++) { if ($i == $excludes[$ei]['s']) { $echk = TRUE; $ncontent[] = $tmp; $tmp = ''; } else if (($ei < $ecount) && ($i == $excludes[$ei]['e'])) { $echk = FALSE; $ncontent[] = $tmp; $tmp = ''; $ei++; } $tmp .= $content[$i]; } $ncontent[] = $tmp; // rebuild content, adding interstitials into proper sections $content = ''; $ncount = count($ncontent); for ($i = 0; $i < $ncount; $i += 2) { $content .= preg_replace('//i', '', $ncontent[$i]); $content .= $ncontent[$i + 1]; } // remove duplicates $content = str_replace($inter_code . " " . $inter_code, $inter_code, trim($content)); return $content; } add_action('wp_head', 'ddia_init'); add_filter('the_content', 'ddia_process'); add_action('admin_menu', 'ddia_add_option_pages'); ?>