News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SSI - Alignment ?

Started by KrisiS, June 08, 2012, 04:22:46 PM

Previous topic - Next topic

KrisiS

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

System32Cro

it's your problem not SSI, show you html code!

floridaflatlander

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

System32Cro

using align="left" you can align it normal
example:
<div align="left">stuff</div>

KrisiS


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

System32Cro

hm... try add style="text-align: left;"

KrisiS

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

floridaflatlander

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;"
}


KrisiS

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>

floridaflatlander

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?

KrisiS

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.


floridaflatlander

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.

KrisiS

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?

Arantor

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.

KrisiS

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

Arantor

That sounds like you're editing the wrong one.

KrisiS

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


Advertisement: