News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Not displaying empty lines in profile

Started by Burpee, October 20, 2004, 11:07:12 AM

Previous topic - Next topic

Burpee

I've been wanting to do this for some time now...
Whenever people don't have their ICQ, AIM, MSN and YIM entered in the forum profile information, the profile still displays these lines but they remain empty. Would it be possible to just not display these lines for people that haven't filled them in?

The code I think should probably be edited is in Profile.template.php:
// Messenger type information.
echo '
<tr>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr><tr>
<td><b>', $txt[513], ':</b></td>
<td>', $context['member']['icq']['link_text'], '</td>
</tr><tr>
<td><b>', $txt[603], ': </b></td>
<td>', $context['member']['aim']['link_text'], '</td>
</tr><tr>
<td><b>', $txt['MSN'], ': </b></td>
<td>', $context['member']['msn']['link_text'], '</td>
</tr><tr>
<td><b>', $txt[604], ': </b></td>
<td>', $context['member']['yim']['link_text'], '</td>
</tr><tr>
<td><b>', $txt[69], ': </b></td>
<td>';


Shouldn't be too hard to do, but I wouldn't know how to  :-[

Burpee

#1
Hmm... figured it out...
// Messenger type information.
echo '
<tr>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr>';

if (!empty($context['member']['icq']['link_text']))
echo '
<tr>
<td><b>', $txt[513], ':</b></td>
<td>', $context['member']['icq']['link_text'], '</td>
</tr>';
if (!empty($context['member']['aim']['link_text']))
echo '
<tr>
<td><b>', $txt[603], ': </b></td>
<td>', $context['member']['aim']['link_text'], '</td>
</tr>';
if (!empty($context['member']['msn']['link_text']))
echo '
<tr>
<td><b>', $txt['MSN'], ': </b></td>
<td>', $context['member']['msn']['link_text'], '</td>
</tr>';
if (!empty($context['member']['yim']['link_text']))
echo '
<tr>
<td><b>', $txt[604], ': </b></td>
<td>', $context['member']['yim']['link_text'], '</td>
</tr>';
               echo '
<tr>
<td><b>', $txt[69], ': </b></td>
<td>';

Waste

It won't let me copy/paste. :(
Guess I will have to do it by hand. :)

Burpee

Hmm... odd...
Perhaps this should be moved to tips and tricks?

Kindred

I like this...

As a note, it can also be applied to any of the profile settings that you do not wish to display when empty.
(I also applied it to website)


// Some more information.
if (!empty($context['member']['website']['url']))
echo '
</td>
</tr><tr>
<td><b>', $txt[96], ': </b></td>
<td><a href="', $context['member']['website']['url'], '" target="_blank">', $context['member']['website']['title'], '</a></td>
</tr>';
echo '
<tr>
<td><b>', $txt[113], ' </b></td>
<td>
<i>', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" border="0" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</i>
</td>
</tr><tr>';
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: