|  | 
| | 
| 
| 
|  |  
| 
Joined:  Jul 2003 Posts: 733 Hoopy frood |  
| OP   Hoopy frood Joined:  Jul 2003 Posts: 733 | 
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.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Jul 2003 Posts: 733 Hoopy frood |  
| OP   Hoopy frood Joined:  Jul 2003 Posts: 733 |  |  |  |  
| 
| 
|  |  
| 
Joined:  Mar 2004 Posts: 457 Fjord artisan |  
|   Fjord artisan 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=2161http://www.mircscripts.org/comments.php?cid=2252
Last edited by Danthemandoo; 13/03/05 11:43 PM.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Jul 2003 Posts: 733 Hoopy frood |  
| OP   Hoopy frood Joined:  Jul 2003 Posts: 733 | 
i wasnt really talking about a text editor, i was asking about a web mime type |  |  |  
| 
| 
|  |  
| 
Joined:  Mar 2004 Posts: 457 Fjord artisan |  
|   Fjord artisan 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.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Jul 2003 Posts: 733 Hoopy frood |  
| OP   Hoopy frood Joined:  Jul 2003 Posts: 733 | 
no, im talking about something server side, just like the .phps is server side. |  |  |  
| 
| 
|  |  
| 
Joined:  Feb 2003 Posts: 306 Fjord artisan |  
|   Fjord artisan Joined:  Feb 2003 Posts: 306 | 
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 |  |  |  
| 
| 
|  |  
| 
Joined:  Dec 2002 Posts: 1,893 Hoopy frood |  
|   Hoopy frood Joined:  Dec 2002 Posts: 1,893 | 
For Apache servers, this consists of three steps. Enable mod_rewrite in httpd.conf and restart the server.
Create a new text file in the root directory of your server, call it .htaccess, and put these lines in it:
 
 RewriteEngine on
RewriteRule \.mrc$ /highlight_mrc.php [E=FILE:%{REQUEST_FILENAME}]
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) |  |  |  
| 
| 
|  |  
| 
Joined:  Jul 2003 Posts: 733 Hoopy frood |  
| OP   Hoopy frood Joined:  Jul 2003 Posts: 733 | 
thats great Online    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 likehttp://mirc.net/paste/?203 and what this looks likehttp://mtec89net.com/test.mrc |  |  |  
| 
| 
|  |  
| 
Joined:  Dec 2002 Posts: 1,893 Hoopy frood |  
|   Hoopy frood Joined:  Dec 2002 Posts: 1,893 | 
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.
 |  |  |  
| 
| 
|  |  
| 
Joined:  Jul 2003 Posts: 733 Hoopy frood |  
| OP   Hoopy frood Joined:  Jul 2003 Posts: 733 | 
thanks. i once asked them for a different peice of code, but they couldnt give it.. figures :P |  |  |  
| 
| 
|  |  
| 
Joined:  Jul 2003 Posts: 733 Hoopy frood |  
| OP   Hoopy frood Joined:  Jul 2003 Posts: 733 | 
cool    thanks |  |  |  | 
 | 
| 
 |