Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

editing text with php

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

editing text with php

Postby rafaes18 » Tue Oct 01, 2002 4:25 am

I am writing a content editor and I would like to have a facility like the one used in php-forum to allow users to customize the text, this is seting some text to bold adding a url etc. Is it possible to do this from php or You need to use Java.
thanks
rafaes18
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Sep 12, 2002 7:18 am

Postby Jay » Tue Oct 01, 2002 5:05 am

You'll get yourself into something long, hard and complicated. The simplest way is just to get them to use [] tags, and search for specific tags and convert them into the html equivilent. You can then progress from there once you build up your skill
Jay
 

Postby rafaes18 » Tue Oct 01, 2002 6:38 am

I more or less can gather the whole process with the exception of how to highlight a piece of text and by clicking on a button to get the [] automatically inserted.
Is this done using php?
is there any tutorial showing how to do this?
thanks
rafaes18
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Sep 12, 2002 7:18 am

Postby Jay » Tue Oct 01, 2002 8:19 am

rafaes18 wrote:I more or less can gather the whole process with the exception of how to highlight a piece of text and by clicking on a button to get the [] automatically inserted.
Is this done using php?
is there any tutorial showing how to do this?
thanks

That's easily done with Javascript. You'll need to define a function for it first, so it knows which state it's in. Then when you click on it, it'll add the appropriate tag to the box (something like form.message += '[b]';) depending on it's state (you either want to open or close the tags)
Jay
 

Postby rafaes18 » Tue Oct 01, 2002 12:14 pm

Can you direct me to a sample code or explain me a bit more how to do this thing of the states. I fell I am touching the solution but still I can't quite sort this last problem.
Thanks for the time and the spirit.
rafa
rafaes18
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Sep 12, 2002 7:18 am

Postby Jay » Tue Oct 01, 2002 12:40 pm

I'm not going to do it for you, but I'll put you on the path!

Find a page which has the function that you require. In IE go to File, Save As, and choose the document type as a Web Archive (mht). This will save EVERYTHING into a single MIME file (when I mean everything, I mean pictures, external scripts, CSS, EVERYTHING).

Now that you have this one file containing everything, open it up in a web editor (not IE, because it'll display it normally, and you want the hidden code behind the scenes) and you'll see a series of files delimited by a special string (something like 654s6ad54s6d21sd - it'll be a garbage string). Anyway, each one of those chunks represents some information, like a picture or script. What you want to do is find the javascript function that's being run by looking at the code for the button you click on to activate the function, find the function elsewhere in the script (it'll all there), and then decipher it!
Jay
 

Postby rafaes18 » Mon Oct 07, 2002 7:03 am

Hi Jay
Against all the odds I have managed to dechypher the thing and I have almost get it working.
thank you

rafa
rafaes18
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Sep 12, 2002 7:18 am

Postby Jay » Mon Oct 07, 2002 1:37 pm

Np
Jay
 


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.