Welcome to Geeklog, Anonymous Wednesday, December 11 2024 @ 08:57 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:
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:
<!-- 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?
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?
9
11
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.
9
15
Quote
All times are EST. The time is now 08:57 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