Welcome to Geeklog, Anonymous Friday, March 01 2024 @ 12:13 am EST

Geeklog Forums

Hard-coded html in lib-common.php


grouch

Anonymous
Geeklog is great (hey, check Groklaw.net ) but the fixed html messages in lib-common.php are driving me nuts. I am not a php wizard, so can anyone give me some tips on how to tell Geeklog to use a new template file?

For example:

Text Formatted Code

function COM_showMessage( $msg )
{
    global $MESSAGE, $_CONF;
       
    $retval = '';
   
    if( $msg > 0 )
    {                    
        $timestamp = strftime( $_CONF['daytime'] );
        $retval .= COM_startBlock( $MESSAGE[40] . ' - ' . $timestamp, '',
                           COM_getBlockTemplate( '_msg_block', 'header' ))
            . '<img src="' . $_CONF['layout_url']
            . '/images/sysmessage.gif" border="0" align="top" alt="">'
            . $MESSAGE[$msg] . '<br><br>'
            . COM_endBlock( COM_getBlockTemplate( '_msg_block', 'footer' ));
    }
           
    return $retval;
}

 


I don't want to simply alter the html in that, I want to create a pair of new template files and tell it to use them.
Like:
Text Formatted Code

<!-- sys_msg_header.thtml -->
<img srce="{layout_url}/images/sysmessage.gif"><br>
<!-- / sys_msg_header.thtml-->

<!-- sys_msg_footer.thtml -->
<br><br>
<!-- sys_msg_footer.thtml -->

 


The function would then put its $MESSAGE[$msg] with those template files wrapped around it.

The problem I have is that each time I try to define a new template file, it reverts to blockheader.thtml and blockfooter.thtml.

Help?
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
How are you trying to specify a different template?
Geeklog components by PortalParts -- www.portalparts.com
 Quote

grouch

Anonymous
Quote by Blaine: How are you trying to specify a different template?


Ok, don't laugh.

Text Formatted Code

        $retval .= COM_startBlock( $MESSAGE[40] . ' - ' . $timestamp, '',
                           COM_getBlockTemplate( '_msg_block', 'header' ))
            . COM_getBlockTemplate( 'sys_msgheader', 'header')
            . $MESSAGE[$msg]
            . COM_getBlockTemplate( 'sys_msgfooter', 'footer')
            . COM_endBlock( COM_getBlockTemplate( '_msg_block', 'footer' ));

 


I saw something similar elsewhere in lib-common.php and just copied and adapted. Sometimes monkey-see, monkey-do works. It didn't this time.
 Quote

All times are EST. The time is now 12:13 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