Advertisement:

Author Topic: IRC Tag  (Read 42709 times)

Offline Louis (CSpotkill)

  • Jr. Member
  • **
  • Posts: 154
  • Gender: Male
  • Geek with Style
    • LSTA
IRC Tag
« on: March 19, 2005, 07:21:26 PM »
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:

Offline Pause

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,618
  • Official Cheesecake
Re: IRC Tag
« Reply #1 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

Offline Louis (CSpotkill)

  • Jr. Member
  • **
  • Posts: 154
  • Gender: Male
  • Geek with Style
    • LSTA
Re: IRC Tag
« Reply #2 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.
My SMF Mods:

Offline Xtasy

  • Semi-Newbie
  • *
  • Posts: 19
Re: IRC Tag
« Reply #3 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.

Offline Louis (CSpotkill)

  • Jr. Member
  • **
  • Posts: 154
  • Gender: Male
  • Geek with Style
    • LSTA
Re: IRC Tag
« Reply #4 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:

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

    Offline Xtasy

    • Semi-Newbie
    • *
    • Posts: 19
    Re: IRC Tag
    « Reply #5 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

    Offline Louis (CSpotkill)

    • Jr. Member
    • **
    • Posts: 154
    • Gender: Male
    • Geek with Style
      • LSTA
    Re: IRC Tag
    « Reply #6 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;,
    My SMF Mods:

    Offline Xtasy

    • Semi-Newbie
    • *
    • Posts: 19
    Re: IRC Tag
    « Reply #7 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 [nofollow]
    « Last Edit: March 23, 2005, 03:05:34 PM by Xtasy »

    Offline Louis (CSpotkill)

    • Jr. Member
    • **
    • Posts: 154
    • Gender: Male
    • Geek with Style
      • LSTA
    Re: IRC Tag
    « Reply #8 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.
    « Last Edit: March 23, 2005, 06:37:55 PM by Louis (CSpotkill) »
    My SMF Mods:

    Offline d3v

    • Jr. Member
    • **
    • Posts: 209
    Re: IRC Tag
    « Reply #9 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.

    Offline SEXAR

    • Semi-Newbie
    • *
    • Posts: 24
    • Gender: Female
    Re: IRC Tag
    « Reply #10 on: March 12, 2008, 11:38:31 PM »
    please update this mod for smf late version
    mau coba klik aja

    [nofollow]

    Offline MF30

    • Jr. Member
    • **
    • Posts: 119
      • Futebol Tuga
    Re: IRC Tag
    « Reply #11 on: July 08, 2009, 03:45:35 PM »
    update this mod for 1.1.9v please.

    Offline Bortmon

    • Newbie
    • *
    • Posts: 3
    Re: IRC Tag
    « Reply #12 on: October 17, 2011, 03:51:45 PM »
    please update to 2.0.1... i need that  :D

    Offline Bortmon

    • Newbie
    • *
    • Posts: 3
    Re: IRC Tag
    « Reply #13 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.
    « Last Edit: June 30, 2013, 01:44:03 PM by Bortmon »