RSS

Forum | A geek going mad!

This Forum is Currently Locked – Access is Read Only
You must be logged in to post
Search Forums:


 






A geek going mad!

UserPost

11:21 AM
Sep 11, 2010


robbie

Member

posts 38

1

Hey folks, I recently created a flatfile editinplace cms. (can be found here: http://krneky.com/wondercms


My problem is, I can't manage to hide the <br> tag in the textarea once it saves itself to a text file. I wouldn't want to remove it, but just hide it.


So far I've tried


$content=nl2br($content);
and
$content = str_replace("<br>", "n", $content);


but neither worked, I've also tried outputting the txt files with <pre> tags but that also failed.


I'm running of out ideas, anyone, please?

6:00 AM
Sep 12, 2010


wfiedler

Moderator

posts 100

2

Wow, Robbie that's a CMS I always was looking for. Great job you did.


I can't solve your problem, because I'm a miserable PHP programmer. Perhaps someone can help. Bob (Baker)???


But, can I have the files to integrate a Javascript markup editor for the editable textareas? I've written several ones and would like to give it a try.


Thanks in advance.


-Wolfram

7:28 AM
Sep 12, 2010


tomw

Member

posts 74

3

Robbie, try this and see if it works:


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

Wolfi, I see you still looking for that perfect CMS.

8:20 AM
Sep 12, 2010


wfiedler

Moderator

posts 100

4

@Tom Wink, you're right. It's a passion… Keep It Simple And Smart = K.I.S.S.


I'm also looking in Web Design to get the ultimate out of nearly nothing. It's like searching for the Holy Grail…


Propably I'll never find it, but it's a lot of fun and it keeps me young Wink.

9:08 AM
Sep 12, 2010


robbie

Member

posts 38

5

Tomw, that didn't work, it makes the <br> disappear but it also makes it inactive (as if <br>'s dont work at all)

Heres a list of things I've tried, but also didn't work.


$content = ereg_replace("n", " ", $content);

$content = str_replace('r', '', str_replace('n', '', $content));

$content = str_replace(chr(10), " ", $content); //remove carriage returns

$content = str_replace(chr(13), " ", $content); //remove carriage returns

I've also tried cheating with <pre></pre> tags but that didn't work out very well.

Wolfram I'm glad you like it, I'm planning on freely releasing it to the public once this is fixed.

Email me trough my site to get the files. The whole cms is about 10 files big, that's around 30kB's (or 100kB's with the .js).

5:14 AM
Sep 13, 2010


tomw

Member

posts 74

6

Robbie, here is my solution:

At the editBox function add the two highlighted lines

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();
}

See the example here: http://odcms.net/wondercms/


Wolfi, keep on looking. You might find it one day. Hopefully you're not an old man by then.Laugh

7:26 AM
Sep 13, 2010


robbie

Member

posts 38

7

Tom, thank you very much, this solved the problem I've been trying to fix forever!


I will be posting the packed CMS today for the world to see. :)

7:31 AM
Sep 13, 2010


wfiedler

Moderator

posts 100

8

@Tom = Genius BakieBakieBakieBakieBakieBakieBakieBakie


You got it!


Come on Robbie – give it to me KissLaugh!

8:09 AM
Sep 13, 2010


robbie

Member

posts 38

9

Ok I think it's ready, I just added the option to edit your keywords and description, any other wishes before I publish it?

12:46 PM
Sep 13, 2010


robbie

Member

posts 38

10

That's it, the WonderCMS is now officially available: WonderCMS

Cheers ;) , I've added Tom on the list on contributors in the readme file.