Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
Hello,

can anyone help me how to print out the codeblock ([ code]..[ /code]) into a textarea. instead between <hr><pre> ... </pre><hr> into <textarea>...</textarea>.

thx for your help


Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I'm not quite sure what your asking for. You want to display code without the <hr /> and <pre></pre> tags?

Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
Hi JustDave,

if you write a message you can put some information into a
Code
 ... 
container. So this information is shown in the thread inside <pre> ... </pre>.

What i want ist to display this information inside a textarea: <textarea> ... </textarea>. The goal for this is, that my users can better read an copy this information.

thx
Rufnex

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Oh ok. Well that should be a simple matter of changing the markup code and replace the <hr /> and <pre> tags with the <textarea> tags.

I don't have time to look at this right now but I will when I get a chance.

Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
Do you know the filename i've to work for this?

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
You can find the do_markup and undo_markup functions in your ubbt.inc.php file.

Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
Oki .. i will try it .. thx a lot!

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Your welcome

Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
Uah ... if i change this block to <textarea> ... </textarea> i got another problem Everythink works fine but inside the block i got on every newline a <br /> but inside the textarea i have to filter it (instead of <br /> should be printet a \n).

any ideas ?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Not off hand. regex's are not something that I'm well versed in. (I need to work on that)

Anyone else?

Sponsored Links
Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
Ok ... i try again

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Will this work for you:

$variable = str_replace("<br />","\n",$variable);

before you put it into a textarea.

Thats how signatures, bios etc... are handled in the profiles.

Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
Hi JoshPet,

can i change the code in ubbt.inc.php like this:

Code
 <br />       preg_match_all("/(\[eDoC\])\n?\r?(.*?)(\[\/eDoC\])/is",$Body,$newmatches); <br />       reset($matches); <br />       for ($i=0; $i < count($newmatches['0']); $i++) { <br />          $Body = str_replace($newmatches[0][$i],$matches[0][$i],$Body); <br />       } <br /> <br />--->   $Body = str_replace("<br />","\n",$Body ); <br />       $Body = str_replace("[ code]","<font class=\"small\">Code:</font><hr /><pre>",$Body); <br />       $Body = str_replace("[ /code]","</pre><hr />",$Body); <br />


or could this be a problem for the other information in a posting?


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:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,834
Joined: January 2000
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 1731
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 20
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
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-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)