Mercurial > defr > drupal > ad
comparison remote/ad_remote.module @ 8:32c1a7d9e1fa ad tip
maj module ad en 2.1
author | sly |
---|---|
date | Fri, 11 Sep 2009 11:10:20 +0000 |
parents | 948362c2a207 |
children |
comparison
equal
deleted
inserted
replaced
7:6aeff3329e01 | 8:32c1a7d9e1fa |
---|---|
1 <?php | 1 <?php |
2 // $Id: ad_remote.module,v 1.1.4.5.2.5.2.5 2009/03/05 00:35:56 jeremy Exp $ | 2 // $Id: ad_remote.module,v 1.1.4.5.2.5.2.6 2009/08/05 00:13:37 jeremy Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * Enhances the ad module to providing cut-and-paste source snippets allowing | 6 * Enhances the ad module to providing cut-and-paste source snippets allowing |
7 * ads to be easily displayed on remote websites. | 7 * ads to be easily displayed on remote websites. |
94 | 94 |
95 // build a snippet to display on the remote web page | 95 // build a snippet to display on the remote web page |
96 $output = '<!--'. t('start') .'-->'; | 96 $output = '<!--'. t('start') .'-->'; |
97 // build a wrapper script which collects the url the ad is displayed on | 97 // build a wrapper script which collects the url the ad is displayed on |
98 $output .= "\n<script language='JavaScript' type='text/javascript'>\n var adurl = window.location.href;\n"; | 98 $output .= "\n<script language='JavaScript' type='text/javascript'>\n var adurl = window.location.href;\n"; |
99 $url = ad($group, $quantity, array('hostid' => $hostid, 'div' => FALSE)); | 99 $url = ad($group, $quantity, array('hostid' => $hostid, 'ad_display' => 'javascript')); |
100 // break up the inner script so the browser doesn't parse it | 100 // break up the inner script so the browser doesn't parse it |
101 $url = str_replace(array('<script', '</script>', 'u=admin/content/ad/ad_remote'), array('"<scr" + "ipt', '"+"</scr" + "ipt>"', 'u="+adurl+"'), $url); | 101 $url = str_replace(array('<script', '</script>', 'u=admin/content/ad/ad_remote'), array('"<scr" + "ipt', '"+"</scr" + "ipt>"', 'u="+adurl+"'), $url); |
102 $output .= "document.write($url)\n</script>\n"; | 102 $output .= "document.write($url)\n</script>\n"; |
103 $output .= '<!--'. t('end') .'-->'; | 103 $output .= '<!--'. t('end') .'-->'; |
104 | 104 |