New Drupal Module Release: AuctionAds 3.0
Posted: Sat 05/26/2007 by ramiroI just released version 3.0 of the Drupal module AuctionAds that allows for easy integration of AuctionAds advertising in your node content. The new version supports ad campaigns and you can now restrict taxonomy terms used as ad keywords to a selected vocabulary.
Support for ad campaigns is the first step towards revenue sharing on websites with multiple authors. This feature will be added in one of the next releases.
Restricting terms to a selected vocabulary enables you to set up a special ad keywords vocabulary. So each time you add or edit a node you can enter terms that are only used as ad keywords.
If there are no taxonomy terms specified for a node the ad keywords entered in the administration form of the AuctionAds module are used as search terms. This form field is required to always have a fallback.
If you display taxonomy terms on content pages you can prevent the ad terms from being displayed using the following code snippet in your template.php file:
Code Snippets
template.php
<?php
function _phptemplate_variables($hook, $vars) {
$variables = array();
$tag_links = array();
if ($hook == 'node') {
// separate free tagging from ad keywords
foreach (module_invoke('taxonomy', 'get_vocabularies', $vars['node']->type) as $vid=>$vocab) {
foreach (module_invoke('taxonomy', 'node_get_terms_by_vocabulary', $vars['node']->nid, $vid) as $term) {
if ($term->vid != 2) { // ad keywords vocabulary id = 2
$tag_links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => $term->description));
}
}
}
$variables['tags'] = theme('item_list', $tag_links);
}
return $variables;
}
?>node.tpl.php
You then insert all terms except the ad keywords in your content by putting out the value of the $tags variable in your node templates.
<?php print $tags; ?>Download
- Login to post comments
