![]() |
Advert Management
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. [sql]ALTER TABLE `ads` ADD `time` INT(10) DEFAULT '0' NOT NULL;[/sql] [sql]ALTER TABLE `ads` ADD `wholeforum` SMALLINT(1) DEFAULT '0' NOT NULL;[/sql] If you already run that query though are still experiencing problems with the time always being January 1st run [sql]ALTER TABLE `ads` CHANGE `time` `time` INT(10) DEFAULT '0' NOT NULL[/sql] 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 |
And before someone asks for a screenshot.
|
this is awesome :) what about exposure that have no limits?
|
oh god, he comes hack of the month ;)
|
whats an advert? and then explain again what this does?
|
|
^^^ ROFL!
anyways... great man I was looking for this hack last night actually, I will post when I get her installed. cheers PPN. -myles |
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 |
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. |
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. |
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 |
Quote:
|
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. |
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.
|
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 |
If that is the case, you need to get out more, Velocd :P
I think advert occurs pretty commonly... |
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 |
Would you post a pic of what it looks like from the users end?
|
neo:
The upper right hand banner is what the enduser will see. |
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. |
So, does this do rotations if there are more then one ad for a certain forum?
|
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 |
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. |
showthread.php (maybe) We are still discussing this
but at least: newthread.php newreply.php editpost.php report.php postings.php |
Not many files then ;)
You'll need to add this code below PHP Code:
PHP Code:
|
You the man :)
(and firefly ofcourse) I will tweak it now :) (global.php I assume) [update] Yep, global.php and it works perfectly !! |
I am pretty sure I am a man too.
/me checks between his legs... Yup, definitely a man... |
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 |
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? |
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 |
Quote:
And one od the best hack of course :) :) :D PPN, please realize this suggestion. I need this too . ;) |
Please add shows ad by time.
Example: 2 days After 2 days ad not show. Thanks for this! |
oh, okay...great. looks like an excellent hack.
|
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. |
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. |
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. |
I very waiting new version :)
PPN, good work :) I will install new version after release :) |
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 |
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 |
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. |
All times are GMT. The time now is 04:48 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|