Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Mikirin on July 24, 2010, 05:02:44 PM

Title: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 05:02:44 PM
How would I do this?  I really find it annoying that I have to scroll to the side to see the rest of the forum.
This may be an incredibly stupid question. But the free forums I used to go to that had phbb had an option. "Resize forum to [__]%"
Title: Re: Resize forum to "90%" etc.
Post by: Kays on July 24, 2010, 05:25:53 PM
Hi, look in the Admin CP > Current Theme. One of the top options should be to set a width for the theme.
Title: Re: Resize forum to "90%" etc.
Post by: Matthew K. on July 24, 2010, 07:03:15 PM
As Kays response does accomplish what is needed, I am marking the topic as resolved.

Topic Starter - Feel free to mark this topic unresolved if anything further comes up or you have continued problems.
Labradoodle-360
Title: Re: Resize forum to "90%" etc.
Post by: bloc on July 24, 2010, 07:16:45 PM
lol, which one is the moderator here I wonder...maybe the badge "support specialist" really isn't what it says it is. ;D

To add to Kays response: its also just for admin, that setting. If you want something visible on the frontpage that can be selected on-the-go and/or by every member in their profile for example, the theme has to be changed to provide it. Default theme and most custom themes only have the admin setting available.
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 07:35:17 PM
But the OP has not confirmed that worked, (even though we know it does)

His Her width option may have disappeared for all we know, Marking as Not solved until the OP confirms it is.
Title: Re: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 08:51:43 PM
I'm female ^^
Well, for some reason, no matter what size I enter, For example 90%, it doesn't change. I tried 150 px, 950px, etc. None change anything...
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 09:00:32 PM
Could you post a link to your forum, and some details too, like installed mods and which theme you use?
Title: Re: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 09:06:28 PM

I have spoiler, ultimate profile, and member color link installed.
I'm using Black Rain, but it's modified to fit the forum's thing. x.x
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 09:20:54 PM
See that forum option which sets the forum width is in index.template.php, a very commonly modified file in custom themes, its quiet possible your custom theme has removed that part


echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '

This should be in your index.template.php file, if you attach it we can check to see if that was removed, and if so add it back in.
Title: Re: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 09:27:11 PM
Quote from: ♪ JohnCcCcCc ♫ on July 24, 2010, 09:20:54 PM
This should be in your index.template.php file, if you attach it we can check to see if that was removed, and if so add it back in.
Where do I add it? Is there any specific location in the coding?
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 09:28:40 PM
Its near the top.

Right after


function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
Title: Re: Resize forum to "90%" etc.
Post by: Matthew K. on July 24, 2010, 09:35:16 PM
Just adding that isn't a smart idea John, first of all,  you'd be opening a div and not adding a close for the div. Second of all, what if it's controlled another way?
Title: Re: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 09:37:13 PM
Now  I have function template_body_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '

   echo '
<div id="br_wrap">
      <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>';
      echo '
            <a href="', $scripturl, '" title=""><img src="', $settings['images_url'], '/brlogo.gif" style="margin: 2px;" alt=""/></a>';
   echo '
            </td>
         </tr>


but I get
The file you tried to save generated the following error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in index.template.php on line 172
Title: Re: Resize forum to "90%" etc.
Post by: Matthew K. on July 24, 2010, 09:38:32 PM
Code (Find) Select

   echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '

   echo '
<div id="br_wrap">

Code (Replace) Select

   echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '';

   echo '
<div id="br_wrap">


Edit: As I stated in my previous post, I do not believe this is a smart way to go about fixing forum width.
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 09:44:18 PM
But its the right way lol

This will make the actual settings for the forum width in current theme work, like they do before their modified.
Title: Re: Resize forum to "90%" etc.
Post by: Matthew K. on July 24, 2010, 09:49:06 PM
Quote from: ♪ JohnCcCcCc ♫ on July 24, 2010, 09:44:18 PM
But its the right way lol

This will make the actual settings for the forum width in current theme work, like they do before their modified.
Do you want me to explain to you where I am coming from, and why I'm right in this case? Not the smartest way to approach it.
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 09:57:12 PM
This is why I asked her to attach the file, Since we don't know what else is missing their,

The only problem I see, possible problem, is that changing the forum width could make the forum look funny if the theme intentionally moved it for that reason, or the theme has a predefined width, other than that, If I were editing it myself, I see no no other problems, not that I can think of the top of my head...
Title: Re: Resize forum to "90%" etc.
Post by: Matthew K. on July 24, 2010, 10:00:42 PM
Well, if nothing else, you should also instruct her to close the div in the proper place. (Bottom of the forum.)

I would definitely look into the Theme's index coding to see how it handles forum width, it may be a simple edit of taking the CSS from the themes CSS index and placing it inline with the settings field so that it can be changed, but then again, the theme author may have written it static and not dynamic for a reason; it may throw off the rest of the layout.

It's definitely not a *bad* thing to do, there just needs to be more put into it than giving someone a div - Without a closing bracket and not knowing the full situation.

Topic Starter - It would definitely help to attach your themes index.template.php please.
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 10:03:49 PM
Quote from: Labradoodle-360 on July 24, 2010, 10:00:42 PM
Well, if nothing else, you should also instruct her to close the div in the proper place. (Bottom of the forum.)

I would definitely look into the Theme's index coding to see how it handles forum width, it may be a simple edit of taking the CSS from the themes CSS index and placing it inline with the settings field so that it can be changed, but then again, the theme author may have written it static and not dynamic for a reason; it may throw off the rest of the layout.

It's definitely not a *bad* thing to do, there just needs to be more put into it than giving someone a div - Without a closing bracket and not knowing the full situation.

Topic Starter - It would definitely help to attach your themes index.template.php please.

Agreed, This is why I asked you (OP) to attach the file instead, because I just copied a small portion of the code, I grabbed everything within the div if you code was the same as mine it would not matter, but what are the odds of that.
Title: Re: Resize forum to "90%" etc.
Post by: bloc on July 24, 2010, 10:12:53 PM
Just find the "br_wrap" style in css/index.css and remove the "width: 1240px". It will then be just full screen width.

No need to add more markup.
Title: Re: Resize forum to "90%" etc.
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 10:18:36 PM
Quote from: Bloc on July 24, 2010, 10:12:53 PM
Just find the "br_wrap" style in css/index.css and remove the "width: 1240px". It will then be just full screen width.

No need to add more markup.

Depends on what the OP wants really, I believe adding the function of the customizable width is best (if its possible with the themes coding), this way it can be changed easily to suit any future changes, but if one just wants it to work, then their are several options
Title: Re: Resize forum to "90%" etc.
Post by: busterone on July 24, 2010, 10:36:15 PM
All smf 2 versions of Black Rain have the width set in css
/* this is the main container surrounding everything, use this to set forum width, font-size  etc. */
#mainframe
{
font-size: 85%;
width: 95%;
margin: auto;
}
Title: Re: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 10:48:05 PM
I'm sorry.... I have about 0 experience with coding... The best I've had was proboards.
There's stuff like "begining with Line 1" and such... Where am I supposed to be here?
Title: Re: Resize forum to "90%" etc.
Post by: busterone on July 24, 2010, 10:51:29 PM
./themes/blackrain/css/index.css
Depending on which version of Black Rain you are using, the above directory may be blackrain2, blackrain20, or blackrain2_20
Title: Re: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 10:55:40 PM
i have the first version.
I'm sorry I'm dumb at this.
Also, as soon as I posted the link here, I got some spam ads. >.<
Title: Re: Resize forum to "90%" etc.
Post by: Mikirin on July 24, 2010, 11:18:51 PM
Quote from: Bloc on July 24, 2010, 10:12:53 PM
Just find the "br_wrap" style in css/index.css and remove the "width: 1240px". It will then be just full screen width.

No need to add more markup.
This worked! thank you soso much!
Title: Re: Resize forum to "90%" etc.
Post by: bloc on July 25, 2010, 06:48:53 AM
Quote from: Mikirin on July 24, 2010, 11:18:51 PM
Quote from: Bloc on July 24, 2010, 10:12:53 PM
Just find the "br_wrap" style in css/index.css and remove the "width: 1240px". It will then be just full screen width.

No need to add more markup.
This worked! thank you soso much!

yw. Glad it helped. :)
Title: Re: Resize forum to "90%" etc.
Post by: busterone on July 25, 2010, 10:48:36 AM
Glad it worked.  :)
Odd, my copies of Black Rain do not have  "br_wrap" in css.