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)

KrisP 08-04-2009 09:31 PM

delete

eric8476 08-05-2009 02:47 PM

is there a banner rotator for for under the first post?

y2ksw 08-05-2009 09:49 PM

Quote:

Originally Posted by eric8476 (Post 1861940)
is there a banner rotator for for under the first post?

There is a template called ad_showthread_firstpost where you may insert a placeholder in order to show a rotating banner.

eric8476 08-06-2009 05:42 PM

what does the placeholder look like

edit: I found it.

eric8476 08-06-2009 07:05 PM

ads are not running

eric8476 08-06-2009 08:21 PM

I removed the first two IDs and none of the banners are running.

y2ksw 08-07-2009 06:45 AM

Quote:

Originally Posted by eric8476 (Post 1862698)
what does the placeholder look like

edit: I found it.

Quote:

Originally Posted by eric8476 (Post 1862745)
ads are not running

There are many reasons why an ad could not run. But the most frequent reason is, you have not inserted the placeholder in any of the templates.

Also, it may happen you have restricted your banner set too much. Please try the inbuilt banners first, and if they fail, ask here. Also make sure to read the help, included in the package.

As for your PM (please don't post PM's if you can ask here), if you need to show one banner more often than others, just insert duplicate that one for as many times you need. A weight of 1:5 of 2 banners require to insert the second 5 times. You may use this script to duplicate banners 10 times (insert your values first):

PHP Code:

<?php
// No support provided!

define('MULTIPLIER'9);
define('USER''youruser');
define('PASS''yourpass');
define('HOST''localhost');
define('DBNAME''yourdb');
define('TABLE_PREFIX''');
 
$banner_id intval($_GET['id']);
mysql_connect(HOSTUSERPASS);
mysql_select_db(DBNAME);
$SQL "SELECT *
    FROM " 
TABLE_PREFIX "rbs_banners
    WHERE id=
$banner_id";
$rss mysql_query($SQL);
$rs mysql_fetch_assoc($rss);
mysql_free_result($rss);
if(!
$rs)
{
    echo 
"<br />Banner $banner_id not found";
    die;
}
$k = array();
$v = array();
foreach(
$rs AS $key => $value)
{
    if(
$key == 'id')
    {
     continue;
    }
    
$k[] = "`$key`";
    
$v[] = "'" addslashes($value) . "'";
}
$SQL "INSERT INTO " TABLE_PREFIX "rbs_banners (" implode(','$k) . ") VALUES (" implode(','$v) . ")";
for(
$i 0$i MULTIPLIER$i++)
{
    
mysql_query($SQL);
}
echo 
"<br />Banner $banner_id duplicated";
die;
?>


CLSSY56 08-15-2009 11:26 AM

Thanks for the mod, this works great! I use it in 3 different places on my homepage.

Wonksta 08-26-2009 12:16 AM

Does this work with animated gifs at all? I am using OpenX as the ad server so I just paste the insert code in this module but it only loads animated gifs for a split second than dissapears (the image). I revert back to a jpg and all is fine.... Odd...

y2ksw 08-26-2009 06:45 AM

Quote:

Originally Posted by SighK (Post 1874470)
Does this work with animated gifs at all? I am using OpenX as the ad server so I just paste the insert code in this module but it only loads animated gifs for a split second than dissapears (the image). I revert back to a jpg and all is fine.... Odd...

Yes it does.

Sounds like a browser issue to me ...

naz7 08-27-2009 03:17 PM

no luck in displaying the built in ads....
installed 2.2.1.rbs.zip and 2.2.1.hotfix.admin_rbs.zip on my vb 3.8.4.

correct me if i'm wrong, if i place code below
<!--@vbbanners:2@-->
should display the google image.

Appreciate if there is really a detailed step by step in putting the ad using this mod...

y2ksw 08-27-2009 03:33 PM

Quote:

Originally Posted by naz7 (Post 1875315)
no luck in displaying the built in ads....
installed 2.2.1.rbs.zip and 2.2.1.hotfix.admin_rbs.zip on my vb 3.8.4.

correct me if i'm wrong, if i place code below
<!--@vbbanners:2@-->
should display the google image.

Appreciate if there is really a detailed step by step in putting the ad using this mod...

<!--@vbbanners:0@-->
should display the samples which install together with the product. When those work on your site, also other scripts should work

naz7 08-28-2009 02:20 AM

y2ksw...thanks for amazing response!
i had it working now in vb 3.8.4.

but 1 q:
In the horizontal banner list, the ID for the samples are 1 and 2.
If i insert <!--@vbbanners:0@-->, it will show the sample ID1, which is google text.

is this a bug or something i amiss?

anyway, great mod!

y2ksw 08-28-2009 06:36 AM

Quote:

Originally Posted by naz7 (Post 1875588)
y2ksw...thanks for amazing response!
i had it working now in vb 3.8.4.

but 1 q:
In the horizontal banner list, the ID for the samples are 1 and 2.
If i insert <!--@vbbanners:0@-->, it will show the sample ID1, which is google text.

is this a bug or something i amiss?

anyway, great mod!

Samples 1 and 2 are horizontal banners.

<!--@vbbanners:0@--> is a placeholder which will show horizontal banners, or better, banners which are located at position 0. the Placeholders don't show banners by ID, else they won't rotate at all. At the current state of development, you may use up to 10 different banner locations for any number of banners each. Banner locations 0 and 1 reflect the old positions horizontal and vertical respectively.

eric8476 10-08-2009 10:20 AM

the <!--@vbbanners:0@--> placeholder does not work can we rotate more than two banner spots for location?

y2ksw 10-08-2009 11:28 AM

Quote:

Originally Posted by eric8476 (Post 1896517)
the <!--@vbbanners:0@--> placeholder does not work can we rotate more than two banner spots for location?

if this placeholder does not work for you, you may define your own in the options. Please make sure it contains %d, which identifies the location. For the rest you are free to choose what you like.

You may define as many banners you wish for each location.

eric8476 10-08-2009 11:55 AM

the @vbbanners@ placeholder shows the sample spots only

y2ksw 10-08-2009 04:19 PM

If you have inserted your banners and they don't show up, probably your rules are too restrictive.

eric8476 10-08-2009 10:34 PM

more than two ads are running, thanks for the plugin

eric8476 10-13-2009 01:39 PM

<!--@vbbanners:2@--> appears as <!--@vbbanners:2@--> on the forum?

y2ksw 10-13-2009 03:49 PM

Quote:

Originally Posted by eric8476 (Post 1899086)
<!--@vbbanners:2@--> appears as <!--@vbbanners:2@--> on the forum?

A HTML comment should not become visible ... unless it isn't inserted in a post and encoded into:

&lt;!--@vbbanners:2@--&gt;

SVTCobraLTD 10-15-2009 02:48 PM

This does work in 3.8.X correct?

djbaxter 10-15-2009 02:51 PM

Quote:

Originally Posted by SVTCobraLTD (Post 1900361)
This does work in 3.8.X correct?

Yes it does.

all-in 10-23-2009 10:43 AM

I am currently running this on vB 3.8.x and it works great. I want to upgrade to the new 4.0 suite, will the banner system still work? Thanks

y2ksw 10-23-2009 11:56 AM

Quote:

Originally Posted by all-in (Post 1904242)
I am currently running this on vB 3.8.x and it works great. I want to upgrade to the new 4.0 suite, will the banner system still work? Thanks

Normal mortals have not yet seen, how vbulletin 4.x intends to handle old plugins and products. Most probably they will continue to work, but until it is released, tested and fixed from all of us, nobody could tell... :)

djbaxter 10-23-2009 12:15 PM

Quote:

Originally Posted by y2ksw (Post 1904284)
Normal mortals have not yet seen, how vbulletin 4.x intends to handle old plugins and products. Most probably they will continue to work, but until it is released, tested and fixed from all of us, nobody could tell... :)

I've been assuming that most will NOT work with vB4, given that most of the code has been rewritten. It would be nice if some of the better products and plugins continued to work but I think we're safest to assume that we'll be starting over in that respect.

We can hope that some of the developers of the major add-ons have been updating their products via the alpha-beta releases (e.g., as vBSEO is doing).

Sunka 10-25-2009 02:20 AM

Is it possible to MOD look only primary usergroup permission (see or not to see banners)?

Let me "picture" this :D

I am in Admin usergroup, and Admin usergroup not see banners.
After I create one custom usergroup, and make all Admins are leaders of that new usergroup, they are members of that additional usergroup too.
For that new usergroup is set up to SEE banners

So, I am in Admin usergroup (my primary usergroup) and in that Custom usergroup (Additional usergroup). And I see banners :D But I do not want it to see banners.

So is it possible to primary usergroup option is stronger that additional usergroup option?

y2ksw 10-25-2009 10:47 AM

Quote:

Originally Posted by Sunka (Post 1905767)
Is it possible to MOD look only primary usergroup permission (see or not to see banners)?

Let me "picture" this :D

I am in Admin usergroup, and Admin usergroup not see banners.
After I create one custom usergroup, and make all Admins are leaders of that new usergroup, they are members of that additional usergroup too.
For that new usergroup is set up to SEE banners

So, I am in Admin usergroup (my primary usergroup) and in that Custom usergroup (Additional usergroup). And I see banners :D But I do not want it to see banners.

So is it possible to primary usergroup option is stronger that additional usergroup option?

No. The function I use is "is_member_of()", which includes also all secondary group memberships.

all-in 11-20-2009 11:20 AM

Hey Y2KSW-
Have you had a chance to test the beta of 4.0 yet? Thanks in advance.


Quote:

Originally Posted by y2ksw (Post 1904284)
Normal mortals have not yet seen, how vbulletin 4.x intends to handle old plugins and products. Most probably they will continue to work, but until it is released, tested and fixed from all of us, nobody could tell... :)


y2ksw 11-20-2009 09:00 PM

Quote:

Originally Posted by all-in (Post 1917679)
Hey Y2KSW-
Have you had a chance to test the beta of 4.0 yet? Thanks in advance.

Yes, it still works. But who knows, maybe the code breaks for the Gold release? :p

Robert Waanders 11-24-2009 11:42 AM

Hey Guys,

I'm having trouble placing the banner on my forum... IN options -> rotating banners system options I've changed the Nth Placeholder to <!--@vbbanners:0@-->, I have placed this option in the header template as: [ad_header_logo]<else /><!--@vbbanners:0@--></if>

I don't see any banners at all... What am I doing wrong, yes there are the default headers, and i have created a banner myself on position 0...

Robert

oferelijah 11-24-2009 08:12 PM

can you add support to the modcp?
i want my mod's to handle this.

10x

RobbieZ 11-25-2009 12:06 AM

I have a customized header already that uses 2 images to create one long one.

How do i include your header template with my customized one so the banner/s sits on top of my right image?

Thanks

y2ksw 11-25-2009 10:00 AM

Quote:

Originally Posted by Robert Waanders (Post 1920084)
Hey Guys,

I'm having trouble placing the banner on my forum... IN options -> rotating banners system options I've changed the Nth Placeholder to <!--@vbbanners:0@-->, I have placed this option in the header template as: [ad_header_logo]<else /><!--@vbbanners:0@--></if>

I don't see any banners at all... What am I doing wrong, yes there are the default headers, and i have created a banner myself on position 0...

Robert

If you have changed the placeholder in the options to: <!--@vbbanners:0@-->, the banners never show up, because you actually try to use a constant. To make the banners work, they need to use a dynamid placeholder, where "0" must be "%d", thus: <!--@vbbanners:%d@-->

Some other valid examples:
@vbbanners:%d@
(mybanners:%d)
$my-ad-placeholder-%d-!

y2ksw 11-25-2009 10:03 AM

Quote:

Originally Posted by oferelijah (Post 1920357)
can you add support to the modcp?
i want my mod's to handle this.

10x

I'm not sure if this is a good idea. ;)

y2ksw 11-25-2009 10:11 AM

Quote:

Originally Posted by RobbieZ (Post 1920469)
I have a customized header already that uses 2 images to create one long one.

How do i include your header template with my customized one so the banner/s sits on top of my right image?

Thanks

If you want to include the banners within CSS headers, you will have to create a script which loads and renders a custom vbulletin page with the banners only. I'm not sure though, if the CSS: url() is capable to load and handle scripts correctly. Please ask a HTML/CSS specialist for advice.

If the CSS is included in vbulletin (the CSS is not saved to disk), and the banners are image only, it should be fine to include a placeholder in the appropriate place. If you save your CSS to file, you will have to use a custom script.

Robert Waanders 11-25-2009 11:01 AM

Quote:

Originally Posted by y2ksw (Post 1920635)
If you have changed the placeholder in the options to: <!--@vbbanners:0@-->, the banners never show up, because you actually try to use a constant. To make the banners work, they need to use a dynamid placeholder, where "0" must be "%d", thus: <!--@vbbanners:%d@-->

Some other valid examples:
@vbbanners:%d@
(mybanners:%d)
$my-ad-placeholder-%d-!

Thanks for your reaction, Ok, I've placed <!--@vbbanners:%d@--> in the header and in the options, is that ok? I still have nothing on my screen... (there's something missing... i Think but I don't see it...

Robert

RobbieZ 11-25-2009 11:23 AM

Quote:

Originally Posted by y2ksw (Post 1920638)
If you want to include the banners within CSS headers, you will have to create a script which loads and renders a custom vbulletin page with the banners only. I'm not sure though, if the CSS: url() is capable to load and handle scripts correctly. Please ask a HTML/CSS specialist for advice.

If the CSS is included in vbulletin (the CSS is not saved to disk), and the banners are image only, it should be fine to include a placeholder in the appropriate place. If you save your CSS to file, you will have to use a custom script.

Therefore my image would have to become background CSS image. I understand. Thanks.

y2ksw 11-25-2009 11:50 AM

Quote:

Originally Posted by Robert Waanders (Post 1920651)
Thanks for your reaction, Ok, I've placed <!--@vbbanners:%d@--> in the header and in the options, is that ok? I still have nothing on my screen... (there's something missing... i Think but I don't see it...

Robert

You have to place <!--@vbbanners:%d@--> in the options and <!--@vbbanners:0@--> in the template, in order to:

- make the placeholder dynamic: <!--@vbbanners:%d@-->
- show a rotating banner in position 0: <!--@vbbanners:0@-->

Concept of the placeholder: Common string which may become <!--@vbbanners:0@--> to <!--@vbbanners:9@--> by code. %d is a C++/PHP formatting placeholder which makes it possibile to script numeric formatting instead of hardcoding. Normally, you would simply ignore the presence of this option. Adversely, you would change this option, only if <!--@vbbanners:%d@--> does not work in your system.

Concept of a banner: Numeric constant which represents a number of banners to be shown at a position between 0-9. The script searches for <!--@vbbanners:0@--> to <!--@vbbanners:9@--> (previously inserted in your templates) and replaces each occurence, if available with a randomly assigned banner, to be shown at exactly that position.

Robert Waanders 11-25-2009 06:33 PM

Hello Giovanni,

Thank you for your very, very usefull posting. For some reason, i don't get the banners to show... very strange... I will puzzle on..

Robert


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