PDA

View Full Version : Need Code to Add 1 Pixel Borders to Forum and Thread List


SolarTalk
12-06-2008, 02:48 PM
Hello,

For example, on vbulletin.org, when you first come to this site and click on the "forums" tab, there is a list of all the forums. You'll notice the forum name, last post, threads, and post is separated by a thin border and the white and gray colors that run vertically also. For example it's vertically white for the list of forum names, and then a light gray for the list of all the last posts, etc.

I recently bought a skin and instead of having all the separation, it's all completely white.

Could someone please post the code I need to accomplish this and tell me what file to put the code under?? I'm not getting support from the company I bought the skin from and really need this fixed. Besides, I would like to learn how to do it myself.

Thanks so much! :up:

--------------- Added 1228582211 at 1228582211 ---------------

oh and just to add, i want to do the same thing for the list of threads as well. thanks!

Lynne
12-06-2008, 03:53 PM
All those are are borders in the table. Very often, you will see in the table tag "border="0"" because they don't want a border at all. You need to set that to 1.

Seven Skins
12-06-2008, 03:56 PM
Its hard to suggest anything when we don't have the code or site.
It might be that the lines are same color as tables or it might be there is no spacing in between table cells.

.

SolarTalk
12-06-2008, 04:05 PM
Lynne, thank you for the response, where would I find the "table tag" so i can change it?

Seven, the website is www.sol@rp@nelt@lk . com...what code would you like me to post?

Thanks.

Lynne
12-06-2008, 04:26 PM
The link to your site doesn't work.

A table tag is something that looks like this (this is from the page source for this page):
<table id="header" border="0" width="100%" cellpadding="0" cellspacing="0" align="center">

You will find the correct table you need in your templates. To find which template to look in - 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.

SolarTalk
12-06-2008, 05:18 PM
Thank you, I did what you said, and it turned out looking like this:

Click Here (http://www.solarpaneltalk.com)

I just put "1" for the border and it seems to much. I would like them really thin and dim, like here on vbulletin.org. I looked at the source code for this forum and couldn't find what code it would be, i noticed it said "0" for borders, so thats confusing me. also would you happen to know how to add the vertical colors of white and gray at the separations, also like here on vbulletin.org?

Thanks again Lynne, I finally feel like I'm getting somewhere.

Lynne
12-06-2008, 05:33 PM
It looks like here on vb, they have border set to 0 and then they use the class tborder to set the border. You should look at the css for this site - in particular the tborder class and alt1 and alt2. They have the columns for those area set to be class alt1, which I think is the default but you removed it.

SolarTalk
12-06-2008, 05:43 PM
how do i see the css?

Seven Skins
12-06-2008, 05:56 PM
It looks like in your style cellspacing has been set to 0, set it to 1 in stylevars of your styles. But it might change the layout in lot of places. See how it goes, you can always change it back to 0.

.

Lynne
12-06-2008, 06:03 PM
how do i see the css?
If you look at the top of the page source for this site, you'll see lines like this (this is for the blue style I am using):

<!-- CSS Stylesheet -->
<link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style-aa50424c-00023.css" id="vbulletin_css" />

So, you'd view it at www.vbulletin.org/forum/clientscript/vbulletin_css/style-aa50424c-00023.css

SolarTalk
12-06-2008, 06:43 PM
I figured out the problem, I just need to figure out the correct place to put the "alt1" and "alt2" tags. They are set up with the border and color, but just can't place them right.

I go style manager > edit templates > forum home templates > then choose the file that I'm seeing under the "view source" but it's different when I'm trying to edit the actual file.

Here is the code for "forumhome_lastpostby" where would I put the "alt2" tag?

<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-->&nbsp;</if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&amp;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&amp;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>

Lynne
12-06-2008, 07:13 PM
You should not have to modify the forumhome_lastpostby template. The columns are included in the template that calls that template (look for the <td> tags around $lastpostby or whatever the call is for that template).

SolarTalk
12-06-2008, 07:41 PM
sorry lynne, but I'm losing you.

I tried to put the <td class="alt2"> tag in various places in the "forumhome_lastpostby" template and it worked, but it just through off the rest of the tables.

I did the same thing to another template, and it worked. If you look at the site, you'll notice the background color and border on the far left where the icons are work fine, i'm just having problems how to fix the other columns.

could you please explain what you meant in a different way? i would appreciate it!

Lynne
12-06-2008, 07:51 PM
You cannot just add a td tag into someplace. You need to just add the class="alt2" into *existing* td tags. It looks like you need to modify the forumhome_forumbit_level2_nopost template and add in the class. Look at this line, you have an empty place in where the class should be (highlighted in red):
<!-- BEGIN TEMPLATE: forumhome_forumbit_level2_post -->
<tr align="center">
<td class="alt1"><img src="web/statusicon/forum_old.gif" alt="" border="0" id="forum_statusicon_13" /></td>
<td class="" align="left" id="f13">
<div>
<a href="forumdisplay.php?f=13"><strong>Member Welcome</strong></a>

</div>
<div class="smallfont">New to Solar Panel Talk? Come in and introduce yourself.</div>


</td>
<td class="" nowrap="nowrap"><!-- BEGIN TEMPLATE: forumhome_lastpostby -->

<div class="smallfont" align="left">


You need to change those to class="alt2" (alt1 would make it white, I think)

SolarTalk
12-06-2008, 08:02 PM
see i noticed that missing tag too, but when I go to the "forumhome_forumbit_level2_nopost" template it isn't there. thats why i'm confused. do you think it was named wrong?

This is what the template "forumhome_forumbit_level2_nopost" looks like:

<tr>
<td class="tcat"><span class="smallfont">&nbsp;</span></td>
<td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">5<else />4</if>">
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
$childforumbits



This is what "forumhome_forumbit_level2_post" looks like: (i added the "alt1" right there in the beginning and replaced "$rowClass" that was there previously. thats what made the background color and border work on the icons that are on the left of the table

<tr align="center">
<td class="alt1"><img src="$stylevar[imgdir_statusicon]/$forum[imageprefix]forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td class="$rowClass" align="$stylevar[left]" id="f$forum[forumid]">
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
<td class="$rowClass" nowrap="nowrap">$forum[lastpostinfo]</td>
<td class="$rowClass">$forum[threadcount]</td>
<td class="$rowClass">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="$rowClass"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>
</tr>
$childforumbits

Lynne
12-06-2008, 08:32 PM
This is what "forumhome_forumbit_level2_post" looks like: (i added the "alt1" right there in the beginning and replaced "$rowClass" that was there previously. thats what made the background color and border work on the icons that are on the left of the table
This is the third line in your "forumhome_forumbit_level2_post" template:

<td class="$rowClass" align="$stylevar[left]" id="f$forum[forumid]"> Change it to:
<td class="alt1" align="$stylevar[left]" id="f$forum[forumid]">
And do similar to other columns like that.

SolarTalk
12-06-2008, 09:23 PM
Thanks so much for your patience and help Lynne. I got it figured out thanks to you and I also learned a ton. Thanks again!

Lynne
12-06-2008, 09:24 PM
It looks very nice! :up: