Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 01:02 am EST
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:
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!
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'] );
//}
, then a
is placed for him instead of nl Thanks!
9
13
Quote
All times are EST. The time is now 01:02 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