[solved] php highlight function help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

ziggy3000
Forum Contributor
Posts: 205
Joined: Fri Mar 23, 2007 3:04 pm

Post by ziggy3000 »

no one knows how to use it??
wow
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Go pick up a book or read a tutorial... this is basic OOP stuff.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Search for CorzBlog or cbparser if you want an out of the box bbCode parser. It will still require some tweaking and you are not going to get exactly what you want the way you want it. In fact, you could just use the highlight_string() or highlight_file() php functions if you wanted to in order to achieve the relatively same effect.

Why don't you?
ziggy3000
Forum Contributor
Posts: 205
Joined: Fri Mar 23, 2007 3:04 pm

Post by ziggy3000 »

cant you guys just tell me?
i looked through the code but there are so many functions i dont know which to use

i hate it when people just tell you to do the work yourself!!!
why do you think we ask you guys???
we expect you to tell us how to improve or to answer our questions
not to be told DO IT YOURSELF
or just search through the php manual or on google!
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

As a long time member of this forum I'd like to offer an apology. Please send us all the code you have and your project requirements and we'll complete your work for you ASAP.

It's shameful the way Everah didn't just write your code for you, he must be a total noob here. I'll dispense the flogging right away.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I... I feel so guilty now.

Seriously, if you want someone to do it for you, pay someone. If you want to learn, let us teach you. That is what we are here for. Besides, you have yet to really explain your question that clearly. At this point, I am not sure if you are just highlighting PHP code for display, if you are parsing it, if you want it highlighted using bbCode syntax or what? Cut us some slack. The least you can do is help us help you. And it helps when you don't get mad at us for not doing your work for you.

@kieran: Thanks bro. I needed that little laugh.
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Post by kaisellgren »

Roflmfao :D
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Highlighting code is hardly rocket science - as a learner topic it's not a bad one really. If you want everyone to do this for you you should be aware most of us charge a bit more than peanuts... Some of us are happy enough to volunteer time to help you learn, but not simply hand you completed work. There's not enough hours in the day to do that.

If you really wanted to see this done, then 5 minutes on Google would have netted you a list of tutorials, tools and libraries capable of doing it with minimal hassle. There's a particularly good one which relies on PHP's native highlighting functions and INI settings even. Not a complicated task if you're willing to learn a handful of new functions.

Commence with Everah's lashing - can I bring the popcorn? ;)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Oooo, popcorn. What do I get if we flog instead of lash?
ziggy3000
Forum Contributor
Posts: 205
Joined: Fri Mar 23, 2007 3:04 pm

Post by ziggy3000 »

i want a really good bbcode parser with basic functions(bold, italic, underline, image, url, code) which is customizable, so i can easily add more buttons and functions, so i can add my highlight code(which is pretty cool), and when parsed, it actually highlights!(it didn't work with IPB)

and the code should be commented so i can learn from the code.

and maugrim, i already have the highlighting code. what i need is the bbcode parser to parse it all.
i can code some stuff, but i am a beginner to intermediate coder, and what i can code is really basic.

and i searched on Google for "advanced membership system with profiles" and i cant find any good ones. theres probably 1, and i don't need that code.

i look on pixel2life for some good tuts, and hotscripts, but its hard to find the "really good" ones
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I mentioned this before, but I suppose I try again...

CBParser
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Not popcorn - flogging has a lower entertainment value...;).

There's a BBCode parser in PEAR which might be worth checking. http://pear.php.net/package/HTML_BBCodeParser
PHPBuilder ran a tutorial some time ago using this PEAR component to build a source highlighter. Hint, hint...;).
ziggy3000
Forum Contributor
Posts: 205
Joined: Fri Mar 23, 2007 3:04 pm

Post by ziggy3000 »

i'll try to modify the cbparser with my "basic" knowledge of php. hopefully, i'll get it to work :D

and for some reason, pear wont work on my home server... i tried to find a tut on google, and after much work(all the ones i found were for unix servers) i found out that we have to run a .bat file, and is still wont work...
thanks anyway
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

There is really not that much to making it work. Just set aside all the cruft and focus on the core functions of the app and you should be alright.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

ziggy3000 wrote:and for some reason, pear wont work on my home server... i tried to find a tut on google, and after much work(all the ones i found were for unix servers) i found out that we have to run a .bat file, and is still wont work...
thanks anyway
Post another thread and outline the problems you're experiencing.. one of our team members will get on that right away.

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.
Post Reply