Warning: fopen(./data/cache/settings/interwiki) [function.fopen]: failed to open stream: Permission denied in /home/newfif/public_html/wg/wireless/wiki.php on line 1488
Warning: fopen(./data/cache/settings/plugins) [function.fopen]: failed to open stream: Permission denied in /home/newfif/public_html/wg/wireless/wiki.php on line 1488
Warning: fopen(./data/cache/settings/urlmapping) [function.fopen]: failed to open stream: Permission denied in /home/newfif/public_html/wg/wireless/wiki.php on line 1488
Warning: Cannot modify header information - headers already sent by (output started at /home/newfif/public_html/wg/wireless/wiki.php:1488) in /home/newfif/public_html/wg/wireless/wiki.php on line 1958
This works well with GoogleGroups Beta service. This helps make links to GoogleGroups with text remotely extracted from usenet topic.
{{{
* All rights reserved. Distributable under GPL.
*
* $Id: UsenetMacro,v 1.13 2005/02/05 03:23:51 root Exp root $
*/
function macro_Usenet($formatter, $value)
{
global $DBInfo;
list($group, $thread) = @explode(':', $value);
$img = sprintf('', $DBInfo->imgs_dir);
if ($group == 'http') {
$url = $value;
} else {
$url = 'http://groups-beta.google.com/group/'.$group;
if (preg_match('/[[:xdigit:]]+/', $thread))
$url .= '/browse_thread/thread/'.$thread;
else
$subj = $group;
}
if (!$subj) {
$purl = parse_url($url);
$fp = @fsockopen($purl['host'], 80, $errno, $errstr, 5);
$out = "GET {$purl['path']} HTTP/1.0\nHost: {$purl['host']}\n\n";
@fwrite($fp, $out);
$buf = @fgets($fp, 80);
if (!preg_match('@200 OK@i', $buf))
return ' URL is not found ';
while (strlen($buf) <= 25000) {
$_ = @fread($fp, 1024);
$buf .= $_;
if (strlen($_) < 1024) break;
}
fclose($fp);
$seek = strpos($buf, 'Subject: ') + 20;
$offset = strpos($buf, ' |
', $seek);
$subj = substr($buf, $seek, $offset-$seek);
if (!$subj) $subj = $group;
}
return sprintf('%s%s', $img, $url, $subj);
}
?>
}}}
Write like this,
{{{
[[Usenet(comp.lang.python)]]
[[Usenet(comp.lang.python:fec2ae850574adf4)]]
[[Usenet(http://groups-beta.google.com/group/comp.unix.programmer/browse_thread/thread/d302919d5af2b802)]]
}}}
then it will be displayed like...
[[Usenet(comp.lang.python)]]
[[Usenet(comp.lang.python:fec2ae850574adf4)]]
[[Usenet(http://groups-beta.google.com/group/comp.unix.programmer/browse_thread/thread/d302919d5af2b802)]]
[http://nohmad.sub-port.net/wiki/CodingLog/2003-09]