Suggestions & Feedback
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsForum InformationSuggestions & Feedback

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 9th, 2005, 04:17 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: 6
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
Reply

Viewing: Dev Articles Community ForumsForum InformationSuggestions & Feedback > 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 News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek