collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 463
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Images In Custom HTML Block  (Read 8850 times)

0 Members and 1 Guest are viewing this topic.

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Images In Custom HTML Block
« on: February 24, 2011, 04:40:11 AM »
XP SP3 SMF 2 RC5 SP 2.3.3

I've got a custom html block centrally on the portal page of my forum.

I want to display an image in that block so that the image fills the block regardless of viewing screen size and resolution.

The image is 640 px wide x 480 px high and is hosted by Photobucket.

If I set the image width in HTML to 100% but leave the height as 480 px, it works well on my 19" screen but on a 10" netbook the image fills the width as you'd expect but forms a block 480 px high leaving a large blank area over the image.

If I also set the height at 100%, the whole image dramatically shrinks and on my screen nowhere nearly fills the available block.

What height setting and format (set number of pixels and % don't seem to work) would you recommend to force the height of this block to expand just enough to permit the image to be displayed in perspective and just to fill the block?
SMF 2.0 Gold
SP 2.3.3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Images In Custom HTML Block
« Reply #1 on: February 24, 2011, 02:00:11 PM »
This is not a SimplePortal support issue.
I am no great expert at this sort of thing.
You don't care about the aspect ratio of the image?
 
It seems that width=100% is going to work, since the width of the block depends on the width of the browser window and/or the width of the other columns in your portal.
 
But, since the height of the block actually depends on the height of the thing inside, and you've just told the thing inside that its height should depend on the height of the block -- how is your poor browser going to figure that one out? It has to recognize the "infinite loop" problem and just pick a value somehow.
 
I did a little googling. Some of the stuff here: http://www.dynamicdrive.com/forums/showthread.php?t=28888 related to using a little javascript to learn the actual area available and setting the height or width of the img accordingly.
 
and here: http://www.tutwow.com/htmlcss/quick-tip-css-100-height/ (about how % height and width is relative to the size of the box the <img> is inside, which is an "infinite loop" problem, since the height of the html block depends on the size of its contents).
 
You can try a little googling, too.
And you can probably find more and better help from the larger community of CSS experts who discuss themes and graphics at simplemachines.org.
 
Good luck!
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Images In Custom HTML Block
« Reply #2 on: March 03, 2011, 08:30:02 AM »
Just got back to this. It's a matter that still requires resolution.

Thank you for such a comprehensive reply. There's much there to give me a good lead.  :)

Incidentally, I do care very much about the perspective of the image. That's the point I tried to make in my final paragraph. Apologies if I didn't explain myself adequately.
« Last Edit: March 03, 2011, 08:41:57 AM by newtoallthis »
SMF 2.0 Gold
SP 2.3.3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Images In Custom HTML Block
« Reply #3 on: March 03, 2011, 04:02:18 PM »
If you set only width or only height, you will preserve the aspect ratio.
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Images In Custom HTML Block
« Reply #4 on: March 04, 2011, 05:43:43 AM »
If you set only width or only height, you will preserve the aspect ratio.

I'm trying to fill the full width of a central block with a slide show from a file host. I reasoned that the available width would vary from PC to PC dependent upon screen size and resolution. So I chose 100% as the width.

I hoped that this would then force the block to expand to the correct height to accommodate the slide show at its natural aspect ratio (800 px by 532 px).

However, if I don't stipulate a physical height for the block, overall image size shrinks dramatically, as though the code loses its ability to 'push up' the block height to a height where the image can utilise 100% of available block with.

Hope that makes sense.

 
SMF 2.0 Gold
SP 2.3.3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Images In Custom HTML Block
« Reply #5 on: March 04, 2011, 06:38:44 AM »
I'm not sure what is keeping it from using 100% of available width. Please provide a link.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Images In Custom HTML Block
« Reply #6 on: March 04, 2011, 03:15:32 PM »
I'm not sure what is keeping it from using 100% of available width. Please provide a link.

That's the thing. It always uses 100% of the width but only if I set the height at a set number of pixels, say 520 px. Trouble is then, on a smaller screen, the slide show is 100% wide but the block is too high with only part of the height being utilised by the slide show.

The currently used code is as follows:-

Code: [Select]
<div style="width:100%; text-align: center;"><embed type="application/x-shockwave-flash" wmode="transparent" src="http://w1233.photobucket.com/pbwidget.swf?pbwurl=http%3A%2F%2Fw1233.photobucket.com%2Falbums%2Fff400%2FLeigh-Lancashire%2F3f5c3796.pbw" height="520" width="100%"><a href="http://photobucket.com/slideshows" target="_blank"><img src="http://pic.photobucket.com/slideshows/btn.gif" style="float:left;border-width: 0;" ></a><a href="http://s1233.photobucket.com/albums/ff400/Leigh-Lancashire/?action=view&amp;current=3f5c3796.pbw" target="_blank"><img src="http://pic.photobucket.com/slideshows/btn_viewallimages.gif" style="float:left;border-width: 0;" ></a></div>
The link is www.leigh-lancashire.com .

The objective is for the slide show to fill 100% of the available width (which it currently does) but for it to push up the height of the block just sufficient to contain the height of the slide show in its correct aspect ratio.
SMF 2.0 Gold
SP 2.3.3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Images In Custom HTML Block
« Reply #7 on: March 04, 2011, 03:31:48 PM »
You are a members-only site, and registration is disabled.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Images In Custom HTML Block
« Reply #8 on: March 04, 2011, 03:39:21 PM »
You are a members-only site, and registration is disabled.

Good observation.  :-[

Would it be impertinent of me to request an email addie by PM?

I'd forgotten that we'd disabled registrations until we can better protect our media content.
SMF 2.0 Gold
SP 2.3.3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Images In Custom HTML Block
« Reply #9 on: March 04, 2011, 07:32:28 PM »
Please set up a "test" account, and PM me the details.
I'll use it to take a look at your issue, and you can recycle the account when you are ready.
It's always handy to have a test "regular member" around for testing things.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Images In Custom HTML Block
« Reply #10 on: March 05, 2011, 04:19:18 AM »
Please set up a "test" account, and PM me the details.
I'll use it to take a look at your issue, and you can recycle the account when you are ready.
It's always handy to have a test "regular member" around for testing things.

Thank you.
SMF 2.0 Gold
SP 2.3.3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Images In Custom HTML Block
« Reply #11 on: March 05, 2011, 07:42:32 PM »
Are you talking about the top block at http://www.leigh-lancashire.com/forum/?
The reason this thing does not behave like an image is that is not an image.It is an embedded flash "widget". I guess it is a slideshow viewer. Maybe it doesn't have a "natural" height or aspect ratio, the way an image does.
 
Does photobucket have any documentation about how you can tame this slideshow widget? Any options you can add to the URL, or set when you are setting up the album and/or slide show?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?