Previous Thread
Next Thread
Print Thread
Rate Thread
#122224 07/23/2001 10:17 PM
Joined: Jul 2001
Posts: 11
Junior Member
Junior Member
Offline
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.. tipsy

Sponsored Links
#122225 07/23/2001 10:42 PM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
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. smile

#122226 07/23/2001 10:50 PM
Joined: Jul 2001
Posts: 11
Junior Member
Junior Member
Offline
Joined: Jul 2001
Posts: 11
thanx alot for your reply..
now, can you give me some code,,,, please help

#122227 07/24/2001 1:47 AM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
in ubb_lib.cgi

Code
code:

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.

#122228 07/24/2001 2:27 AM
Joined: Jul 2001
Posts: 11
Junior Member
Junior Member
Offline
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...

Sponsored Links
#122229 07/24/2001 12:42 PM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
well you could switch the br s into n s by doing this
$_[0] =~ s/
/n/ig;

#122230 07/24/2001 1:02 PM
Joined: Jul 2001
Posts: 11
Junior Member
Junior Member
Offline
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?

#122231 07/24/2001 3:17 PM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
my $variable = $_[0];
$variable =~ s/
/n/ig;

#122232 07/25/2001 4:38 PM
Joined: Jul 2001
Posts: 11
Junior Member
Junior Member
Offline
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
Code
code:

if he writes code the code comes in a textbox,,not like above,,got it??
please help..


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)