Advertisement:

Working but not great: have username appear differently if buddy

Aloittaja samborabora, elokuu 06, 2014, 07:19:43 IP

« edellinen - seuraava »

samborabora

Okay, I've been trying to think about the easiest way to accomplish this for a week or so, and I finally came up with a crude solution:

In Display.template:

//not buddy
if (!$message['member']['is_buddy'] )
echo '
', $message['member']['link'] , ($message['id'] !== $context['first_message'] && $message['member']['id'] == $context['topic_starter_id'] && !$message['member']['is_guest']) ? '
<br />
<img src="'.$settings['default_images_url'].'/topicstarter2.png" height="6p" width="60px" alt="'.$txt['TopicStarter_txt'].'" title="'.$txt['TopicStarter_txt'].'" style="vertical-align:bottom" />' : '' , '
</h4>
<ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
//is buddy
if ($message['member']['is_buddy'] )
echo '<span class="buddydisp">
', $message['member']['link'] , ($message['id'] !== $context['first_message'] && $message['member']['id'] == $context['topic_starter_id'] && !$message['member']['is_guest']) ? '
</span>
<br />
<img src="'.$settings['default_images_url'].'/topicstarter2.png" height="6p" width="60px" alt="'.$txt['TopicStarter_txt'].'" title="'.$txt['TopicStarter_txt'].'" style="vertical-align:bottom" />' : '' , '
</h4>
<ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';


In css:

.buddydisp a:link, .buddydisp a:hover, .buddydisp a:visited  {
background: black;
color: white !important;
}


There's an example of how you could have people you've buddied appear specially in forum posts, but as you can see, it's really long and repeats too much code, really. I'd like to have this controlled by the array preferably with a class that gets injected directly into the link, but I'm still learning arrays and they always go wrong when I try! If anyone has a tidier solution, I'm all ears, but if not, maybe this concept is useful to someone?

Advertisement: