Forum Announcements
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsForum InformationForum 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 Dev Articles Community Forums Sponsor:
  #1  
Old August 10th, 2005, 01:56 PM
thaminda's Avatar
thaminda thaminda is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 thaminda User rank is Private First Class (20 - 50 Reputation Level)thaminda User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 17 h 42 m 33 sec
Reputation Power: 11
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, 01:57 PM
thaminda's Avatar
thaminda thaminda is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 thaminda User rank is Private First Class (20 - 50 Reputation Level)thaminda User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 17 h 42 m 33 sec
Reputation Power: 11
New Highlighter button

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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsForum InformationForum Announcements > New BBCode - Syntax Highlighter


Developer Shed Advertisers and Affiliates


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 News | Latest Threads | Shoutbox
Forum Jump

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap