Advertisement:

Author Topic: Static links in memberlist.template.php  (Read 5404 times)

Offline nay27uk

  • Full Member
  • ***
  • Posts: 573
  • Gender: Male
    • Lister Hosting
Static links in memberlist.template.php
« 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
 
 
« Last Edit: August 02, 2009, 02:43:12 PM by nay27uk »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Static links in memberlist.template.php
« Reply #1 on: August 02, 2009, 02:44:03 PM »
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline nay27uk

  • Full Member
  • ***
  • Posts: 573
  • Gender: Male
    • Lister Hosting
Re: Static links in memberlist.template.php
« Reply #2 on: August 02, 2009, 02:47:31 PM »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Static links in memberlist.template.php
« Reply #3 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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline nay27uk

  • Full Member
  • ***
  • Posts: 573
  • Gender: Male
    • Lister Hosting
Re: Static links in memberlist.template.php
« Reply #4 on: August 02, 2009, 03:37:08 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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Static links in memberlist.template.php
« Reply #5 on: August 02, 2009, 03:47:04 PM »
Sorry - been very hectic.

That said it's almost identical. The block in question is:
Code: [Select]
// 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:
Code: [Select]
// 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>';
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline nay27uk

  • Full Member
  • ***
  • Posts: 573
  • Gender: Male
    • Lister Hosting
Re: Static links in memberlist.template.php
« Reply #6 on: August 02, 2009, 04:37:53 PM »
thanks so much for the help

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Static links in memberlist.template.php
« Reply #7 on: August 02, 2009, 04:45:51 PM »
Does this solve the topic? Please mark it if it does.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline nay27uk

  • Full Member
  • ***
  • Posts: 573
  • Gender: Male
    • Lister Hosting
Re: Static links in memberlist.template.php
« Reply #8 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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Static links in memberlist.template.php
« Reply #9 on: August 02, 2009, 05:11:14 PM »
My bad, I did it in a bit of a hurry.

Code: [Select]
// 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>';
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline nay27uk

  • Full Member
  • ***
  • Posts: 573
  • Gender: Male
    • Lister Hosting
Re: Static links in memberlist.template.php
« Reply #10 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>';

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,041
    • Arantor on GitHub
Re: Static links in memberlist.template.php
« Reply #11 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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.