Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2017, 01:50 PM
Emad ELsayed's Avatar
Emad ELsayed Emad ELsayed is offline
 
Join Date: Feb 2013
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How add floating ads in left and right vb4

welcome everybody
How add floating ads in left and right vb4 ?
This code works
PHP Code:
<div id="RightFloatAds" style="right: 0px; position: fixed; text-align: center; top: 0px;"Google AdSense Code </div
PHP Code:
<div id="LeftFloatAds" style="Left: 0px; position: fixed; text-align: center; top: 0px;"Google AdSense Code </div
But when minimize the window size of the Forum .. comes in the background
Is there a way to fit with Style
Reply With Quote
  #2  
Old 03-11-2017, 01:58 PM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can check out this mod

https://vborg.vbsupport.ru/showthrea...99#post2570099
Reply With Quote
  #3  
Old 03-11-2017, 02:32 PM
bzcomputers's Avatar
bzcomputers bzcomputers is offline
 
Join Date: Apr 2012
Location: TX
Posts: 503
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This information below will only work correctly on fixed width sites...

Say for example your site has a fixed width of 800px centered on the screen, and then your side banners are a width of 160px each. That will require a minimum of 1120px total to show everything (without any margins). Now, you can take into account a small margin between ads so everything doesn't show right on top of each other, so we'll add 80px (20px on both the left & right side of each ad) for a total of 1200px.

We'll now need to write css code to say don't show those sidebar ads when the screen is less than 1200px wide.

Code:
@media screen and (max-width: 1199px) {
    #RightFloatAds, #LeftFloatAds {
        display: none;
    }
}
You can add this code to additional.css template. Then confirm it is working like desired by manually adjusting your screen width.
Reply With Quote
2 благодарности(ей) от:
Emad ELsayed, yilmaz
  #4  
Old 03-11-2017, 02:51 PM
yilmaz's Avatar
yilmaz yilmaz is offline
 
Join Date: Sep 2004
Posts: 751
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would it be this product?

Screenshot
Attachment 155989
Attached Files
File Type: xml product-yilmaz_floating_ads.xml (5.5 KB, 4 views)
Reply With Quote
Благодарность от:
Emad ELsayed
  #5  
Old 03-11-2017, 06:50 PM
Emad ELsayed's Avatar
Emad ELsayed Emad ELsayed is offline
 
Join Date: Feb 2013
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KevinL View Post
Dear Sorry it did not work 4.2.4


Quote:
Originally Posted by bzcomputers View Post
This information below will only work correctly on fixed width sites...

Say for example your site has a fixed width of 800px centered on the screen, and then your side banners are a width of 160px each. That will require a minimum of 1120px total to show everything (without any margins). Now, you can take into account a small margin between ads so everything doesn't show right on top of each other, so we'll add 80px (20px on both the left & right side of each ad) for a total of 1200px.

We'll now need to write css code to say don't show those sidebar ads when the screen is less than 1200px wide.

Code:
@media screen and (max-width: 1199px) {
    #RightFloatAds, #LeftFloatAds {
        display: none;
    }
}
You can add this code to additional.css template. Then confirm it is working like desired by manually adjusting your screen width.
Thank you very much dear
Everything is fine now
I set the maximum width of 1000 Ad 2unit 160 and the total in 1250
Is this good for you ??
Best Regards

Quote:
Originally Posted by yilmaz View Post
Would it be this product?

Screenshot
Attachment 155989
Works
But when minimize the window size of the Forum ... It appears on the forums
Reply With Quote
  #6  
Old 03-12-2017, 01:52 AM
webmastersun's Avatar
webmastersun webmastersun is offline
 
Join Date: Oct 2013
Location: www.webmastersun.com
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Emad ELsayed View Post
But when minimize the window size of the Forum .. comes in the background
Is there a way to fit with Style
You should use bzcomputers's way suggested.
Using media screen can help in this case but note that when viewing your banner ads on smaller screens, they can hide a part of your content on right and left side.
Reply With Quote
  #7  
Old 03-12-2017, 01:47 PM
yilmaz's Avatar
yilmaz yilmaz is offline
 
Join Date: Sep 2004
Posts: 751
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Emad ELsayed View Post
Works
But when minimize the window size of the Forum ... It appears on the forums
Demo https://i.hizliresim.com/ldrG7B.gif
Attached Files
File Type: xml product-yilmaz_floating_ads.xml (5.7 KB, 3 views)
Reply With Quote
  #8  
Old 03-12-2017, 02:58 PM
Emad ELsayed's Avatar
Emad ELsayed Emad ELsayed is offline
 
Join Date: Feb 2013
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yilmaz View Post
This works great dear
But you can develop it so that it can exclude Forum
Best regards for your cooperation
Reply With Quote
  #9  
Old 03-12-2017, 05:14 PM
yilmaz's Avatar
yilmaz yilmaz is offline
 
Join Date: Sep 2004
Posts: 751
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Emad ELsayed View Post
This works great dear
But you can develop it so that it can exclude Forum
Best regards for your cooperation
added excluded forums

Attachment 155992
Attached Files
File Type: xml product-yilmaz_floating_ads.xml (6.3 KB, 5 views)
Reply With Quote
Благодарность от:
KevinL
  #10  
Old 03-12-2017, 07:16 PM
Emad ELsayed's Avatar
Emad ELsayed Emad ELsayed is offline
 
Join Date: Feb 2013
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yilmaz View Post
added excluded forums

Attachment 155992
dear / yilmaz
I can't thank you enough
Thank a lot for the the nice gift
Best Regards
Reply With Quote
Благодарность от:
yilmaz
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04722 seconds
  • Memory Usage 2,302KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (5)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete