Suggestions & Feedback
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
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:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 9th, 2005, 03: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: 4
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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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

Iron Speed




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