Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Ad Management System Details »»
Ad Management System
Version: 0.1, by Carnage Carnage is offline
Developer Last Online: Sep 2014 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.7.x Rating:
Released: 06-18-2009 Last Update: 06-24-2009 Installs: 10
DB Changes Uses Plugins Template Edits Auto-Templates
Additional Files Is in Beta Stage  
No support by the author.

This mod needs special care when installing; please read the entire of this post and the first post in this thread before attempting an installation.

Ad Management System for Vbulletin
Requirements
  • Vbulletin 3.7+
  • Vbulletin 3.6.x and Additional compatibility product.
  • MySQL 5.0.3+ (5.1.16 recommended)

Features
  • Allow users to upload ads for display on your forums
  • Manage (approve and reject) ads from the admin cp
  • Payment handled via VB subscriptions
Coming soon: (either not implemented or not functional)
  • Restrict max number of active ads at one time; any extras will be queued for display
  • External mode (share ads between different forums)
  • Default ads (show a default ad if none exist)
  • Network ads (mix ads from a 3rd party host into rotation)

Installation
1. Backup DB
2a. If you have changed the name of your admincp, rename the admincp directory appropriately.
2b. Upload files in upload directory to your forum root.
2c. (Vbulletin 3.6.x only) Install the ad compatibility product
3. Import admanager product file. IMPORT 1 PRODUCT FILE ONLY (see below)
4. Edit navbar template and add a link to advertising.php

Note: there are TWO product files. One is for use with mysql versions 5.0.3+ the other will only work if:
a) Your vbulletin database user account has the SUPER privilege
b) You are running MySQL 5.1.16+ and your account has the CREATE TRIGGER privilege

If you use the first product file (for 5.0.3) you need to run the following queries using an account with the super privilege.

There is now also a third product file, this file is only needed if you are using vbulletin 3.6.x

PHP Code:
$db->query("DROP TRIGGER IF EXISTS `" TABLE_PREFIX "advertsinsert`;");

$db->query("DELIMITER //
CREATE TRIGGER `" 
TABLE_PREFIX "advertsinsert` AFTER INSERT ON `" TABLE_PREFIX "adverts`
 FOR EACH ROW BEGIN
    CASE NEW.status
        WHEN 0 THEN UPDATE " 
TABLE_PREFIX "adzones SET waiting = waiting+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 1 THEN UPDATE " 
TABLE_PREFIX "adzones SET queued = queued+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 2 THEN UPDATE " 
TABLE_PREFIX "adzones SET active = active+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 3 THEN UPDATE " 
TABLE_PREFIX "adzones SET pending = pending+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 4 THEN UPDATE " 
TABLE_PREFIX "adzones SET rejected = rejected+1 WHERE adzoneid = NEW.adzoneid;
    END CASE;
END
//
DELIMITER ;"
);

$db->query("DROP TRIGGER IF EXISTS " TABLE_PREFIX "advertsupdate`;");

$db->query("DELIMITER //
CREATE TRIGGER `" 
TABLE_PREFIX "advertsupdate` AFTER UPDATE ON `" TABLE_PREFIX "adverts`
 FOR EACH ROW BEGIN
    CASE NEW.status
        WHEN 0 THEN UPDATE " 
TABLE_PREFIX "adzones SET waiting = waiting+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 1 THEN UPDATE " 
TABLE_PREFIX "adzones SET queued = queued+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 2 THEN UPDATE " 
TABLE_PREFIX "adzones SET active = active+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 3 THEN UPDATE " 
TABLE_PREFIX "adzones SET pending = pending+1 WHERE adzoneid = NEW.adzoneid;
        WHEN 4 THEN UPDATE " 
TABLE_PREFIX "adzones SET rejected = rejected+1 WHERE adzoneid = NEW.adzoneid;
    END CASE;
    CASE OLD.status
        WHEN 0 THEN UPDATE " 
TABLE_PREFIX "adzones SET waiting = waiting-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 1 THEN UPDATE " 
TABLE_PREFIX "adzones SET queued = queued-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 2 THEN UPDATE " 
TABLE_PREFIX "adzones SET active = active-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 3 THEN UPDATE " 
TABLE_PREFIX "adzones SET pending = pending-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 4 THEN UPDATE " 
TABLE_PREFIX "adzones SET rejected = rejected-1 WHERE adzoneid = OLD.adzoneid;
    END CASE;
END
//
DELIMITER ;"
);

$db->query("DROP TRIGGER IF EXISTS `" TABLE_PREFIX "advertsdelete`;");

$db->query("DELIMITER //
CREATE TRIGGER `" 
TABLE_PREFIX "advertsdelete` AFTER DELETE ON `" TABLE_PREFIX "adverts`
 FOR EACH ROW BEGIN
    CASE OLD.status
        WHEN 0 THEN UPDATE " 
TABLE_PREFIX "adzones SET waiting = waiting-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 1 THEN UPDATE " 
TABLE_PREFIX "adzones SET queued = queued-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 2 THEN UPDATE " 
TABLE_PREFIX "adzones SET active = active-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 3 THEN UPDATE " 
TABLE_PREFIX "adzones SET pending = pending-1 WHERE adzoneid = OLD.adzoneid;
        WHEN 4 THEN UPDATE " 
TABLE_PREFIX "adzones SET rejected = rejected-1 WHERE adzoneid = OLD.adzoneid;
    END CASE;
END
//
DELIMITER ;"
); 
Setup
This mod may be a little confusing for some; this is intended as a brief usage guide:

Once installed, a menu should be added to your admin cp (you may have to refresh first) under styles + templates, this menu contains one entry: show/edit adzones. Before you click this link, you should setup at least 1 paid subscription for use with this mod and make a note of its id (can be found by editing it, its in the title bar with the subscription title). You should use the subscriptions description to describe the ad zone it will be used for; specify max/min image dimensions and any rules you may have for ads, this description will be shown to users uploading ads to the zone.

You will be presented with a list of all ad_ template found in the database, VB3.7 has about 8, there may be more with 3.8, VB 3.6 has none, however I will be releasing a version of this mod for VB 3.6 shortly.

Click the edit link next to an ad zone you wish to allow users to buy ads in. Fill in the information; title will be the title shown to users purchasing ads so should be descriptive of the zone eg: 'Below Header'; the max active ads section dosn't work currently however will be implemented in a future release; subscription id should be the id number of the subscription you created earlier.

You will be returned to the list, now the n/a's for the adzone will have been replaced with numbers. Clicking a number will show all ads with the indicated status. Clicking the ads pending admin approval number will take you to a form where you can approve and reject ads submitted by users.

If the numbers here remain 0 even when there are ads in the categories; you havn't added the triggers correctly.

Usage
The intended usage pattern for this mod looks like this:
1. User uploads an advert to the site.
2. An admin approves the ad for display
3. The user purchases a subscription
4. The ad is displayed for the length of the subscription

This is a alpha release and may contain bugs, you should test this mod on a dev site before installing it onto a production site.

Notes on behaviours
Ads can be edited by users if and only if they have been rejected or they have not yet been approved.
Once an ad has been rejected or approved, that desision cannot be changed.
Each user may only submit 1 ad per ad zone.
This mod may conflict with any mod that adds plugins to the subscription system.

Show Your Support

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

Comments
  #2  
Old 06-19-2009, 03:08 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I anticipate many Q's about the mysql triggers stuff so i'm reserving this post to answer them in
Reply With Quote
  #3  
Old 06-19-2009, 03:09 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This post is for feature requests
Reply With Quote
  #4  
Old 06-19-2009, 03:27 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any screenshots?
Reply With Quote
  #5  
Old 06-19-2009, 03:32 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Putting some together now
Reply With Quote
  #6  
Old 06-20-2009, 07:18 AM
Come2Daddy Come2Daddy is offline
 
Join Date: May 2008
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm interested, actually

I've been thinking of something like this

thank you for sharing
Reply With Quote
  #7  
Old 06-20-2009, 10:22 AM
raja811 raja811 is offline
 
Join Date: Oct 2006
Posts: 390
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mose screenshot pls
Reply With Quote
  #8  
Old 06-20-2009, 10:49 AM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

raja: what else did you have in mind?

The screenshots i've posted show a wide range of the usage of the mod - remember payment is handled through the existing vbulletin subscription system
Reply With Quote
  #9  
Old 06-25-2009, 08:45 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've uploaded a product to provide compatibility with vbulletin 3.6.x
Reply With Quote
  #10  
Old 08-10-2011, 08:48 AM
J517E7B2F4A5 J517E7B2F4A5 is offline
 
Join Date: May 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this will work nice but i've just one small problem when i trying to upload and image this is what it tell me

Quote:
There was an error encountered with your upload:

Invalid File Path Specified
What i've to do for fix this small error?


Edit: fixed
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 01: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.04679 seconds
  • Memory Usage 2,322KB
  • Queries Executed 23 (?)
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
  • (1)bbcode_php
  • (1)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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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