/*
Plugin Name: Adsense Attachment Page
Plugin URI: http://djuki.padrino.co.yu/blog/wordpress-plugins/adsense-attachment-plugin/
Description: This is plugin for WordPress from 2.0 to 2.1 version. It will show your attachments (best for Images) in new page rounded with ads. This great way to earn some money and show large images in new window. This plugin show attachments with thumbnail image, and when you click on it will show image in full size.
Version: 0.1
Author: Ivan Djurdjevac
Author URI: http://djuki.padrino.co.yu/blog
*/
$__CLIENT_ID__ = "pub-6096930969415863";
$__AD_PARTNER__ = "";
function Return_Substrings($text, $sopener, $scloser)
{
$result = array();
$noresult = substr_count($text, $sopener);
$ncresult = substr_count($text, $scloser);
if ($noresult < $ncresult)
$nresult = $noresult;
else
$nresult = $ncresult;
unset($noresult);
unset($ncresult);
for ($i=0;$i<$nresult;$i++)
{
$pos = strpos($text, $sopener) + strlen($sopener);
$text = substr($text, $pos, strlen($text));
$pos = strpos($text, $scloser);
$result[] = substr($text, 0, $pos);
$text = substr($text, $pos + strlen($scloser), strlen($text));
}
return $result;
}
function ChangeImageLink($content) {
global $post;
$niz = array();
$content = preg_replace('/<\/a>/',
'
', $content);
return $content;
}
function SenseImagesPanel() {
if (isset($_POST['submit'])) {
$topcode = $_POST['topcode'];
$leftcode = $_POST['leftcode'];
$rightcode = $_POST['rightcode'];
$bottomcode = $_POST['bottomcode'];
$iwidth = $_POST['iwidth'];
$secondimage = $_POST['secondimage'];
$returnto = $_POST['returnto'];
$topcode = addslashes($topcode);
$leftcode = addslashes($leftcode);
$rightcode = addslashes($rightcode);
$bottomcode = addslashes($bottomcode);
update_option('topcode',$topcode);
update_option('leftcode',$leftcode);
update_option('rightcode',$rightcode);
update_option('bottomcode',$bottomcode);
update_option('iwidth', $iwidth);
update_option('secondimage', $secondimage);
update_option('returnto', $returnto);
} else {
$iwidth = get_option('iwidth');
$secondimage = get_option('secondimage');
$returnto = get_option('returnto');
}
?>
Put the Ads code into this textareas.