SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | $wgExtensionCredits['parserhook'][] = array( | |
3 | 'name' => 'AmazonAssociatesHTML', | |
4 | 'description' => 'Place amazon ads anywhere in your wiki', | |
5 | 'author' => 'Marc Hoover', | |
6 | 'url' => 'http://www.celeb-wiki.com' | |
7 | ); | |
8 | ||
9 | $wgHooks['ParserFirstCallInit'][] = 'AmazonAdsSetup'; | |
10 | ||
11 | function AmazonAdsSetup( &$parser ) { | |
12 | $parser->setHook( 'amazonAd', 'AmazonRender' ); | |
13 | return true; | |
14 | } | |
15 | ||
16 | ||
17 | function AmazonRender($input, $args ) { | |
18 | $input =""; | |
19 | $url = array(); | |
20 | $placement = $args['placement']; | |
21 | $linkId = $args['linkId']; | |
22 | ||
23 | - | $amazon['showad'] = '<nowiki><iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=grnlignmet-20&marketplace=amazon®ion=US&placement='. $placement .'asins='. $placement .'&linkId='. $linkId .'&show_border=true&link_opens_in_new_window=true">'."\n"; |
23 | + | $amazon['showad'] = '<nowiki><iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=grnlignmet-20&marketplace=amazon&region=US&placement='. $placement .'asins='. $placement .'&linkId='. $linkId .'&show_border=true&link_opens_in_new_window=true">'."\n"; |
24 | $amazon['showad'] .= '</iframe></nowiki>'."\n"; | |
25 | ||
26 | ||
27 | return $amazon['showad']; | |
28 | } |