Jump to content

wizr

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wizr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. All fixed and ready for download, the problem was fixed by changing function editBox(actual) { if(!changing){ width = widthEl(actual.id) + 20; height =heightEl(actual.id) + 2; actual.innerHTML = "<textarea…" changing = true; } actual.firstChild.focus(); } to function editBox(actual) { if(!changing){ width = widthEl(actual.id) + 20; height =heightEl(actual.id) + 2; str = actual.innerHTML; actual.innerHTML = str.replace(/<br>/gi, ""); actual.innerHTML = "<textarea…" changing = true; } actual.firstChild.focus(); } The WonderCMS is now available for download: WonderCMS
  2. I don't know much but I'm trying to help, isn't there one to many ) on the very end? Try: if (preg_match('/[a-z0-9-\s]{3,13}/i', $username)==0)
  3. It's a really simple thing, in a few steps: It makes a textarea that is writable to a .txt file. I display this text area with: <div id="change"><span id="a1" class="editText"><? echo $textInfile; ?></span></div> . This goes trough: <? $thefile = "files/edit.txt"; $textInfile = file_get_contents($thefile); ?> This saves the file to edit.txt The main config has these: $fieldname = htmlspecialchars($_GET['fieldname']); $content = stripslashes(strip_tags($_GET['content'],"<p><img><i></i></p><h1></h1><h2></h2></a><li></li><a><strong><em><strike><b>")); $content = trim($content); $content=nl2br($content); User enters content into the text area and it writes it directly to the txt file once the user clicks out of the area. So far the most efficient thing that worked (or not) is : str_replace("<br>", "\n", $content); This would be perfect if it didn't disable <br>'s completely. Also another thing, when you click on the text area on http://krneky.com/ccms (password demo) the text area shows normal <br> tags, while the ones saved in http://krneky.com/ccms/files/edit3.txt (the text files), shows <br />. I have no idea what else is there to try. Edit: I'm also using - http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js - http://krneky.com/ccms/js/editInplace.js - http://krneky.com/ccms/js/wkrte.js - http://krneky.com/ccms/js/jquery-1.3.2.min.js Do you think any one of these may be causing problems?
  4. If I use the code you gave me, it hides the <br>'s successfully, but when I enter a new line in the textarea it just doesn't happen. Like it removes <br> completely, not just hides it. I'm trying different variations, do you think the js library could be the problem, instead of php?
  5. I found a fix to this, instead of $file1 = include '/ccms/files/edit.txt'; echo $file1; // This outputs the file. using $file1 = include '/ccms/files/edit.txt'; $file1 = substr($file1, 0, -1); echo $file1; removes the "number 1" that becomes visible for no good reason at each textarea. Or even better, using this below works without and errors. $file1 = file_get_contents('/ccms/files/edit.txt'); echo $file1; But still the hiding of <br> remains a mystery. What we've done till now is: str_replace("<br>", "\n", $content); - it does hide the <br> tag, but it makes it inactive.
  6. str_replace("<br>", "\n", $content); Also doesn't work, it hides the <br>'s, but doesn't actually make one, its like doing a <br> and not going into the next line. (that line sort of disables <br>'s not only hiding them.)
  7. I recently made a flatfile cms (+ edit in place). Here's an example of how it shows the <br>'s when hitting enter. The password is demo. Now when you click inside (in any text field - there are 4), when hitting enter it makes a new line without showing a <br> tag. Clicking outside and inside the textarea, it will show all the line breaks you've made. My question is how to hide the <br> tag. What I've searched, found and tried the following: $content=nl2br($content); and $content = str_replace("<br>", "\n", $content); Neither worked. Also when using this code $file1 = include '/ccms/files/edit.txt'; echo $file1; // This outputs the file. to show the content on another page, it adds a number 1 to every textarea I have on the original page. You can preview the number 1 error here.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.