PDA

View Full Version : Advert Management


Scott MacVicar
05-25-2002, 10:00 PM
This is a script to allow you to manage the adverts on your forums, you can have any sort of advert you can imagine there is no actual limit with this hack to what it can be, javascript, flash, image, text and images.

You add adverts to a category or a forum or the whole board. If the category has child forums they will inherit the adverts as well as their own adverts if they have any.
Adverts can have a set exposure such as 10,000 views and once it has reached that it will stop.

It fills a variable called $advert which you just place in any template, such as the header, you can also use variables and replacements within the adverts, such as $bbuserinfo[userid] for the persons userid in a link within an advert.

Updated June 9th at 19:44 GMT

Added date limits and options for unlimited exposures.
To upgrade from an older version, reapply code in global.php, upload ads.php and run this sql query to alter the ads table you made.

ALTER TABLE `ads` ADD `time` INT(10) DEFAULT '0' NOT NULL;

ALTER TABLE `ads` ADD `wholeforum` SMALLINT(1) DEFAULT '0' NOT NULL;
If you already run that query though are still experiencing problems with the time always being January 1st run

ALTER TABLE `ads` CHANGE `time` `time` INT(10) DEFAULT '0' NOT NULL

New features include showing the advert on the entire forum by using a radio button, some highlighting in the admin panel, italic name indicates the time period has ended and a bold name means the advert has met its quota for exposures.

You must chance RAND() to RAND(NOW()) if you have mysql 3.23.52 or above

Scott

Scott MacVicar
05-26-2002, 04:33 PM
And before someone asks for a screenshot.

Neopiper
05-26-2002, 05:08 PM
this is awesome :) what about exposure that have no limits?

RDX1
05-26-2002, 05:18 PM
oh god, he comes hack of the month ;)

Kumaro
05-26-2002, 05:31 PM
whats an advert? and then explain again what this does?

Scott MacVicar
05-26-2002, 05:35 PM
Em its an advert

http://www.dictionary.com/search?q=advertisement

snyx
05-26-2002, 06:33 PM
^^^ ROFL!
anyways... great man I was looking for this hack last night actually, I will post when I get her installed.

cheers PPN.
-myles

Parker Clack
05-26-2002, 06:34 PM
PPN:

Great hack. Have your figured out a way to make it count the number of times it has been clicked on like a link?

I added a maketableheader2 with a colspan of 4 in the adminfunctions.php file as the default is only a colspan of 2.

Parker

Scott MacVicar
05-26-2002, 06:45 PM
Oh the maketable problem hold on you don't need another function you just need to adjust the variables passed into the function.

Adjusting ads.php just now.

Scott MacVicar
05-26-2002, 06:48 PM
If you wanted it to count the number times a link had been clicked on you have to start creating a file in which to hold the link information and that means you have to start doing more work and you wouldn't really be able to use the adverts for other media like javascript.

Ill have a think about it though.

Parker Clack
05-26-2002, 07:37 PM
PPN:

Ok, I will see what you do. Thanks.

I added another row so that the actual banner would show up too.

Below the last </tr> I added

echo "<tr>";
echo "<td colspan='4' align='center'>$ads[advert]</td>";
echo "</tr>";

and I added the ability to reset the count on the advert to zero if you wanted by adding

// ###################### Start Reset #######################
if ($action=="reset") {

doformheader("ads","zero");
makehiddencode("adid",$adid);
maketableheader("Confirm reset");
makedescription("Are you sure you want to reset this advert");
doformfooter("Yes","",2,"No");

}

// ###################### Start Kill #######################
if ($HTTP_POST_VARS['action']=="zero") {

$ad = $DB_site->query("SELECT name FROM ads WHERE adid='$adid'");
$DB_site->query("UPDATE ads SET exposed=0 WHERE adid='$adid'");
echo "<p>Advert $ad[name] has been reset</p>";
$action="list";

}

and just link to reset.

Thanks again for a great hack. This is something that I thought should have been included with vBulletin from the start.

Parker

scsa20
05-26-2002, 08:18 PM
Originally posted by PPN
Em its an advert

http://www.dictionary.com/search?q=advertisement

lol, dictionary.com, the only place where I go to for defantions :D

Scott MacVicar
05-26-2002, 08:51 PM
Yep but that can cause problems showing the ad if it has alot of ads or if its javascript with \ in it as it would be stripped and could cause problems.
The reset thing i'll add to the release then.

Scott MacVicar
05-26-2002, 09:08 PM
Uploads ads.php from the zip again to get the reset feature working on your board, you can use this to reset your ad hits to start exposures at 0 again.

Velocd
05-26-2002, 09:57 PM
advert eh? you're the first person I have met abbreviate advertisements into advert, instead of plainly referring to it as an ad.

nonetheless, excellent hack :D

Sparkz
05-27-2002, 12:33 AM
If that is the case, you need to get out more, Velocd :P

I think advert occurs pretty commonly...

duke
05-27-2002, 02:57 AM
This is a great

sugestion
1. what if you want to have two different rotatons one at top and obe at bottom you would need to variable's is that a posability to add.

2. there should be a way to set the banner to unlimited exposers

3. rotate the ad in all or one forum to beable to choose two or three forums right now it is a little limited to all of one catagory or one forum

Neo
05-27-2002, 05:45 AM
Would you post a pic of what it looks like from the users end?

Parker Clack
05-27-2002, 10:43 AM
neo:

The upper right hand banner is what the enduser will see.

Floris
05-27-2002, 11:36 AM
It works very nice :) I expected to find instructions for many files, but this was very quick and easy. Great hack!

One little tweak me and my users want, is to exclude the showthread and postreply pages. Or at least an option for the admin to also show on those pages, or not.

Another little tweak is the option to show certain banners for unlimited time.

Jeremy W.
05-27-2002, 11:58 AM
So, does this do rotations if there are more then one ad for a certain forum?

Parker Clack
05-27-2002, 12:19 PM
Jeremy:

Yes as long as you have them in the same forum they will show up together. You chose the forum(s) that you want the banner(s) to show up in. So you can have multiple banners for a single forum.

PPN:

I did notice though if you have more than one banner for a forum though it will create multiple of the banners. Say I put in banner1 and banner2 to show up in forum1. When I go back to the admin for the banners I will see three banner1s show up and 1 banner2. Now if I go back and delete the extra banner1s they will not show up again but when you first add them they are often times multiples.

Parker

Scott MacVicar
05-27-2002, 12:28 PM
Will test it now, this shouldn't really happen as there is only one query. Does it appear 3 times when you add banner1 or does it only appear 3 times when you after you add banner2?

xiphoid: to exclude pages you have to start doing more checking, what files are you wanting to exclude? Tell me and i'll try and get the code done to do it.

Floris
05-27-2002, 12:51 PM
showthread.php (maybe) We are still discussing this

but at least:
newthread.php
newreply.php
editpost.php
report.php
postings.php

Scott MacVicar
05-27-2002, 01:19 PM
Not many files then ;)

You'll need to add this code below

eval("\$advert = trim(\"".str_replace("\'", "'", addslashes($advert['advert']))."\");");

if (substr($PHP_SELF,-strlen('newthread.php'))=='newthread.php' or substr($PHP_SELF,-strlen('newreply.php'))=='newreply.php' or substr($PHP_SELF,-strlen('editpost.php'))=='editpost.php' or substr($PHP_SELF,-strlen('report.php'))=='report.php' or substr($PHP_SELF,-strlen('postings.php'))=='postings.php') {
$advert='';
}

Floris
05-27-2002, 01:46 PM
You the man :)
(and firefly ofcourse)

I will tweak it now :) (global.php I assume)

[update]
Yep, global.php and it works perfectly !!

Sparkz
05-27-2002, 02:43 PM
I am pretty sure I am a man too.
/me checks between his legs...

Yup, definitely a man...

Parker Clack
05-27-2002, 04:53 PM
PPN:

It happens after I add the second banner. The first one will get tripled.

I also noticed that the move function doesn't work with having the $advert array in global.php. Somehow it messes with postings.php and the move function thinks that you are trying to move it back to the same forumid. If I put the code in forumdisplay.php and showthread.php it works as I want it.

Would putting the check that you have written above resolve the issue with postings.php?

Thanks,
Parker

Henry-RS
05-27-2002, 06:19 PM
Ok, I installed this without a problem, but there doesn't seem to be a feature that rotates the banners if you add two different ones to one specific forum, using the one "$advert" variable.

How can I make them rotate, by picking random banners that were assigned to that area?

Parker Clack
05-27-2002, 06:31 PM
Henry:

If you put more than one banner for a forum the script will randomly pick the banner to display out of the ones that you have assigned to that forum area. From what I have experienced they are about one a one to one footing. Your mileage may vary.

Parker

inetd
05-27-2002, 07:51 PM
Originally posted by duke
This is a great

sugestion
1. what if you want to have two different rotatons one at top and obe at bottom you would need to variable's is that a posability to add.

2. there should be a way to set the banner to unlimited exposers

3. rotate the ad in all or one forum to beable to choose two or three forums right now it is a little limited to all of one catagory or one forum Good suggestion!
And one od the best hack of course :) :) :D
PPN, please realize this suggestion. I need this too . ;)

inetd
05-27-2002, 08:53 PM
Please add shows ad by time.
Example: 2 days
After 2 days ad not show.

Thanks for this!

Kumaro
05-28-2002, 12:16 AM
oh, okay...great. looks like an excellent hack.

Scott MacVicar
05-28-2002, 10:27 AM
Bah thats my bad, i set $forumid in the global code, i'll change that until then em thats broken :D

WIll update it in a bit.

Will do some of the suggestions, To pick multiple forums might cause a problem cause the query will be more complicated but i should be able to find something.

Floris
05-28-2002, 05:36 PM
WIll update it in a bit.

It has been a bit,
and I just upgraded to 2.2.6 RC,
and re-installed your hack -redownloaded it too-

Works like I want to.

Scott MacVicar
05-28-2002, 10:53 PM
Ive updated it now, sorted the forumid problem. Added unlimited exposures and the time limit.

The next problem is multiple banners and I've decided that allowing it for multiple forums would prove too dificult after some testing was done but I'll consult some people just to be sure.

inetd
05-29-2002, 02:45 AM
I very waiting new version :)
PPN, good work :)
I will install new version after release :)

Parker Clack
05-29-2002, 03:07 AM
PPN:

Looking good. I have it installed and is working just fine on my board. Your new coding resolved the issue with the move/copy/move thread with redirect issue I was having.

Thanks again,

Parker

Parker Clack
05-29-2002, 04:55 AM
PPN:

I am not sure if this is a bug or not or just something not working right on my board but when I installed it before midnight the time limit function correctly identified the server date and worked great. Then I noticed that the banners stopped showing up after midnight and when I went to edit the file the stop date was listed as January 1 2001. If I reset this to today's date it would revert back to the January 1 2001.

Parker

Scott MacVicar
05-29-2002, 08:19 AM
Getting it to 2001 is a good trick since there isn't any in the code ;)

You'll need to update all old ads with a time period, setting it today wont work as its based on 12am that day, so by the time you add it, its already happened.

Stealthy
05-29-2002, 12:30 PM
PPN, excuse my naivety but this is the first time for me doing banners.

Question: When filling in the section 'Code to be shown as advert', what exactly does this mean? Could you show an example of one please?

Also, do I have to have the banners on my server? I would like to link the banners to the advertisers' servers. How can this be accomplished?

Thanks for your help and great hack!

active
05-29-2002, 06:54 PM
help need please this is just the hack i need to can not seem to install it any one help me out please

Scott MacVicar
05-29-2002, 07:31 PM
Stealthy, for the Code to be shown you can put in whatever you like and it will replace $advert in any of your code, it can be images, text or javascript. Its up to you it doesn't matter what you have.

I have
<a href="http://www.site.com"><img src="http://www.site.com/banners.gif" alt="Website" /></a>


active, do what the instructions say in the text file within the zip. Make the code changes and then upload ads.php then run the sql query at the top to create the table.

Parker Clack
05-29-2002, 08:24 PM
PPN:

Sorry. I meant January 1, 2002. If I delete the ad and reenter it at say 2200 then at 0001 it gets reset back to January 1, 2002.

Sorry if I wasn't clear before.

Parker

active
05-29-2002, 09:06 PM
sorry to be a pain but were do i run the sql?

Stealthy
05-29-2002, 10:50 PM
Thanks PPN, I will give it a try.

Also, I am getting the same problem as Parker. When I save the advert, I save it as 30 June 2002 but when I go back in to modify, it is set to 1 January 2002. Maybe this is why I cannot get the banner to show up as it is expired??

Scott MacVicar
05-29-2002, 11:24 PM
What version of php are you running Parker? Its now 01:21 and its running fine on my local board which is php 4.2.1. Also what mysql version are you running?

Floris
05-30-2002, 01:00 PM
I had a problem, you meantioned to upgrade, I did, and problem disappeared, I could move threads again. But now I can't use this hack. The adverts won't show up.

Floris
05-30-2002, 01:03 PM
Ah, I see now.
It does say 2002 in my hear, but resets the dates to jan 1st, 2002. If i change them, then goto 'edit' it still says '1 jan 2002'. So that is why they wont' show up.

Scott MacVicar
05-30-2002, 02:24 PM
Ok i obviously have a date problem I cant find on linux i'll play with it tonight after work.

Floris
05-30-2002, 02:34 PM
Take your time, it is really appriciated. I wish I was as smart as you guys, and do it myself :) I already looked. But ofcourse..

Neopiper
05-30-2002, 04:55 PM
heheh for some reason i cant get the ads to view after upgrade, i reinstall the hack becoz of the problem moving thread , now move thread works but the banner didnt show at all

Scott MacVicar
05-30-2002, 07:47 PM
change this wee bit in global.php

if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',-1,')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}

to

if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',-1,')>0 AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}

This will disable the time length function until i get it sorted.

Neopiper
05-30-2002, 08:38 PM
thanks PPN :)

Stealthy
06-01-2002, 12:08 AM
PPN, I did the edit and it still resets to 1 January 2002. I still cannot see the banners. Have you figured out what the problem could be?

inetd
06-01-2002, 05:47 AM
PPN, when you release new version? :)

Scott MacVicar
06-01-2002, 09:48 AM
Im having major problems working out what it is, its actually quite puzzling.

Stealthy if you update the code in global.php then time isn't taken into account. Have you set correct zones in the admin panel and the banner isn't all exposed. It can be 0 or a value.

Stealthy
06-01-2002, 02:12 PM
PPN, I have tried "0", left it blank, and I have tried other values and still the same thing.

Does it matter where you place the $advert value? I have tried various places within my "header" template and it will not show up anywhere.

dxb
06-01-2002, 06:17 PM
thanks alot for this hack PPN and I have one Q .... will this work with vb224 or I have to upgrade to 226 to get it running :)

Parker Clack
06-01-2002, 10:33 PM
PPN:

Sorry. I've been working the "day" job. I am running PHP Version v4.1.2 and MySQL Version v3.23.43 on a Linux box.

What is really weird about all of this is that the date showed up correctly when I first created the banner. So it would have in the date line today's date and all would be fine. Then after 0001 came around on the next day the date would get reset to January 1st, 2002. If I deleted the banner and reinstalled it the date would still default to the January 1st, 2002 date. Now if I got out of the admin panel completely then reinstalled the banner the date would be fine until the next date came up and again the $advert would be wrong and the banners don't get displayed.

I know you are working on this and I see no reason why it isn't working either and getting reset instead of staying. I just commented out those lines of code referring to the date and all works as it should.

I am glad to see that others are having issues with this too instead of it being just me screwing something up again. :)

Parker

GeorgeofCS
06-02-2002, 04:29 PM
great hack :) One question though is there a way to get it so that ads that are selected as any forum will run on pages like forum home, etc? It only appears to run on my site in the forums themselves and I'd like to make it so it would run pretty much throughout the site. :classic:

active
06-03-2002, 08:38 PM
please help this looks like just the hack i need for my site but i can not get it to work im new to vbullititon any help would be very gratefull

Tech_Koss
06-05-2002, 03:28 AM
Originally posted by active
sorry to be a pain but were do i run the sql?
run that in your "phpmyadmin"

if you dont know what the link is ask your host

Scott MacVicar
06-05-2002, 08:30 AM
OK i cant get the time thing to work, time to pester chen and see if he can find a solution to why it is not updating.
I presume Parker that you dropped the ads table and re created it or altered the table to add the time column.

Parker Clack
06-06-2002, 12:07 AM
PPN:

I just took out the time check and that column from the ads table.
Works just fine that way.

Parker

Slynderdale
06-07-2002, 01:06 AM
i get a parse error with the ads.php and when i add the code to global.php

Parse error: parse error in /home/public_html/forum/admin/ads.php on line 246

Scott MacVicar
06-07-2002, 06:24 AM
Upload the file in ASCII

Slynderdale
06-07-2002, 06:49 AM
i did, they still didnt work :(

Slynderdale
06-07-2002, 08:32 AM
works now, got my self a new ftp client

Slynderdale
06-07-2002, 11:40 AM
hmm, i found a bug, i set the advert to show for one year but it doesnt show

Scott MacVicar
06-09-2002, 05:48 PM
Sorted the problem, the best idea is to download the hack again, drop the ads table and then re-upload the ads.php file to admin, reapply code in global.php and recreate table. There has been many changes recently to all code concerned with this hack.

Floris
06-09-2002, 05:58 PM
Wow, you solved it! Great, I will try to re-apply the hack again soon!! w000 h00000

Scott MacVicar
06-09-2002, 06:04 PM
If you need to know it was something real real real real simple, wasnt even any php coding.

I had made the time column a small integer which isn't enough to accomodate a timestamp as its 10 characters long. But i added some more features any way.

Floris
06-09-2002, 06:58 PM
Uninstalled the hack, then installed the latest .zip from the first post, and it seems to work just fine!


Oh,
what if I now want to exclude files? can I still apply that little code you provided or will that not work properly with this new version?

https://vborg.vbsupport.ru/showthread.php?postid=254950#post254950

Scott MacVicar
06-09-2002, 07:24 PM
Yeah it'll still work, Im going to look into a way of adding an advert to seperate forums.

Floris
06-09-2002, 07:32 PM
A nice challange maybe (or maybe I am trying to hard)

Showing banners on announcement pages. (or at least on all of them)

Scott MacVicar
06-09-2002, 07:53 PM
Banners should be shown on announcement pages as they have a $forumid specified and this should invoke the code which loads banner code.

Presuming you have a banner set for the forum that your viewing the announcements for.

Floris
06-09-2002, 08:04 PM
Ah great :)

Just added a few banners from MadOnion to my site and they look great in the footer :) Works perfectly, especially that little code to exclude some pages.

No, let's see how rich I will become !

Stealthy
06-10-2002, 12:15 AM
Thanks PPN! Works great!

*installed*

merit5
06-10-2002, 03:58 AM
Has there been a way figured out to have for instance.. 2 calls of the $advert tag and have it as two different banners or will it always call the same banner when calling multiple banners on the same page?

thanks for the update.. this hack is great..

Scott MacVicar
06-10-2002, 07:10 AM
Will be looking into this as soon as I get back from vacation.

My rough idea is add a variable in the vBulletin options asking how many banners to load. $advert_1 and $advert_2 etc

Slynderdale
06-11-2002, 11:48 PM
works great now, i made a couple changes though, greak hack

Slynderdale
06-18-2002, 06:40 PM
made more changes :)

Slynderdale
06-18-2002, 06:40 PM
heres the modify list screenshot

X-Fan
06-19-2002, 10:43 AM
Is there any way to adapt this hack for button ads and icon ads?

Andy R
06-21-2002, 08:19 PM
OK, I have run the MySQL command via PHPMyAdmin. In order to run the comman, I had to remove the apostrophy marks (').

Here is the result I got:Your SQL-query has been executed successfully

SQL-query :
CREATE TABLE ads (
adid smallint(5) NOT NULL auto_increment,
name varchar(25) NOT NULL default '',
forumid smallint(5) NOT NULL default 0,
wholeforum smallint(1) NOT NULL default 0,
exposed smallint(10) NOT NULL default 0,
exposures smallint(10) NOT NULL default 0,
time int(10) NOT NULL default 0,
advert text NOT NULL,
KEY adid (adid)
)


I have edited the /forums/admin/index.php file and all the admin features seem to be working. I can create ads and modify them.

When I ad the code to global.php and upload the modified file, I get a MySQL error:Database error in vBulletin 2.2.6:

Invalid SQL: SELECT * FROM ads WHERE wholeforum='1' AND time>=1024693619 AND (exposed<=exposures OR exposures=0) ORDER BY RAND()
mysql error: You have an error in your SQL syntax near 'RAND()' at line 1

mysql error number: 1064

Date: Friday 21st of June 2002 03:06:59 PM
Script: http://www.airstreamforums.com/forums/forums/index.php?s=
Referer: http://www.airstreamforums.com/forums/online.php?s=


I have reverted back to the original gloabl.php for now.

Any clues on what I might be doing wrong?

Thanks,

Andy

inetd
06-28-2002, 09:08 AM
PPN, when you release new version? :)

Scott MacVicar
06-28-2002, 09:39 AM
organic-hosting what version of MySQL are you running?

inted i had to modify the forums.php and set in there how many times to invoke the banner code.

Slynderdale Ive stolen your who it should be shown to idea and Ive got the code written for that.

ladyfyre
06-28-2002, 06:29 PM
Hey PPN, just wanted to let you know, i found a bug.

i have mine set to unlimited exposures...but the exposure count for all adverts only went to 32767 for Houston, Austin, and Dallas, and will not go any higher....so the counter has a bug somewhere....

Scott MacVicar
06-28-2002, 07:56 PM
Its not a bug its the limit of mysql smallint.
Ill icq you the fix.

ladyfyre
06-29-2002, 12:15 AM
ok....cool

inetd
06-30-2002, 01:29 PM
PPN, sorry. I'm inEtd, but not intEd :)
And i don't understand you :(

Jeremy W.
07-03-2002, 01:17 AM
I'll be installing this hack later on this week, letcha know how it goes :)

inetd
07-13-2002, 03:53 PM
PPN, when you released new version? :)

X-Fan
07-17-2002, 05:15 AM
The coolest thing would be to combine this with vbPortal's banner admin system and KarateKid's recent vB Banner Control hack to make for an absolute banner management system for vB!

Is that at all possible?!

X-Fan
07-18-2002, 04:49 PM
PPN, would it be possible to include tracking of click-thrus and the click-thru percentage for each banner, please?

WoodiE
07-19-2002, 01:32 AM
Right now I have my buttons and main logo centered. How do I make it so my main logo is aligned to the left and a banner aligned to the right with the buttons centered if possible?

I have included my header. Any help would be great!!!

Thanks

WoodiE

EchoHype.com
07-21-2002, 11:02 PM
Sweet hack man!

veedee
07-22-2002, 09:32 AM
I've just installed adcycle. This hack is great but AdCycle is better :)

WoodiE
07-23-2002, 11:52 AM
whats better about it? I think Advert Management is great.

Do you have a link for AdCycle?

-WoodiE

EchoHype.com
08-03-2002, 08:35 AM
Hey woodie

try

www.adcycle.com


hehe

ochw
08-07-2002, 06:41 PM
is there any way of have the banners change from one to another/

Night Owl
08-12-2002, 02:59 AM
Originally posted by ladyfyre
Hey PPN, just wanted to let you know, i found a bug.

i have mine set to unlimited exposures...but the exposure count for all adverts only went to 32767 for Houston, Austin, and Dallas, and will not go any higher....so the counter has a bug somewhere....

I am having this problem too. Can you send me the fix? Just PM me to let me know how you would like to send the info, if you don't mind.

Thanks!

SpeedStreet
09-10-2002, 02:19 PM
Anyone who uses phpadsnew....This hack works great out of the box, provided you use the header.

Awesome hack! Saved the day!

Kevin104
09-14-2002, 02:51 PM
Hey PPN,

I love this hack, it works great.

I only have one question though. I want to use this to put banner ads on my non-vB pages. How would I be able to do that?

Thanks for the great hack!

DannyITR
09-17-2002, 05:53 AM
Woks great !

I would also like ot know if it's possible to ad the banner to the threads in that particular forum as well. What do you guys think?

Buddha
09-19-2002, 12:28 AM
Originally posted by Slynderdale
works great now, i made a couple changes though, greak hack

i like these additions (all of the ones you've listed in the three replies).
any way you can post the addons so that we can apply them as well.
thanks.

WoodiE
09-27-2002, 05:00 AM
Is there anyway to make the banner open a new window after its been clicked on?

-WoodiE

bouncer18
10-15-2002, 03:20 AM
in the a href url

add a

target="blank"

Rand M
10-19-2002, 05:33 PM
Installed on v2.2.8, very smooth.....
Thank you.

alkatraz
10-23-2002, 01:45 PM
Great hack! But I'll wait for a clickthrough tracking system to be added =)

Tigga
10-26-2002, 07:44 PM
I seem to be having some of the same problems as other people. If I add more than one ad, it will only display the newest one I added. I also noticed the problem with ads being created multiple times. It seemed to only do this whenever I refreshed the page right after adding one though. I'm sure I have the new version because I had never downloaded it before and it has the option to set a date for the ad to expire. Any idea's on what I did wrong?

Thanks,
Brian

DannyITR
11-06-2002, 08:08 PM
Same problem here. It was working fine alternating between banners and all of a sudden it only displays the newest one. I've even re-installed the hack. Help!

Okiewan
11-07-2002, 01:53 AM
Originally posted by DannyITR
Same problem here. It was working fine alternating between banners and all of a sudden it only displays the newest one. I've even re-installed the hack. Help!

Ditto :(

DannyITR
11-07-2002, 02:11 PM
Guys, you must help us lost souls.

Julio
11-08-2002, 01:05 AM
I installed and ran the queries.... worked OK, but whenever I set an ad and try to view it in the board I get the following error:

Parse error: parse error, unexpected T_STRING in c:\MYPATH\global.php on line 237

Fatal error: Call to undefined function: getpermissions() in c:\MYPATH\index.php on line 10

Any help?

DannyITR
11-08-2002, 08:19 PM
help!

Julio
11-08-2002, 11:13 PM
Nevermind... fixed it.

1) Anyone knows the code I should use to have some flash, or videos show up?

2) Why when I add an ad, it doesn't show start date? It only shows end date. How can I do that?

Okiewan
11-09-2002, 12:35 PM
Same problem here. It was working fine alternating between banners and all of a sudden it only displays the newest one. I've even re-installed the hack. Help!

Pretty Please?

DrkFusion
11-09-2002, 01:05 PM
At last, I have found the best use for this.

Thanks PPN!
-Arunan

grahamvonbaron
11-11-2002, 09:00 PM
I have the 2.2.8 version and I have been able to install some hacks myself, however I could use some help with this Adv manager hack.

Actually, I am open for somebody to be my go to guy for overseaing maintenance/upgrades and new hacks, I will pay a nominal fee or trade for your services. thanks,

graham@rcnow.com

SpeedStreet
11-15-2002, 05:50 AM
Like everyone else, I am seeing an issue after a certain time of running this hack. However, I have uncovered something that I find VERY strange...

The only advertisement that loads on my page now is the most current one in the database...when I go into PHPmyAdmin, all the rows EXCEPT the most recent one return ok values. The most recent ID, when I try to browse its data, returns zero values and appears as if I was making a query versus a view.

Does ANYBODY know what could be causing this issue? How can we fix this? This is a great hack, and I hate to see it go by the wayside just cuz of a simple error....

Julio
11-15-2002, 11:22 AM
Yes. I would even pay to get this hack working! :tired:

SpeedStreet
11-15-2002, 02:01 PM
I just posted a general distress call, hoping other PHP gurus would come in here and help this hack out.

This is one of the best hacks period...to see it languish like this is sad :(

Okiewan
11-15-2002, 02:50 PM
Pretty wild it's just getting dropped like this. Dissapointing.

Scott MacVicar
11-16-2002, 05:18 PM
Most of my hacks have been re-written for vB3 and I have other things to do. Though I will definately try and debug this hack on a fresh install tonight.

/me adds this to his todo list.

Okiewan
11-16-2002, 07:14 PM
Great! Thank you.

Scott MacVicar
11-16-2002, 09:52 PM
ok i can't figure out why ORDER BY RAND() refuses to be working, its actually quite wierd and it appears to be the source of the problem.

SpeedStreet
11-16-2002, 10:51 PM
PPN,

Thank you for picking this back up!!! We will all wait patiently for you to fix it :)

If you need a tester, I am here for you!

Julio
11-17-2002, 12:10 AM
PPN: Same here as for test site. In fact I wrote that I would be willing to pay to fix this hack, since my board most probably be sponsored and I definately NEED to use this hack.

You have no idea how reconfortable is to know most of your hacks are being coded for VB3. This greatly increases the chances for me to update sooner, but it will pass a while until I do some tests, etc before upgrading. It needs to be seamless.

As always... keep the good work.

SpeedStreet
11-18-2002, 03:53 PM
PPN,

I tried adding a limit, just HOPING that would work, and that still didn't seem to fix the problem.

i.e.
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND() LIMIT 50");

I'm still thinking that the issue lies within the info of the table. My last entry is always garbled only in that table, no others...

SpeedStreet
11-22-2002, 12:44 PM
Any luck?

waherne
11-29-2002, 05:29 PM
PPN,

I was reviewing this thread and also the code for the hack.

I'm not a programmer but would this be a solution?!!!!

I think that the problem relates to the mysql query and the 'order by rand()' instruction.

Would this solution work?

1. Query the database but exclude the order by rand() referred to above.
2. Count the no of rows in the query result/array. Result ='x'.
3. Use a php function to pick a random value 'y' between 0 and x-1.
4. Select row 'y' from the query result/array and use this to display the advert.

What do you think?

Or is there anyone else out there that has the coding skill to implement and test this?

This is a great hack and only needs the last push to make it a super one!

Keep up the good work.

Willie

SpeedStreet
11-29-2002, 08:10 PM
If someone can write it, I will test it :)

SpeedStreet
12-04-2002, 01:46 AM
Right about now is when I start crying....Did PPN wander off again? ;)

Visionray
12-04-2002, 03:22 AM
good thing I read the last few pages of this thread and realized this hack isn't working. Maybe the first post should be updated with that info so people don't go instalilng it to only find out it doesn't work.

SpeedStreet
12-06-2002, 05:43 PM
I tried ORDER BY RAND(GETDATE())

That crapped out my system.

Then, I tried
RAND(datepart(ss,getdate())
Still nothing.

How about if generate a random number using PHP, convert it to an integer value (probably by
multiplying by 100 and lopping off the decimals) and use that as the
seed?

I don't know how to do this, but I clearly remember there being something on these forums about a vbrand() function.

thakikka
12-14-2002, 05:14 PM
Hello,

nice hack! Sorry for my bad english, but I will try to explain the problem that occurs on my board..

I put the variable into the header template and it works on all pages, but if i go directly to a post, e.g. http://forum.ksgemeinde.de/showthread.php?postid=170230#post170230 the banner is not shown?

But if you go to the same thread directly, e.g. http://forum.ksgemeinde.de/showthread.php?threadid=19771 the banner is shown.

Do I have to insert anything anywhere to get it work in the header even if you directly go to the last post?

Thanks in advance,
thakikka

quickstang22
12-19-2002, 05:34 AM
I'm posting another cry for the hack to be fixed. I really need a reliable ad system going. So far this one rocks but I need it to rotate banners.

Scott MacVicar
12-19-2002, 06:37 AM
I'm going to have a go of re-writing this hack, maybe before christmas. Life is just a bit hectic at the moment.

The problem with this hack is basically the sql query that fetches the adverts, it doesn't seem to randomise it.

SpeedStreet
12-19-2002, 12:34 PM
Would any of my proposed fixes work for this, PPN?

waherne
12-19-2002, 04:04 PM
PPN,

I modified your hack and have now got it to randomise the adverts successfully. As I said before, I am not a programmer, so my code is probably inefficient in performing the task - when I post the code here, you and others can hopefully assist in that respect.

The only thing with my modification is that I have disabled the 'show on whole board' functionality. Basically, I didn't need it for my purpose.

I'm at work now and don't have access to my laptop. I will post my code to this thread over the next few days.

Once again, thanks for the hack.

Willie

thakikka
12-20-2002, 09:34 PM
I guess I found the error I reported some posts before (banners not shown on directly linked posts).

If the script finds something like "&threadid=19938" then the banner gets displayed.

But if you directly link to a post, it contains "?postid=172199" and the banner does not get displayed.

Can someone fix this so banners get displayed on every page?

Thanks in advance,
Sebastian

thewolf
12-22-2002, 08:22 AM
Hi PPN,

any news on the new version of this hack?

Also, will it work with the latest stable version of Vbulletin (2.2.9)?

Keep up the good work!

Thanks,
Marco.

waherne
12-22-2002, 09:30 AM
Further to my post above, here are the changes I made to PPN's hack to make it randomise. As I said, let us all work together to make my code more efficient.

Willie

////////////////////START//////////////////////////
In global.php, FIND:

if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND

time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE wholeforum='1' AND time>=".time()." AND (exposed<=exposures OR

exposures=0) ORDER BY RAND()");
}

AND REPLACE IT WITH:

$DB_site;

$sql="SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()";

$advert1 = mysql_query($sql);
$advert2 = mysql_query($sql);

$adcounter=0;
while($countrow = mysql_fetch_row($advert1))
{
$adcounter++;
}
$act1=rand(0,$adcounter-1);
$adcounter3=0;
while($countrow3 = mysql_fetch_row($advert2))
{
if($adcounter3==$act1)
{
$DB_site->query("UPDATE ads SET exposed=exposed+1 WHERE adid='$countrow3[0]'");
eval("\$advert = trim(\"".str_replace("\'", "'", addslashes($countrow3[7]))."\");");
}
$adcounter3++;
}

///////////////END///////////////////

I just noticed that there is another block of code that should also be included in the Find It and Replace above, essentially it's the code immediately following that set out above and beginning with $DB_site->query("UPDATE ads SET exposed - one query only.

SpeedStreet
12-22-2002, 05:39 PM
Now, let me understand you correctly. This code works, but it eliminates the "Show on all forums" functionality?

waherne
12-22-2002, 07:59 PM
Correct.

Adverts on child forums will be pooled together with adverts on their parent forums (and their parents...) as before. One advert will then be picked from the pool. Therefore, insertion of an advert at the ultimate parent level could be one way of displaying it on the entire forum.

Test my code and see if it suits your needs.

Willie

quickstang22
12-31-2002, 01:08 AM
Willie

I tried your fix but lost all my ads. Not one is showing up. I made sure they were not selected for show all fourms. Just had them in child forums

Matt

themonarch
01-05-2003, 12:56 AM
Originally posted by Visionray
good thing I read the last few pages of this thread and realized this hack isn't working. Maybe the first post should be updated with that info so people don't go instalilng it to only find out it doesn't work.

mmm, good point VisionRay. I installed this hack and then when it didn't work, I came back in here to read the whole thread and found out it's not working right yet.

ChurchMedia
01-05-2003, 06:33 AM
When I run this query:

CREATE TABLE `ads` (
`adid` smallint(5) NOT NULL auto_increment,
`name` varchar(25) NOT NULL default '',
`forumid` smallint(5) NOT NULL default '0',
`wholeforum` smallint(1) NOT NULL default '0',
`exposed` smallint(10) NOT NULL default '0',
`exposures` smallint(10) NOT NULL default '0',
`time` int(10) NOT NULL default '0',
`advert` text NOT NULL,
KEY `adid` (`adid`)
);

I get this error:

MySQL said:

You have an error in your SQL syntax near '\'\',
`forumid` smallint(5) NOT NULL default \'0\',
`wholeforum` smallint(' at line 3

Any ideas?

SpeedStreet
01-05-2003, 02:46 PM
Where's PPN?

That code did not work for me waherne...

SpeedStreet
01-13-2003, 12:12 PM
well then...

Scott MacVicar
01-23-2003, 10:28 AM
change

RAND() in global.php to RAND(NOW())

I just found out that the format had changed on newer versions of MySQL.

SpeedStreet
01-23-2003, 01:34 PM
PPN,

While this may help the problem, I am still only getting one banner ad to pull out of three records consistently:


Banner 1 [edit] [reset] [remove] 0 0 Leaders Forum No
Banner 2 [edit] [reset] [remove] 48 0 All forums Yes
Banner 3 [edit] [reset] [remove] 0 0 Leaders Forum No


I did change both RAND() arguements to RAND(NOW()). There must be something else amiss. Also, I have tried switching it so that only one banner appears in the All Forums and the other appear in a subforum, but the All Forum one still overrides the other two, if you understand what I am saying.

Let me know if I can help in any way!


SYSTEM INFO
Operating System Linux
Apache Version 1.3.27 (Unix)
Perl Version 5.006001
PHP Version 4.2.3
Mysql Version 3.23.54

waherne
01-23-2003, 04:34 PM
I have just installed VB 2.29 and this hack with the amendments I suggested earlier. The ads rotated correctly as I expected.

Willie

SpeedStreet
01-23-2003, 06:42 PM
hrmm....I wonder why I am having problems then...

Merjawy
02-06-2003, 01:11 PM
better late than never

I haven't a clue what ver. my php/sql but who cares? the hack works for me .. I don't have any ads but I can put different announcement or special greetings in different forums.. INSTALL

thnx

Brain Crusher
02-09-2003, 10:46 PM
i want a hack plugin for this should like

only ads for guests :)

or only ads in a special category

Doc203
02-25-2003, 04:17 AM
Works great for me also, and I changed Global.php, but it still doesn't appear to be random. Any ideas?

DannyITR
02-26-2003, 02:28 PM
change

RAND() in global.php to RAND(NOW())


I'm confused now. Is the hack fixed? Is that all it was? What about the fix proposed by waherne? PPN can you update us?

DannyITR
02-26-2003, 03:14 PM
I changed it but it still only displays the most recent ad. I have 2.26 but I'll upgrade to 2.30 and see what happens.

DannyITR
02-26-2003, 04:45 PM
Nope, doesn't rotate the banners.

Help!

DannyITR
02-26-2003, 04:56 PM
I just did the modification suggested by waherne and I lost all my ads.

Waherne, the last part is not clear. Can you edit the origional post and inlcude whatever code needs to be replace with the first batch. Mabye that is the problem although I'm sure I did it right.

We still don't have a hack that can randomly rotate banners in the same forum.

Help!

DannyITR
03-02-2003, 04:06 PM
help

SpeedStreet
03-02-2003, 04:26 PM
Try PMming PPN....he seems to answer those.

DannyITR
03-11-2003, 01:44 PM
no reply to my PM yet

DannyITR
03-12-2003, 11:53 PM
help

GoTTi
03-13-2003, 08:00 AM
yup, im having same problem where it doesnt rotate the banners.

I did the RAND(NOW()) thing, still nothing.

SpeedStreet
03-13-2003, 12:52 PM
Hrmm, this really sucks :(

DannyITR
03-16-2003, 12:40 AM
PPN?

DannyITR
03-16-2003, 05:06 PM
up

DannyITR
03-21-2003, 01:54 AM
It can't be that hard. Mabye someone else can help? v

Imprezer
03-21-2003, 08:23 PM
Bump!

I cannot seem to find a good banner management and this is the one I like but I cannot get it to rotate the banners.

Please help us!

DannyITR
03-21-2003, 08:56 PM
I was thinking about using phpadsnew and putting a zone in the head. I think it would work but the problem is you'd have the same for all forums. I've sold a non-rotation banner in one of my forums but from now on I want a rotation for the whole forum.

Drowned
03-27-2003, 12:30 AM
Damnit :( I love this hack... isn't anybody willing fo fix this great hack? :(

SpeedStreet
03-27-2003, 01:31 AM
<sniff>

The problem is, PPN has shown time and again on these sites that he is a great coder. I think right now he has alot on his plate.

He has also been working pretty hard on VB3....hopefully sometime soon he will pop in and fix our problems :D

DannyITR
04-16-2003, 08:37 PM
any news?

The Realist
04-19-2003, 10:59 PM
In the admin controlpanel were it says Code to be shown as advert........ What does it mean and what code you you put in there?

Is it a direct link to a gif, HTML has it does not say.

Regards,

Brian

trafix
04-20-2003, 12:59 AM
i hate to spam :( but if you are having problems have a look at my Arrow Ads (link in sig)

Jacko
05-18-2003, 06:02 PM
Excellent hack, works a treat on my 2.3.0 board :bandit:

* Jacko clicks install *

Anjie
05-23-2003, 03:06 AM
Not only works, but rotates with java script, and this hack ROCKS! Exactly what I've been looking for for sooooooo long!! THANK YOU!!!!

Super Ted
05-27-2003, 08:25 PM
Has anyone worked out how to include 2 different banners on a page?

noppid
05-27-2003, 09:04 PM
04-19-03 at 09:59 PM trafix said this in Post #179 (https://vborg.vbsupport.ru/showthread.php?postid=384430#post384430)
i hate to spam :( but if you are having problems have a look at my Arrow Ads (link in sig)

I've gone to your site more then once looking for your hacks. I'm lost everytime.

Can you please explain why they can't be posted here for better support and availability?

EDIT: NM, this one works great.

Anjie
05-29-2003, 02:55 AM
To ad more than one ad to a forum, use this code in the "Code to be shown as advert" box. Works like a charm. :D

<SCRIPT LANGUAGE="JavaScript">
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="Ad Name";
url="http://youradsite.com";
alt="Alt Message";
banner="http://www.yoursite/banner.jpg";
width="460";
height="80";
}
if (ad==2) {
txt="Ad Name";
url="http://youradsite.com";
alt="Alt Message";
banner="http://www.yoursite/banner.jpg";
width="468";
height="60";
}
if (ad==3) {
txt="Ad Name";
url="http://youradsite.com";
alt="Alt Message";
banner="http://www.yoursite/banner.jpg";
width="468";
height="60";
}
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_new\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('<small>' + txt + '</small></a>');
document.write('</center>');
</SCRIPT><br>


If you have more ads, just change the number variable in line 2., copy and paste a new section and rename the if statement to ad==4 and so on. This works like a charm for me, I've got in running different sets of banners on 60 some odd forums. :) This hack is a master stroke.

The only thing I'd like to do is get the subs to work independently of the parent forum, other than that this hack is the best! :)

Sidewindr
05-30-2003, 04:59 AM
I am having a similar problem ..

I have set up 5 banners and it appears to be stuck on the 4th and 5th banners....

Odd. .

I found I had to have RAND() not RAND(NOW()) as the latter did not seem to work when I put the following query inth mysql cmd line interface..

SELECT * FROM ads ORDER BY RAND(NOW());

Yielded the ad list in the same order EVERY time

SELECT * FROM ads ORDER BY RAND();

Yielded the ad list in a different order every time.

Sidewindr
05-30-2003, 05:46 AM
I fixed the problem .. it is wierd .. I had to run the database query twice!! So instead of this portion of code in global.php

mysql Ver 11.18 Distrib 3.23.53, for sun-solaris2.9 (sparc)
PHP 4.3.1 (cli) (built: Mar 25 2003 16:03:01)


if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE wholeforum='1' AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}


I had to use


if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE wholeforum='1' AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
$advert=$DB_site->query_first("SELECT * FROM ads WHERE wholeforum='1' AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}



Also just a quick note .. it does not work very well with only 2 adverts. If you only have 2 adverts make 3 copies of each and the randomization will work alot better.

94supratt
06-04-2003, 07:11 PM
<center><a href="http://www.dtpracing.com" target="_blank"><img src="http://www.tidewaterracing.com/pics/dtpcard1.jpg"" width="289" height="125"></center>

I have that as an ad in the "Code to be shown as advert" and now when I try to quote someone in a post I am unable to highlight using the left button on the mouse. Any ideas why.

Sidewindr
06-06-2003, 01:35 AM
There appears to be a problem with the following portion of code in global.php


if (isset($postid)) {
// viewing post
$postid=verifyid('post',$postid,0);
if ($postid!=0) {
$advert_forumid=$postid['forumid'];
}
}


$advert_forumid appears to be incorrect. If post id is say 92355 and the post is in thread 23352 in forum 24. advert_forumid is set to 9 ... this is wrong and it should be 24.

I got around it for the time being by changing it to the following.


if (isset($postid) and isset($threadid)) {
// viewing post
$thread=verifyid("thread",$threadid,0,1);
$advert_forumid=$thread['forumid'];
}


This works and the advert_forumid is set to 24 for the above example.

I don't think this fix is correct though, is there a scenaro where postid is set but threadid is not ?

gmarik
06-06-2003, 05:44 AM
MySQL 4.0.13 should work with vBulletin 2.3?

Sidewindr
06-24-2003, 01:48 AM
What's the hack for this hack to allow the exposure count to go over 32767 exposures ?

Moreliator
07-22-2003, 08:29 PM
This may be asking alot, but is there any way you could make an addon that would allow the Admin to specify certain banners based on a user's location? For example, I have some adverts who I can only display for US traffic, and for International traffic I woudl want a different banner displayed.

Thanks.

gldtn
08-10-2003, 08:29 AM
Anyone got this to work with vB2.3.0? I installed it but the options to configure it in admin, it does not appear.

Anjie
08-19-2003, 09:00 PM
yeah worked great on ours. :) 2.3.0

mfacer
08-27-2003, 11:48 AM
awesome hack!! Love it to bits!!

works perfectly on 2.3.2

:-)

see example: http://www.yu-gi-oh-online.co.uk/forum/showthread.php?s=&threadid=67

Super Ted
09-08-2003, 08:21 PM
Has anyone got this hack to work on a non-vb page?

Super Ted
09-11-2003, 04:06 PM
^^^Bump^^^ I am sure others would like to know too!

MuSuL
09-14-2003, 06:02 AM
So after reading all 196 posts to this, I have not seen or maybe I have over looked that post that talked about fixing the problem of the ad banners not rotating...Mine are not!...The first on the list is the only one that shows...

So here is the question, is there a way to make the banners rotate and have then rotate from one to the other every so many seconds?

Or does the hack only let one banner show until you refreash the screen, which I have done and nothing has changed...I would love to be able to use this hack, but if it does not work, why use it?

TheLab
09-17-2003, 08:43 PM
So after reading all 196 posts to this, I have not seen or maybe I have over looked that post that talked about fixing the problem of the ad banners not rotating...Mine are not!...The first on the list is the only one that shows...

So here is the question, is there a way to make the banners rotate and have then rotate from one to the other every so many seconds?

Or does the hack only let one banner show until you refreash the screen, which I have done and nothing has changed...I would love to be able to use this hack, but if it does not work, why use it?


Same here, the banners are only rotating when you refresh the screen.
Also one more thing. Can yoy make it in any way to record the clicks? Thats what the advertisers want...to know how many clicks their banner had.

Thanx in advance

d3nnis
09-19-2003, 05:04 AM
Scott, anyway to use this ad management to show those advertisers whats the current page views or stats?

d3nnis
09-19-2003, 05:06 AM
Also one more thing. Can yoy make it in any way to record the clicks? Thats what the advertisers want...to know how many clicks their banner had.

Thanx in advance


thats what i want... since the advertisers needs to be convince...

liquidblaze
09-23-2003, 08:12 PM
this hack doesnt seem to work for me.. at least the images dont get displayed - i edited all files and upped ads.php but whenever i set something in the adverts panel it doesnt get displayed. the strange thing though is that the visits get counted ...

MrNase
09-24-2003, 11:23 AM
are you sure you used "<img src="....">" ???! You should include ALL html code and not just the url to the image :)


btw: working for me! Very cool work! Thanks!

liquidblaze
09-24-2003, 11:27 AM
well i dont think of myself as the UEBER php/sql pro but i know quite a lot about html ;)

im using a full <img> tag incl. alt and all surrounded by a link - it doesnt work with or without link nor with or without alt :)

MrNase
09-24-2003, 11:32 AM
adjust the time (last setting when adding a new one or updating a new one...) standard is 29th january 2003 and that is wrong... change it to ... ... 2004 or whatever :)

liquidblaze
09-24-2003, 11:46 AM
all done .. date is set and all works - the countdown (how many exposures are left) works too, it just doesnt show the image - neither via hotlinking nor via a local (on the server itself) file.

any more hints for people who are no total morons?

i mean.. setting it up was no prob - using it neither, i just dont see the images...

madhouse
09-24-2003, 02:35 PM
Liquidblaze , just a question but did you add $advert to you header template?

liquidblaze
09-24-2003, 02:45 PM
ah yes someone is looking like the absolute noob now... :) thx for your help

Spyke1
09-30-2003, 04:52 PM
is it possible to use this to manage banners on a site (outside vbulletin)?

Big J
10-04-2003, 08:36 PM
Hey PPN, just wanted to let you know, i found a bug.

i have mine set to unlimited exposures...but the exposure count for all adverts only went to 32767 for Houston, Austin, and Dallas, and will not go any higher....so the counter has a bug somewhere....

I'm having the same issue. Could comeone please PM me the fix!! Thanks!

madhouse
10-05-2003, 12:17 AM
Read my post here :https://vborg.vbsupport.ru/showpost.php?p=436245&postcount=206

If u are having the same issue....

PAINTBALLM
10-07-2003, 02:40 AM
i'd like to see the option to output a statistics page for your sponsors/advertisers to view, so they know that they arent getting done dirty.

d3nnis
10-07-2003, 02:51 AM
Its not a bug its the limit of mysql smallint.
Ill icq you the fix.


hi Scott can you post here?

d3nnis
10-07-2003, 06:23 AM
found the solution... i alter ad table , exposed field to bigint(10)

TheLab
10-07-2003, 10:12 PM
found the solution... i alter ad table , exposed field to bigint(10)


What does this change? And whats the exact query you run?

d3nnis
10-07-2003, 11:01 PM
What does this change? And whats the exact query you run?


i used phpmyadmin, under ads table, field -> exposed, click on action -> change

TheLab
10-07-2003, 11:11 PM
And what did you earn by doing that?

Edit: Forget it.. i found out what this does.. :nervous:

d3nnis
10-08-2003, 03:04 PM
some info about mysql numeric types..

http://www.mysql.com/doc/en/Numeric_types.html

smallint can only goes up to 32767

so by changing to bigint, I can expect it to goes up to 9223372036854775807!

PAINTBALLM
10-13-2003, 08:43 AM
Scott, I installed this hack, and what I did was modified the variables and installed it again so I could have a different banner system for both the top and bottom of my site. I changed all of the advert variables for the footer system to advert2, and changed all the ads to ads2, then the variable I put in the footer is $advert2 instead of $advert... It works nice..

Accept, one problem is confusing me, as I am not a PHP expert, and you are :P I think you can help me..

First, go here, and look at the footer, notice it works.. http://www.paintballmessage.com/forums

Now go here, and look at the footer, notice.. its not working... http://www.paintballmessage.com/forums/forumdisplay.php?s=&forumid=8

It seems to work on every page accept two, those two being the showthread.php and the forumdisplay.php...

Could you tell me how to fix this?

Thanks scott ;)

Justin

d3nnis
10-13-2003, 11:07 PM
some info about mysql numeric types..

http://www.mysql.com/doc/en/Numeric_types.html

smallint can only goes up to 32767

so by changing to bigint, I can expect it to goes up to 9223372036854775807!


by the way, exposure max limit will also be 32767 since the datatype value is smallint.

if you wish to go beyond 32767, you have to change it to bigint as well.

PAINTBALLM
10-14-2003, 01:05 AM
^^^Bump^^^ I am sure others would like to know too!


Ted what you could do is make a php file in your forum directory, and have it call the global and functions files.... And then put $advert in that, in a table with 0 border and 0 cell padding spanning 100% x 100% centered.. Make it transparent on the non vb page, and it would work like a dream ;) thats what I do

PAINTBALLM
10-15-2003, 01:37 AM
i hope scott is on vacation or something, beacuse hes not responding :(

Super Ted
10-16-2003, 03:29 PM
I want to try and maximise my ad space or whatever free space is available on the forum pages or my non vb homepage. However I don't want it looking a mess or too intrusive. I have seen boards that have a column down the left that contain ads, plus ones at the top of individual forums. I also need to be able to count page impressions for these ads. So multiple ads per page plus the ability to count ad impressions. Do any of you do this already? or have a site that has maximised its ads potential without making a mess of the forum.

midnightz
12-09-2003, 04:21 PM
I have installed this before, But on my friends board, it wont go past the first advert and cycle, i have tested it for about 30 minutes? This is quite strange

anybody come accross this? I looked in admin settings and count won't change on variation after the first. It just wont join in the cycle?!? :(

Dan Flynn
02-13-2004, 10:16 PM
This is a very very great hack.

Thank You :)

lorden
02-15-2004, 04:47 PM
Some silly question it seems as though my whole hack has run flawlessly, i just don't know where to add $advert.

i tried doing some reading and tried adding it just as a test to newthread.php for example.

I keep getting line errors, i'll kepe looking hopefully someone can reply with the simple answer to this...

Super Ted
02-15-2004, 04:48 PM
In the header or footer is your best bet.

LadyBeth
03-08-2004, 12:43 PM
Two silly questions from a newbie...
1. will this work in 3.0 gamma
2. can it be set up to work on the main index/forums pag ein the upper right hand corner....

ok so it is three questions...
3. if yes, how?

Sorry to be so...new at this...

SpeedStreet
03-08-2004, 01:00 PM
To my knowledge, it will not work with vB 3....though I *thought* there was some talk on vb.com about adding this in.

Dez_U
03-13-2004, 11:51 AM
great hack.

Question, is there a plan to update it to run on vb 3 ?

thanks again

BradM
03-23-2004, 04:33 AM
I personally would love to see it in v3 :D

JustAskJulie
04-01-2004, 12:38 AM
Tried to run the first SQL query and got this

JustAskJulie
04-01-2004, 12:42 AM
Tried to install the first SQL query and got this error:

Error

SQL-query :

CREATE TABLE `ads` (

`adid` smallint( 5 ) NOT NULL auto_increment,
`name` varchar( 25 ) NOT NULL default '',
`forumid` smallint( 5 ) NOT NULL default '0',
`wholeforum` smallint( 1 ) NOT NULL default '0',
`exposed` smallint( 10 ) NOT NULL default '0',
`exposures` smallint( 10 ) NOT NULL default '0',
`time` int( 10 ) NOT NULL default '0',
`advert` text NOT NULL ,
KEY `adid` ( `adid` )
)

MySQL said:


You have an error in your SQL syntax near '`ads` ( `adid` smallint(5) NOT NULL auto_increment, `name` varchar(25) NOT NULL ' at line 1

Sidewindr
04-05-2004, 04:05 AM
I NEED this for VB3!!!! Desperatley.

chet
04-05-2004, 09:26 PM
This is posted in VB3 but does it work in VB3, the title reads "Advert Management
For vBulletin 2.2.6"

Regards

Chet

Sorry about that, right forum wrong post, is it ready for vB3 at all

Chet

White Knight
04-10-2004, 12:45 AM
Nope... Nothing for VB3 yet.. lots of people waiting for it though. One of the hacks I greatly missed when I was running 2.0

Sidewindr
04-10-2004, 01:34 AM
I have ended up using phpAdsNew, seems to be VERY good :)

White Knight
04-13-2004, 01:31 PM
I have ended up using phpAdsNew, seems to be VERY good :)

yeah it works if your just trying to do banners.

I was accually using this for the html addition into certian subbords.. I was able to add tables images just like "second menu"

94supratt
09-22-2004, 02:58 PM
Is it possible to have multiple ads appear at the same time? I would like to have them side by side at the top of my forum.

M.C.
10-12-2004, 07:54 PM
just join to everyone who waiting for vB 3x port!!! bump bump bump !!!

jamiepryer@hotm
06-23-2005, 05:31 PM
hey, can someone post up a link to a forum this is working on please :)

Dez_U
06-24-2005, 06:22 PM
lets Bump it again in the hopes that someone is ready to releas this as a 3.5 plug in :)

Julie
12-25-2005, 02:19 PM
lets Bump it again in the hopes that someone is ready to releas this as a 3.5 plug in :)

With you on that bump! *bump*

94supratt
01-04-2006, 12:28 AM
All of my ads have expired because the last date I can set an ad to expire is Dec 31, 2005. How do I resolve this?

94supratt
01-04-2006, 12:34 AM
change this wee bit in global.php

if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',-1,')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}

to

if(isset($advert_forumid)) {
$foruminfo = getforuminfo($advert_forumid);
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',$foruminfo[parentlist],')>0 AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
} else {
$advert=$DB_site->query_first("SELECT * FROM ads WHERE LOCATE(CONCAT(',',forumid,','),',-1,')>0 AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");
}

This will disable the time length function until i get it sorted.



I did this to disable the time length function in the mean time.

bradg
02-21-2006, 02:33 PM
lets Bump it again in the hopes that someone is ready to releas this as a 3.5 plug in :)

I second that bump! I desperately need this for 3.5.3!!

Andy R
02-21-2006, 09:05 PM
Yes, this would be excellent for 3.5!

Marco van Herwaarden
02-21-2006, 09:26 PM
This is a 4 year old vB2 hack.

Nobody ever migrated it to vB3.0 i the last 2 years, so i doubt someone will do it for 3.5 now.

Probably enough alternatives.

bradg
02-22-2006, 12:07 PM
I've looked around and can't find anything that does exactly what this one did. If you know of anything it would be a huge help to me as well as the several others who have replied with the same response as mine.