Quasidan (quasidan) wrote in stylehelp,
Quasidan
quasidan
stylehelp

  • Music:

Making friends view talklinks use the assigned foreground and background colors for each friend

zvi_likes_tv wants "the talkpost and talkread links to be the same as the assigned friend foreground color." (link)

You can't do it through FRIENDS_TALK_LINKS because %%fgcolor%% and %%bgcolor%% doesn't work through there. So basically you have to copy all that stuff (talk and readlinks) into FRIENDS_EVENT (and the private and friends-only versions). Using Generator, your HTML for FRIENDS_EVENT might look something like this:

<table width="600" cellpadding="2" cellspacing="0"
border="0" summary="" class="entrybox">
<tr align='left'>
<td bgcolor="%%color:stronger_back%%" align="center">
<table width="100%" cellpadding="5" cellspacing="0"
border="0"
summary="">
<tr align='left'>
<td class="caption">%%subject%%</td>
<td align="right" class="index">[%%datetime%%]</td>
</tr>
<tr align='left'>
<td colspan="2" bgcolor="%%color:page_back%%">
<table cellpadding="1" align="right" cellspacing="0"
border="0"
summary="">
<tr align='left'><td bgcolor="%%color:stronger_back%%">
<table cellpadding="2" align="center" cellspacing="0"
border="0"
summary="">
<tr align='left'><td bgcolor="%%bgcolor%%" align="center">
<a class="index" href="%%cons:siteroot%%/users/%%user%%/">
%%friendpic%%
<font color="%%fgcolor%%">%%user%%</font></a>%%altposter%%
</td></tr></table>
</td></tr></table>
%%currents%%
%%event%%
</td>
</tr>
<tr>
<td align="right" colspan="2" width="100%" class="comments" style="background: %%bgcolor%%">
<a href="%%urlread%%" style="color:%%fgcolor%%"><b>%%messagecount%% comment%%mc-plural-s%%</b></a>|<a href="%%urlpost%%" style="color:%%fgcolor%%">post comment</a>
</td>
</tr></table>
</td>
</tr>
</table><p>


To see this style in action, check out this link. This is Stylehelp Style #190152 (feel free to copy and use).
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 2 comments
Are you sure that the %%urlread%% and %%urlpost%% properties are available in FRIEND_EVENT? I didn't think that they were, and in fact the customview link with style 190152 has these links broken.

I did a similar thing for one of my own styles using CSS, which came out rather like this: at the beginning of FRIEND_EVENT, before any event properties, I put in a small style definition.

<style type="text/css">
<!--

.event_talk_%%user%%%%itemid%% A:link
{ color: %%fgcolor%% ;
}
.event_talk_%%user%%%%itemid%% A:visited
{ color: %%fgcolor%% ;
}
.event_talk_%%user%%%%itemid%% A:hover
{ color: %%fgcolor%%;
text-decoration: underline;
}
.event_talk_%%user%%%%itemid%% A:active
{ color: %%color:page_alink%%;
text-decoration: underline;
}

-->
</style>

Then, where I wanted to use comments (inside a block which already had %%bgcolor%% as its background), I put the comments links inside a style class. The "color:" part of the style handled the non-link text, and a similar scheme could probably be used to define a background color on that block, if one weren't already there in my style.

<div class="event_talk_%%user%%%%itemid%%" style="color: %%fgcolor%%;">
%%talklinks%%
</div>

The style number on that is 79084, "Friends Sidebar" by user cmshaw if you want to look it up in the Style Browser; because of some other modifications, it'll only appear well in IE5+ on Windows, though. Sorry 'bout that.
You're right about the comment links, I forgot to change them (will do right now).