vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Rotating Banner System (https://vborg.vbsupport.ru/showthread.php?t=188328)

y2ksw 08-02-2009 05:47 PM

Paste this in an empty file and call it as you like, e.g. rbs_html.php

PHP Code:

<?php
error_reporting
(E_ALL & ~E_NOTICE);
define('SKIP_SESSIONCREATE'1);
define('NOCOOKIES'1);
define('THIS_SCRIPT''rbs_blank');
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();
require_once(
'./global.php');
$html '<html>
<head>
 <title>Rotating Banner System</title>
</head>
<body>
<!--@vbbanners:0@-->
</body>
</html>'
;
eval(
'print_output("' $html '");');
?>

Within the HTML, you call this script, for example:

HTML Code:

<html>
<head>
 <title>Untitled</title>
</head>
<body>
    <iframe src="rbs_html.php" width="468" height="85" scrolling="no"></iframe>
</body>
</html>

rbs_html.php should stay in the forum home to work properly.

leylandfor 08-02-2009 06:24 PM

Hi

I have successfully got this mod displaying a banner in the header of my forum, but i would like it to display in the footer of each page too.

I have tried to edit footer, forumdisplay templates etc but it doesnt work, could someone give me step to step info on how to add a banner to footer of all pages please?

Thanks

y2ksw 08-02-2009 06:48 PM

Maybe you don't have enough banners in your database?

pitzerwm 08-02-2009 08:45 PM

I've added my banners and things are looking good. JFYI, the click counter didn't appear to be working as expected, I had the "limit" set at 0, when I make it 1M it appeared to count. I have only tested that a couple of times, while checking the links and getting the banners loaded. I'm thinking that it has to do with "refreshing" like seeing the menu correctly needed logging out and back in.

As I also remember reading some previous posts, there was a discussion whether the banners rotated without "refreshing" the forum page. In my case it does appears to need the page refreshed, to bring up a different banner, which BTW is fine with me.

pitzerwm 08-03-2009 02:36 AM

Quote:

Originally Posted by y2ksw (Post 1839744)
If you insert the flash in the image field, it works half and half. The Flash needs to have the right link inside, else it won't work.

If you prefer to use the code, you also will need to cover the flash with a transparent gif, as shown here. Then you may use a different link, but still you will have to code each Flash banner manually.
HTML Code:

<div>
    <div style="z-index: -1; position: absolute; height: 468px; width: 60px;">
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="468" height="60">
            <param name="movie" value="images/banners/yourflash.swf" />
            <param name="quality" value="high" />
            <param name="wmode" value="transparent" />
            <embed src="images/banners/yourflash.swf" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60" ></embed>
        </object>
    </div>
    <div style="z-index: 10; position: absolute; width: 468px; height: 60px;">
        <a href="http://www.domain.tld/yourlink" target="_blank"><img alt="" border="0" height="60" src="img/transparent.gif" width="468" /></a>
    </div>
</div>


I have been messing with this trying to get it to work, and one thing, in the 2nd div line did you get the dimensions backwards? When I use this on my page, the banner is off to the right almost off the page, with about 10% showing. (my banner is on the right side of the pages.

I'm not understanding Reset Notifications, does this reset the counters, i.e. at the end of the month after a report has been sent?

If not have you thought about being able to reset the counters i.e. at the end of the month.

Thanks again for a great mod.

y2ksw 08-03-2009 08:47 AM

Quote:

Originally Posted by pitzerwm (Post 1860312)
I've added my banners and things are looking good. JFYI, the click counter didn't appear to be working as expected, I had the "limit" set at 0, when I make it 1M it appeared to count. I have only tested that a couple of times, while checking the links and getting the banners loaded. I'm thinking that it has to do with "refreshing" like seeing the menu correctly needed logging out and back in.




As I also remember reading some previous posts, there was a discussion whether the banners rotated without "refreshing" the forum page. In my case it does appears to need the page refreshed, to bring up a different banner, which BTW is fine with me.

Clicks are counted only on "image" banners, and only if click tracking is enabled. If the Max Clicks limit is set to 0, any number of clicks are allowed, else, the banner hides when the number of clicks has reached that value. I have tried that also on 3.6.8.

To see the number of clicks (and other data) updated, you need to browse the banners in ACP, no AJAX or other magic there ;)

As for your PM, the error page you show is probably coming from a "missing page". If your rbs_html.php file is in the /forum/ folder, the IFRAME source must read: src="/forum/rbs_html.php". In fact, it does not appear to exist in /

If you need cycling the banners at certain intervals, the above HTML can be changed with a REFRESH meta tag, so your banners would rotate at your refresh rate.

y2ksw 08-03-2009 08:51 AM

Quote:

Originally Posted by pitzerwm (Post 1860467)
I'm not understanding Reset Notifications, does this reset the counters, i.e. at the end of the month after a report has been sent?

This option resets a flag which indicates the mail was sent to users. This is useful if the mail has not arrived or if you test your settings, in order to repeat the notification.

pitzerwm 08-03-2009 04:22 PM

Thanks again, I found that I had a "line" at the top of the rbs_html.php code. Its always something small. It is working, I just need to "adjust" it a little to fit in the iframe right.

As for "rotating" the banner, there appeared to be some confusion as to whether it rotated on its own, without refreshing the page or when the page was refreshed. On my site it rotates when the page is refreshed which is fine for me.

pitzerwm 08-03-2009 06:13 PM

Quote:

Originally Posted by y2ksw (Post 1860223)
Paste this in an empty file and call it as you like, e.g. rbs_html.php

PHP Code:

<?php
error_reporting
(E_ALL & ~E_NOTICE);
define('SKIP_SESSIONCREATE'1);
define('NOCOOKIES'1);
define('THIS_SCRIPT''rbs_blank');
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();
require_once(
'./global.php');
$html '<html>
<head>
 <title>Rotating Banner System</title>
</head>
<body>
<!--@vbbanners:0@-->
</body>
</html>'
;
eval(
'print_output("' $html '");');
?>


I was having a problem with the banner lining up in the iframe, and with some outside help found that if you add this in the above code will fix it.

PHP Code:

<head>
 <
title>Rotating Banner System</title>
</
head>
<
style type=\"text/css\">

<!--
body {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
}
-->
</style>

<body> 

IMPORTANT: there is also a "\" at type=\"text/css\"> which appears to get killed in the above code.

I also added the margin controls in the html code.

<iframe src="/forum/rbs_html.php" width="600" height="80" scrolling="no" marginheight="0" marginwidth="0" ></iframe>

One or both of these fixed it tested in IE 5 and FireFox 3.5

y2ksw 08-03-2009 10:06 PM

I meant the refresh inside the small HTML snipplet ... of course you may also refresh the main page. :)

All double quotes must be escaped with \" in the PHP code I sent, else part or all of the HTML code disappears. Thus:

<style type="text/css"> => <style type=\"text/css\">


All times are GMT. The time now is 12:10 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.03263 seconds
  • Memory Usage 1,776KB
  • 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
  • (2)bbcode_html_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)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