Make a new input like: CUSTOM_HEADER and CUSTOM_FOOTER? Make a new input like: CUSTOM_HEADER and CUSTOM_FOOTER?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Make a new input like: CUSTOM_HEADER and CUSTOM_FOOTER?

Started by gelaskimgel, October 12, 2006, 10:02:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gelaskimgel

well my question is: Is it possible to make a new entry, which can make is possible to include a new php file, just like CUSTOM_HEADER and CUSTOM_FOOTER works... and then add it into the template.html file, just like your ad {CUSTOM_HEADER} and {CUSTOM_FOOTER} ?

I've tried and got it to work, but only with showing the user avatar picture... I've at a code into theme.php and then did called it int template.html by writing: {AVATAR_FORM}... but i can't do it with in same way now,,, the code I need to add in template.html is:

<?php
include("reklame-settings.php");
?>

<table width="130" border="<?php print $table_border ?>">
<?php
$q1 mysql_query("select * from nicktaq_posts order by id desc LIMIT 1");
while($taq mysql_fetch_array($q1)){
?>

<tr>
<td bgcolor="<?php print $table_bgcolor_bottom ?>">
<img src="update_dyt.jpg">
</td>
</tr>
<tr>
<td bgcolor="<?php print $table_bgcolor_bottom ?>">
<font face="Century Gothic" size="2">
<strong><?php print $taq['name'?></strong>
<br>
</font>
</td>
</tr>
<tr>
<td width="130" bgcolor="<?php print $table_bgcolor_bottom ?>">
<font face="Century Gothic" size="2">
<?php print $taq['message'?>
<br>
</font>
</td>
</tr>
<?php
}
?>

</table>



please hellp :) many thanks :)

nickfzx

sorry to post on an old thread but thought it better than starting a new one.

So i want to do the same thing as mentioned above...have more than just CUSTOM_HEADER and CUSTOM FOOTER...I would like to also create CUSTOM_SIDEBAR, etc

is there any reason why this shouldn't work if i just duplicate whats been done for custom_header.  Is there any reason why it shouldn't be done?  Is there an official coppermine way of doing this or am I on my own?

It would be cool imo if you could have as many custom includes as you like...in punbb there is a directory where you put your custom include files and then in the punbb template you just do <pun_include="file_to_include.php"> as many times as you like.

Maybe I should post that functionality in feature requests :)

Joachim Müller

Just look at how this is being accomplished using the existing {CUSTOM_HEADER}-token: depending on whether your custom placerholder token is suppossed to come before the {GALLERY}-token of after it (think of the {GALLERY}-token as a placeholder for the actual coppermine content as well as a separator between pageheader and pagefooter), you'll have to edit the corresponding functions pageheader or pagefooter that reside in your theme.
Let's say that you want your custom token to appear before the {GALLERY}-token: edit themes/yourtheme/theme.php and findfunction pageheader($section, $meta = '')and modify as suggested below. If this function is not being defined in your custom theme, copy the default function from the sample theme. To do this, copy // Function for writing a pageheader
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

        $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        );

    echo template_eval($template_header, $template_vars);
}
from themes/sample/theme.php into a new line before?>of the file themes/yourtheme/theme.php

Then add the custom token's content definition: edit themes/yourtheme/theme.php, find    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);and add after it (into a new line)    $yourCustomVarName = cpg_get_custom_include('/absolute/path/to/your/additional/custom/include_file.php');

Next, find        '{CUSTOM_HEADER}' => $custom_header,and add after it (into a new line)        '{YOUR_CUSTOM_TOKEN}' => $yourCustomVarName,

Finally, edit themes/yourtheme/template.html and add {YOUR_CUSTOM_TOKEN} somewhere before the {GALLERY}-token.


nickfzx