News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Static links in memberlist.template.php

Started by nay27uk, August 02, 2009, 02:38:13 PM

Previous topic - Next topic

nay27uk

In memberlist.template.php how can I change the following code to static links with my own icons

Quote
// ICQ?
  if (!isset($context['disabled_fields']['icq']))
   echo '
   <td class="windowbg2">', $member['icq']['link'], '</td>';
  // AIM?
  if (!isset($context['disabled_fields']['aim']))
   echo '
   <td class="windowbg2">', $member['aim']['link'], '</td>';
  // YIM?
  if (!isset($context['disabled_fields']['yim']))
   echo '
   <td class="windowbg2">', $member['yim']['link'], '</td>';
  // MSN?
  if (!isset($context['disabled_fields']['msn']))
   echo '
   <td class="windowbg2">', $member['msn']['link'], '</td>';


like this TIP I have used for display template http://www.simplemachines.org/community/index.php?topic=50765.0


Arantor



Arantor

Sorry, I misread that.

The tip should be explaining it. You just upload the icons you want to use into the theme's images directory and apply the edits to Display.template.php as it says.

You may find you get better support by replying in that thread if you need further advice.

nay27uk

Quote from: Arantor on August 02, 2009, 03:14:21 PM
Sorry, I misread that.

The tip should be explaining it. You just upload the icons you want to use into the theme's images directory and apply the edits to Display.template.php as it says.

You may find you get better support by replying in that thread if you need further advice.

You miss read me againe I alredy did it for display template I want the same thing in memberlist.template.php not display template.php

Arantor

Sorry - been very hectic.

That said it's almost identical. The block in question is:

// ICQ?
if (!isset($context['disabled_fields']['icq']))
echo '
<td class="windowbg2">', $member['icq']['link'], '</td>';

// AIM?
if (!isset($context['disabled_fields']['aim']))
echo '
<td class="windowbg2">', $member['aim']['link'], '</td>';

// YIM?
if (!isset($context['disabled_fields']['yim']))
echo '
<td class="windowbg2">', $member['yim']['link'], '</td>';

// MSN?
if (!isset($context['disabled_fields']['msn']))
echo '
<td class="windowbg2">', $member['msn']['link'], '</td>';


Just replace with:

// ICQ?
if (!isset($context['disabled_fields']['icq']))
echo '
<td class="windowbg2"><a href="'. $message['member']['icq']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/icq.gif" border="0" /></a></td>';

// AIM?
if (!isset($context['disabled_fields']['aim']))
echo '
<td class="windowbg2"><a href="'. $message['member']['msn']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/msn.gif" border="0" /></a></td>';

// YIM?
if (!isset($context['disabled_fields']['yim']))
echo '
<td class="windowbg2"><a href="'. $message['member']['aim']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/aim.gif" border="0" /></a></td>';

// MSN?
if (!isset($context['disabled_fields']['msn']))
echo '
<td class="windowbg2"><a href="'. $message['member']['yim']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/yim.gif" border="0" /></a></td>';

nay27uk


Arantor

Does this solve the topic? Please mark it if it does.

nay27uk

sorry nope it has replaced the icons well but when I click any of them it just opens a blank page called about blank

Arantor

My bad, I did it in a bit of a hurry.


// ICQ?
if (!isset($context['disabled_fields']['icq']))
echo '
<td class="windowbg2"><a href="'. $member['icq']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/icq.gif" border="0" /></a></td>';

// AIM?
if (!isset($context['disabled_fields']['aim']))
echo '
<td class="windowbg2"><a href="'. $member['msn']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/msn.gif" border="0" /></a></td>';

// YIM?
if (!isset($context['disabled_fields']['yim']))
echo '
<td class="windowbg2"><a href="'. $member['aim']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/aim.gif" border="0" /></a></td>';

// MSN?
if (!isset($context['disabled_fields']['msn']))
echo '
<td class="windowbg2"><a href="'. $member['yim']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/yim.gif" border="0" /></a></td>';

nay27uk

Great thanks worked a treat just had to rearange the msn aim and stuff as the code you suplied was like this in places. Anyway thanks very much for the help on this

if (!isset($context['disabled_fields']['msn']))
         echo '
         <td class="windowbg2"><a href="'. $member['yim']['href']. '" target="_blank"><img src="' . $settings['images_url'] . '/yim.gif" border="0" /></a></td>';

Arantor

Sorry about that. It's in a different order and I just must have copied in wrongly. Good to see it's sorted though.

Advertisement: