Welcome to Geeklog, Anonymous Thursday, April 25 2024 @ 10:42 am EDT

Geeklog Forums

Story display HTML formatted hack not working


Mikusan

Anonymous
I was trying to get functionality so that when people submit links and don't know HTML PHP would do it for them...after figuring out the HARD part (ereg_replace) thank god it's over... the simple part just isn't budging. The problem is that my ereg_replace is only useful when HTML formatted is enabled. And when it is you must use
to get endlines. Now i figured this would be an easy hack by using nl2br() which works fine with my own engine, but with geeklog it's not working. I added the code as shown:
Text Formatted Code

function COM_article( $A, $index='' )
{
    global $_TABLES, $mode, $_CONF, $LANG01, $_USER, $LANG05;

    $curtime = COM_getUserDateTimeFormat( $A['day'] );
    $A['day'] = $curtime[0];

    // If plain text then replace newlines with <br> tags
  //MY CODE PART
        // Edit, even if it's not plain text newlines will be replaced by <BR>
    //if( $A['postmode'] == 'plaintext' )
    //{
        $A['introtext'] = nl2br( $A['introtext'] );
        $A['bodytext'] = nl2br( $A['bodytext'] );
    //}
 
Yes, i want that if one does not use
, then a
is placed for him instead of nl Thanks!
 Quote

All times are EDT. The time is now 10:42 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content