Forum Announcements
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Forum Information Forum Announcements

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old August 9th, 2005, 02:18 PM
thaminda_2
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
New BBCode - Syntax Highlighter

We have added new bbcode “highlighter” which use for generic syntax highlighting. This one support wide range of popular languages.

Usage :
[ highlight=language ]
Codes
[ /highlight ]

Here is a new highlighter bbcode in action, displaying part of a PHP code.
php Code:
Original - php Code
  1. <?php
  2. function _split_text($text)
  3. {
  4. $MAX_LENGTH = 160;
  5.  
  6.   $split=explode(" ",$text);
  7.   $numwords = count($split);
  8.   $i=0; //while counter
  9.   $a = 1; //counts the text chunks
  10.  
  11.   $amount = ceil(strlen($text)/($MAX_LENGTH-5)); //get total word chunks
  12.   while($i < $numwords){
  13.    $len = (strlen($newtext[$a])+strlen($split[$i])); //get length of the active chunk
  14.      if($len>($MAX_LENGTH-5)){ //do we have to start a new one?
  15.        $a++;
  16.        $newtext[$a] = "[$a/$amount] "; //Adds [1/2]
  17.      }else{
  18.        if($i == 0) $newtext[$a] = "[$a/$amount] ";
  19.        $newtext[$a]=$newtext[$a]." ".$split[$i];
  20.        $i++;
  21.      }
  22.   }
  23.   return $newtext;
  24. }
  25. }
  26. ?>



Here is the list of languages supported by this new bbcode

actionscript
ada
apache
asm
asp
bash
caddcl
cadlisp
c_mac
c
cpp
csharp
css-gen.cfg
css
delphi
diff
div
d
eiffel
gml
html4strict
java
javascript
lisp
lua
matlab
mpasm
nsis
objc
oobas
oracle8
pascal
perl
php-brief
php
python
qbasic
smarty
sql
vbnet
vb
vhdl
visualfoxpro
xml

Reply With Quote
  #2  
Old August 10th, 2005, 02:02 PM
thaminda_2
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
New Highlighter button

We have add new highlight button URL to editor toolbar, so people can easily use that button to create [ highlight=language ] tags.

Reply With Quote
Reply

Viewing: Web Development Archives Forum Information Forum Announcements > New BBCode - Syntax Highlighter


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway