Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] bp_activity_add strips newline characters ?? Why?


  • vanleurth
    Participant

    @vanleurth

    Hi programmers,

    I have bben using bp_activity_add to insert youtube videos into my activity stream. The problem is this function strips away the newline characters when inserted.

    for example this is my content

    $content = ‘Video \n http://youtube.com/watch?v=thtk89 \n watch it here’;

    I get the string in the same line inserted in the php database

    Any helps is appreciated. It seems crazy BP is stripping the tags

Viewing 3 replies - 1 through 3 (of 3 total)

  • Henry Wright
    Moderator

    @henrywright

    Instead of trying the newline characater, try <br /> or <p>.

    If that’s the exact code you’re using (and it hasn’t been mangled by the forum), you need to use " marks instead of ' for PHP to convert the \n into a newline.


    vanleurth
    Participant

    @vanleurth

    Thank you, that was the problem.
    I need to brush up on my php string processing knowledge.

    Have a great day !!

    V.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] bp_activity_add strips newline characters ?? Why?’ is closed to new replies.
Skip to toolbar