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:

Code: [Select]
require_once($sourcedir . '/IrcTag.php');
Code: [Select]
// 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:
Code: [Select]
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:

Code: [Select]
<?php // Added to start syntax-highlighting


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

Code: [Select]

<?php // Added to start syntax-highlighting

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

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

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.