Display ads created by the author of a node
abramo - July 8, 2008 - 11:58
| Project: | Ad Views |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Image Ads created by the author of a node in view :: I try to call such ads through NodeFamily - in this case the whole ad node is displayed (including statistics, etc). Therefore this method of calling ads created by the author of the node in view apparently cannot be used.
In views I cannot see anything connected to Ads - and just displaying ad images by views is no solution!
So, how can one display in *any* node in view image ads created by the author of that node?
(of course, I do not mean ads manually embedded in each and every module, but automatically called by author, like in NodeFamily !!)

#1
#2
It's not clear to me: are you trying to display advertisements using the views module?
#3
No, not by using "views" - I found out that this alternative is not supported.
While it is possible to display ads created by the author of any node viewed, by using the NodeFamily module, NodeFamily prints the whole ad node, including stats etc, which is not helpful.
What I need, of course, is to present the ads only.
For example author "X" has created node "Y" for content and has also created an image ad, banner "YY".
When a visitor views content node "Y" he is able to view ad "YY" within node "Y".
This, of course, without manually embedding a particular ad in a particular node - but by automatic inclusion in the simple way NodeFamily functions. The problem with NodeFamily is that the whole ad node is displayed.
A snippet in the "Y" node template, possibly?
For a CMS like Drupal, which is not simply site creation software but "community" software, connecting ads to their authors in the way described is very desirable, I believe.
Any ideas would be much appreciated :)
#4
#5
#6
for anybody needing such an application, here is a suggestion useful up to the time something better turns up:
- do the job using "views"
- for this you have to revert to the last release of the ad module offering views integration (ad-5.x-1.5-rc2) - freaking, as that release still has bugs resolved in the latest release (but if we must, we must . . . .)
- create a view according to your needs, ex. for banners (image ads)
- in arguments, select the argument type: User: UID is Author
- in argumetns, select default to "use empty text"
- in arguments, add the following argument handling code:
if (arg(0) == 'node' && is_numeric(arg(1))) {$node=node_load(arg(1));
$args[0] = $node->uid;
}
return $args;
in this way you pull content created by an author into a node created by that author - any content actually, as specified by the "view" filters, and in this case ads.
hope this helps.
abramo
#7
I agree that this is a request best solved using "views". Re-assigning to the ad_views module.
(Sadly, nobody has stepped up to maintain the ad_views module yet, but hopefully soon.)