Code For Code tags..

Reply

Join Date: Jul 2008
Posts: 1,072
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Code For Code tags..

 
0
  #1
Apr 29th, 2009
Good Morning All..

How to do coding for code tags , when we post a thread..And the display the content between the code tags with different color using PHP..

Thanks in Advance.

Shanti.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 88
Reputation: urtrivedi is an unknown quantity at this point 
Solved Threads: 14
urtrivedi urtrivedi is offline Offline
Junior Poster in Training

Re: Code For Code tags..

 
0
  #2
Apr 29th, 2009
I dont know the actual method but I think following may work.
  1. str_replace("code","<span style='your style'>",$yourtext);
  2. str_replace("/code","</span>",$yourtext);
You mus use full tag in your code i.e. \[code\]
Last edited by urtrivedi; Apr 29th, 2009 at 8:02 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,190
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Code For Code tags..

 
-1
  #3
Apr 29th, 2009
Have look at this article of what you can do with out any additional tools/libraries/plugins. However if you after tool you may consider GeSHi (I think dani use it here or she use it in past) or check result of this search and perhaps you find something for your self
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,072
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: Code For Code tags..

 
0
  #4
Apr 29th, 2009
thanks for you both..
i will work on this and let you know...
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC