News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Resize forum to "90%" etc.

Started by Mikirin, July 24, 2010, 05:02:44 PM

Previous topic - Next topic

Mikirin

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 [__]%"

Kays

Hi, look in the Admin CP > Current Theme. One of the top options should be to set a width for the theme.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Matthew K.

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

bloc

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.

ɔɔɔɔɔɔuɥoɾ

#4
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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Mikirin

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...

ɔɔɔɔɔɔuɥoɾ

Could you post a link to your forum, and some details too, like installed mods and which theme you use?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Mikirin

#7

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

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Mikirin

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?

ɔɔɔɔɔɔuɥoɾ

Its near the top.

Right after


function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Matthew K.

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?

Mikirin

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

Matthew K.

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.

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Matthew K.

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.

ɔɔɔɔɔɔuɥoɾ

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...


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Matthew K.

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.

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

bloc

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.

Advertisement: