Changing use of ICQ, AIM, YIM, MSN fields in Memberlist

Started by oclotusclub, January 08, 2008, 02:24:04 AM

Previous topic - Next topic

oclotusclub

My forum is for a car club and I would like to use the existing ICQ, AIM, YIM, and MSN columns in the Memberlist to show the cars they own.

Is it possible to reuse these fields?  I have looked for a mod for this but could not find anything. I saw the Custom Field Mod, but I would also like those custom fields displayed in columns in the Memberlist, not just in the Member Profile.

Is there a solution for this?

Thanks,
Sean

jamesk

I have used the custom profile mod and some manipulation of the memberlist.template.php file to achieve something like what you're looking for.  It does not, however, sort/search by the custom fields.  I think I posted the code in the custom profile fields thread...

oclotusclub

Thanks, James.  I'll take a look at it when I return from CES.

Cheers,
Sean

Fiery

oclotusclub,

Do you have an update for us?

How was CES?

oclotusclub

Quote from: Fiery on January 20, 2008, 09:15:45 PM
oclotusclub,

Do you have an update for us?

How was CES?

CES was great, thanks for asking, Fiery.  Lots of walking, great exhibits, and loads of people.  Nothing new there that you don't already know of through the Internet, though.  In the 80's and early 90's, the CES & Comdex show was essential as it was the only place to really see and hear about the new stuff, other reading about it in printed magazines (PC Magazine, PC World, etc). Today, it's not so essential, but it's still fun because it is in Las Vegas and it's a good excuse for a vacation under the guise of a "business trip". Also, the Adult Video Expo is at the same time, so I think a lot of people go there too. I didn't go though.

Anyway, I haven't been able to find the exact thread which jamesk mentions above. I do not have to sort by the custom fields as he mentions, just display them next to the Member Name on the Members page. Also, I was hoping that I can customize the registration process so that those fields can be filled in at the same time that a person submits their registration for the forum.  Basically, I would just like to make ICQ, AIM, YIM and MSN fields simple text fields.  Right now, I think if something is put in there, it puts an icon for the instant messaging service and makes that icon a clickable link to the IM client. I need to use it to keep track of who has what kind of car, and if they are members of the larger national club.

I have a possible solution of switching out the icons for different images (of cars possibly), then disabling the links to the IM clients (and changing the column headers in the Members page), but I will hold off until I see the solution that jamesk came up with.  If anyone knows of the exact thread he mentions, please post it here.

Thanks!

jamesk

I don't think it was all in one thread, but there were probably links to other/multiple threads.

Anyways, I don't remember exactly what was done, but the memberlist.php file holds the column titles:

// Set up the columns...
$context['columns'] = array(
'isOnline' => array(
'label' => $txt['online8'],
'width' => '20'
),
'realName' => array(
'label' => $txt[35]
),
'emailAddress' => array(
'label' => $txt[307],
'width' => '25'
),

'ICQ' => array(
'label' => $txt['firstname'],
'width' => '25'
),
'AIM' => array(
'label' => $txt['lastname'],
'width' => '25'
),

'avatar' => array(
'label' => $txt['avatar'],
),
'ID_GROUP' => array(
'label' => $txt[87]
),
'registered' => array(
'label' => $txt[233]
),
'posts' => array(
'label' => $txt[21],
'width' => '115',
'colspan' => '2'
)
);


If you see my ICQ, it's
'ICQ' => array(
   'label' => $txt['firstname'],
   'width' => '25'

so that means I added $txt['firstname'] somewhere, probably index.english.php.

The custom profile fields can be displayed in the memberlist by altering the memberlist.template.php file:


// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
echo '
<tr style="text-align: center;"', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '>
<td class="windowbg2">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
</td>
<td class="windowbg" align="left">', $member['link'], '</td>
<td class="windowbg2">', $member['hide_email'] ? '' : '<a href="mailto:' . $member['email'] . '"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . ' ' . $member['name'] . '" /></a>', '</td>

<td class="windowbg2">', empty($member['options']['CP1']) ? '' : $member['options']['CP1'] , '</td>
<td class="windowbg2">', empty($member['options']['CP2']) ? '' : $member['options']['CP2'] , '</td>

<td class="windowbg2">', $member['avatar']['image'], '</td>
<td class="windowbg" align="left">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
<td class="windowbg" align="left">', $member['registered_date'], '</td>
<td class="windowbg2" width="15">', $member['posts'], '</td>
<td class="windowbg" width="100" align="left">
', $member['posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $member['post_percent'] . '" height="15" alt="" />' : '', '
</td>
</tr>';
}


This is what I used to replace the fields I didn't want:
<td class="windowbg2">', empty($member['options']['CP1']) ? '' : $member['options']['CP1'] , '</td>
<td class="windowbg2">', empty($member['options']['CP2']) ? '' : $member['options']['CP2'] , '</td>

If I also recall, I removed all the options for the ICQ,AIM,MSN stuff in the profile...so I assume things were changed around in the profile.template.php file as well...

Ahh...here's a couple of changes:

// Messenger type information.
// REMOVED
/*
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>';
*/

// ADDED
echo '<tr>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
  </tr>
  <tr>
    <td><b>', $txt[69], ': </b></td>
<td>    
    ';
// END


The custom profile thread itself can be viewed by clicking on the "comment on this mod" link in the mod page itself.

Hope that helps...


Sarge

Hello oclotusclub, have you checked out the above code?

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

oclotusclub

This revision to my forum is currently on hold. Thank you for your assistance and inquiries. I will post something here once I return to it.

Rumbaar

I'll make this project as solved at the moment, if and when you return to this project you can post any new questions and/or finding and we'll re-open it.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: