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
  #52  
Old 05-30-2002, 02:34 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #53  
Old 05-30-2002, 04:55 PM
Neopiper Neopiper is offline
 
Join Date: Dec 2001
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #54  
Old 05-30-2002, 07:47 PM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

change this wee bit in global.php

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 LOCATE(CONCAT(',',forumid,','),',-1,')>0 AND time>=".time()." AND (exposed<=exposures OR exposures=0) ORDER BY RAND()");

to

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 (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.
Reply With Quote
  #55  
Old 05-30-2002, 08:38 PM
Neopiper Neopiper is offline
 
Join Date: Dec 2001
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks PPN
Reply With Quote
  #56  
Old 06-01-2002, 12:08 AM
Stealthy Stealthy is offline
 
Join Date: May 2002
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #57  
Old 06-01-2002, 05:47 AM
inetd inetd is offline
 
Join Date: Nov 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PPN, when you release new version?
Reply With Quote
  #58  
Old 06-01-2002, 09:48 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #59  
Old 06-01-2002, 02:12 PM
Stealthy Stealthy is offline
 
Join Date: May 2002
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #60  
Old 06-01-2002, 06:17 PM
dxb's Avatar
dxb dxb is offline
 
Join Date: Oct 2001
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #61  
Old 06-01-2002, 10:33 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
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 12:29 PM.


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.08006 seconds
  • Memory Usage 2,313KB
  • 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
  • (2)bbcode_php
  • (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