View Full Version : Last post text should line up better
Maxwell the Cat
10-29-2008, 08:35 PM
The Last Post text on my forums home page lines up a bit odd.
http://img100.imageshack.us/img100/9263/picture1iq3.png (http://imageshack.us)
http://img100.imageshack.us/img100/picture1iq3.png/1/w380.png (http://g.imageshack.us/img100/picture1iq3.png/1/)
The date of the last post is on its own line, below the author. Is there a way I can get these to be on the same line, so it takes up less room?
p@nDa
10-29-2008, 09:43 PM
i want to edit that one too , cause using my style the last post title and the autor are the same exactly color , i wanna use different colors for that
Azhrialilu
10-30-2008, 07:44 AM
Without seeing your site or the code you have set up currently, it's hard to be sure what you've done. My own site has the last post on the same line as the last poster.
p@nDa
10-30-2008, 08:35 AM
should be this one ...
<div class="smallfont" align="$stylevar[left]">
<div>
<span style="white-space:nowrap">
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
<if condition="$lastpostinfo['prefix']">
$lastpostinfo[prefix]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a></span>
</div>
<div style="white-space:nowrap<if condition="is_browser('ie', 6)">; float:$stylevar[left]</if>">
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</div>
<div align="$stylevar[right]" style="white-space:nowrap">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]#post$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</div>
and actually it looks like the img i attach ...
i would like the name of the poster would be parsed as usually in the rest of the forum , with the color and style of his respective usergroup ( like 'who's online box' )
Maxwell the Cat
10-30-2008, 10:57 PM
If I can figure out what template is responsible for this, I can probably poke around it enough to figure out how to make the change I want.
p@nDa
10-31-2008, 12:27 PM
i take that code form the template
forumhome_lastpostby
if u manage how to edit can u please help me too ?
thanks
Lynne
10-31-2008, 02:14 PM
Whenever you want to find a template, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code.
Maxwell the Cat
11-01-2008, 11:17 AM
Whenever you want to find a template, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code.
Woah! That's pretty handy. The more you know...
Anyways, this is in my forumhome_lastpostby template. The code for it is this:
<if condition="$show['lastpostinfo']">
<div class="smallfont" align="$stylevar[left]">
<div>
<span style="white-space:nowrap">
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
<if condition="$lastpostinfo['prefix']">
$lastpostinfo[prefix]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a></span>
</div>
<div style="white-space:nowrap<if condition="is_browser('ie', 6)">; float:$stylevar[left]</if>">
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</div>
<div align="$stylevar[right]" style="white-space:nowrap">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]#post$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</div>
<else />
<div class="smallfont" align="$stylevar[right]">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</if>
I've played with it a little bit but haven't had much luck getting the text to line up. Anyone have any thoughts?
p@nDa
11-01-2008, 01:03 PM
i have finally done ... i explain how to so if some noob like me need this kind of thing it can follow my experience :)
1) add a new class in Additional CSS with attributes i would like to use ...
.lastpostby, .lastpostbyActive
{
color: #ffffff;
}
.lastpostby a:link, .lastpostby_alink, .lastpostbyActive a:link, .lastpostbyActive_alink
{
color: #ff8c25;
text-decoration: none;
}
.lastpostby a:visited, .lastpostby_avisited, .lastpostbyActive a:visited, .lastpostbyActive_avisited
{
color: #ff8c25;
text-decoration: none;
}
.lastpostby a:hover, .lastpostby a:active, .lastpostby_ahover, .alt1Active a:hover, .lastpostbyActive a:active, .lastpostbyActive_ahover
{
color: #33FF33;
text-decoration: none;
}
2) simply add definition class="lastpostby" in the <div definition in the code ( in the template ) ...
<div class="lastpostby" style="white-space:nowrap<if condition="is_browser('ie', 6)">; float:$stylevar[left]</if>">
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</div>
see the photo attached for the change ...
that's all , but it was so hard figuring out how to do this , i really take long time to search for the specific help and at the end i tried on my own ... :)
p@nDa
11-01-2008, 01:08 PM
@ Maxweel ...
this is ur code ...
<div>
<span style="white-space:nowrap">
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
<if condition="$lastpostinfo['prefix']">
$lastpostinfo[prefix]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a></span>
</div>
<div style="white-space:nowrap<if condition="is_browser('ie', 6)">; float:$stylevar[left]</if>">
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</div>
maybe u should add both part in one only <div> to have on the same line , no ?
like ...
<div>
<span style="white-space:nowrap">
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
<if condition="$lastpostinfo['prefix']">
$lastpostinfo[prefix]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a></span>
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</div>
i haven't tested ...
i removed the
</div>
<div style="white-space:nowrap<if condition="is_browser('ie', 6)">; float:$stylevar[left]</if>"> beetween the 2 phrases ...
Maxwell the Cat
11-01-2008, 09:08 PM
Okay, I played with the code and I'm getting closer to what I want. Right now, this is my code:
<if condition="$show['lastpostinfo']">
<div class="smallfont" align="$stylevar[left]">
<div>
<span style="white-space:nowrap <if condition="is_browser('ie', 6)">; float:$stylevar[left]</if>">
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
<if condition="$lastpostinfo['prefix']">
$lastpostinfo[prefix]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a></span>
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</div>
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]#post$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
<else />
<div class="smallfont" align="$stylevar[right]">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</if>
And this is what its outputting:
http://img83.imageshack.us/img83/8812/picture1hd6.png (http://imageshack.us)
http://img83.imageshack.us/img83/picture1hd6.png/1/w416.png (http://g.imageshack.us/img83/picture1hd6.png/1/)
So how can I get the time on the same line as the other text and be justified all the way to the right?
Seven Skins
11-04-2008, 04:33 PM
.
Use table instead of divs ... if you wanna make sure they are in one line.
PS. If user name is too long it will stretch the last post column.
Tried and tested code below:
<if condition="$show['lastpostinfo']">
<div class="smallfont" align="$stylevar[left]">
<div>
<span style="white-space:nowrap">
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
<if condition="$lastpostinfo['prefix']">
$lastpostinfo[prefix]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpostinfo[trimthread]</strong></a></span>
</div>
<table align="center" width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="left" style="white-space:nowrap" class="smallfont">
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</td>
<td align="right" style="white-space:nowrap" class="smallfont">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]#post$lastpostinfo[lastpostid]">
<img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</td>
</tr>
</table>
</div>
<else />
<div class="smallfont" align="$stylevar[right]">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</if>
.
Maxwell the Cat
11-07-2008, 05:54 PM
That works. Thank you!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.