Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Banner Ads System Details »»
Banner Ads System
Version: 1.00, by tnguy3n tnguy3n is offline
Developer Last Online: Sep 2010 Show Printable Version Email this Page

Version: 3.5.2 Rating:
Released: 01-03-2006 Last Update: Never Installs: 210
DB Changes Uses Plugins Template Edits
Additional Files  
No support by the author.

Banner Ads System
Author: Thinh Nguyen (tnguy3n)
Support: www.vbviet.org

###############
Banner Ads System Expanded version supports Adsense, Adbrite, Flash, Inframe, etc.
Click on the link below for more info & to purchase:
http://www.vbviet.com/index.php?act=...od&productId=8
###############

This simple rotational banner ads system get random ads from your database and display globally under navbar on your board.
It's been fully tested on vb 3.5.2, but it should work fine for all 3.5 Gold version.

FEATURES:
- Banner stats tracker
- Ability to enable/disable
- Admin ability to add/modify/delete banners
- Admin ability to view banner stats/detail for each banner
- more

#################
STRUCTURE:
- New Files: 3
- New Template: 1
- New db tables: 2
- Product: 1


#################
INSTALLATION:

1. Upload files to appropriate dir in your forumroot
2. UPload product xml file in your Product Manager

#################
If you find this hack useful or wish to sponsor/support future development of the hack, you can donate to


If you need custom version of this hack, pls contact me.

:::::UPDATE:::::
The product xml above will add 2 plugins and the ads stays fixed under navbar. This, however, may not be working with some custom skins if navbar template's codebit are changed. To fix that problem, open Banner System plugin (at global_start hook), replace the whole content with:

PHP Code:
// Banner Ads System by tnguy3n
if($vbulletin->options['bannersys_mode'])
{
    
$getads $vbulletin->db->query_read("SELECT * FROM " TABLE_PREFIX "

bannersys_banners WHERE status = '1' ORDER BY RAND() LIMIT 1"
);
    
$ads $vbulletin->db->fetch_array($getads);

    
// print banner ads
    
eval('$bannerads = "' fetch_template('bannerads') . '";');

    
$vbulletin->db->free_result($getads);
    unset(
$getads);

Next step, you'll have to modify some templates in order to display the ads, place this following code:
HTML Code:
$bannerads
anywhere you want to show the ads.
If you want to show the ads globally on your forums, put that code in either header or navbar or footer template.

To enable/disable or change other settings of Banner System: vBulletin Options -> Banner System Settings
- Banner System Mode: yes = enable, no = disable
- Show Banners to Logged In Users: yes = everyone (including logged in users), no = only guests
- Ads In New Window: yes = open in new window, no = open in same window

Show Your Support

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

Comments
  #272  
Old 11-17-2006, 03:55 PM
Jack Crazy Jack Crazy is offline
 
Join Date: Dec 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried reinstalling, still NOTHING in ADMINCP. I read every post and page regarding this hack but admincp banner manager remains empty...
Reply With Quote
  #273  
Old 11-17-2006, 04:34 PM
burntire burntire is offline
 
Join Date: Jun 2006
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jack Crazy View Post
I tried reinstalling, still NOTHING in ADMINCP. I read every post and page regarding this hack but admincp banner manager remains empty...

Works for me are you using 3.6.3?
Reply With Quote
  #274  
Old 11-17-2006, 06:28 PM
Jack Crazy Jack Crazy is offline
 
Join Date: Dec 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I am currently running vBulletin version 3.5.1

yup, still three black bars where the banner manager is... damnit
Reply With Quote
  #275  
Old 11-17-2006, 07:00 PM
burntire burntire is offline
 
Join Date: Jun 2006
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jack Crazy View Post
No, I am currently running vBulletin version 3.5.1


yup, still three black bars where the banner manager is... damnit

Upgrade that old software.
Reply With Quote
  #276  
Old 11-18-2006, 07:14 PM
Jack Crazy Jack Crazy is offline
 
Join Date: Dec 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is their something wrong in my banneradmin.php file?
PHP Code:
<?php

/*======================================================================*\
|| #################################################################### ||
|| # Banner System Lite v.1.0                                          # ||
|| # Author: Thinh Nguyen (tnguy3n)                                      # ||
|| # Support site: http://www.vbviet.com                              # ||
|| # Copyright ? 2005 vBviet Network. All Rights Reserved.               # ||
|| # This file may not be redistributed in whole or significant part  # ||
|| #################################################################### ||
\*======================================================================*/

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('GET_EDIT_TEMPLATES'true);
define('THIS_SCRIPT''banneradmin');

require_once(
'./global.php');

// #################### Start main script ####################

if (empty($_REQUEST['do']))
{
    
$_REQUEST['do'] = 'settings';
}

if(
$_REQUEST['do'] == 'settings'){

    
header("Location: options.php?do=options&dogroup=bannersys");
}

// Banner Manager
if($_REQUEST['do'] == "manage")
{
    
print_cp_header("Banner System Manager");
    
print_table_start();
    
print_table_header("Banner Manager"4);
    
print_form_header('banneradmin','addbanner');
    
$banners $db->query_read("SELECT * FROM " TABLE_PREFIX "bannersys_banners ORDER BY bannerid ASC");
    
print_cells_row(array('Banner''Dimension''Status','Options'), 1111'tcat');
    while(
$banner $db->fetch_array($banners))
    {
        
$bannerid $banner['bannerid'];

        if(
$banner['status'] == '0')
        {
            
$status '<font color="red">Inactive</font>';
            
$linkopt "<a href=\"banneradmin.php?do=activate&bannerid=$bannerid\">Activate</a>";
        }
        elseif(
$banner['status'] == '1')
        {
            
$status '<font color="green">Active</font>';
            
$linkopt "<a href=\"banneradmin.php?do=deactivate&bannerid=$bannerid\">Deactivate</a>";
        }
        elseif(
$banner['status'] == '2'
        { 
            
$status '<font color="yellow">Unapproved</font>'
            
$linkopt "<a href=\"banneradmin.php?do=approve&bannerid=$bannerid\">Approve</a>";
        }

        
$cell = array();
        
$cell[] = "<div align='center'>$banner[bannername]<br />$banner[bannerdesc] <br /><a href=\"$banner[bannerurl]\" title=\"$banner[bannername]\" target=\"_blank\"><img src=\"$banner[imgurl]\" alt=\"$banner[bannername]\" borde=\"0\"></a></div>";
        
$cell[] = $banner['bwidth'] . ' x ' $banner['bheight'];
        
$cell[] = $status;
        
$cell[] = "<div align='center'><a href=\"banneradmin.php?do=modify&bannerid=$bannerid\">Modify</a> | <a href=\"banneradmin.php?do=delete&bannerid=$bannerid\" onClick=\"return confirm('Delete it?')\">Delete</a><br />$linkopt</div>";
        
print_cells_row($cell);
    }
    
print_submit_row('Add New Banner'04);
    
print_table_footer();
    
print_cp_footer();
    exit;
}
if(
$_REQUEST['do']=="addbanner"){
    
print_cp_header("Add New Banner");
    
print_table_start();
    
print_table_header("Add Banner");
    
print_form_header('banneradmin','insertbanner');
    
print_input_row("Banner Name:<dfn>Your banner name.</dfn>"'bannername');
    
print_input_row("Description:<dfn>Short description for the banner.</dfn>"'bannerdesc');
    
print_input_row("Banner Link:<dfn>Home link of the banner. Must start with http://www..</dfn>"'bannerurl');
    
print_input_row("Image Location:<dfn>Location of banner image. Must start with http://www.</dfn>"'imgurl');
    
print_input_row("Banner Width:<dfn></dfn>"'bwidth');
    
print_input_row("Banner Height:<dfn></dfn>"'bheight');
    
print_yes_no_row("Active?:<dfn>Is it active?</dfn>"'status');
    
print_submit_row('Add Banner'0);
    
print_table_footer();
    
print_cp_footer();
    exit;
}

if(
$_POST['do'] == 'insertbanner')
{
    
$vbulletin->input->clean_array_gpc('p', array('bannername' => TYPE_STR'bannerdesc' => TYPE_STR'bannerurl' => TYPE_STR'imgurl' => TYPE_STR'bwidth' => TYPE_INT'bheight' => TYPE_INT'status' => TYPE_INT));

    
$db->query_write("
        INSERT INTO " 
TABLE_PREFIX "bannersys_banners(bannername, bannerdesc, bannerurl, imgurl, bwidth, bheight, status) 
        VALUES('" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[bannername])) . "', 
            '" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[bannerdesc])) . "', 
            '" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[bannerurl])) . "', 
            '" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[imgurl])) . "', 
            '" 
intval($vbulletin->GPC[bwidth]) . "', 
            '" 
intval($vbulletin->GPC[bheight]) . "',
            '" 
intval($vbulletin->GPC[status]) . "')
        "
);
    
define('CP_REDIRECT'"banneradmin.php?do=manage");
    
print_stop_message('banner_added_successfully');
    exit;
}

if(
$_REQUEST['do']=="modify")
{
    
$vbulletin->input->clean_array_gpc('r', array('bannerid' => TYPE_INT));

    
$banner$db->query_first("SELECT * FROM " TABLE_PREFIX "bannersys_banners WHERE bannerid = '" $vbulletin->GPC['bannerid'] . "'");
    
print_cp_header("Modify Banner");
    
print_table_start();
    
print_table_header("Modify Banner: $banner[bannername]");
    
print_form_header('banneradmin','update');
    
construct_hidden_code('bannerid'$banner['bannerid']);
    
print_input_row("Banner Name:<dfn>Your banner name.</dfn>"'bannername'$banner['bannername']);
    
print_input_row("Description:<dfn>Short description for the banner.</dfn>"'bannerdesc'$banner['bannerdesc']);
    
print_input_row("Banner Link:<dfn>Home link of the banner. Must start with http://www..</dfn>"'bannerurl'$banner['bannerurl']);
    
print_input_row("Image Location:<dfn>Location of banner image. Must start with http://www.</dfn>"'imgurl'$banner['imgurl']);
    
print_input_row("Banner Width:<dfn></dfn>"'bwidth'$banner['bwidth']);
    
print_input_row("Banner Height:<dfn></dfn>"'bheight'$banner['bheight']);
    
print_yes_no_row("Active?:<dfn>Is it active?</dfn>"'status'$banner['status']);
    
print_submit_row($vbphrase['update']);
    
print_table_footer();
    
print_cp_footer();
    exit;
}

if(
$_POST['do'] == 'update')
{
    
$vbulletin->input->clean_array_gpc('p', array(
                            
'bannerid'            => TYPE_INT,
                            
'bannername'        => TYPE_STR,
                            
'bannerdesc'        => TYPE_STR,
                            
'bannerurl'            => TYPE_STR,
                            
'imgurl'            => TYPE_STR,
                            
'bwidth'            => TYPE_INT,
                            
'bheight'            => TYPE_INT,
                            
'status'            => TYPE_INT
                        
));

    
$db->query_write("UPDATE " TABLE_PREFIX "bannersys_banners
        SET bannername = '" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[bannername])) . "',
            bannerdesc = '" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[bannerdesc])) . "',
            bannerurl = '" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[bannerurl])) . "',
            imgurl = '" 
addslashes(htmlspecialchars_uni($vbulletin->GPC[imgurl])) . "',    
            bwidth = '" 
intval($vbulletin->GPC[bwidth]) . "',
            bheight = '" 
intval($vbulletin->GPC[bheight]) . "',    
            status = '" 
intval($vbulletin->GPC[status]) . "'    
        WHERE bannerid = '" 
intval($vbulletin->GPC[bannerid]) . "'
        "
);
    
define('CP_REDIRECT'"banneradmin.php?do=manage");
    
print_stop_message('updated_banner_successfully');
    exit;
}

if (
$_REQUEST['do'] == 'delete')
{
    
$vbulletin->input->clean_array_gpc('r', array('bannerid' => TYPE_INT));
    
$db->query_write("
        DELETE FROM " 
TABLE_PREFIX "bannersys_banners 
        WHERE bannerid = '" 
intval($vbulletin->GPC[bannerid]) . "'
    "
);
    
define('CP_REDIRECT'"banneradmin.php?do=manage");
    
print_stop_message('deleted_banner_successfully');
    exit;
}

if (
$_REQUEST['do'] == 'activate')
{
    
$vbulletin->input->clean_array_gpc('r', array('bannerid' => TYPE_INT));
    
$db->query_write("
        UPDATE " 
TABLE_PREFIX "bannersys_banners SET status = '1'
        WHERE bannerid = '" 
intval($vbulletin->GPC[bannerid]) . "'
    "
);
    
define('CP_REDIRECT'"banneradmin.php?do=manage");
    
print_stop_message('activated_banner_successfully');
    exit;
}

if (
$_REQUEST['do'] == 'deactivate')
{
    
$vbulletin->input->clean_array_gpc('r', array('bannerid' => TYPE_INT));
    
$db->query_write("
        UPDATE " 
TABLE_PREFIX "bannersys_banners SET status = '0'
        WHERE bannerid = '" 
intval($vbulletin->GPC[bannerid]) . "'
    "
);
    
define('CP_REDIRECT'"banneradmin.php?do=manage");
    
print_stop_message('deactivated_banner_successfully');
    exit;
}


// banner stats
if($_REQUEST['do'] == 'stats')
{
    
print_cp_header("Banner Stats Manager");
    
print_table_start();
    
print_table_header("Banner Stats"4);
    
print_cells_row(array('Banners''Total Hits''Status','Option'), 1111'tcat');

    
$getstats $db->query_read("SELECT banners.bannerid, banners.bannername, banners.bannerurl, banners.status, stats.*, COUNT(stats.bannerid) AS totalhits
        FROM " 
TABLE_PREFIX "bannersys_stats AS stats
        LEFT JOIN " 
TABLE_PREFIX "bannersys_banners AS banners ON (banners.bannerid = stats.bannerid)
        GROUP BY stats.bannerid
        ORDER BY totalhits DESC    
    "
);
    while(
$stats $db->fetch_array($getstats))
    {
        if(
$stats['status'] == '0')
        {
            
$status '<font color="red">Inactive</font>';
        }
        elseif(
$stats['status'] == '1')
        {
            
$status '<font color="green">Active</font>';
        }
        elseif(
$stats['status'] == '2'
        { 
            
$status '<font color="yellow">Unapproved</font>'
        }
        
        
// print results
        
$cell = array();
        
$cell[] = "<a href=\"$stats[bannerurl]\" target=\"_blank\">" $stats['bannername'] . '</a>';
        
$cell[] = $stats['totalhits'];
        
$cell[] = $status;
        
$cell[] = "<div align='center'><a href=\"banneradmin.php?do=viewstats&bannerid=$stats[bannerid]\">View Detail</a></div>";
        
print_cells_row($cell);
    }
    
print_table_footer();
    
print_cp_footer();
}


// view banner stats
if($_REQUEST['do'] == 'viewstats')
{
    
$bannerid $vbulletin->input->clean_gpc('r''bannerid'TYPE_INT);

    
print_cp_header("Banner Stats Manager");
    
print_table_start();
    
print_table_header("Detail Stats"3);
    
print_cells_row(array('User''Visit Date''User IP'), 111'tcat');

    
$getstats $db->query_read("SELECT stats.*, banner.bannerid, user.userid, user.username
        FROM " 
TABLE_PREFIX "bannersys_stats AS stats
        LEFT JOIN " 
TABLE_PREFIX "bannersys_banners AS banner ON (banner.bannerid = stats.bannerid)
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (user.userid = stats.visitorid)
        WHERE stats.bannerid = '
$bannerid'
        ORDER BY stats.visitdate DESC    
    "
);
    while(
$stats $db->fetch_array($getstats))
    {
        
$stats['visitdate'] = vbdate($vbulletin->options['dateformat'], $stats['visitdate']);

        if(
$stats['userid'])
        {
            
$user "<a href=\"../member.php?u=$stats[userid]\">" $stats['username'] . '</a>';
        }
        else
        {
            
$user 'Guest';
        }

        
// print results
        
$cell = array();
        
$cell[] = $user;
        
$cell[] = $stats['visitdate'];
        
$cell[] = $stats['visitorip'];
        
print_cells_row($cell);
    }
    
print_table_footer();
    
print_cp_footer();
}


?>
Reply With Quote
  #277  
Old 11-18-2006, 07:21 PM
Jack Crazy Jack Crazy is offline
 
Join Date: Dec 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and this is what I see in ACP:
Reply With Quote
  #278  
Old 11-26-2006, 10:04 AM
MotMann MotMann is offline
 
Join Date: Jan 2006
Location: Germany
Posts: 333
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How i can put in complet affilicodes?
Reply With Quote
  #279  
Old 01-01-2007, 10:00 PM
MotMann MotMann is offline
 
Join Date: Jan 2006
Location: Germany
Posts: 333
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No answer here?
Reply With Quote
  #280  
Old 03-16-2007, 08:09 PM
Puntoboy Puntoboy is offline
 
Join Date: Sep 2005
Location: Northampton UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Oap JTRipper View Post
working fine for me

vb 3.6 rc2
vba 2.2

www.oapsquad.com/forums/

if your using custom themes have you done this
PHP Code:
Thishowevermay not be working with some custom skins if navbar template's codebit are changed. To fix that problem, open Banner System plugin (at global_start hook), replace the whole content with:

// Banner Ads System by tnguy3n
if($vbulletin->options['
bannersys_mode'])
{
    $getads = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "

bannersys_banners WHERE status = '
1' ORDER BY RAND() LIMIT 1");
    $ads = $vbulletin->db->fetch_array($getads);

    // print banner ads
    eval('
$bannerads "' . fetch_template('bannerads') . '";');

    $vbulletin->db->free_result($getads);
    unset($getads);

I have done this but the ads do not show...:down:
Reply With Quote
  #281  
Old 06-12-2007, 07:32 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This has always worked for me..

Where is the download??? I understand you are selling a version now but to remove the older version and leave the whole thread is just not right....

I don't have a spare $20 right now and would like to download the one that was here... Does anyone have it?? Please??
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 02:06 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
  • Page Generation 0.05301 seconds
  • Memory Usage 2,459KB
  • 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
  • (1)bbcode_html
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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