Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Advert Management Details »»
Advert Management
Version: 1.00, by Scott MacVicar Scott MacVicar is offline
Developer Last Online: Mar 2016 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 05-25-2002 Last Update: Never Installs: 47
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #182  
Old 05-23-2003, 03:06 AM
Anjie Anjie is offline
 
Join Date: Jan 2003
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not only works, but rotates with java script, and this hack ROCKS! Exactly what I've been looking for for sooooooo long!! THANK YOU!!!!
Reply With Quote
  #183  
Old 05-27-2003, 08:25 PM
Super Ted Super Ted is offline
 
Join Date: Apr 2002
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone worked out how to include 2 different banners on a page?
Reply With Quote
  #184  
Old 05-27-2003, 09:04 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
04-19-03 at 09:59 PM trafix said this in Post #179
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.
Reply With Quote
  #185  
Old 05-29-2003, 02:55 AM
Anjie Anjie is offline
 
Join Date: Jan 2003
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
PHP Code:
<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!
Reply With Quote
  #186  
Old 05-30-2003, 04:59 AM
Sidewindr Sidewindr is offline
 
Join Date: Oct 2002
Location: Australia
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #187  
Old 05-30-2003, 05:46 AM
Sidewindr Sidewindr is offline
 
Join Date: Oct 2002
Location: Australia
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)

PHP Code:
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

PHP Code:
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.
Reply With Quote
  #188  
Old 06-04-2003, 07:11 PM
94supratt 94supratt is offline
 
Join Date: Dec 2002
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
<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.
Reply With Quote
  #189  
Old 06-06-2003, 01:35 AM
Sidewindr Sidewindr is offline
 
Join Date: Oct 2002
Location: Australia
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There appears to be a problem with the following portion of code in global.php

PHP Code:
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.

PHP Code:
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 ?
Reply With Quote
  #190  
Old 06-06-2003, 05:44 AM
gmarik's Avatar
gmarik gmarik is offline
 
Join Date: May 2002
Location: Mocsow
Posts: 1,288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MySQL 4.0.13 should work with vBulletin 2.3?
Reply With Quote
  #191  
Old 06-24-2003, 01:48 AM
Sidewindr Sidewindr is offline
 
Join Date: Oct 2002
Location: Australia
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's the hack for this hack to allow the exposure count to go over 32767 exposures ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:35 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.14884 seconds
  • Memory Usage 2,345KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete