mIRC Home    About    Download    Register    News    Help

Print Thread
.mrc files -- web mime type #114086 12/03/05 03:07 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
i am looking to set up something similar to what .phps files do, except i want to do this for .mrc files.. like colorize the code when viewing the file from my server. im not sure what this would consist of doing but im sure it can be done.

Last edited by MTec89; 12/03/05 03:10 AM.

http://MTec89Net.com
irc.freenode.net #MTec89Net
Re: .mrc files -- web mime type #114087 13/03/05 07:37 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
any one?


http://MTec89Net.com
irc.freenode.net #MTec89Net
Re: .mrc files -- web mime type #114088 13/03/05 11:40 PM
Joined: Mar 2004
Posts: 457
D
Danthemandoo Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
you;d need to find a program which has the ability to do custom syntax highlighting. Then you'd need to customise it yourself, and probably input every single mirc command and identifier into it. I think there is a custom config for a program called "Textpad" which has that but textpad is not free so i havn't tried it.

But frankly, if you can write mirc script you can read it just as easily without bothering with syntax highlighting. However i still wish the inbuilt editor had syntax hightighting, that'd be awesome, but thats been suggested a load of times so shouldn't be discussed in this thread.

[Edit] Found a couple of things on mircscripts.org:
http://www.mircscripts.org/comments.php?cid=2161
http://www.mircscripts.org/comments.php?cid=2252

Last edited by Danthemandoo; 13/03/05 11:43 PM.
Re: .mrc files -- web mime type #114089 14/03/05 12:33 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
i wasnt really talking about a text editor, i was asking about a web mime type


http://MTec89Net.com
irc.freenode.net #MTec89Net
Re: .mrc files -- web mime type #114090 14/03/05 12:41 AM
Joined: Mar 2004
Posts: 457
D
Danthemandoo Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
you mean like viewing a .mrc file via a web browser but syntax highlighted?
I don't see why it couldn't be done in firefox/mozilla, but would involve creating an extension for it and i don't have the 1st clue how.

Re: .mrc files -- web mime type #114091 14/03/05 01:02 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
no, im talking about something server side, just like the .phps is server side.


http://MTec89Net.com
irc.freenode.net #MTec89Net
Re: .mrc files -- web mime type #114092 14/03/05 10:35 AM
Joined: Feb 2003
Posts: 307
T
tontito Offline
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
Hello,
i and some other m8s implement a web server that runs server side mircscript pages.
Is that what you are looking for?
If so check this

Re: .mrc files -- web mime type #114093 14/03/05 10:59 AM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
For Apache servers, this consists of three steps.
  1. Enable mod_rewrite in httpd.conf and restart the server.
  2. Create a new text file in the root directory of your server, call it .htaccess, and put these lines in it:

    Code:
    RewriteEngine on
    RewriteRule \.mrc$ /highlight_mrc.php [E=FILE:%{REQUEST_FILENAME}]

  3. Get a PHP script that highlights mIRC syntax, place it in the root directory of your server and call it highlight_mrc.php. One (silly) example is here.

    As you can learn from the example, the variable $_SERVER['REDIRECT_FILE'] holds the path to the .mrc file.
(Tested on Apache 1.3)

Re: .mrc files -- web mime type #114094 14/03/05 08:01 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
thats great Online smile well, im looking for a bit more highlighting though, like the things like == and just things like that, so a mix of what this looks like
http://mirc.net/paste/?203
and what this looks like
http://mtec89net.com/test.mrc


http://MTec89Net.com
irc.freenode.net #MTec89Net
Re: .mrc files -- web mime type #114095 14/03/05 09:06 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I updated the file (highlight_mrc.txt) to color assignment (=) and comparison (==) operators too. You can add more options yourself by editing the highlight_mirc() function.

Keep in mind that I wrote the file merely as an example—it's by no means supposed to be an efficient and fully-functional syntax highlighter. If you want something better, consider asking the mirc.net staff to share their code with you.

Re: .mrc files -- web mime type #114096 14/03/05 09:20 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
thanks. i once asked them for a different peice of code, but they couldnt give it.. figures :P


http://MTec89Net.com
irc.freenode.net #MTec89Net
Re: .mrc files -- web mime type #114097 14/03/05 09:22 PM
Joined: Jun 2003
Posts: 5,024
M
Mentality Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
The source code for the mirc.net highlighter can be found at http://www.tye.ca/source/mhighlight.zip smile (example script)

Regards,


Mentality/Chris
Re: .mrc files -- web mime type #114098 14/03/05 09:27 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
cool smile thanks


http://MTec89Net.com
irc.freenode.net #MTec89Net
Re: .mrc files -- web mime type #114099 14/03/05 10:26 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
many thanks to all you people! laugh http://mtec89net.com/test.mrc

ill make this code available inscase people want to use it as i did, it required some recoding of the other code

http://mtec89net.com/highlight_mirc.phps


http://MTec89Net.com
irc.freenode.net #MTec89Net