# HG changeset patch # User sly # Date 1240220977 0 # Node ID 416ea999ed76919d3882a27c9b3933765ddb580e # Parent e5584a19768bf54fb4b1192e2aaf6a451bf4507f maj ad version rc1 diff -r e5584a19768b -r 416ea999ed76 ad.admin.inc --- a/ad.admin.inc Wed Apr 15 07:58:32 2009 +0000 +++ b/ad.admin.inc Mon Apr 20 09:49:37 2009 +0000 @@ -1,5 +1,5 @@ t('If enabled, any destination URLs entered in ads will be required to be complete URLs (including http:// or https:// at the beginning). If you wish to include internal urls, you will need to disable this option.'), ); + $form['search'] = array( + '#type' => 'fieldset', + '#title' => t('Search'), + '#collapsible' => TRUE, + ); + + $form['search']['ad_no_search'] = array( + '#type' => 'checkbox', + '#title' => t('Remove ads from local search results'), + '#default_value' => variable_get('ad_no_search', 1), + '#description' => t('If enabled, all advertisements will be removed from local search results. Users with %perm1 or %perm2 permissions will still see advertisements in the search results.', array('%perm1' => t('administer advertisements'), '%perm2' => t('edit any advertisement'))), + ); + + $form['search']['ad_meta_noindex'] = array( + '#type' => 'checkbox', + '#title' => t('Remove ads from remote search engines'), + '#default_value' => variable_get('ad_meta_noindex', 1), + '#description' => t('If enabled, advertisement nodes will include the !noindex, telling remote search engines to not include these nodes in their search index. This meta tag will appear on any page that an advertisement node is displayed on, even if a page is comprised of both ad nodes and other site content. It will not be displayed when advertisements are displayed via blocks, calls to ad(), or other display methods when the page is comprised of non-ad content.', array('!noindex' => l(t('noindex meta tag'), 'http://en.wikipedia.org/wiki/Noindex'))), + ); + $form['iframe'] = array( '#type' => 'fieldset', '#title' => t('IFrame'), @@ -646,6 +666,8 @@ variable_set('ad_cache', $form_state['values']['ad_cache']); variable_set('ad_display', $form_state['values']['ad_display']); variable_set('ad_validate_url', $form_state['values']['ad_validate_url']); + variable_set('ad_no_search', $form_state['values']['ad_no_search']); + variable_set('ad_meta_noindex', $form_state['values']['ad_meta_noindex']); variable_set('ad_iframe_frameborder', $form_state['values']['ad_iframe_frameborder']); variable_set('ad_iframe_scroll', $form_state['values']['ad_iframe_scroll']); variable_set('ad_iframe_width', $form_state['values']['ad_iframe_width']); diff -r e5584a19768b -r 416ea999ed76 ad.info --- a/ad.info Wed Apr 15 07:58:32 2009 +0000 +++ b/ad.info Mon Apr 20 09:49:37 2009 +0000 @@ -4,9 +4,9 @@ dependencies[] = taxonomy description = An advertising system for Drupal powered websites. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 ad.module --- a/ad.module Wed Apr 15 07:58:32 2009 +0000 +++ b/ad.module Mon Apr 20 09:49:37 2009 +0000 @@ -1,5 +1,5 @@ " n.type != 'ad'"); + } } /** @@ -936,6 +954,9 @@ case 'view': if (isset($node->adtype)) { + if (variable_get('ad_meta_noindex', 1)) { + ad_noindex_meta(); + } $node = node_prepare($node, $teaser); $node->content['body'] = array( '#value' => $teaser ? $node->teaser : theme('node_ad', $node, $page), @@ -975,6 +996,17 @@ } } +/** + * Add the noindex meta tag. + */ +function ad_noindex_meta() { + static $added = FALSE; + if (!$added) { + drupal_set_html_head(''); + $added = TRUE; + } +} + function ad_adapi($op, $node = NULL) { switch ($op) { case 'permissions': @@ -1206,6 +1238,9 @@ if (is_object($aid) && isset($aid->aid)) { $aid = $aid->aid; } + else if (is_object($aid) && isset($aid->nid)) { + $aid = $aid->nid; + } else if (is_object($aid)) { watchdog('ad', 'Invalid aid object passed into ad_permission, no aid->aid set.'); $aid = 0; diff -r e5584a19768b -r 416ea999ed76 cache/file/ad_cache_file.info --- a/cache/file/ad_cache_file.info Wed Apr 15 07:58:32 2009 +0000 +++ b/cache/file/ad_cache_file.info Mon Apr 20 09:49:37 2009 +0000 @@ -5,9 +5,9 @@ description = Provides a file-caching mechanism to improve ad serving performance. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 channel/ad_channel.info --- a/channel/ad_channel.info Wed Apr 15 07:58:32 2009 +0000 +++ b/channel/ad_channel.info Mon Apr 20 09:49:37 2009 +0000 @@ -5,9 +5,9 @@ description = Provides the ability to create advertisement channels, about which rules can be defined. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 channel/ad_channel.install --- a/channel/ad_channel.install Wed Apr 15 07:58:32 2009 +0000 +++ b/channel/ad_channel.install Mon Apr 20 09:49:37 2009 +0000 @@ -1,5 +1,5 @@ nid if available + +April 14th, 2009 (6.x-2.0-beta6) - ad.module o bug #431806: use valid XHTML when displaying advertisements diff -r e5584a19768b -r 416ea999ed76 documentation/INSTALL.txt --- a/documentation/INSTALL.txt Wed Apr 15 07:58:32 2009 +0000 +++ b/documentation/INSTALL.txt Mon Apr 20 09:49:37 2009 +0000 @@ -45,18 +45,22 @@ the ad_report module. (Goto :: administer >> modules :: then put a check next to 'ad_report') -7) Assign the 'show advertisements' permission to all roles that you wish to +7) If you wish to filter out duplicate clicks and other invalid clicks (as + detailed in the README), enable the click_filter module. + (Goto :: administer >> modules :: then put a check next to 'click_filter') + +8) Assign the 'show advertisements' permission to all roles that you wish to see advertisements. (Goto :: administer >> user management >> access control :: then put a check next to 'show advertisements' for all roles that should see ads) -8) You can display ads in blocks by going to administer >> blocks and enabling +9) You can display ads in blocks by going to administer >> blocks and enabling the per-ad-group blocks that are automatically generated. -9) Optionally configure an input filter for your advertisements that allow - the html tags to display correctly. - (Goto :: administer >> site configuration >> input filters) - If you need to associate a specific input filter with the advertisement - content type, you may want to review the following projects: +10) Optionally configure an input filter for your advertisements that allow + the html tags to display correctly. + (Goto :: administer >> site configuration >> input filters) + If you need to associate a specific input filter with the advertisement + content type, you may want to review the following projects: http://drupal.org/project/better_formats http://drupal.org/project/filterbynodetype diff -r e5584a19768b -r 416ea999ed76 documentation/README.txt --- a/documentation/README.txt Wed Apr 15 07:58:32 2009 +0000 +++ b/documentation/README.txt Mon Apr 20 09:49:37 2009 +0000 @@ -191,9 +191,11 @@ You can also specify how to display a given ad. Current display methods are - 'javascript' and 'raw'. When using the 'javascript' method, ads will - randomly change even when the Drupal pagecache is enabled. When using the - 'raw' method, ads will only change when the Drupal pagecache is flushed. + 'javascript', 'jquery', 'iframe', and 'raw'. When using the 'javascript', + 'jquery', and 'iframe' methods, ads will randomly change even when the Drupal + pagecache is enabled. When using the 'raw' method, ads will only change when + the Drupal pagecache is flushed. + To force one ad with a tid of 76 to display using JavaScript you would pass in the following parameters: 'javascript')); @@ -315,3 +317,21 @@ 'Last seven days', 'This month', 'This year' and 'All time' will all be the same. When available, statistics will also include 'Last hour', 'Yesterday', 'Last month', and 'Last year'. + +When displaying advertisements using the JavaScript, jQuery, and IFrame methods +impressions are tracked each time the script is loaded. When displaying +advertisements using the Raw method, impressions are tracked through the use +of a hidden 1x1 pixel image that is displayed along with each advertisement. + +The click_filter module can be enabled to filter out the following invalid +clicks: + * Duplicate clicks from the same IP address + * Clicks from the owner of the advertisement + * Clicks from any user with 'filter clicks' permissions. + * Clicks from any users in which the word "bot" is contained in their + HTTP_USER_AGENT + +This means that when the click_filter module is enabled, all clicks by UID 1 +will be filtered because Drupal will automatically assign all permissions to +this user, including the 'filter clicks' permisison. The click_filter module +currently has no configuration options beyond the 'filter clicks' permission. diff -r e5584a19768b -r 416ea999ed76 embed/ad_embed.info --- a/embed/ad_embed.info Wed Apr 15 07:58:32 2009 +0000 +++ b/embed/ad_embed.info Mon Apr 20 09:49:37 2009 +0000 @@ -4,9 +4,9 @@ dependencies[] = ad description = Embed ads in content. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 external/ad_external.info --- a/external/ad_external.info Wed Apr 15 07:58:32 2009 +0000 +++ b/external/ad_external.info Mon Apr 20 09:49:37 2009 +0000 @@ -4,9 +4,9 @@ dependencies[] = ad description = Enhances the ad module to support externally hosted ads. Typically combined with IFrames. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 html/ad_html.info --- a/html/ad_html.info Wed Apr 15 07:58:32 2009 +0000 +++ b/html/ad_html.info Mon Apr 20 09:49:37 2009 +0000 @@ -4,9 +4,9 @@ dependencies[] = ad description = Enhances the ad module to support html-based ads, such as those defined by many advertising affiliate websites. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 image/ad_image.info --- a/image/ad_image.info Wed Apr 15 07:58:32 2009 +0000 +++ b/image/ad_image.info Mon Apr 20 09:49:37 2009 +0000 @@ -5,9 +5,9 @@ dependencies[] = upload description = Enhances the ad module to support banner ads. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 notify/ad_notify.info --- a/notify/ad_notify.info Wed Apr 15 07:58:32 2009 +0000 +++ b/notify/ad_notify.info Mon Apr 20 09:49:37 2009 +0000 @@ -6,9 +6,9 @@ description = Receive email notifications regarding ads. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 owners/ad_owners.info --- a/owners/ad_owners.info Wed Apr 15 07:58:32 2009 +0000 +++ b/owners/ad_owners.info Mon Apr 20 09:49:37 2009 +0000 @@ -5,9 +5,9 @@ description = Enhances the ad module to support ad owners. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 remote/ad_remote.info --- a/remote/ad_remote.info Wed Apr 15 07:58:32 2009 +0000 +++ b/remote/ad_remote.info Mon Apr 20 09:49:37 2009 +0000 @@ -5,9 +5,9 @@ description = Generates cut-and-paste source snippets allowing ads to be easily displayed on remote websites. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 report/ad_report.info --- a/report/ad_report.info Wed Apr 15 07:58:32 2009 +0000 +++ b/report/ad_report.info Mon Apr 20 09:49:37 2009 +0000 @@ -5,9 +5,9 @@ description = Provides comprehensive charts and reports about advertising statistics. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 statistics/click_filter/click_filter.info --- a/statistics/click_filter/click_filter.info Wed Apr 15 07:58:32 2009 +0000 +++ b/statistics/click_filter/click_filter.info Mon Apr 20 09:49:37 2009 +0000 @@ -4,9 +4,9 @@ dependencies[] = ad description = Filter duplicate click statistics. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 text/ad_text.info --- a/text/ad_text.info Wed Apr 15 07:58:32 2009 +0000 +++ b/text/ad_text.info Mon Apr 20 09:49:37 2009 +0000 @@ -4,9 +4,9 @@ dependencies[] = ad description = Enhances the ad module to support static text ads. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926" diff -r e5584a19768b -r 416ea999ed76 weight/probability/ad_weight_probability.info --- a/weight/probability/ad_weight_probability.info Wed Apr 15 07:58:32 2009 +0000 +++ b/weight/probability/ad_weight_probability.info Mon Apr 20 09:49:37 2009 +0000 @@ -5,9 +5,9 @@ description = Allow admin to adjust the probability that an ad will be displayed. core = 6.x -; Information added by drupal.org packaging script on 2009-04-14 -version = "6.x-2.0-beta6" +; Information added by drupal.org packaging script on 2009-04-17 +version = "6.x-2.0-rc1" core = "6.x" project = "ad" -datestamp = "1239719705" +datestamp = "1239975926"