Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Louis (CSpotkill) on March 19, 2005, 07:21:26 PM

Title: IRC Tag
Post by: Louis (CSpotkill) on March 19, 2005, 07:21:26 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=108)

Install this mod to be able to link to IRC channels & servers with the IRC tag. Also replaces server aliases with the proper server name, using the servers/aliases listed in mIRC's servers.ini file. (You can easily add your own server aliases too.)

Example:

BBCodeBecomes ...
[irc=irc://irc.gamesurge.net/c4a]Join #c4a on GameSurge![/irc]A link named Join #c4a on GameSurge! that points at irc://irc.gamesurge.net/c4a
[irc=gamesurge/c4a]Join #c4a on GameSurge![/irc]Same as above
[irc]gamesurge/c4a[/irc]A link to irc://irc.gamesurge.net/c4a named irc://irc.gamesurge.net/c4a

To install this mod (and many others):

Download IrcTag1.0.zip (http://mods.simplemachines.org/index.php?a=download;mod=108;id=4959). Click Admin, then click Package Manager, then Download New Packages. Under Upload a Package, click Browse and find the IrcTag1.0.zip. Then click Upload and follow the prompts.

Known issues:

Note: Only tested with SMF 1.0.2 - The modification should work in previous versions, but the installer might not. If you get any problems, please reply (http://www.simplemachines.org/community/index.php?topic=30930.0) with your SMF/IRC Tag version numbers, and I'll try to fix the problems as soon as possible.
Title: Re: IRC Tag
Post by: Pause on March 19, 2005, 09:04:05 PM
How about [irc=irc://irc.server.net:6667/roomhere]join #room here[/irc] so that it connects on port 6667?    :P
Title: Re: IRC Tag
Post by: Louis (CSpotkill) on March 20, 2005, 02:35:35 PM
I didn't mention it, but it can do that already ;)

See the fourth example on http://www.cszen.com/testforum/index.php?topic=1.msg8#msg8

But using an alias instead of the server won't work if you use a port number.

Example: [irc=irc://gamesurge:6667/roomhere]join #roomhere[/irc]
Will create a link to irc://gamesurge:6667/roomhere which doesn't work.

I hadn't thought about different port numbers when I was making the alias script. So if some of the mirc.ini servers use different port numbers, we might have to correct a few entries. I guess I'll go over it later and allow for different ports when using aliases and correct any aliased servers that use a non-standard port.
Title: Re: IRC Tag
Post by: Xtasy on March 22, 2005, 10:03:47 AM
Is there a manual install I could read, Ive done alot of modifying to the forum so package manager to work, and I cant seem to get it to work when I manually install.
Title: Re: IRC Tag
Post by: Louis (CSpotkill) on March 22, 2005, 03:23:22 PM
Open IrcTag1.0.zip and extract/upload IrcTag.php your Sources folder. Next, open Sources/Subs.php and do the following:

require_once($sourcedir . '/IrcTag.php');
// IRC Tag mod [irc=server/channel]Link Text[/irc]
'~\[irc\](?:irc://)*(.+?)\[/irc\]~ie' => isset($disabled['irc']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'irc://\'.checkIRCserver(\'$1\'))' : '\'<a href="irc://\'.checkIRCserver(\'$1\').\'" target="_blank">irc://\' . checkIRCserver(\'$1\') . \'</a>\'',
'~\[irc=(?:irc://)*(.+?)\](.+?)\[/irc\]~ie' => isset($disabled['irc']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' (irc://\'.checkIRCserver(\'$1\').\')\'' : '\'<a href="irc://\'.checkIRCserver(\'$1\').\'" target="_blank">$2</a>\'',
Title: Re: IRC Tag
Post by: Xtasy on March 22, 2005, 07:38:01 PM
Thanks, Im recieving the following error message:

Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/menowar/public_html/xenez/forum/Sources/Subs.php on line 953
Title: Re: IRC Tag
Post by: Louis (CSpotkill) on March 22, 2005, 08:03:49 PM
Mind posting Subs.php around line 953 ? Or maybe try re-uploading the file.

Here's what that part of the file should look like:

<?php // Added to start syntax-highlighting


$code_to_from = array(
// A named email address. [[email protected]]me[/email] // Spam-Me-Not SMF Mod
'~\[email=(.+?)\](.+?)\[/email\]~ie' => isset($disabled['email']) ? '\'$2 (\'.SpamMeNotEncode(\'$1\',3).\')\'' '\'<a href="mailto:\'.SpamMeNotEncode(\'$1\',3).\'">\' . preg_replace(\'~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'',
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
'~\[iurl=([^\]]+?)\]([^\[\]]+?)\[/iurl\]~i' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '<a href="$1" target="_blank">$2</a>' '$2 ($1)') : '<a href="$1">$2</a>',
'~\[iurl=(.+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'' 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'') : '\'<a href="$1">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'',
'~\[iurl\](.+?)\[/iurl\]~i' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '<a href="$1" target="_blank">$1</a>' '$1') : '<a href="$1">$1</a>',
// FTP link.  Named...?  [ftp=upload.sourceforge.net]Sourceforge[/ftp]
'~\[ftp\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$1\')' '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$1\', array(\'@\' => \'&#64;\'))) . \'</a>\'',
'~\[ftp=(.+?)\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'' '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'',
// IRC Tag mod [irc=server/channel]Link Text[/irc]
'~\[irc\](?:irc://)*(.+?)\[/irc\]~ie' => isset($disabled['irc']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'irc://\'.checkIRCserver(\'$1\'))' '\'<a href="irc://\'.checkIRCserver(\'$1\').\'" target="_blank">irc://\' . checkIRCserver(\'$1\') . \'</a>\'',
'~\[irc=(?:irc://)*(.+?)\](.+?)\[/irc\]~ie' => isset($disabled['irc']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' (irc://\'.checkIRCserver(\'$1\').\')\'' '\'<a href="irc://\'.checkIRCserver(\'$1\').\'" target="_blank">$2</a>\'',
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'' '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'',
Title: Re: IRC Tag
Post by: Xtasy on March 22, 2005, 11:55:39 PM
hmmm mine looks way different...


<?php // Added to start syntax-highlighting

// A named email address. [[email protected]]me[/email]
if(isset($add['[email='])){
$arr1[] = '~\[email=(.+?)\](.+?)\[/email\]~ie';
$arr2[] = isset($disabled['email']) ? '$2 ($1)' '\'<a href="mailto:$1">\' . preg_replace(\'~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
}
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
if(isset($add['[iurl='])){
$arr1[] = '~\[iurl=([^\]]+?)\]([^\[\]]+?)\[/iurl\]~i';
$arr1[] = '~\[iurl=(.+?)\](.+?)\[/iurl\]~ie';
if(isset($disabled['iurl'])){
if(isset($disabled['url'])){
$arr2[] = '$2 ($1)';
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
}else{
$arr2[] = '<a href="$1" target="_blank">$2</a>';
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
}
}else{
$arr2[] = '<a href="$1">$2</a>';
$arr2[] = '\'<a href="$1">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
}
}
if(isset($add['[iurl]'])){
$arr1[] = '~\[iurl\](.+?)\[/iurl\]~i';
$arr2[] = isset($disabled['iurl']) ? (isset($disabled['url']) ? '$1' '<a href="$1" target="_blank">$1</a>') : '<a href="$1">$1</a>';
}
// FTP link.  Named...?  [ftp=upload.sourceforge.net]Sourceforge[/ftp]
if(isset($add['[ftp]'])){
$arr1[] = '~\[ftp\](.+?)\[/ftp\]~ie';
$arr2[] = isset($disabled['ftp']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$1\')' '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$1\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
}
if(isset($add['[ftp='])){
$arr1[] = '~\[ftp=(.+?)\](.+?)\[/ftp\]~ie';
$arr2[] = isset($disabled['ftp']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'' '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
}
// IRC Tag mod [irc=server/channel]Link Text[/irc]
'~\[irc\](?:irc://)*(.+?)\[/irc\]~ie' => isset($disabled['irc']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'irc://\'.checkIRCserver(\'$1\'))' '\'<a href="irc://\'.checkIRCserver(\'$1\').\'" target="_blank">irc://\' . checkIRCserver(\'$1\') . \'</a>\'',
'~\[irc=(?:irc://)*(.+?)\](.+?)\[/irc\]~ie' => isset($disabled['irc']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' (irc://\'.checkIRCserver(\'$1\').\')\'' '\'<a href="irc://\'.checkIRCserver(\'$1\').\'" target="_blank">$2</a>\'',

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';
if(isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = isset($disabled['url']) ? '$1' '<a href="$1" target="_blank">$1</a>';
}


Im using 1.02 and I have the following mods installed: .     
TinyPortal
G&S_Sticky
Faster Parsecode
SMF Arcade
OnLine Users Today
The Bar Of Experience
Message Icon Manager
Enhanced Quick Reply
Donations_Mod
Spam-me-not

Board URL: http://www.xenez.com
Title: Re: IRC Tag
Post by: Louis (CSpotkill) on March 23, 2005, 06:35:22 PM
Faster Parsecode is the problem - I've never used it, and the mod isn't compatible with it right now. I'll install it and work out the integration for a 1.1 release. Sorry.
Title: Re: IRC Tag
Post by: d3v on June 10, 2005, 11:51:06 PM
I have SMF 1.0.4 and Faster Parse Code Mod Installed.
IRC Tag is installed. I try:

[irc=irc://irc.freenode.net/catchmydr1ft]Visit #catchmydr1ft on Freenode IRCD[/irc]

and it shows up just that way instead of being converted. Is this a version issue? Thank you.
Title: Re: IRC Tag
Post by: SEXAR on March 12, 2008, 11:38:31 PM
please update this mod for smf late version
Title: Re: IRC Tag
Post by: MF30 on July 08, 2009, 03:45:35 PM
update this mod for 1.1.9v please.
Title: Re: IRC Tag
Post by: Bortmon on October 17, 2011, 03:51:45 PM
please update to 2.0.1... i need that  :D
Title: Re: IRC Tag
Post by: Bortmon on June 30, 2013, 01:29:49 PM
also please update for 2.0.4... i need it too :D

Edit:\> Never mind. I just found this mod "Alternativ Protocol Fix" ( http://custom.simplemachines.org/mods/index.php?mod=784 ) which does exactly what i need.
After downloading this package, you have to edit the "package-info.xml" and extend the listed versions by "2.0 - 2.99.99"; after that it worked on my 2.0.4.