(1) 2 »
smdcom smdcom
  • Joined: 2004/4/26 23:46
  • From Malaysia
  • Group: Registered Users
  • Posts: 901
  • Posted on: 2004/9/14 23:05
Add Yahoo! Messenger Status In Site Info Block #1
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 JasonMR
  • Just can't stay away
  • Just can't stay away
  • Joined: 2004/6/21 6:38
  • Group: Registered Users
  • Posts: 655
  • Posted on: 2004/9/15 0:46
Re: Add Yahoo! Messenger Status In Site Info Block #2
Hmmmmm, thanks for this hack smdcom!

I'm gonna test it right away....
smdcom smdcom
  • Joined: 2004/4/26 23:46
  • From Malaysia
  • Group: Registered Users
  • Posts: 901
  • Posted on: 2004/9/15 2:00
Re: Add Yahoo! Messenger Status In Site Info Block #3
Quote:

JasonMR wrote:
Hmmmmm, thanks for this hack smdcom!

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


your welcome...
gary711 gary711
  • Just popping in
  • Just popping in
  • Joined: 2004/8/3 2:10
  • Group: Registered Users
  • Posts: 13
  • Posted on: 2004/9/15 2:20
Re: Add Yahoo! Messenger Status In Site Info Block #4
how to add msn status in site info block??
irmtfan irmtfan
  • Module Developer
  • Module Developer
  • Joined: 2003/12/7 15:14
  • From In the middle of nowhere
  • Group: Registered Users Community Coordinator (temporary)
  • Posts: 3419
  • Posted on: 2004/9/15 2:31
Re: Add Yahoo! Messenger Status In Site Info Block #5
how to add yahoo status in user profile to all users can use that.?
thanks by the way
JasonMR JasonMR
  • Just can't stay away
  • Just can't stay away
  • Joined: 2004/6/21 6:38
  • Group: Registered Users
  • Posts: 655
  • Posted on: 2004/9/15 2:52
Re: Add Yahoo! Messenger Status In Site Info Block #6
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.
smdcom smdcom
  • Joined: 2004/4/26 23:46
  • From Malaysia
  • Group: Registered Users
  • Posts: 901
  • Posted on: 2004/9/15 3:37
Re: Add Yahoo! Messenger Status In Site Info Block #7
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 JasonMR
  • Just can't stay away
  • Just can't stay away
  • Joined: 2004/6/21 6:38
  • Group: Registered Users
  • Posts: 655
  • Posted on: 2004/9/15 3:56
Re: Add Yahoo! Messenger Status In Site Info Block #8
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.
smdcom smdcom
  • Joined: 2004/4/26 23:46
  • From Malaysia
  • Group: Registered Users
  • Posts: 901
  • Posted on: 2004/9/15 4:13
Re: Add Yahoo! Messenger Status In Site Info Block #9
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..

smdcom smdcom
  • Joined: 2004/4/26 23:46
  • From Malaysia
  • Group: Registered Users
  • Posts: 901
  • Posted on: 2004/9/15 4:20
Re: Add Yahoo! Messenger Status In Site Info Block #10
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
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team