|
-
Aug 7th, 2002, 11:15 AM
#1
Thread Starter
Hyperactive Member
[code] Code Here [/code]
I need code to convert code [CODE] CODE HERE [//CODE] to code inside table or textarea .. the code that used in phpbb forum .. Thanks
-
Aug 7th, 2002, 01:06 PM
#2
Frenzied Member
tell me your kidding......
http://www.vbforums.com/showthread.p...hreadid=184356
do you not pay attention when we write alllllll your code
-
Aug 7th, 2002, 01:09 PM
#3
-
Aug 7th, 2002, 01:11 PM
#4
Frenzied Member
lol good one, but he has never been there,
-
Aug 7th, 2002, 01:14 PM
#5
-
Aug 7th, 2002, 01:29 PM
#6
Thread Starter
Hyperactive Member
no M.R The Hobo
You are mistake
the problem that code contain form many lines and I want to replace new line "\n" with "<br>
and after that replce [code] .. if you test that .. you will see that <br> appear inside <textarea> .. so you must not replace new line "\n" that beetween (Code) and (/Code) with <BR> .. that is the frist problem
____________
second problem .. if you replace (code) with "<table width=100%><td width=100>"
and replace (/CODE) with "</TD></TABLE>"
what if user do not close code with (/CODE) ? the page will not seem good
-
Aug 7th, 2002, 01:31 PM
#7
Stuck in the 80s
Re: no M.R The Hobo
Hey, I just found this cool link: http://www.php.net/
They have this thing called a manual. It's documentation on all the PHP functions. It's really cool!
-
Aug 7th, 2002, 01:35 PM
#8
Frenzied Member
what you are asking has nothing to do with replacing text inside of [code] tags.
use ereg_replace();
that is all I will help you. hell search these forums and you will see that has been asked before. also like I said, what in the hell are you making, a 1.3 TB file
-
Aug 7th, 2002, 01:38 PM
#9
Stuck in the 80s
Re: no M.R The Hobo
Originally posted by prokhaled
and after that replce [code] .. if you test that .. you will see that <br> appear inside <textarea> .. so you must not replace new line "\n" that beetween (Code) and (/Code) with <BR> .. that is the frist problem
Then you're going to have to go step by step through your text (I posted an example of how to do this in another one of your threads) and parse only the stuff not in (code)(/code) tags.
Originally posted by prokhaled
if you replace (code) with "<table width=100%><td width=100>"
and replace (/CODE) with "</TD></TABLE>"
Use the substr_count() function to count the number of (code)'s and the number of (/code)'s in the text. If they are not equal, take the user back to whatever they were doing with a message saying "Not all tags are closed."
-
Aug 7th, 2002, 01:49 PM
#10
Thread Starter
Hyperactive Member
substr_count
that is good Idea .. is there any function in JavaScript like substr_count in php .. that until tell user that the tags is not equal before submit
Thanks
-
Aug 7th, 2002, 01:57 PM
#11
Stuck in the 80s
Re: substr_count
Originally posted by prokhaled
that is good Idea .. is there any function in JavaScript like substr_count in php .. that until tell user that the tags is not equal before submit
Thanks
I don't think there is to my knowledge. But I don't know JS functions very well.
-
Aug 7th, 2002, 02:37 PM
#12
Thread Starter
Hyperactive Member
-
Aug 7th, 2002, 03:02 PM
#13
Stuck in the 80s
And just for future reference, it's Mr. Hobo. Not M.R The Hobo.
-
Aug 7th, 2002, 03:12 PM
#14
Fanatic Member
Re: no M.R The Hobo
Originally posted by prokhaled
second problem .. if you replace (code) with "<table width=100%><td width=100>"
and replace (/CODE) with "</TD></TABLE>"
what if user do not close code with (/CODE) ? the page will not seem good
If you write a valid preg_replace expression then it will only convert the completed tags meaning areas it finds both the [code] text [/code] in that order.
-Matt
-
Aug 7th, 2002, 10:34 PM
#15
Stuck in the 80s
-
Aug 8th, 2002, 12:46 PM
#16
Frenzied Member
-
Aug 8th, 2002, 01:11 PM
#17
Stuck in the 80s
-
Aug 8th, 2002, 01:18 PM
#18
Frenzied Member
ahh drats, I have been caught
-
Aug 8th, 2002, 10:11 PM
#19
Fanatic Member
lol, Hobo just found out
-
Aug 13th, 2002, 02:02 PM
#20
Stuck in the 80s
Originally posted by cpradio
lol, Hobo just found out
It's not like I really cared.
I just happed to notice. It's not like I try to get the FBI profile of every member...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|