Version: 1.00, by zajako
Developer Last Online: Aug 2013
Version: 2.3.x
Rating:
Released: 05-18-2003
Last Update: Never
Installs: 8
No support by the author.
The Post admin hack is for those who need money for bandwith, or those who just don't mind advertising thought their site.
This hack adds posts randomly after someone replys. The posts are shown to the usergroups that are enabled to view them, in the forums that are set to show them.
This hack uses a bit of the organization of the tom bot hack, cause that is what inspried this idea, however the bot was totaly removed, and was replaced with a random ad genertor. The postbit used also was changed to make it dispaly clearly as an add rather than a post, however you can clone the postbit template to make it match.
If you use this hack, please leave the gama banner in the rotation. Its not required to use this hack, id just appriciate it since i did not create this hack for my use, but solely for anyone who would want to.
Also id like to see this in use on some of your sites so i know how i can improve it as well as other people see examples so if you post a url to your board with it installed, ill put a link in the first post.
I am thinking about installing this (on vB2 installation).
Google ads in a post would require the post to support Javascript. It sounds like that should work since it shouldn't go through any filter which would deny a certain format like HTML code... Has anyone tried this?
Looking at the remaining reported bugs concering adding, editing and deleting ads, it looks like that can be avoided by just using phpMyAdmin to edit and delete specific ads rather than using the vB Admin CP.
It sure would be great if something like this could read all the text in the thread and choose a best-match (local) ad based on keywords to post content-specific ads like Google Adsense does.
I'm sure lots of people would pay for a feature like this - including me.
Problem now is that for those user groups that don't get the ads, there is still a blank post by "Ad Bot" . Any way around this? They have scroll past a blank post, seems it doesn't matter if there is an ad in it or not....
There is a bug in the added code to admin/functions.php which does not account for "ad" posts that are not supposed to be viewable by the usergroup. I am not familiar with this area of the code well enough to do it most efficiently but the following works.
First create a new template called "postbit_donotshow" which is empty (contains nothing!)
In admin/functions.php, replace:
Code:
// do posts from ignored users
$getperms=$DB_site->query_first("SELECT canviewads FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND user.userid='$bbuserinfo[userid]'");
if (($ignore[$post[userid]] and $post[userid] != 0)) {
eval("\$retval = \"".gettemplate("postbit_ignore")."\";");
} elseif($post[adid] && $getperms[canviewads]==1) {
$script=$DB_site->query_first("SELECT script FROM adholder WHERE id=$post[adid]");
$post[message]=stripslashes("$script[script]");
eval("\$retval = \"".gettemplate("postbit_advertisement")."\";");
}else{
eval("\$retval = \"".gettemplate("postbit")."\";");
}
return $retval;
with the following code:
Code:
// do posts from ignored users
$getperms=$DB_site->query_first("SELECT canviewads FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND user.userid='$bbuserinfo[userid]'");
if (($ignore[$post[userid]] and $post[userid] != 0)) {
eval("\$retval = \"".gettemplate("postbit_ignore")."\";");
} elseif($post[adid] && $getperms[canviewads]==1) {
$script=$DB_site->query_first("SELECT script FROM adholder WHERE id=$post[adid]");
$post[message]=stripslashes("$script[script]");
eval("\$retval = \"".gettemplate("postbit_advertisement")."\";");
} elseif($post[adid]) {
eval("\$retval = \"".gettemplate("postbit_donotshow")."\";");
}else{
eval("\$retval = \"".gettemplate("postbit")."\";");
}
return $retval;