4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: universal on April 21, 2005, 03:27:35 PM
-
<tr>
<td width="35%" align="right"><b>{lang_icq}</b></td>
<td>{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
</tr>
Why I never saw (<b>{user_icq_status}</b>) thing working? And how to fix it? I`m talking about member_profile.html
You can try to look at this here: http://www.pramoga.net/member.php?action=showprofile&user_id=1
-
That's a VERY good question :)
I was also curious, but did not see it as a big problem (as my users do not fill their ICQ out very often)...
-
The ICQ url format has been changed, that's why it doesnt work anymore...
in includes/functions.php find:function get_icq_status($uin) {
// From: http://www.koehntopp.de/php/snippets.html#code-icq
if (!is_numeric($uin)) return FALSE;
$fp = @fsockopen('wwp.icq.com', 80, $errno, $errstr, 8);
if (!$fp) return FALSE;
$request = "HEAD /scripts/online.dll?icq=$uin&img=5 HTTP/1.0\r\n"
."Host: wwp.icq.com\r\n"
."Connection: close\r\n\r\n";
fputs($fp, $request);
do {
$response = fgets($fp, 1024);
}
while (!feof($fp) && !stristr($response, 'Location'));
fclose($fp);
if (strstr($response, '4367')) return 'online';
if (strstr($response, '4349')) return 'offline';
if (strstr($response, '4386')) return 'disabled';
return FALSE;
}
Replace it with:function get_icq_status($uin) {
// From: http://www.koehntopp.de/php/snippets.html#code-icq
if (!is_numeric($uin)) return FALSE;
$fp = @fsockopen('status.icq.com', 80, $errno, $errstr, 8);
if (!$fp) return FALSE;
$request = "HEAD /online.gif?icq=$uin&img=3 HTTP/1.0\r\n"
."Host: status.icq.com\r\n"
."Connection: close\r\n\r\n";
fputs($fp, $request);
do {
$response = fgets($fp, 1024);
}
while (!feof($fp) && !stristr($response, 'Location'));
fclose($fp);
if (strstr($response, 'online1')) return 'online';
if (strstr($response, 'online0')) return 'offline';
if (strstr($response, 'online2')) return 'disabled';
return FALSE;
}
-
thanks ;)
-
Nice, I just tried that out... and changed only a little bit:
this
if (strstr($response, 'online1')) return 'online';
if (strstr($response, 'online0')) return 'offline';
if (strstr($response, 'online2')) return 'disabled';
to this
if (strstr($response, 'online1')) return '<img src="templates/default/images/online.gif" width="14" height="14" border="0" alt="online" title="online">';
if (strstr($response, 'online0')) return '<img src="templates/default/images/offline.gif" width="14" height="14" border="0" alt="offline" title="offline">';
if (strstr($response, 'online2')) return '<img src="templates/default/images/disabled.gif" width="14" height="14" border="0" alt="disable" title="disabled">';
and I did use these images:
online: (http://photo.overlord.cz/templates/default/images/online.gif)
offline: (http://photo.overlord.cz/templates/default/images/offline.gif)
disabled: (http://photo.overlord.cz/templates/default/images/disabled.gif)
:)
Thank you V@no
-
you are right...that's the only three lines could be changed...for some reason it didnt work when I tested it..:?
I'd suggest u dont use it that way, leave them as if (strstr($response, 'online1')) return 'online';
if (strstr($response, 'online0')) return 'offline';
if (strstr($response, 'online2')) return 'disabled';
and then in the template use:<img src="templates/default/images/{user_icq_status}.gif" width="14" height="14" border="0" alt="{user_icq_status}" title="{user_icq_status}">
I belive this is more practical ;)
-
right :D that's a very elegant way, how to do it... one will never learn out... :lol:
-
Just found out, that ICQ must have changed the internet pages, so the detail-link shows you an error page instead of the user's ICQ-detail...
Change
http://wwp.icq.com/scripts/search.dll?to=
into
http://www.icq.com/people/about_me.php?uin=
everywhere you find it in the code and templates and it will work again.
Have fun
-
... everywhere ...
Do you have a complete file list ? I would not like to look for so much ... :wink:
- details.php
- member.php
- ... ?
-
No, I do not. Sorry.
I just use a file search like:
search for: *.php *.htm *.html
find text: wwp.icq
(in Norton Commander, Total Commander, Windows Commander, Salamander etc.)