vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - Banner Rotator (https://vborg.vbsupport.ru/showthread.php?t=169266)

ErnestA 01-08-2009 02:51 AM

I'm using it with IE7 and it works just fine.

ErnestA 01-09-2009 08:24 PM

Track Banner Usage!

I've read a few posts from people with the same issue that I have. This product would be perfect if you could track which banners are displayed and how often. If you're charging for advertising, this is almost a requirement.
Well, being a programmer myself, I decided to figure out a very simple way to track it. Now, you'll have to query the database manually yourself to get the statistics, if I get adventurous down the road I might add that. But for now, at least the database will track the banners that get displayed and when.

This information is provided AS IS with no warranty or liability at all. Use it at your own risk!

First of all, open a connection to your database (I assume Mysql). Use the following create table statement. If you don't have command line access, you may want to try integrating this create table statement with the product.xml file.

We're going to create a new table to track banners. So issue the following command at the Mysql command prompt:
CREATE TABLE brotatorlog (bid smallint(20) unsigned, name varchar(255), bannerdate TIMESTAMP);

Next, go into the admincp of vbulletin, go to "Plugins & Products" and click on "Plugin Manager"
Click on the link to edit banner rotator. In the plugin PHP code window, scroll all the way to the bottom of the window.

The last statement in this window should be:
$defaultdir . "/" . $ban['name'] . "' alt='" . $ban['alt'] . "' width='".$ban['width']."' height='".$ban['height']."' border='0'>";
}

Don't delete or modify any of the existing code. Insert the following code AFTER the above line.


if (!$ban['bid']) {
}
else
{
$db->query("INSERT INTO brotatorlog (bid, name) VALUES (".$ban['bid'].",'".$ban['name']."')");
}



Display a few banners then go into your mysql database and issue the following query:

select * from brotatorlog;

You should see something like this (excuse the poor formatting):

+------+-----------------------+---------------------+
| bid | name | bannerdate |
+------+-----------------------+---------------------+
| 1 | mybannera.jpg | 2009-01-08 18:14:32 |
| 2 | mybanner1.gif | 2009-01-08 18:16:37 |
+------+-----------------------+---------------------+

using the bid field, you can cross reference it back to the original brotator table with an SQL join query. Remember to periodically purge that table.

Enjoy.

Ernest.:D

cagbaazee 01-11-2009 02:55 PM

will it works with version 3.8

jkcerda 01-14-2009 01:26 PM

getting an error that I did not get previously

Warning: move_uploaded_file(./images/brotator/FobNationBanner.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in [path]/admincp/brotator.php on line 65

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpYuMkT9' to './images/brotator/FobNationBanner.gif' in [path]/admincp/brotator.php on line 65

Any help will be appreciated

hope I am in the right area.

mmblz 01-14-2009 04:52 PM

I would be cool if this could let you set a different banner depending on the date...

ErnestA 01-17-2009 02:11 PM

Quote:

Originally Posted by cagbaazee (Post 1708647)
will it works with version 3.8

I'm running it in 3.8 and it it seems to be OK (even with the hack I made to it).

ErnestA 01-17-2009 02:13 PM

I haven't seen a post from the guy maintaining this mod for a while and he hasn't been online since Aug 2008. Is this mod dead? Because I really like it and would like to see it improved. If the original author doesn't want to maintain it any longer I'd consder taking it over.

ErnestA 01-17-2009 02:18 PM

Quote:

Originally Posted by jkcerda (Post 1712077)
getting an error that I did not get previously



Warning: move_uploaded_file(./images/brotator/FobNationBanner.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in [path]/admincp/brotator.php on line 65

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpYuMkT9' to './images/brotator/FobNationBanner.gif' in [path]/admincp/brotator.php on line 65


Any help will be appreciated

hope I am in the right area.


You have not mentioned much about your setup. Is it being hosted or is it your own server? Do you have root access? When you created the images/brotator sub directory did you chown it to your webuser (ex: apache)?

Is your PHP install running in SAFE mode? Because that could be the problem as well.
If your system is running selinux, check your audit.log file to see if httpd is being denied write access.

Post some real details about your setup and I'll try to help you out.

jkcerda 01-20-2009 09:51 PM

Quote:

Originally Posted by ErnestA (Post 1715783)
You have not mentioned much about your setup. Is it being hosted or is it your own server? Do you have root access? When you created the images/brotator sub directory did you chown it to your webuser (ex: apache)?

Is your PHP install running in SAFE mode? Because that could be the problem as well.
If your system is running selinux, check your audit.log file to see if httpd is being denied write access.

Post some real details about your setup and I'll try to help you out.

Fixed the issue, I have access to the server, its being hosted, now I need to find out hoew to get different images to show instead of the same on

Graphictr 01-22-2009 12:33 PM

Thanks


All times are GMT. The time now is 10:01 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.01357 seconds
  • Memory Usage 1,746KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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