|
Joined: Jul 2001
Posts: 11
Junior Member
|
Junior Member
Joined: Jul 2001
Posts: 11 |
hello, I have a programming site, and wjhen a member writes any thing between [ code] and [ /code] it shows him code,,I modified this so it shows me code the way i want, but i have a little problem, some time i have to post like 100 lines of code,,so the topic page will be bad looking and some time it takes a large widh, so i want the code to be shown in a text box, i did that, but the problem in the < br> tag, it appears in the text box after each line, i tried to filter the code,, but that did not work,,so do you have any idea?? please help.. 
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
when you post the ubb changes all n s from the input box into s. so look for a regex that does that. let me know if you want me to look for ya. 
|
|
|
|
Joined: Jul 2001
Posts: 11
Junior Member
|
Junior Member
Joined: Jul 2001
Posts: 11 |
thanx alot for your reply.. now, can you give me some code,,,, please help
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
in ubb_lib.cgi try commenting that out. im not sure exactly what you want it to do, but thats where it converts the returns in post msgs into tags.
|
|
|
|
Joined: Jul 2001
Posts: 11
Junior Member
|
Junior Member
Joined: Jul 2001
Posts: 11 |
thanx now tell me, can you tell what is the code to do the opposite thing?? i mean change the < br> into return...
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
well you could switch the br s into n s by doing this $_[0] =~ s/ /n/ig;
|
|
|
|
Joined: Jul 2001
Posts: 11
Junior Member
|
Junior Member
Joined: Jul 2001
Posts: 11 |
thanx alot, now how do i define a variable? if i modified any thing in $_[0] its gonna affect the cdoe,, i want to define a varial and modify it,,got it?
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
my $variable = $_[0]; $variable =~ s/ /n/ig;
|
|
|
|
Joined: Jul 2001
Posts: 11
Junior Member
|
Junior Member
Joined: Jul 2001
Posts: 11 |
well, nothing worked with me :(:(:(:( i tried every thing,,, what i want exactly is: when the member writes any thing as code, i mean he writes something between [ code] and [ /code]..like this if he writes code the code comes in a textbox,,not like above,,got it?? please help..
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 808
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,932
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|