TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 11:50:36 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,176
  • Total Topics: 21,220
  • Online today: 177
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 136
  • Total: 137
  • davo88

Adding YIM icon

Started by alhaudhie, December 16, 2009, 04:36:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alhaudhie

TP 1.0.4

SMF 1.1.10

Adding YIM icon in user online block.

How can we add

side of username in online user list...?

like when user is On their YIM the icon
Mrcare
is showing side their name and other user can cliick to go for YM or yahoo instant web massengger.

i have try to edit the code in TPBlocks.template.php like
$online = ssi_whosOnline('array');    
           echo $bullet.$txt['tp-users'].': '.$online['num_users'];    
           echo '<br />'.$bullet.$txt['tp-guests'].': '.$online['guests'];    
           echo '<br />'.$bullet.$txt['tp-total'].': '.$online['total_users'].'<hr />
<div style="width: 100%; ' , $online['num_users']>5 ? 'height: 32ex;overflow: auto;' : '' ,'">';       

   foreach($online['users'] as $user)
{

if ($message['member']['yim']['href'])
echo '
<a href="', $message['member']['yim']['href'], '" target="_blank"><img src="' . $settings['images_url'] . '/yim.gif" border="0" /></a>';
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo '<br />';
}
echo '
</div>';
}
echo '</div>';
}

but there is nothing... tq.

Freddy

Where are you getting the $message array from ?

alhaudhie

Quote from: freddy888 on December 16, 2009, 05:30:14 PM
Where are you getting the $message array from ?

i get it from display.template.php

Freddy

You can't just add in a reference to an array wherever you like - the array needs to be loaded some place first.  Your array is going to be empty because ssi_whosOnline does not load up your $message array.  So that is why it doesn't work.

I would go and edit the ssi_whosOnline.php and add the YIM field to it's output.  Then you can check it like this :

if ($user['YIM'])
{
      ...display the icon and link...
}

alhaudhie

i have tried it like
foreach($online['users'] as $user)
      {
         
     if ($user['YIM'])

          echo '
                                    <a href="', $message['member']['yim']['href'], '" target="_blank"><img src="' . $settings['images_url'] . '/yim.gif" border="0" /></a>';
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
         echo '<br />';
   
}


but nothing change..

Freddy

Did you do what I suggested with the ssi_whosOnline.php ?

You still have a reference to $message in there too...

alhaudhie

Quote from: freddy888 on December 16, 2009, 06:13:36 PM
Did you do what I suggested with the ssi_whosOnline.php ?

You still have a reference to $message in there too...

oh.. sorry... i edit the wrong file..

alhaudhie

nothing change..

// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';
//ym
if ($user['YIM'])
{
          echo '
                                    <a href="', $message['member']['yim']['href'], '" target="_blank"><img src="' . $settings['images_url'] . '/yim.gif" border="0" /></a>';
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
         echo '<br />';
   
}   
// Bold any buddies.

Freddy

I said to add the field YIM to the output of the array.... and why are you using the $message array again ?

Please read what I say carefully...

Do you want me to do this for you if you are stuck ?

alhaudhie

 :laugh:

Quote from: freddy888 on December 16, 2009, 06:46:16 PM
I said to add the field YIM to the output of the array.... and why are you using the $message array again ?

Please read what I say carefully...

Do you want me to do this for you if you are stuck ?

yes... i dont know anything.. what i did is try and try and try...

hope u can tell step by step.. tq