vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   DHC Banner Ads - Upgrade [1.4] (https://vborg.vbsupport.ru/showthread.php?t=79738)

Xenatino 04-09-2005 10:00 PM

DHC Banner Ads - Upgrade [1.4]
 
Upgrade now available

DHC Banner Ads Hack

This script allows you to manage the banner advertisments on your vBulletin board from within the Admin Control Panel. Currently not integrated with PayPal, NoChex so payment will have to remain seperate, although this is set for later releases.

Features

? Display Banner Ads on every page
? Limit display of ads to so many clicks or views
? Turn off display of ads for certain usergroups
? Count clicks and views through Admin CP
? Keep banner ads in database but dont include them in rotation (ie: If maximum views has been reached)
? Auto deactivate when maximum clicks/views are reached
? Displays stats of ads in specified users control panel
? End date and time for banners (Limit or Unlimited)
? Multiple banners per page, using a locations script

Please don't forget to hit the Install button if you use this hack - It helps me judge how popular this hack is and how far to carry on supporting it



*UPDATE* [17th Apr 05] v1.4 Released! Download new ZIP file and either do fresh install or upgrade from previous version!

v1.2.1 - All queries now include TABLE_PREFIX for boards that use this function
Steps have also been taken to prevent SQL Injection

Marco van Herwaarden 04-10-2005 09:39 PM

Quote:

Originally Posted by Xenatino
Bad start already, forgot to attach the ZIP File :rolleyes:

Just edit your first post and add the file please.

Marco van Herwaarden 04-10-2005 09:45 PM

Thanks for sharing your work. A few remarks though after a quick view of the code:

- You are not using TABLE_PREFIX in all your queries, so this hack will not work for boards using a table prefix.
- There are some places in the coding vulnerable to SQL injections. Please validate all values before using them in a query.

eXtremeTim 04-10-2005 09:46 PM

Does this hack check secondary user groups?

Xenatino 04-10-2005 09:52 PM

Quote:

Just edit your first post and add the file please.
Have done, feel free to delete my reply.

Quote:

Thanks for sharing your work. A few remarks though after a quick view of the code:

- You are not using TABLE_PREFIX in all your queries, so this hack will not work for boards using a table prefix.
- There are some places in the coding vulnerable to SQL injections. Please validate all values before using them in a query.
I thought I had used TABLE_PREFIX wherever I could, I will check again and re-upload. Also, thanks for the advice on SQL injection, will sort all that out now...

Quote:

Does this hack check secondary user groups?
Not in this version no, I will arrange for that to be coded into the next version

Nordinho 04-10-2005 10:15 PM

this looks very promising!!

007 04-10-2005 10:24 PM

Very cool! How about instead of expiring after so many views or clicks, how about also just after so much time? I am interested but it would be really cool to be able to set how long the ad should be active too. Maybe have it show how much time it has left in the AdminCP?

~006

Xenatino 04-10-2005 10:26 PM

Future releases will include the ability to limit by time as well.

This was originally coded into the script on my own site, but due to sloppy coding I decided to elave it out until future releases.

tp214 04-11-2005 01:55 AM

UPDATED!


alright well i fixed it for the controls to be put in the admincp

find: (in admincp/index.php)

Code:

$printhr = false;
        if (can_administer('canadminstyles'))
        {        $printhr = true;

add below:

Code:

construct_nav_option($vbphrase['banner_view'], 'dhcbannerads.php?do=view', '<br />');
construct_nav_option($vbphrase['banner_add'], 'dhcbannerads.php?do=add', '<br />');
construct_nav_group("DHC Banner System", '<hr />');

Add 2 more phrases:

first-
phrase type: global
varname: banner_view
text: View Current DHC Banners

Second-
phrase type: global
varname: banner_add
text: Add a DHC Banners

Then in footer template:

find:
Code:

<br />
<div class="smallfont" align="center">$vbphrase[all_times_are_gmt_x_time_now_is_y]</div>

replace with:
Code:

<br />
<div align="center">$banner_ad &nbsp;</div>
<br />
<div class="smallfont" align="center">$vbphrase[all_times_are_gmt_x_time_now_is_y]</div>

The last edit is for only if you want it at the bottom of the page...

jugo 04-11-2005 02:18 AM

Very Awesome..>Can't wait for the PayPal integrated version...This will be very cool.

tp214 04-11-2005 02:24 AM

apparently you can only have banners that are 468 by 60 pixels, fix please...

Xenatino 04-11-2005 08:39 AM

tp214: Thank you for the updates and I will add these to the release tonight.

Also, I will allow for multiple sizes to be entered in the Admin CP determining the size of the banner.

Future releases are set to include:

Multiple banners per page
Checking of secondary usergroups
Specifying which forums certain banners will be shown in
Limit by time/days
Paypal integration for automatic setup (with admin moderation of banners)
Setup of packages, ie: 1000 views for $5 preset etc... (Custom packages)

Next release due: 13th April

The Realist 04-11-2005 08:58 AM

Does this hack rotate banners?

The Realist 04-11-2005 08:59 AM

Nice ideas but we have nochex as well for us mortals that dont use Paypal. And instead of multiple banners per page, what about banner rotation as well, or even a choice of multiple or rotation.

Quote:

Originally Posted by Xenatino
tp214: Thank you for the updates and I will add these to the release tonight.

Also, I will allow for multiple sizes to be entered in the Admin CP determining the size of the banner.

Future releases are set to include:

Multiple banners per page
Checking of secondary usergroups
Specifying which forums certain banners will be shown in
Limit by time/days
Paypal integration for automatic setup (with admin moderation of banners)
Setup of packages, ie: 1000 views for $5 preset etc... (Custom packages)

Next release due: 13th April


Xenatino 04-11-2005 09:31 AM

Currently the script selects a random banner from the list on each refresh or page change. Everytime the header script is loaded a random banner will be chosen.

Also, NoChex will be integrated with this script, I thought I had mentioned that but looking back i forgot to.

The Realist 04-11-2005 10:18 AM

I just installed it and added 2 banners, but only the 1st one in the list is showing, they are not rotating?

Laters

vulture 04-11-2005 11:36 AM

Can it display the amazon <Iframe> based banners?

Xenatino 04-11-2005 02:59 PM

Quote:

Originally Posted by The Realist
I just installed it and added 2 banners, but only the 1st one in the list is showing, they are not rotating?

Laters

Make sure that the other banner is set to active in the Admin CP

Quote:

Can it display the amazon <Iframe> based banners?
Not yet, no. Only images can be used as banners.

Again, next release is due 13th April so watch out for the features in that

Xenatino 04-11-2005 10:14 PM

The Realist: After a few debugging minutes I found out the error in the script that does not allow one of the banners to be shown.

In /includes/functions_bannerads.php find
PHP Code:

$random rand(0,$max); 

and change it to
PHP Code:

$random rand(0,($max+1)); 

Or alternativley you can just re-download the zip file and get the updated functions_bannerads.php

The Realist 04-11-2005 10:22 PM

I'll download it now M8 and give it a test.

The Realist 04-11-2005 10:31 PM

Somethings not right M8. When I enable just one of the 2 banners I get the one showing up fine and then on rotation the other shows up but as a 468x60 box with a red x.

Also the 2nd banner should not show as its disabled and also the path of the 2nd blank banner is wrong, if I right click and view properties the path is wrong?

HELP?

The Realist 04-11-2005 10:38 PM

I put the original code back in as you pointed out above, and now my banners work but dont rotate?

The Realist 04-12-2005 11:49 AM

Well I woke up this morning after putting the original code back and the banners are now rotating?

Work that one out?

Xenatino 04-12-2005 01:53 PM

Possibly to do with your cache, or maybe an error on your server.

Currently working on next release...

turkforum 04-13-2005 09:25 PM

waiting for the 13th today is 13th ehhhee

Xenatino 04-14-2005 07:05 AM

Many additions have been made to the script and this release will be out soon. Just tweaking some bugs before I release to public.

v1.4 Release Features
• Unlimited banners per page based on a location script
• Majority of bugs from 1.2.1 fixed and in fully working order
• Now allows for different banner types: Image/Flash/Custom Code (If you select Custom Code you have the option to input your own code with basic variables)
• Banner size included in Admin CP
• End date/time for banner included to allow limiting by timespan

Tigur 04-15-2005 12:16 PM

can't wait. Any idea when?

Xenatino 04-16-2005 11:59 PM

Version 1.4 has been released. Sorry for the delay but their were more bugs in my code than I thought would be!

Let me know what you think of the upgrades and what else can be done to improve it?

Densit5 04-19-2005 04:11 AM

Er - i tried to do a 1st install - when i click the install button on the install_bannerads.php page - it comes up with

Not Found
The requested URL /forum/admincp/.php was not found on this server.

Densit5 04-19-2005 04:39 AM

wtf ?

print_form_header('install_bannerads', 'sql'); =

<!-- form started: 5 queries executed -->
<form action=".php" name="messageform" method="post"> :squareeyed:

Densit5 04-19-2005 05:35 AM

K bypassed that problem - then i came across a prefix problem in functions_bannerads.php

line 34
is
$GetUsergroup = $DB_site->query_first("SELECT displayads FROM usergroup WHERE usergroupid='$bbuserinfo[usergroupid]'");

should be
$GetUsergroup = $DB_site->query_first("SELECT displayads FROM ".TABLE_PREFIX."usergroup WHERE usergroupid='$bbuserinfo[usergroupid]'");

Xenatino 04-19-2005 08:49 PM

Densit5: Sorry for the errors, can you tell me please how you bypassed that error and I will try and incorporate it into the script.

Also, I will be sure to include that update above into the script

sunnycher 04-20-2005 03:15 AM

So we shouldn't install this until you have fixed the problem densit5 is having?
I'm so looking forward to this one!
Thank you X!

Xenatino 04-20-2005 08:00 PM

All changes have been made. Installation runs smoothy now, tested on 2 different servers!

dynaimc 04-21-2005 03:14 PM

Good feature, installed!

Is there a way to add a feature in the next version that will allow you to have the link open in a new (_blank) window or the same (_self) window? So ads that relate to in-forum ads (like promoting a new feature or forum in the same forum) open in the same window, and external links open in a new window?

Thanks!

sunnycher 04-21-2005 03:44 PM

Great idea dynamic! That way they don't leave your forum.
Thanks Xenatino!!

sunnycher 04-21-2005 04:03 PM

I'm coming up with a Parse error: parse error, unexpected '/' in /home/content/c/h/e/cher123/html/community/global.php on line 522 while installing. can't get past it.

sunnycher 04-21-2005 04:32 PM

----------------------------------------------------------------------
/global.php (1 Change)
----------------------------------------------------------------------
FIND

eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');

ADD ABOVE

// <DHC>
require_once('./includes/functions_bannerads.php');
$TotalSlots = get_banner_slots();
for ($x=1; $x < ($TotalSlots+1); $x++)
{
$banner_ad[$x] = print_random_banner($x);
}
// </DHC>
----------------------------------------------------------------------

This is where I'm having the problems so far.
If I do this to my global.php that is in my FORUM root directory, I get the above error.
Looking at this /global.php (1 Change) it makes it look as though there should be a global.php in my main ROOT directory?

Xenatino 04-21-2005 07:02 PM

Quote:

Originally Posted by dynaimc
Good feature, installed!

Is there a way to add a feature in the next version that will allow you to have the link open in a new (_blank) window or the same (_self) window? So ads that relate to in-forum ads (like promoting a new feature or forum in the same forum) open in the same window, and external links open in a new window?

Thanks!

Thank you for this suggestion, I will be usre to implement it into the next release

Densit5 04-28-2005 08:58 PM

Been busy the past week - i am now looking back at the problem i am still having - I think its a problem with my v bulletin site - as i run the install_bannerads.php file - when i hit the Start installation button - it redirects me to .php which does not exist.

code i have is :-

<!-- form started: 5 queries executed -->
<form action=".php" name="messageform" method="post">
<input type="hidden" name="do" value="" />
<br />
<table cellpadding="4" cellspacing="0" border="0" align="center" width="65%" class="tborder">
<tr>
<td class="tcat" align="center" colspan="2"><b>vBulletin Message</b></td>

</tr>
<tr valign="top">
<td class="alt1" colspan="2"><blockquote><br />This script will install the necessary MySQL data to run DHC Banner Ads...<br /><br /><input type="submit" value="Start Installation"><input type="hidden" name="do" value="sql"><br /><br /></blockquote></td>
</tr>
<tr>
<td class="tfoot" colspan="2" align="center"> <input type="button" class="button" value="Go Back" tabindex="1" onclick="window.location='javascript:history.back(1)';"/> </td>
</tr>
</table>
</form>
<!-- form ended: 5 queries executed -->

i think its a problem in my global.php file somewhere, am investigating. i by passed it by creating some manual form code in the install php file that call the sql function, which worked. So i dont think your code is at fault here. But i will find out why hopefully soon.


All times are GMT. The time now is 04:39 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.01465 seconds
  • Memory Usage 1,831KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)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