I'm planning one out as we speak. Manages rotation, ad managment by role, etc.
don't hold your breath though, its hardly near finished.
In the meantime, you can get by with this: http://lussumo.com/community/discussion/4959/alter-first-comment/#Item_2
Right now it puts code at the first and last post. To get some in the middle, change that if block in the center to something like this:if ( 1 == $RowNumber % 5 ) { $Comment->Body .= $CommentGrid->Context->GetDefinition('AfterFirstPostCode'); }
Adsense has a limit of the number of ads per page, so you might want to check up on that.
Hey guys, just remember the AdSense TOS says no more than 3 standard ad units per page. :)
1 Link Unit on the same page is acceptable, I would hate to see people get kicked out of the adsense program for this.
Here's my method: Edit comments.php (code here is before and after the ad code) Just paste your full code in between the and . This will display the ad blocks at set comment intervals. (in this case #4 and #10)
I tried it and screwed my comments up. Any help would be much appreciated... <?php /* * Copyright 2003 Mark O'Sullivan * This file is part of Vanilla. * Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. * Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * The latest source code for Vanilla is available at www.lussumo.com * Contact Mark O'Sullivan at mark [at] lussumo [dot] com * * Description: Display, add, and manipulate discussion comments */
// Create the comment form if ($CommentGrid->ShowForm) { $CommentForm = $Context->ObjectFactory->CreateControl($Context, 'DiscussionForm'); $CommentForm->Discussion = &$CommentGrid->Discussion; $CommentFoot = $Context->ObjectFactory->CreateControl($Context, 'Filler', 'comments_foot.php'); }
// Define properties of the page controls that are specific to this page $Head->BodyId = 'CommentsPage'; $Menu->CurrentTab = "discussions"; $Panel->CssClass = "CommentPanel"; $Panel->BodyCssClass = "Comments"; $Context->PageTitle = $CommentGrid->Discussion->Name;
@nuclearw Google's scripts limit you to 3 units per page, so technically you could run your AdSense code within the comment loop (display an ad block after every comment) and only 3 units would display.
@nuclearw and joemad, I find both your code examples really hard to read (Wallphone isn't as lazy as me), if you pop some <code></code> tags around your code snippets and select the "Html" comment formatter (radio button just above the "Add you comments" button) then it makes it a lot easier to read. Thanks :)