xoops forums
Posted on: 2004/9/15 3:05
smdcom
smdcom (Show more)
Posts: 901
Since: 2004/4/27
#1

Add Yahoo! Messenger Status In Site Info Block

hack i made to add ym status in site info block!

1. edit modules/system/blocks/system_blocks.php
2. backup system_blocks.php...
3. search for:
Quote:

function b_system_info_show($options)
{
global $xoopsConfig, $xoopsUser;
$xoopsDB =& Database::getInstance();
$myts =& MyTextSanitizer::getInstance();
$block = array();
if (!empty($options[3])) {
$block['showgroups'] = true;
$result = $xoopsDB->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM ".$xoopsDB->prefix("groups_users_link")." l LEFT JOIN ".$xoopsDB->prefix("users")." u ON l.uid=u.uid LEFT JOIN ".$xoopsDB->prefix("groups")." g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid");
if ($xoopsDB->getRowsNum($result) > 0) {
$prev_caption = "";
$i = 0;
while ($userinfo = $xoopsDB->fetchArray($result)) {
if ($prev_caption != $userinfo['groupname']) {
$prev_caption = $userinfo['groupname'];
$block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);
}
if ($xoopsUser != '') {
$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$userinfo['uid']."','pmlite',450,370);\"><img src=\"".XOOPS_URL."/images/icons/pm_small.gif\" border=\"0\" width=\"27\" height=\"17\" alt=\"\" /></a>", 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);

} else {
if ($userinfo['user_viewemail']) {
$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => '<a href="mailto:'.$userinfo['email'].'"><img src="'.XOOPS_URL.'/images/icons/em_small.gif" border="0" width="16" height="14" alt="" /></a>', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
} else {
$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => '&nbsp;', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
}
}


4. add tag in red
Quote:

function b_system_info_show($options)
{
global $xoopsConfig, $xoopsUser;
$xoopsDB =& Database::getInstance();
$myts =& MyTextSanitizer::getInstance();
$block = array();
if (!empty($options[3])) {
$block['showgroups'] = true;
$result = $xoopsDB->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, u.user_yim, g.name AS groupname FROM ".$xoopsDB->prefix("groups_users_link")." l LEFT JOIN ".$xoopsDB->prefix("users")." u ON l.uid=u.uid LEFT JOIN ".$xoopsDB->prefix("groups")." g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid");
if ($xoopsDB->getRowsNum($result) > 0) {
$prev_caption = "";
$i = 0;
while ($userinfo = $xoopsDB->fetchArray($result)) {
if ($prev_caption != $userinfo['groupname']) {
$prev_caption = $userinfo['groupname'];
$block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);
}
if ($xoopsUser != '') {
$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'yim' => $myts->htmlspecialchars($userinfo['user_yim']), 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&to_userid=".$userinfo['uid']."','pmlite',450,370);\"><img src=\"".XOOPS_URL."/images/icons/pm_small.gif\" border=\"0\" width=\"27\" height=\"17\" alt=\"\" /></a>", 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);

} else {
if ($userinfo['user_viewemail']) {
$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'yim' => $myts->htmlspecialchars($userinfo['user_yim']), 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => '<a href="mailto:'.$userinfo['email'].'"><img src="'.XOOPS_URL.'/images/icons/em_small.gif" border="0" width="16" height="14" alt="" /></a>', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
} else {
$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'yim' => $myts->htmlspecialchars($userinfo['user_yim']), 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => '&nbsp;', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
}
}


5. go to admin cp | system | block | edit site info

6. change to...
Quote:
<table class="outer" cellspacing="0">

<{if $block.showgroups == true}>

<!-- start group loop -->
<{foreach item=group from=$block.groups}>
<tr>
<th colspan="3"><{$group.name}></th>
</tr>

<!-- start group member loop -->
<{foreach item=user from=$group.users}>
<tr>
<td class="even" valign="middle" align="center"><img src="<{$user.avatar}>" alt="" width="32" /><br /><a href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><{$user.name}></a></td>

<td class="odd" width="20%" align="center" valign="middle">
<a href=http://messenger.yahoo.com/edit/send/?.target=<{$user.yim}>><img src=http://opi.yahoo.com/online?u=<{$user.yim}>&m=g></a>
</td>


<td class="even" width="20%" align="right" valign="middle"><{$user.msglink}></td>
</tr>
<{/foreach}>
<!-- end group member loop -->

<{/foreach}>
<!-- end group loop -->
<{/if}>
</table>

<br />

<div style="margin: 3px; text-align:center;">
<img src="<{$block.logourl}>" alt="" border="0" /><br /><{$block.recommendlink}>
</div>


7. make sure you enter your yim id in profile...

8. example in http://www.xoopsmalaysia.org



JasonMR

Just can't stay away
Posted on: 2004/9/15 4:46
JasonMR
JasonMR (Show more)
Just can't stay away
Posts: 655
Since: 2004/6/21
#2

Re: Add Yahoo! Messenger Status In Site Info Block

Hmmmmm, thanks for this hack smdcom!

I'm gonna test it right away....
Posted on: 2004/9/15 6:00
smdcom
smdcom (Show more)
Posts: 901
Since: 2004/4/27
#3

Re: Add Yahoo! Messenger Status In Site Info Block

Quote:

JasonMR wrote:
Hmmmmm, thanks for this hack smdcom!

I'm gonna test it right away....


your welcome...

gary711

Just popping in
Posted on: 2004/9/15 6:20
gary711
gary711 (Show more)
Just popping in
Posts: 13
Since: 2004/8/3 6
#4

Re: Add Yahoo! Messenger Status In Site Info Block

how to add msn status in site info block??

irmtfan

Module Developer
Posted on: 2004/9/15 6:31
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#5

Re: Add Yahoo! Messenger Status In Site Info Block

how to add yahoo status in user profile to all users can use that.?
thanks by the way

JasonMR

Just can't stay away
Posted on: 2004/9/15 6:52
JasonMR
JasonMR (Show more)
Just can't stay away
Posts: 655
Since: 2004/6/21
#6

Re: Add Yahoo! Messenger Status In Site Info Block

Just in case anyone is as colour blind (not really) as I am, there are 4 changes to be made in system_blocks.php, and 3 changes to the template file (one can easily, as I have done, oversee to change the colspan in the th-tag of the table displaying the info).

Also, if you don't see the changes, change your theme, as this will update your actuall DB file, stored under templates_c (which you need to have deleted previously, as it will only update, if a theme file is actually changed).

Thanks again smdcom.
Posted on: 2004/9/15 7:37
smdcom
smdcom (Show more)
Posts: 901
Since: 2004/4/27
#7

Re: Add Yahoo! Messenger Status In Site Info Block

Quote:

gary711 wrote:
how to add msn status in site info block??


i think msn doesn't support image status... if it does let me know... and give me the url for the status image..

in yahoo it has this image
http://opi.yahoo.com/online?u=<your yahoo id!>&m=g

msn??

JasonMR

Just can't stay away
Posted on: 2004/9/15 7:56
JasonMR
JasonMR (Show more)
Just can't stay away
Posts: 655
Since: 2004/6/21
#8

Re: Add Yahoo! Messenger Status In Site Info Block

I may be able to offer a solution. Though, as I don't use IM, nor am interested in using it, I will not implement it.

Check out this web site http://www.onlinestatus.org/. The nice thing about this solution: you can use a set of icons, with a common design, which looks better than using the propriatary icon set.

Here is a link to a site, that the previous one links to: http://onlinestatus.foxinus.cz:8085/.
There you can get the icons and HTML-snippets/code needed.

Hope this helps.
Posted on: 2004/9/15 8:13
smdcom
smdcom (Show more)
Posts: 901
Since: 2004/4/27
#9

Re: Add Yahoo! Messenger Status In Site Info Block

Quote:

JasonMR wrote:
I may be able to offer a solution. Though, as I don't use IM, nor am interested in using it, I will not implement it.

Check out this web site http://www.onlinestatus.org/. The nice thing about this solution: you can use a set of icons, with a common design, which looks better than using the propriatary icon set.

Here is a link to a site, that the previous one links to: http://onlinestatus.foxinus.cz:8085/.
There you can get the icons and HTML-snippets/code needed.

Hope this helps.


thanks... i will take a look of it..

Posted on: 2004/9/15 8:20
smdcom
smdcom (Show more)
Posts: 901
Since: 2004/4/27
#10

Re: Add Yahoo! Messenger Status In Site Info Block

it seems msn doesn't support Online Status Indicator anymore...

i have test it.. but it display blank image...

http://status.dewaldsr.com:8081/regis ... =&unknownurl=&ircchannel=

u can try it there.. by using your own msn id...

let me know