Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: nay27uk on August 02, 2009, 02:38:13 PM

Title: Static links in memberlist.template.php
Post by: nay27uk on August 02, 2009, 02:38:13 PM
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 (http://www.simplemachines.org/community/index.php?topic=50765.0)

Title: Re: Static links in memberlist.template.php
Post by: Arantor on August 02, 2009, 02:44:03 PM
See this thread (http://www.simplemachines.org/community/index.php?topic=50765.0).
Title: Re: Static links in memberlist.template.php
Post by: nay27uk on August 02, 2009, 02:47:31 PM
Quote from: Arantor on August 02, 2009, 02:44:03 PM
See this thread (http://www.simplemachines.org/community/index.php?topic=50765.0).

Thats the one I alredy posted above
Title: Re: Static links in memberlist.template.php
Post by: 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.
Title: Re: Static links in memberlist.template.php
Post by: nay27uk on August 02, 2009, 03:37:08 PM
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
Title: Re: Static links in memberlist.template.php
Post by: Arantor on August 02, 2009, 03:47:04 PM
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>';
Title: Re: Static links in memberlist.template.php
Post by: nay27uk on August 02, 2009, 04:37:53 PM
thanks so much for the help
Title: Re: Static links in memberlist.template.php
Post by: Arantor on August 02, 2009, 04:45:51 PM
Does this solve the topic? Please mark it if it does.
Title: Re: Static links in memberlist.template.php
Post by: nay27uk on August 02, 2009, 04:50:53 PM
sorry nope it has replaced the icons well but when I click any of them it just opens a blank page called about blank
Title: Re: Static links in memberlist.template.php
Post by: Arantor on August 02, 2009, 05:11:14 PM
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>';
Title: Re: Static links in memberlist.template.php
Post by: nay27uk on August 02, 2009, 07:38:38 PM
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>';
Title: Re: Static links in memberlist.template.php
Post by: Arantor on August 02, 2009, 08:05:46 PM
Sorry about that. It's in a different order and I just must have copied in wrongly. Good to see it's sorted though.