Previous Thread
Next Thread
Print Thread
Rate Thread
#318979 12/29/2012 4:07 AM
Joined: Dec 2001
Posts: 87
Power User
Power User
Joined: Dec 2001
Posts: 87
In my Active Topic listing, I'd like a certain category of postings to have a different background color.

Can anyone give me an assist on how to begin this?

BACKGROUND:
I have a Category with about 6 forums in it that is only open to "members" only. So when a posting from this Category shows up under Active Topics, I'd like it to be immediately obvious (with a different background color).


Bill Barker
Issaquah, Wa
Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
In templates/default/activetopics.tpl find:
Code
<tr>
<td class="{$topics[row].color}" valign="top">
<a href="{ubb url="ubb=postlist&Board=`$topics[row].forum_id`" title=$topics[row].forum_title}">{$topics[row].forum_title}</a>
</td>
<td class="{$topics[row].color}" valign="top">
<img src="{$config.BASE_URL}/images/{$style_array.icons}/{$topics[row].post_icon}" alt="" />
</td>
<td class="{$topics[row].color}" valign="top">
<div {$topics[row].tool_tip}>
{if $topics[row].gonew}
<a href="{ubb url="ubb=show`$display`&topic=`$topics[row].topic_id`&gonew=1#UNREAD"}"><img src="{$config.BASE_URL}/images/{$style_array.general}/gotonew.gif" alt="{$lang.JUMP_NEW}" title="{$lang.JUMP_NEW}" /></a>
{/if}
<a href="{ubb url="ubb=show`$display`&Number=`$topics[row].post_id`#Post`$topics[row].post_id`" title=$topics[row].post_subject}">{$topics[row].post_subject}</a>
{$lang.TEXT_BY} {$topics[row].poster_name}
@ {$topics[row].post_time}<br />
</div>
<br />
<span name="body[{$topics[row].row}]" style="display:block">{$topics[row].post_body}</span>
</td>
</tr>

Replace With:
Code
{if $topics[row].forum_id eq '15'}
<tr>
<td class="{$topics[row].color}_special" valign="top">
<a href="{ubb url="ubb=postlist&Board=`$topics[row].forum_id`" title=$topics[row].forum_title}">{$topics[row].forum_title}</a>
</td>
<td class="{$topics[row].color}_special" valign="top">
<img src="{$config.BASE_URL}/images/{$style_array.icons}/{$topics[row].post_icon}" alt="" />
</td>
<td class="{$topics[row].color}_special" valign="top">
<div {$topics[row].tool_tip}>
{if $topics[row].gonew}
<a href="{ubb url="ubb=show`$display`&topic=`$topics[row].topic_id`&gonew=1#UNREAD"}"><img src="{$config.BASE_URL}/images/{$style_array.general}/gotonew.gif" alt="{$lang.JUMP_NEW}" title="{$lang.JUMP_NEW}" /></a>
{/if}
<a href="{ubb url="ubb=show`$display`&Number=`$topics[row].post_id`#Post`$topics[row].post_id`" title=$topics[row].post_subject}">{$topics[row].post_subject}</a>
{$lang.TEXT_BY} {$topics[row].poster_name}
@ {$topics[row].post_time}<br />
</div>
<br />
<span name="body[{$topics[row].row}]" style="display:block">{$topics[row].post_body}</span>
</td>
</tr>
{else}
<tr>
<td class="{$topics[row].color}" valign="top">
<a href="{ubb url="ubb=postlist&Board=`$topics[row].forum_id`" title=$topics[row].forum_title}">{$topics[row].forum_title}</a>
</td>
<td class="{$topics[row].color}" valign="top">
<img src="{$config.BASE_URL}/images/{$style_array.icons}/{$topics[row].post_icon}" alt="" />
</td>
<td class="{$topics[row].color}" valign="top">
<div {$topics[row].tool_tip}>
{if $topics[row].gonew}
<a href="{ubb url="ubb=show`$display`&topic=`$topics[row].topic_id`&gonew=1#UNREAD"}"><img src="{$config.BASE_URL}/images/{$style_array.general}/gotonew.gif" alt="{$lang.JUMP_NEW}" title="{$lang.JUMP_NEW}" /></a>
{/if}
<a href="{ubb url="ubb=show`$display`&Number=`$topics[row].post_id`#Post`$topics[row].post_id`" title=$topics[row].post_subject}">{$topics[row].post_subject}</a>
{$lang.TEXT_BY} {$topics[row].poster_name}
@ {$topics[row].post_time}<br />
</div>
<br />
<span name="body[{$topics[row].row}]" style="display:block">{$topics[row].post_body}</span>
</td>
</tr>
{/if}

Replace '15' with the id of the special forum. For more than one forum you can adjust to the following and adapt accordingly:
Code
{if $topics[row].forum_id eq '15' || $topics[row].forum_id eq '23'}

You'll need to add an "extra" css of:
Code
.topicsubject_special {
}
.alt-topicsubject_special {
}
.new-topicsubject_special {
}
.new-alt-topicsubject_special {
}

[Linked Image]

You may have to add linking classes as:
Code
.topicsubject_special {
}
.topicsubject_special a:link {
}
.topicsubject_special a:visited {
}
.topicsubject_special a:active {
}
.alt-topicsubject_special {
}
.alt-topicsubject_special a:link {
}
.alt-topicsubject_special a:visited {
}
.alt-topicsubject_special a:active {
}
.new-topicsubject_special {
}
.new-topicsubject_special a:link {
}
.new-topicsubject_special a:visited {
}
.new-topicsubject_special a:active {
}
.new-alt-topicsubject_special {
}
.new-alt-topicsubject_special a:link {
}
.new-alt-topicsubject_special a:visited {
}
.new-alt-topicsubject_special a:active {
}


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
There, last edit...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Dec 2001
Posts: 87
Power User
Power User
Joined: Dec 2001
Posts: 87
Gizmo, this is fantastic. It hits right at the improvement that I've wanted to upgrade for a long time.

Now, maybe I didn't tweak it correctly, but this screen view shows a couple of issues.

1. The Forum names are missing. It says ARRAY instead.

2. Some of the formatting is lost (cell outlines and link colors).

3. Lastly, should I have added the "linking classes" to the common.css file?


[Linked Image]

Many thanks for getting me this far.


Bill Barker
Issaquah, Wa
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
#1 shouldn't happen, we aren't mucking with the array, just appending to links when the forum I'd is matched... Though this was made on 7.5.7 so it could need adjusting for past versions...

#2 did you add the style updates for linking at the bottom of the post?

#3 see the "extra" section of the style editor


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Joined: Dec 2001
Posts: 87
Power User
Power User
Joined: Dec 2001
Posts: 87
Well, here it is morning and the ARRAY link is still showing.

Now, I'm not 100% sure, but I "THINK" that the "array" text didn't show up until I added the new version of activetopics.tpl.

I only modifed and added two files:
activetopics.tpl and
main.css

And I've now added both of the original files back to the Forum. But it still shows the "ARRAY" wording.

Oh, just reread your post -- I haven't updated to 7.5.7 yet.
Was thinking of doing it today. Maybe that's the solution??

Any idea why I may have lost the "presentation" of the link? If you mouse-over it, the link is active.

------------UPDATE------------
I just RE-SAVED the tpl again and then the ARRAY wording disappeared and went back to normal. That part is now working okay.

Last edited by Bill B; 12/29/2012 8:29 PM. Reason: Added UPDATE

Bill Barker
Issaquah, Wa
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
well the presentation of how the link works is because of the
Code
a:link {
}
a:visited {
}
a:active {
}

lines; because of the way the styles are handled (all the different areas to adjust different style options for new posts, alternative coloring, etc) we have to make sure they all get updated for the "special" class too.

Last edited by Gizmo; 12/29/2012 10:21 PM.

UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Dec 2001
Posts: 87
Power User
Power User
Joined: Dec 2001
Posts: 87
I think that I have it working good now... Will give it a more thorough check tomorrow and Sunday.

This appears to work EXACTLY the way that I wanted it to... very cool.

I hope that there's no "collateral" damage. :-)


Bill Barker
Issaquah, Wa
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
There shouldn't be, it's simply changing the class of items in specific forums...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Dec 2001
Posts: 87
Power User
Power User
Joined: Dec 2001
Posts: 87
So far, so good. I only made a couple of simple CSS changes - the biggest being the background color. I've just modified it again, and it seems to be working very nicely. I have 9 different forums that all list in a differnt color.

Now... I might try to expand this some more, and introduce ANOTHER color (third) for yet a different forum. We'll see.

I really like this. Sorry that you can't see it, since you'd have to be logged in as a MEMBER in order for the different color to show.


Bill Barker
Issaquah, Wa
Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Lol, sounds interesting actually; I'm glad that it worked out for you though.


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)