News:

Wondering if this will always be free?  See why free is better.

Main Menu

IRC Tag

Started by Louis (CSpotkill), March 19, 2005, 07:21:26 PM

Previous topic - Next topic

Louis (CSpotkill)

Link to Mod

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. 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:
  • Does not add a button to the post area. (Want it to? Speak up!)

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 with your SMF/IRC Tag version numbers, and I'll try to fix the problems as soon as possible.
My SMF Mods:

Pause

How about [irc=irc://irc.server.net:6667/roomhere]join #room here[/irc] so that it connects on port 6667?    :P
"You and me, inside that box, now." - The Doctor

Bite Fusion
Fusion Web Network
VG Fusion
Wrestling Fusion + Wrestling Fusion Forums

Louis (CSpotkill)

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.
My SMF Mods:

Xtasy

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.

Louis (CSpotkill)

Open IrcTag1.0.zip and extract/upload IrcTag.php your Sources folder. Next, open Sources/Subs.php and do the following:

  • Search for codefromcache. Above that line, add $sourcedir, to the global list of variables.
  • Below the static $codefromcache line, insert the following line:
require_once($sourcedir . '/IrcTag.php');
  • Next, search for Find a (named?) URL... and above that, insert the following lines:
// 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>\'',
    My SMF Mods:

    Xtasy

    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

    Louis (CSpotkill)

    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>\'',
    My SMF Mods:

    Xtasy

    #7
    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 [nofollow]

    Louis (CSpotkill)

    #8
    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.
    My SMF Mods:

    d3v

    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.

    SEXAR

    please update this mod for smf late version
    mau coba klik aja

    [nofollow]

    MF30

    update this mod for 1.1.9v please.

    Bortmon

    please update to 2.0.1... i need that  :D

    Bortmon

    #13
    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.

    Advertisement: