Quote:
Originally Posted by Okiewan
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;