PDA

View Full Version : PAH---Post Ad Hack


zajako
05-18-2003, 10:00 PM
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.

ScreenShot:
Post Screen (https://vborg.vbsupport.ru/attachment.php?s=&postid=396964)

File:
version 1.01 (https://vborg.vbsupport.ru/attachment.php?s=&postid=399258)

Updates:
From 1.0 to 1.01 (https://vborg.vbsupport.ru/showthread.php?postid=399256#post399256)

Sites Using it:
waiting for urls to be submitted

zajako
05-18-2003, 11:36 PM
Screen of a post

zajako
05-18-2003, 11:37 PM
version 1

Floris
05-18-2003, 11:48 PM
That is a very nice idea. I think there are a lot of forum sites out there that can actually use this. Good work :)

zajako
05-19-2003, 01:16 AM
yeah i have no use for this, its just i got the idea and i knew i should make it for others.

I personaly hate advertising banners.

?nima
05-19-2003, 03:44 AM
Good idea; however, I don't think I will be useing this :bandit:

insanctus
05-19-2003, 01:39 PM
Cool hack although I can not think of a use...But I will keep it in the maybe need folder :)

zajako
05-19-2003, 02:29 PM
I think the only applicable uses for this is, for unregistered users viewing the boards, or if you charge for membership, to allow registered users to view with banners, and those who payed view without banners.

partang2
05-21-2003, 09:04 AM
Did anyone install this one?

zajako
05-21-2003, 01:24 PM
i installed it on a testboard before posting, so it should work.

Dean C
05-21-2003, 03:25 PM
What an excellent idea :)!

- miSt

Okiewan
05-22-2003, 02:37 PM
Great idea... but a major issue!

New thread... fine.
First reply.... fine.
Second reply........ doesn't show up.

Thought the problem was in newreply.php, but even putting the unmodified version back in, still won't show second reply.

There is no error, acts normal when submitting the second reply, but when it returns to the thread, the second reply is not there?

Help? Please!

Okiewan
05-22-2003, 03:01 PM
This hack has some great potential!

Here is an error message that just showed-up:

Invalid SQL: SELECT script FROM adholder WHERE adid=1
mysql error: Unknown column 'adid' in 'where clause'

zajako
05-23-2003, 07:31 AM
mist: Thanks

about the errors:

gah, ill look into this

Okiewan
05-23-2003, 06:48 PM
Thanks ... great hack :)

zajako
05-24-2003, 08:24 AM
These directions are to update to PAH 1-01

open functions.php find

$script=$DB_site->query_first("SELECT script FROM adholder WHERE adid=$post[adid]");

Change to:

$script=$DB_site->query_first("SELECT script FROM adholder WHERE id=$post[adid]");

zajako
05-24-2003, 08:24 AM
version1-01

Okiewan
05-24-2003, 01:23 PM
That did it :) VERY cool, thanks for the support!

zajako
05-25-2003, 11:57 AM
not a problem, could you submit what url your using this on, so people can see it in action?

Okiewan
05-25-2003, 02:25 PM
Once I release it, sure will. 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....

Dribbles
05-26-2003, 02:43 AM
Nice hack ... does this rotate the ads in any way or are they the one set banner once the ad is posted? thnx

Dribbles
05-26-2003, 03:10 AM
oops, maybe I was vague ... I mean once a banner is posted, if someone presses refresh, will he always see the same banner or will it rotate per view?

PS - I added 3 banners to test out the rotation ... tried to delete them from the admin cp and it won't delete it. I see in the instructions it gives a way to delete all ads through phpmyadmin ... but I'd like to keep a couple of my current ones. Are there any easier ways to delete individual ads? Also, once an ad is deleted, will it still show up in the ads that are already posted? thnx

PPS - When I try to edit an ad:



Database error in vBulletin Control Panel 2.3.0:

Invalid SQL: UPDATE adholder SET name=Your Ad Here,script=<a href=\"http://www.yoursite.com\" target=\"_blank\"><img src=\"http://www.yoursite.net/images/ilads.gif\" border=0></a> WHERE id=2
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Ad Here,script=<a href=\"http://www.yoursite.com\" target=\"_bl

mysql error number: 1064

Date: Sunday 25th of May 2003 11:15:13 PM

zajako
05-27-2003, 01:46 AM
gah, ill look into that error dribbles

Also the adbot posts should not be showing, i will look into this when i get on my comp...

also dribbles when i fix these errors the posts will not change banners, it will be like a post with a banner in it with the special postbit.

Dribbles
05-27-2003, 07:25 AM
very nice .. thnx a million man.

David Bott
07-24-2003, 01:21 PM
Any word on this hack about the above issues? Thank you kindly, looks like something we just may use.

Mntsnow
07-24-2003, 05:40 PM
I too wouild be interested in this one

Zachery
07-25-2003, 09:23 AM
ill have zajako look into this when he gets back online

zajako
07-25-2003, 07:52 PM
sorry guys i have been really really busy working on some of my softwares when im online. I have a new full time job doing concrete and am gone most of my days so when i am home i gotta get stuff that helps pay the bills done first.

Hostc
07-27-2003, 10:01 PM
If this gets fixed it would be nice, hence my forum would be perfect for the use of this hack.

Okiewan
01-26-2004, 04:01 AM
PLEASE!!! PRETTY PLEASE!!!
Can you port this to RC3? Did I say Please?

ryancooper
05-16-2004, 07:41 PM
PLEASE!!! PRETTY PLEASE!!!
Can you port this to RC3? Did I say Please?
Any word on getting this for VB 3? I would love to put google ads up. . .

Tom1234
09-18-2004, 02:59 AM
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.

Tom1234
09-18-2004, 03:08 AM
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.

Tom1234
09-20-2004, 05:10 AM
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:


// 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:


// 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;

Justice
10-10-2004, 07:06 AM
is there something like this available for v3.0.3?

Silviu
06-23-2006, 04:39 PM
Anyone can make it work for 3.60 ? I would even pay for it.