Extension “amazonize ” for TicTap Contextual Ads - WordPressPlugin

I wrote a small extension for TicTap Contextual Ads - WordPressPlugin

It's realy realy realy quick and dirty. :-o

Maybe I will write a wordpress-plugin. Sometime :-)

Ich habe eine Erweiterung für TicTap Contextual Ads - WordPressPlugin geschrieben. Hingerotzt trifft es eher :-).

Wenn mal Zeit ist, mach ich auch WordPress-Plugin draus. Mal schauen.

Example -------------------------------------------------------------------------------------->

The Code of Extension "amazonize "

PHP:
  1. <?
  2. function amazonize ($theContent)
  3. {
  4.   global $post;
  5.  
  6.   $amazon_id = get_post_meta($post->ID, 'amazon_id', true);
  7.     if ( $amazon_id == '') return $theContent;
  8.   $amazon_img = get_post_meta($post->ID, 'amazon_img', true);
  9.  
  10. $amazon_div = '
  11. <div style="float:right;margin:12px;text-align:center;">
  12. <h6>Mouseover-Werbung</h6><a id="lnx'.$post->ID.'" class="tt_mylink" name="evtst|a|'.$amazon_id.'" href="http://www.amazon.de/gp/product/'.$amazon_id.'?ie=UTF8&tag=schilliconcar-21&linkCode=as2&camp=1638&creative=6742&creativeASIN='.$amazon_id.'">
  13. <img border="0" src="'.$amazon_img.'"/></a>
  14. <img src="http://www.assoc-amazon.de/e/ir?t=schilliconcar-21&l=as2&o=3&a='.$amazon_id.'" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div>';
  15.   return $amazon_div.$theContent;
  16. }
  17.  
  18. // add this in top of main index.php of your wordpress
  19. add_filter('the_content', 'amazonize');
  20.  
  21. //and change your Amazon id!
  22. ?>

How to use?

If you use WordPress you can add 2 wordpress custom fields : amazon_id and amazon_img.
Example:

amazon_id = 363601384X
amazon_img=http://images.amazon.com/images/P/363601384X.01._AA_SCMZZZZZZZ_V63704912_.jpg


Warning: fopen(http://www.youtube.com/api2_rest?method=youtube.videos.list_by_tag&dev_id=e_xieum5R98&tag=WordPressPlugin) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.0 410 Gone in /home/www/doc/16037/scill.de/www/content/wp-content/plugins/youtuberelated.php on line 109
Cannot read RSS data file.