UBB.Dev
Hi


I asked JoshPet for help with a hack to make the already "read posts" a visited link colour.

The mod doesnt seem to work so he suggested that I post the code here for some help.

In a nutshell I want the posts that have already been read to turn a visited link colour (users arent used to the yellow and orange open book icons)

Here is an excerpt from my message:



"You know the two icons that tell you whether a thread has a new post(little orange open book) and the little yellow open book?
Well the users want the subject line itself to change colour if the post has been read

Like in our existing older forum.
http://www.b2g3.com/boards/board.cgi?user=CYABC

Is there anyway to change that or are the post icons in the Legend: New Posts and No new posts the only option we have?

Can I make the *read post* a visited link colour?

Did that make sense?

For instance: Poster Views Replies

Subject: Leanna 2 0

(orange new post icon here depicting new message)
Josh is Great

Now once I have clicked on *josh is great* to read it, can that Josh is Great text be turned into a visited link colour(as well as the yellow *post has been read icon*?

The members are used to their text being a visited link."


Below is the mod that Josh did for me but it doesnt seem to work. (nothing happens at all)

Btw, here is my ubbthreads form addy:
http://cyabc.infopop.cc/ubbthreads/postlist.php?Cat=&Board=Scratch


JoshPet's Message & Mod

I would think that the text link appearing the color of a visited link happens in the browser.. but it doens't in threads...might be the stylesheet overriding something...
My forums the link does change color after you've visited it. But not each time... in other words it's not a read/unread thing.. the browser just remembers.

I don't know if you would be able to make the text different colors for read/unread messages.

Now I havne't tested this out... I do alot of things with trial and error.. .but you might see if you could hack something together.....

In postlist.php find this:

// ----------------------------------------------------------------
// If we are going to be viewing in flat mode, let's show all pages
$pageprint = "";
if ( ($mode == "showflat") && ($Replies >= $user['U_FlatPosts']) ) {
$pages = $Replies;
if ($Replies <= $user['U_FlatPosts']) { $pages= $pages + 1; }
if ($user['U_FlatPosts']) {
$pages = ($pages) / $user['U_FlatPosts'];
}
$pageprint = " <font class="small">( {$ubbt_lang['PAGE_TEXT']} ";
for ($prints = 1; $prints <= ($pages+1); $prints++) {
$pageprint .= "<a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board=$Board&Number=$Number&page=$page&view=$view&sb=$sb&o=$o&fpart=$prints">$prints</a> ";
}
$pageprint .= "<a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board=$Board&Number=$Number&page=$page&view=$view&sb=$sb&o=$o&fpart=all">{$ubbt_lang['TEXT_ALL']}</a> )</font>";
}

And see if something like this might work:
// ----------------------------------------------------------------
// If we are going to be viewing in flat mode, let's show all pages
$pageprint = "";
if ( ($mode == "showflat") && ($Replies >= $user['U_FlatPosts']) ) {
$pages = $Replies;
if ($Replies <= $user['U_FlatPosts']) { $pages= $pages + 1; }
if ($user['U_FlatPosts']) {
$pages = ($pages) / $user['U_FlatPosts'];
}
$pageprint = " <font class="small">( {$ubbt_lang['PAGE_TEXT']} ";
for ($prints = 1; $prints <= ($pages+1); $prints++) {
if ( ($Posted > $unread) && ( !ereg($thisone,$read) ) ) {
$pageprint .= "<font color="0000ef"><a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board=$Board&Number=$Number&page=$page&view=$view&sb=$sb&o=$o&fpart=$prints">$prints</a></font> ";
}
else {
$pageprint .= "<font color="9c009c"><a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board=$Board&Number=$Number&page=$page&view=$view&sb=$sb&o=$o&fpart=$prints">$prints</a></font> ";
}
}
if ( ($Posted > $unread) && ( !ereg($thisone,$read) ) ) {
$pageprint .= "<font color="0000ef"><a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board=$Board&Number=$Number&page=$page&view=$view&sb=$sb&o=$o&fpart=all">{$ubbt_lang['TEXT_ALL']}</a> )</font>";
}
else {
$pageprint .= "<font color="0000ef"><a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board=$Board&Number=$Number&page=$page&view=$view&sb=$sb&o=$o&fpart=all">{$ubbt_lang['TEXT_ALL']}</a> )</font>";
}
}

Note how I've added the "if unread" conditions, then manually inserted the font tags with colors (you might need to tweak the colors).

That would be my best GUESS... but I don't know. You might try playing and see.... if not... post the code above on threadsdeve and say "I'm close but this isn't working" and maybe someone (smarter than me LOL) would know.

Hope that helps a bit.

Josh

-------------------------------------------------------



Also. I would like to get rid of some of those post icons, and have the unread and read posts as a link color, the yellow book and orange book clutter the board IMO


Any ideas gentleman?


Thanks in advance

Lerosia
You should be able to change your link visited/active/hover colors using the stylesheets.
Examples:


A:link {
color: #0000FF;
}
A:visited {
color: #FF0000;
}
A:active {
color: #00FF00;
}
A:HOVER {
color: #FF0000;
}

.onbody A:LINK {
color: #0000FF;
}
.onbody A:VISITED {
color: #FF0000;
}
.onbody A:ACTIVE {
color: #00FF00;
}
.onbody A:HOVER {
color: #FF0000;
}
Posted By: JoshPet Re: Make a - 09/16/2002 4:45 PM
LOL

Gee that seems a lot simpler than what I thought.

Also Lerosia.... the post icon could be edited out of the postlist.tmpl template.
Posted By: Lerosia Re: You read my mind - 09/16/2002 5:03 PM
Hi Dave

Funny I was just popping back in to post the stylesheet I was using.
Where do I change it"

Heres my stylesheet:

A:link, A:visited, A:active, A:hover {
text-decoration: none;
font-weight: regular;
}
A:link {
color: #990000;
}
A:visited {
color: #990000;
}
A:active {
color: #990000;
}
A:HOVER {
color: #dc143c;
}
.onbody{
background: #FFFFEE:;
}
.onbody A:LINK {
color: #990000;
}
.onbody A:VISITED {
color: #990000;
}
.onbody A:ACTIVE {
color: #990000;
}
.onbody A:HOVER {
color: #dc143c;
}
BODY,P,TABLE,TD,TR {
font-size: 9pt;
font-family: verdana,arial,sans-serif;
}
BODY {
background: #FFFFFF;
}
PRE {
font-size: 8pt;
font-family: courier;
}
.tableborders {
background: #000000;
}
.tdheader {
font-size: 11pt;
font-weight: bold;
color: #ffffff;
background: #006666;
font-family: arial;
}
.tdheader A:LINK {
color: #f5f5f5;
}
.tdheader A:VISITED {
color: #f8f8ff;
}
.tdheader A:ACTIVE {
color: #ff0000;
}
.menubar{
font-size: 10pt;
font-family: vedana, arial;
background: #d3d3d3;
color: #006666;
}
.post {
}
.post:FIRST-LINE {
}
.post:FIRST-LETTER {
}
.new {
font-size: 8pt;
color: #dc143c;
}
.catandforum {
font-size: 8pt;
}
.posttime {
font-size: 8pt;
font-style: oblique;
text-align: center;
background: #EFEFEF;
}
.threadtotal {
font-size: 8pt;
background: #EFEFEF;
}
.posttotal {
font-size: 8pt;
background: #d3d3d3;
}
.small {
font-size: 8pt;
font-family: helvetica,arial;
}
.standouttext {
color: blue;
}
.welcome {
background: #ffffff;
font-family: Times new roman;
color: #000000;
}
.forumtitle {
}
.forumdescript {
font-size: 8pt;
}
.lighttable {
background: #f5fffa;
color: #000000;
}
.darktable {
background: #ffffff;
color: #000000;
}
.darktable A:LINK {
color: #990000;
}
.darktable A:VISITED {
color: #990000;
}
.darktable A:ACTIVE {
color: #006666;
}
.darktable A:HOVER {
color: #dc143c;
}
.cleartable {
background: #FFFFFF;
}
.footertable {
background: #d3d3d3;
}
.alternatetable {
background: #FFFFFF;
}
.subjecttable {
background: #ffffff;
}
.formboxes{
font-family: geneva, arial, sans-serif;
background-color: #ffffff;
color: #000000;
}
.buttons {
font-family: geneva, arial, sans-serif;
background-color: #cccccc;
color: #000000;
}



Lerosia
Posted By: AllenAyres Re: You read my mind - 09/16/2002 5:31 PM
Moving to "how do I?"
Posted By: Lerosia Sorry Allen - 09/17/2002 6:50 AM
I had a feeling this was a How Do I post but not sure because of the code

FYI, Thank you very much for the fix info. It was just a couple of changes to my stylesheets
I havent played with stylesheets so I was a bit nervous but after a few test sheets it worked fine

Thanks again



Lerosia
Posted By: AllenAyres Re: Sorry Allen - 09/17/2002 7:07 AM
no problem, just keeping the forums as neat and useful as possible. Glad you got it working
© UBB.Developers