TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,965
  • Latest: boruko
Stats
  • Total Posts: 195,982
  • Total Topics: 21,320
  • Online today: 431
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 139
  • Total: 139

Change Size Of Upper Panel Blocks

Started by sandmannd, March 11, 2011, 11:24:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sandmannd

Hello,

I'm still learning programing. I'm trying to get some ads at the top of my forums. I have them working and rotating but they won't show the proper size of width 590 x height 118. They just show a small box and cut off the pictures. How do I change the block size? Also, is there a way to make this block centered on the forum at the top? You can view it at my site.

Link to my site: http://www.uppermidwestoutdoors.com
SMF version:  SMF 1.1.13
TP version: TinyPortal v1.0 beta 3
Default Forum Language: English
Theme name and version: Default

sandmannd

#1
Also, here is the code I'm using under the HTML/Javascript

<SCRIPT LANGUAGE="javascript">
<!-- Copyright 2000 - Galichon Enterprises, Inc. rich@galichon.net http://www.galichon.net
// Permission granted to SimplytheBest.net to list the script in the DHTML scripts library
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
function banner(img_source,url,alt,chance){
this.img_source = img_source;
this.url = url;
this.alt = alt;
this.chance = chance;
}
function display() {
with (this) document.write("<A HREF=" + url + "><IMG SRC='" + img_source + "' WIDTH=590 HEIGHT=118 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.display = display;
banners = new Array();

banners[0] = new banner("http://i128.photobucket.com/albums/p170/sandmannd/UMO/Sponsors/Rotating%20Ads/ProShopAd.gif",
" http://proshop.uppermidwestoutdoors.com/",
"The UMO Pro Shop",
10);
banners[1] = new banner("http://i128.photobucket.com/albums/p170/sandmannd/UMO/Sponsors/Rotating%20Ads/WildernessWarmthAd.gif",
" http://www.millelacslakeicefishing.com/",
"Wilderness Warmth",
10);
banners[2] = new banner("http://i128.photobucket.com/albums/p170/sandmannd/UMO/Sponsors/Rotating%20Ads/ThorneBrosAd.jpg",
"http://www.thornebros.com/",
"Thorne Bros",
10);
banners[3] = new banner("http://i128.photobucket.com/albums/p170/sandmannd/UMO/Sponsors/Rotating%20Ads/WeirhairAd.gif",
" http://www.weirhairfishingrods.com/",
"Weirhair Custom Fishing Rods",
10);
banners[4] = new banner("http://i128.photobucket.com/albums/p170/sandmannd/UMO/Sponsors/Rotating%20Ads/AdvertiseHereAd.jpg",
" http://www.uppermidwestoutdoors.com/become-a-sponsor-of-umo/",
"UMO Advertising",
10);
banners[5] = new banner("http://i128.photobucket.com/albums/p170/sandmannd/UMO/Sponsors/Rotating%20Ads/EvertsAd.jpg",
" http://www.evertsfishingresort.com/",
"Everts Resort",
10);
banners[6] = new banner("http://i128.photobucket.com/albums/p170/sandmannd/UMO/Sponsors/Rotating%20Ads/DockSidersAd.gif",
" http://lakemarionmarine.com/dock_siders.html/",
"Dock-Siders Mobile Marine Repair",
10);



sum_of_all_chances = 0;
for (i = 0; i < banners.length; i++) {
sum_of_all_chances += banners[i].chance;
}
function display_banner() {
chance_limit = 0;
randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
for (i = 0; i < banners.length; i++) {
chance_limit += banners[i].chance;
if (randomly_selected_chance <= chance_limit) {
document.write("<A HREF=" + banners[i].url + "><IMG SRC='" + banners[i].img_source + "' WIDTH=590 HEIGHT=118 BORDER=0 ALT='" + banners[i].alt + "'></A>");
return banners[i];
break;
}
}
}
//-->
</SCRIPT><SCRIPT LANGUAGE="javascript">
<!--
top_banner = display_banner();
//-->
</SCRIPT>



Lesmond

Edited your code to include the [code][/code] tags

Someone will look at this soon, in the meantime I will also test it out on my test site for you.

lurkalot

Quote from: sandmannd on March 11, 2011, 11:24:26 PM

They just show a small box and cut off the pictures. How do I change the block size? Also, is there a way to make this block centered on the forum at the top? You can view it at my site.


Sandmannd, have you fixed this?  The banners showing full width for me.  in fact larger than the  590 x height 118 sizes you stated.  in IE8 and Firefox.

Lesmond

works fine on my test site here http://forums-4-free.info/index.php

Also to center the banner use this code at the beginning <center> and end </center> of your script 

sandmannd

Quote from: ©Lesmond on March 12, 2011, 12:03:26 AM
works fine on my test site here http://forums-4-free.info/index.php

Also to center the banner use this code at the beginning <center> and end </center> of your script

It looks awesome on your site and exactly how I want it on my site. But when I go to it, even on a different computer, doesn't matter if I use Firefox or IE, it shows as a small box.


lurkalot

sandmannd, this is how your site looks to me.  All the banners are full width.

sandmannd

That's the header you are looking at lurkalot. You have to click on the "forum" button to see the ones I'm doing at the top of the forums.

lurkalot

 :-[  :idiot2:  :uglystupid2:

Sorry, I'm a idiot.  Your right it don't work. 

Strange it does on Les's site.  Are you sure you are pasting the code in properly?  Use firefox, not IE to do this.  IE messes with the code. ;)

Lesmond

QuoteIt looks awesome on your site and exactly how I want it on my site. But when I go to it, even on a different computer, doesn't matter if I use Firefox or IE, it shows as a small box.
Could be another block messing with it, try turning one block off at a time, then check it.

BTW are you using the wysiwg editor for this?

This website is proudly hosted on Crocweb Cloud Website Hosting.