[ PHP CODE @ 22.01.2010. 11:26 ] @
Pozdrav svima. Free Rich Text Editor Na pomenutom linku se nalazi online text editor koji zelim da koristim na jednom projektu, medjutim, i pored toga sto je autor ostavio kratki "how to" ne uspijevam da nadjem resenje za sledece: Naime, nakon sto u "Design" dijelu se unese neki sadrzaj, u "Code" dijelu se isti pretvara u HTML code. Sad, potrebno mi je da nekako taj "Code" dio ucitam u varijablu i dalje manipulisem s njom. Sa PHP se snalazim onako... dovoljno, ali javascript jos nisam poceo uciti. Imam osjecaj da je nesto vrlo jednostavno, ali zbog navedenog razloga ne mogu da rijesim ovo. Ovo je PHP dio koji preko varijable unosi sadrzaj u DESIGN dio: Code: <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } // Send the preloaded content to the function. $content = freeRTE_Preload("<i>This is some <b><br>preloaded</b> content</i>") ?> <form method="get"> <!-- Include the Free Rich Text Editor Runtime --> <script src="../js/richtext.js" type="text/javascript" language="javascript"></script> <!-- Include the Free Rich Text Editor Variables Page --> <script src="../js/config.js" type="text/javascript" language="javascript"></script> <!-- Initialise the editor --> <script> initRTE('<?= $content ?>', 'example.css'); </script> <input type="submit"> </form> Ovo je sadrzaj richtext.js richtext.js |