Simple Machines Community Forum

General Community => Scripting Help => Topic started by: KrisiS on June 08, 2012, 04:22:46 PM

Title: SSI - Alignment ?
Post by: KrisiS on June 08, 2012, 04:22:46 PM
Hello,

Is it possible to have the script for recent topics align to the left?
In the attached image you can see where certain topics make the alignment look crap.

Thanks
Title: Re: SSI - Alignment ?
Post by: System32Cro on June 09, 2012, 07:30:09 AM
it's your problem not SSI, show you html code!
Title: Re: SSI - Alignment ?
Post by: floridaflatlander on June 09, 2012, 07:52:49 AM
I put stuff in it's own div and style that, also I think I assigned an h5 tag to the text(but I had to do this in the ssi function it's self and once again, I think).
Title: Re: SSI - Alignment ?
Post by: System32Cro on June 09, 2012, 08:58:17 AM
using align="left" you can align it normal
example:
<div align="left">stuff</div>
Title: Re: SSI - Alignment ?
Post by: KrisiS on June 09, 2012, 10:42:34 AM

<tr height="155" valign="top" width="700">
<td>
<div id="forum" align="left">
<h4>Latest forum posts</h4>
<?php ssi_recentPosts(4, array(9,12,26,27,46,36,39,38,55,10,3,24)); ?>
<a href="http://ugn-gaming.com/forum/index.php?action=recent"><font color="red">View Most recent forum posts</font></a>
</div>
    </td>
</tr>


When I change <div id="forum" align="left">
to
<div id="forum" align="right">

If simply aligns the <H4> and 'View most recent forum posts' - to the right. When I have it aligned left, they align left but the SSI text does not change its position.
Title: Re: SSI - Alignment ?
Post by: System32Cro on June 09, 2012, 10:43:41 AM
hm... try add style="text-align: left;"
Title: Re: SSI - Alignment ?
Post by: KrisiS on June 09, 2012, 10:52:00 AM
<div id="forum" style="text-align: left;">
<h4>Latest forum posts</h4>
<?php ssi_recentPosts(4, array(9,12,26,27,46,36,39,38,55,10,3,24)); ?>
<a href="http://ugn-gaming.com/forum/index.php?action=recent"><font color="red">View Most recent forum posts</font></a>
</div>


This does not work, are you sure it is not something that needs to be edited within the SSI?
Title: Re: SSI - Alignment ?
Post by: floridaflatlander on June 09, 2012, 11:01:18 AM
Quote from: KrisiS on June 09, 2012, 10:52:00 AM
<div id="forum" style="text-align: left;">
<h4>Latest forum posts</h4>
<?php ssi_recentPosts(4, array(9,12,26,27,46,36,39,38,55,10,3,24)); ?>
<a href="http://ugn-gaming.com/forum/index.php?action=recent"><font color="red">View Most recent forum posts</font></a>
</div>


This does not work, are you sure it is not something that needs to be edited within the SSI?

Look at your source and see if there is any other thing that may be in the div that will effect the output. Firefox's firebug can help.

You may have an inheritance problem(if you do firefug will tell you) so try

<div id="forum-ssi" >
<h4 style="text-align: left;">Latest forum posts</h4>
<?php ssi_recentPosts(4, array(9,12,26,27,46,36,39,38,55,10,3,24)); ?>
<a href="http://ugn-gaming.com/forum/index.php?action=recent"><font color="red">View Most recent forum posts</font></a>
</div>


and/or try on your css page,
<div id="forum-ssi" >
<h4 >Latest forum posts</h4>
<?php ssi_recentPosts(4, array(9,12,26,27,46,36,39,38,55,10,3,24)); ?>
<a href="http://ugn-gaming.com/forum/index.php?action=recent"><font color="red">View Most recent forum posts</font></a>
</div>

#forum-ssi h4 {
text-align: left;"
}

Title: Re: SSI - Alignment ?
Post by: KrisiS on June 09, 2012, 11:24:21 AM
It doesnt seem to work.

On a fresh page I have done the following and it still returns the same alignment (where it leaves gaps depending on the size of a post)
I know it is overkill with the align="left" but I've just entered it like that to cover more ground at once.


<tr height="350"bgcolor="#ffffff" align="left">
<td align="left">
<div align="left">
<?php ssi_recentPosts(4, array(9,12,26,27,46,36,39,38,55,10,3,24)); ?>
</td>
</tr>
Title: Re: SSI - Alignment ?
Post by: floridaflatlander on June 09, 2012, 11:42:25 AM
Quote from: KrisiS on June 09, 2012, 11:24:21 AM
It doesnt seem to work.


<div align="left">


What doesn't seem to work?
Where is the closing div for the above code, where the is h4 you had, did you try firefox's firebug or chromes developers tools to see any inheritance?
Title: Re: SSI - Alignment ?
Post by: KrisiS on June 09, 2012, 12:00:14 PM
I dont see any errors.

If you look at the original attached image. On the bottom part of it, the recetopics are aligned nicely to the left.
However, if a post is made in a topic which has a longer name - it loses its alignment.

The script is aligning the output via the length of the topic names as opposed to sticking to the left regardless of the topic name.

Title: Re: SSI - Alignment ?
Post by: floridaflatlander on June 09, 2012, 12:07:52 PM
Quote from: KrisiS on June 09, 2012, 12:00:14 PM
I dont see any errors.

If you look at the original attached image. On the bottom part of it, the recetopics are aligned nicely to the left.
However, if a post is made in a topic which has a longer name - it loses its alignment.

The script is aligning the output via the length of the topic names as opposed to sticking to the left regardless of the topic name.

So get fire bug and see what changes between the two and where are the styles are coming from.
Title: Re: SSI - Alignment ?
Post by: KrisiS on June 09, 2012, 12:18:54 PM
In the table generated via the SSI script, it has all of the <td> aligned to the right with the following code <td align="right" valign="top" nowrap="nowrap">

Im assuming if I align a <div> to the left and place this script in it, it will not change the fact that the SSI is generating a table which is aligning right?

So I am assuming it must be edited within the script somewhere?
Title: Re: SSI - Alignment ?
Post by: Arantor on June 09, 2012, 12:22:20 PM
In which case, alter the function itself to not align right... you're calling ssiRecentTopics or whatever, look for the function in SSI.php and just change where it has <td align="right" in the code to just <td (so there's no align="right" bit)

Though it might look better if there weren't boards with very very long names in.
Title: Re: SSI - Alignment ?
Post by: KrisiS on June 09, 2012, 12:36:04 PM
Quote from: Arantor on June 09, 2012, 12:22:20 PM
..... look for the function in SSI.php and just change where it has <td align="right" in the code to just <td (so there's no align="right" bit)

When I do that, or even change it to <td align="left" valign="top" nowrap="nowrap"> it is still aligning them via the:

closing ] within the topics name
EG:
                        [Example 1] Re: Massive frame drops by laugher
                        [Example 2] Re: Massive frame drops by laugher
[Example 3 is slightly longer] Re: Massive frame drops by laugher
Title: Re: SSI - Alignment ?
Post by: Arantor on June 09, 2012, 12:43:00 PM
That sounds like you're editing the wrong one.
Title: Re: SSI - Alignment ?
Post by: KrisiS on June 09, 2012, 12:44:00 PM
Apologies, I appear to have edited the wrong one.
It is working now, and would you believe I never thought of reducing the length of the boards :o (facepalm)

Thank you very much for you help guys, really !!