Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

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
  #12  
Old 08-10-2011, 10:27 AM
J517E7B2F4A5 J517E7B2F4A5 is offline
 
Join Date: May 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by J517E7B2F4A5 View Post
this will work nice but i've just one small problem when i trying to upload and image this is what it tell me



What i've to do for fix this small error?


Edit: fixed
Founded Thank you works like a charm :up::up:
Reply With Quote
Reply

Thread Tools

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:04 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.10995 seconds
  • Memory Usage 2,232KB
  • Queries Executed 16 (?)
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
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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