vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Banner Ads System (https://vborg.vbsupport.ru/showthread.php?t=104432)

tnguy3n 01-03-2006 10:00 PM

Banner Ads System
 
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
https://vborg.vbsupport.ru/external/2010/02/12.gif

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

Hasann 01-04-2006 03:16 PM

very usefully thanks for sharing

croportal 01-04-2006 04:13 PM

thanks, very nice

mrusdy 01-04-2006 06:08 PM

nice & cool

Snake 01-04-2006 07:02 PM

Whoa this is great! Thanks! :D

jpt62089 01-04-2006 08:27 PM

will this work with Adsense?

Puntoboy 01-04-2006 09:15 PM

is this just a simplified version of PHPadsnew?

TheAllusionist 01-05-2006 02:09 AM

Great I had one for 3.07 and have been looking for something like this. Quick question, are the banners linked to the advertiser or are they just images that rotate? Asking because I really need something that links to the sponsor's site. Either way, nice work!

zahrani 01-05-2006 02:52 AM

Great one.. thanks
it's working smoothly.

athoob 01-05-2006 05:16 AM

wonderful thanks

JsnakeJ 01-05-2006 10:03 PM

Great work. You forgot the Banner added phrase though. ;) Also try having it in a template instead of how it is currently, its cutting off my skins navbar.

PennylessZ28 01-05-2006 10:08 PM

thanks

Rukas 01-06-2006 01:48 AM

Exactly what Ive been looking for, will install and test when I get home and then donate something for your trouble, thanks.

Rukas 01-06-2006 01:49 AM

Ahh question, can we put the banner wherever we want or does it just stick it where it sticks it??

tnguy3n 01-06-2006 04:07 AM

It stays fixed below navbar, but if you need to put it somewhere else, that would be easy to do too.

Akakios 01-06-2006 11:42 AM

Hallo,

ich habe auch installiert aber obwohl im Admin funktioniert, in Hauptseite sehe ich keinen Banner.
Wo mache ich Fehler?

Hasann 01-06-2006 11:51 AM

Hallo akakios,

doch es funktioniert aber du musst nach der installation Erlaubnis geben für die Mitglieder okei?

unter AdminCP> Banner System> Banner Settings> Show Banners to Logged In Users?> Yes und speichern

Akakios 01-06-2006 12:23 PM

Hallo Hasann

leider das hat auch nicht geholfen.
Bei mir steht "You can set whether to show banner ads to logged in users here." und habe ich YES Markieren und gespeichert. Ader trotzdrm erscheint keiner Banner.
Soll ich vielleicht ein "include" oder so was in Template schreiben?
Übrigens, es gibt keine "neue Template" in zip ordner.

Hasann 01-06-2006 12:34 PM

hmm..,
hast du schon mal product_bannersys.xml datei durch admincp> plugin manager importiert?
und welche version von vBulletin hast du?

tnguy3n 01-06-2006 03:18 PM

I wish I know what you guys talk about. :D

Akakios 01-06-2006 04:21 PM

Quote:

Originally Posted by Hasann
hmm..,
hast du schon mal product_bannersys.xml datei durch admincp> plugin manager importiert?
und welche version von vBulletin hast du?

Ich habe alle richtig installiert. Und zwar banner erscheint sich im Admin dass installiert ist.
Ich habe die 303 Version. Ich habe aber andere Template. Blue Wonder. Ist vielleicht das sProblem?

Akakios 01-06-2006 04:26 PM

Quote:

Originally Posted by tnguy3n
I wish I know what you guys talk about. :D

Sorry but my English is poor.
I have problem with Banner Ads System. I have installed but I can not to see the Banner.
But in Admin I see th Banner.
I have 303 version und Blue Wonder Template.
That is my problem. :disappointed:

tnguy3n 01-06-2006 05:16 PM

This banner hack is for vbulletin version 3.5.x. It wouldn't work in vb 3.0.3.

Akakios 01-06-2006 06:41 PM

Ok! Thank you.
Do you know a good banner programm for 3.0.3?

guyfox 01-07-2006 06:26 AM

im running 3.5.1 and the .org banner shows when a guest shows but thats all I see. Seems like I'm missing a bunch of stuff. Only screen I can find in my boards from the screenshots is the 1st one. I'm noob and probably missing something. Any help is appreicated.

tnguy3n 01-07-2006 07:00 AM

vBulletin Options -> Banner System Settings, check Yes to "Show banners to logged in users".

kadafi_alive 01-07-2006 05:17 PM

Hi,

How would I let display at the top right hand corner?

JohnnyClark 01-07-2006 08:41 PM

I have a problem, when i click the link on my forum home, it doesnt take me to the place. Its an error, 404... IT adds "amp;" to my link

TheAllusionist 01-08-2006 05:06 AM

IT would be nice if there was some documentation or a post explaining what the 'call' is named and where it is placed, so we could relocate it as needed. I am not a coder, but I didn't find the code in navbar or forumhome with a cursorary search. It does work on my current theme, but a theme I have in developement has side nav bar and not the horizontal ones on top, hence I thought it would be in the nav bar template. Anyway, if some one could post what I am looking for I imagine I could relocate it! :cool: Thank you for your time.

kadafi_alive 01-08-2006 10:59 AM

I have managed to add it to the top, however, it stays in the middle instead of right aligning. Anyone know how to do that?

tnguy3n 01-08-2006 11:23 AM

I'll write the docs for this later. For those who want to show the ads somewhere else, alter the codes in Banner System plugin.

djkristoff 01-08-2006 04:16 PM

Database error in vBulletin 3.5.3:

Invalid SQL:
CREATE TABLE IF NOT EXISTS bannersys_banners (
bannerid int(10) NOT NULL auto_increment,
bannername varchar(200) NOT NULL,
bannerdesc varchar(250) NOT NULL,
bannerurl varchar(250) NOT NULL,
imgurl varchar(250) NOT NULL,
bwidth mediumint(4) NOT NULL,
bheight mediumint(4) NOT NULL,
status tinyint(1) NOT NULL default '1',
PRIMARY KEY (bannerid)
) ENGINE=MyISAM AUTO_INCREMENT=1;

MySQL Error : You have an error in your SQL syntax near 'ENGINE=MyISAM AUTO_INCREMENT=1
' at line 11
Error Number : 1064
Date : Sunday, January 8th 2006 @ 11:15:54 AM
IP Address : 68.148.132.214
Username : kristoff
Classname : vb_database

djkristoff 01-08-2006 04:34 PM

works fine after you remove the MyISAM etc ...

A few suggestions that would really help boost this package would be:

- Scheduled Banner Expiration (give a start / end date to which the banner is valid)
- Allow the banners to be uploaded to the board into a folder or the db, instead of linking from an external source
- if there is no link for the banner, remove the <a href> and just show it as a normal image. some people just dont have a website to link to and are just interested in showing their banner.

other than that great job! nice package. helps alot.

TheAllusionist 01-08-2006 05:09 PM

Quote:

Originally Posted by tnguy3n
I'll write the docs for this later. For those who want to shade the ads somewhere else, alter the codes in Banner System plugin.

Thanks! This is a sweet plugin thanks for sharing it.

tnguy3n 01-08-2006 06:19 PM

Quote:

Originally Posted by djkristoff
works fine after you remove the MyISAM etc ....

thanks, will fix that. I used MyISAM as default engine.

guyfox 01-08-2006 11:33 PM

I actually had to click no then yes again to get it to work lol. Works great though. Does exactly what it needs to, well done.

EchoZA 01-09-2006 11:48 AM

Quote:

Originally Posted by djkristoff
works fine after you remove the MyISAM etc ...

A few suggestions that would really help boost this package would be:

- Scheduled Banner Expiration (give a start / end date to which the banner is valid)
- Allow the banners to be uploaded to the board into a folder or the db, instead of linking from an external source
- if there is no link for the banner, remove the <a href> and just show it as a normal image. some people just dont have a website to link to and are just interested in showing their banner.

other than that great job! nice package. helps alot.


I had the same problem, removed the MyISAM line, re-upload the .xml file and all ran fine, but now when I try log into my ADMIN CP I get the following error,

Code:

Database error in vBulletin 3.5.3:

Invalid SQL:
SELECT * FROM bannersys_banners WHERE status = '1' ORDER BY RAND() LIMIT 1;

MySQL Error  : Table 'vbulletin_treatingyourself_com.bannersys_banners' doesn't exist
Error Number : 1146
Date        : Monday, January 9th 2006 @ 08:46:34 AM
Script      : http://www.treatingyourself.com/vbulletin/login.php
Referrer    :
IP Address  : 209.203.59.78
Username    : Administrator
Classname    : vb_database

Please help!

EchoZA 01-09-2006 12:24 PM

^^^ I'm going to install phpmyadmin see if I can add the tables manually, looks like the tables were not added :(

EchoZA 01-09-2006 01:05 PM

If I add the code from the .xml in via phpmyadmin, as follows.

Code:

("CREATE TABLE IF NOT EXISTS " . TABLE_PREFIX . "bannersys_banners (
  bannerid int(10) NOT NULL auto_increment,
  bannername varchar(200) NOT NULL,
  bannerdesc varchar(250) NOT NULL,
  bannerurl varchar(250) NOT NULL,
  imgurl varchar(250) NOT NULL,
  bwidth mediumint(4) NOT NULL,
  bheight mediumint(4) NOT NULL,
  status tinyint(1) NOT NULL default '1',
  PRIMARY KEY (bannerid)
)
");

I get the following error,

Code:

#1064 - You have an error in your SQL syntax near '("CREATE TABLE IF NOT EXISTS " . TABLE_PREFIX . "bannersys_banners (
  bannerid' at line 1

Please could I have some help, I'm a little new at this :(

tnguy3n 01-09-2006 02:04 PM

Quote:

Originally Posted by EchoZA
If I add the code from the .xml in via phpmyadmin, as follows.

Code:

("CREATE TABLE IF NOT EXISTS " . TABLE_PREFIX . "bannersys_banners (
  bannerid int(10) NOT NULL auto_increment,
  bannername varchar(200) NOT NULL,
  bannerdesc varchar(250) NOT NULL,
  bannerurl varchar(250) NOT NULL,
  imgurl varchar(250) NOT NULL,
  bwidth mediumint(4) NOT NULL,
  bheight mediumint(4) NOT NULL,
  status tinyint(1) NOT NULL default '1',
  PRIMARY KEY (bannerid)
)
");

I get the following error,

Code:

#1064 - You have an error in your SQL syntax near '("CREATE TABLE IF NOT EXISTS " . TABLE_PREFIX . "bannersys_banners (
  bannerid' at line 1

Please could I have some help, I'm a little new at this :(

because you didn't get the database table right.
try:
PHP Code:

CREATE TABLE IF NOT EXISTS bannersys_banners (
  
bannerid int(10NOT NULL auto_increment,
  
bannername varchar(200NOT NULL,
  
bannerdesc varchar(250NOT NULL,
  
bannerurl varchar(250NOT NULL,
  
imgurl varchar(250NOT NULL,
  
bwidth mediumint(4NOT NULL,
  
bheight mediumint(4NOT NULL,
  
status tinyint(1NOT NULL default '1',
  
PRIMARY KEY (bannerid)


and if you have table prefix, add it before the table name.


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

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.01589 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete