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)

ofir24 10-23-2011 10:43 AM

i didn't say it's not working, cause it's working, but some option doesn't work, example:
i try: "ad thread last post content" look for ads on the thread, nothing.

metalguy639 10-24-2011 12:31 AM

1 Attachment(s)
Here is a simple way to add your banners in a CMS widget.

You will need to create a PHP Execution by doing the following:

Step 1:

1. In the admincp go to vBulletin CMS>Widgets
2. Click on "Create New Widget" at the bottom.
3. Choose "PHP Direct Execution" in the Widget Type drop down at the top.
4. Give your widget a title - do not make it too long as your box will be whatever size you have in your CMS.
5. Now click the "Save" button.

Step 2:

1. Go to vBulletin CMS>Widgets and select the widget you just made.
2. Click on the "Configure" link all the way to the right.
3. Delete all the test inside the box when it pops up.
4. Place this code in the box:

Code:

$templater = vB_Template::create('banner_sidebar');
$output = $templater->render();

5. Now click the "Save" button.

Step 3:

1. Go to Styles & Templates>Style Manager click the drop down box on the right side and choose "Add New Template".
2. In the "Title" box put "banner_sidebar" without the quotes.
3. Now in the large box below place your code for your banners like you would any other template. For instance I put this:

Code:

<div align="center">@vbbanners:4@</div><br />
<div align="center">@vbbanners:5@</div><br />
<div align="center">@vbbanners:6@</div><br />
<div align="center">@vbbanners:7@</div><br />
<div align="center">@vbbanners:8@</div><br />
<div align="center">@vbbanners:9@</div>

I'm using vBSEO so that is why it may look different from yours.

4. Now click the "Save" button.

Step 4:

1. Enter your banner info using the positions that you put code to in your new template and save the banners.

metalguy639 10-24-2011 12:33 AM

Quote:

Originally Posted by wampforum (Post 2164049)
Ok I'm stumped!! I have been running this mod fine for months.
But now I have a problem. I currently run a single ad placement in the header just below the log in as well as the 2 default VB ads under navbar and footer.
What I wish to do is place a rotational ad into a cms widget. I can get the widget to work fine when using:
<!--@vbbanners:0@--> But adding banners to another list and using that instead won't work.
It seems I have the nth placeholder in options set to <!--@vbbanners:0@--> so it wont show anything else I assume?
Reading this thread it seems that should be <!--@vbbanners:%@--> instead but changing that makes the ads in the header disappear.
So It seems I can only show ads in <!--@vbbanners:0@--> with that same code as the nth placeholder.
What am I doing wrong? I use the <!--@vbbanners:0@--> code in the ad location template

Help?!!

Quote:

Originally Posted by Big-Pete (Post 2156926)
I can't get this to show up in a CMS widget, Do i need to use a static html widget? and do i just put @vbbanners:%d@ in it??

I have vbseo installed, I've changed the place holder as per the PDF but still can't get it to work.

Quote:

Originally Posted by vikris (Post 2020184)
One of the greatest addons!!! :) I have several questions though:

1. Will it be in the future more than 10 positions?

2. Some of the ads are displaying also in the forums (specifically header and footer) how to remove that? I like the ads to be displayed only on CMS page.

3. Maybe this question is out of the thread, but I have to ask: Is there a way to setup a widget on the main CMS to show friendly sites with small graphic and link to them?

Thanks a lot again!

Regards,

vikris

Quote:

Originally Posted by dweber (Post 2009540)
I would like to add a place holder into a static HTML Widget box on the "Front Page" but am a newbie.

Could anyone give me a sample line of HTML code to insert the placeholder (@vbanners@) into?

Thanks in advance.

See this post: https://vborg.vbsupport.ru/showpost....postcount=1542

y2ksw 10-24-2011 01:12 PM

Quote:

Originally Posted by ofir24 (Post 2260483)
i didn't say it's not working, cause it's working, but some option doesn't work, example:
i try: "ad thread last post content" look for ads on the thread, nothing.

Some options need additional work to do, which however have nothing to do with my plugin.

For example, the inbuilt ad locations of vbulletin require you to define additional rules from within Advertising, else they will not show at all. In these definitions you would use then the RBS placeholders instead of other HTML and everything works out just fine :)

y2ksw 10-24-2011 01:14 PM

Quote:

Originally Posted by metalguy639 (Post 2260748)
Here is a simple way to add your banners in a CMS widget. (...)

Very nice! :up:

djbaxter 10-26-2011 08:03 PM

I need to exclude the banners from a specific mobile style. What's the simplest way to do this?

y2ksw 10-27-2011 07:42 AM

Quote:

Originally Posted by djbaxter (Post 2261820)
I need to exclude the banners from a specific mobile style. What's the simplest way to do this?

If your banner locations are defined in the Master style, probably it will need moving them into the single styles.

I imagine however, you are using the advertising ... then maybe selecting the style will help.

djbaxter 10-27-2011 03:06 PM

Quote:

Originally Posted by y2ksw (Post 2261989)
If your banner locations are defined in the Master style, probably it will need moving them into the single styles.

I imagine however, you are using the advertising ... then maybe selecting the style will help.

Selecting the style isn't helpful because you can only select one. I only want to EXCLUDE one.

But this worked. I edited the RBS Banner Insertion plugin as follows:

I inserted

Code:

/** don't display banners for Mobile 2 style **/
if (STYLEID!=134) {

at the top of the "Banner Insertion" plugin and

Code:

}
at the very bottom.

May I suggest that an option to exclude certain styles might be added in a new version?

y2ksw 10-30-2011 11:17 AM

Quote:

Originally Posted by djbaxter (Post 2262059)
May I suggest that an option to exclude certain styles might be added in a new version?

I don't think so ... :)

I would have made for each style an ad, instead, if I really had to, or rather not used the ad system at all and modified the relative templates in a way that I could do without it. As a matter of fact, using the ad system slows down the forums quite a bit ... it is useful and simple, but not a long term solution for heavily loaded systems ;)

y2ksw 10-31-2011 04:54 PM

@all

I soon will review the code and add a few features. Is there anything you may wish to add?


All times are GMT. The time now is 11:03 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.02980 seconds
  • Memory Usage 1,757KB
  • 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
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (6)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