TinyPortal

Development => Support => Topic started by: sandmannd on March 11, 2011, 11:24:26 PM

Title: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 11, 2011, 11:24:26 PM
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
Title: Re: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 11, 2011, 11:30:37 PM
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>


Title: Re: Change Size Of Upper Panel Blocks
Post by: Lesmond on March 11, 2011, 11:51:49 PM
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.
Title: Re: Change Size Of Upper Panel Blocks
Post by: lurkalot on March 11, 2011, 11:59:54 PM
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.
Title: Re: Change Size Of Upper Panel Blocks
Post by: 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 
Title: Re: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 12, 2011, 12:40:29 AM
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.

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi128.photobucket.com%2Falbums%2Fp170%2Fsandmannd%2FUMO%2FSponsors%2FRotating%2520Ads%2FRotatingAd.jpg&hash=43ce3020f9d07cbeac8226bd2ac07d032e034639)
Title: Re: Change Size Of Upper Panel Blocks
Post by: lurkalot on March 12, 2011, 12:50:08 AM
sandmannd, this is how your site looks to me.  All the banners are full width.
Title: Re: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 12, 2011, 12:54:57 AM
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.
Title: Re: Change Size Of Upper Panel Blocks
Post by: lurkalot on March 12, 2011, 01:04:12 AM
 :-[  :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. ;)
Title: Re: Change Size Of Upper Panel Blocks
Post by: Lesmond on March 12, 2011, 01:11:52 AM
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?
Title: Re: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 12, 2011, 01:17:39 AM
Not using the editor, found the code here: http://www.tinyportal.net/index.php?topic=31973.0;all

Would it be because I have an older version of TP installed? Should I upgrade? If so, where do I find the upgrade file at?
Title: Re: Change Size Of Upper Panel Blocks
Post by: Lesmond on March 12, 2011, 01:27:42 AM
With that code it shouldn't make any difference what version of tp you are using, but having said that, its always good to upgrade!

Just to remind you, if you do decide to upgrade alway make a backup of your site and database first.

You can check out our downloads for the latest TP    1.0 RC1
Title: Re: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 12, 2011, 01:31:12 AM
Hmmm, if it shouldn't make a difference, I wonder what the problem is.

To upgrade, do I just download the new version and install it?
Title: Re: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 12, 2011, 01:52:28 AM
I disabled every dang block on my site and still the same problem. I even made a new one that was of one ad using just HTML and just putting it in as an image. Same thing. I tried to use the Top Panel Blocks to do it as well and had the same problem. I'm at a loss as to what to do.
Title: Re: Change Size Of Upper Panel Blocks
Post by: IchBin on March 12, 2011, 07:57:10 AM
Have you restricted the size of the center block in your panel settings or block settings? I see in your code that there is something setting that block to a width of 150px. Removing that width fixes the problem for me.
Title: Re: Change Size Of Upper Panel Blocks
Post by: sandmannd on March 12, 2011, 02:29:17 PM
Hi IchBin,

I can't find in my code the 150px. I did get into the panel settings and change them to 1000px and now it's centered and showing up full size. Thanks,  that fixed it and it's great. Much appreciated!!
Title: Re: Change Size Of Upper Panel Blocks
Post by: Lesmond on March 12, 2011, 02:44:30 PM
Glad you got it sorted, I will mark this has solved.