[solved] php highlight function help
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
it's okay. i understand your just trying to help, but i do expect someone to be really helpful and post some code once in a while...aaronhall wrote: Also, I know a few here already apologized, but I wanted to say sorry myself for all of the code we didn't write for you, and for not going above and beyond to spoon-feed you answers. As many of the people in this community have spent years learning the language themselves, I speak for all of us what I say that we regret not jumping all over the opportunity fix your problems without anything in return, and not going out of our way to make sure you learn absolutely nothing. How harebrained of us to think that you should be expected to try things for yourself; how selfish of us to have expected you to utilize resources that are already freely available on the internet. Please accept our heartfelt and sincere apologies.
and i don't need pear just yet... i am going to get another pc, and triple boot Ubuntu, vista and xp, so if it doesn't work on windows, ill try Ubuntu.
ok i dont know how to implement my highlight function into the cbparser
heres the code
first of all i want it
heres the code
Code: Select all
<?php
/*
syntax highlighting (Cool Colored Code™)
och, why not!
*/
$ccc = array(); $i = 0;
while ($ccc_str = stristr($bb2html, '[ccc]')) {
$ccc_str = substr($ccc_str, 0, strpos($ccc_str, '[/ccc]') + 6);
$bb2html = str_replace($ccc_str, "***ccc_string***$i", $bb2html);
$ccc[$i] = str_replace("\r\n", "\n", $ccc_str);
$i++;
}
?>
Code: Select all
not [ccc][/ccc]
i just replaced all ccc's with php but then i am confused on using my function instead of the one thats included
heres the code i want replaces with
[b]Edited: I Solved it. Dont need help anymore.[/b]
Last edited by ziggy3000 on Fri Apr 13, 2007 4:08 pm, edited 2 times in total.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
I am taking this down by Sunday night because it is really not ready for production use yet. But since your problem is so urgent and you need this like yesterday, have at it. I make no warranties about its usability. It worked in local testing on PHP 5 on Apache 2.2 on Windows XP. Please do not ask for support as I am still making it work at the moment.
thanks everah it's awesome!
but if i want to use my highlight function, instead of the pear
so if i replace T_CONSTANTS.php and PHP_highlight.php with my func.php and replace some parts of parser-test.php needed to use my func, would it work?
Edited: Never Mind. I got it to work
but if i want to use my highlight function, instead of the pear
so if i replace T_CONSTANTS.php and PHP_highlight.php with my func.php and replace some parts of parser-test.php needed to use my func, would it work?
do you have any idea when it will be?I am taking this down by Sunday night because it is really not ready for production use yet.
Edited: Never Mind. I got it to work
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
do you have a ten line or less code that replaces [b][/b] with <b></b>
the one in cbparser is kinda long, and i like to keep my code short
i added more buttons for url, image, and php code, but it doesn't parse the tags
it parses everything between the <?php and ?> tags in the textfield that you input
the only files i am using are parser-test.php and func.php(my highlight function) so i dont really have a core...
the test page was a little javascript and html and some php
func.php is a function named hc()
the one in cbparser is kinda long, and i like to keep my code short
i added more buttons for url, image, and php code, but it doesn't parse the tags
it parses everything between the <?php and ?> tags in the textfield that you input
the only files i am using are parser-test.php and func.php(my highlight function) so i dont really have a core...
the test page was a little javascript and html and some php
func.php is a function named hc()