Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: includes in theme.php NOT template.html  (Read 3214 times)

0 Members and 1 Guest are viewing this topic.

nukeworker

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Visit NukeWorker.com
    • Nuclear Jobs
includes in theme.php NOT template.html
« on: March 04, 2005, 12:04:10 am »

I have been using the custom header modification for a year or so now, with great luck.  Thank you for explaining that to me then.  I now have a new problem.

I have read all the forums, and every message that my search popped up.  I have found many people asking the same questions about includes.  I found a few that asked my question (comming) but it was never answered.

I am trying to put {smf_welcome} into the breadcrumb section in the theme.php, but either it is not parsed, or the echo output is ignored..  It is displayed just as typed.  I can use {smf_welcome} in the template.html, but that is not where I need it.

This is what the bread crumb section looks like:
Code: [Select]
// HTML template for the breadcrumb
$template_breadcrumb = <<<EOT
<!-- BEGIN breadcrumb -->
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                        <td><b>{BREADCRUMB}</b></td>
<td align="right">


 {smf_welcome}
 {smf_logonline}


                </td></tr></table>

<!-- END breadcrumb -->
<!-- BEGIN breadcrumb_user_gal -->
        <tr>
                <td colspan="3" class="tableh1">
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                        <td><span class="statlink"><b>{BREADCRUMB}</b></span></td>
                        <td align="right"><span class="statlink"><b>{STATISTICS}</b></span></td>
                </tr>
                </table>
                </td>
        </tr>
<!-- END breadcrumb_user_gal -->

EOT;

I tried escaping the EOT, and starting it up again, but that didnt work (coppermine can't fine the code block then).  I tried using $smf_welcome, and that displayed blank (could be echo issue).  I tried {smf_welcome} and it is not parsed.


I have multiple php ssi functions that work in the template.html with the following code:

Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

   if(empty($smf_welcome)){
      include('http://www.nukeworker.com/forum/SSI.php?ssi_function=welcome');
      $smf_welcome = ob_get_contents();
      ob_clean();
   }

   if(empty($smf_logonline)){
      include('http://www.nukeworker.com/forum/SSI.php?ssi_function=logOnline');
      $smf_logonline = ob_get_contents();
      ob_clean();
   }

   if(empty($smf_boardstats)){
      include('http://www.nukeworker.com/forum/SSI.php?ssi_function=boardStats');
      $smf_boardstats = ob_get_contents();
      ob_clean();
   }
   if(empty($cpg_statistics)){
      include('http://www.nukeworker.com/pictures/statistics_ssi.php');
      $cpg_statistics = ob_get_contents();
      ob_clean();
   }
   if(empty($smf_latestmember)){
      include('http://www.nukeworker.com/forum/SSI.php?ssi_function=latestMember');
      $smf_latestmember = ob_get_contents();
      ob_clean();
   }

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
        '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{MAIN_MENU}' => theme_main_menu(),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
'{smf_welcome}' => $smf_welcome,
'{smf_logonline}' => $smf_logonline,
'{smf_boardstats}' => $smf_boardstats,
'{cpg_statistics}' => $cpg_statistics,
'{smf_latestmember}' => $smf_latestmember,
        );

    echo template_eval($template_header, $template_vars);
}

Any help you could give me would be appreciated.

I am working on a derivitive of the SMF theme.  I have made the "TREE" style navigation for the bread crumbs, and made a few other changes.  When I have everything finished, I will share it with the community.  I need to learn this trick first, so I can finish my customizations.

Here are a few links:
http://www.nukeworker.com/pictures/thumbnails.php?album=1
http://www.nukeworker.com/pictures/
« Last Edit: March 04, 2005, 12:10:10 am by nukeworker »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: includes in theme.php NOT template.html
« Reply #1 on: March 04, 2005, 06:23:35 am »

with cpg1.3.x, you can not use the SMF_SSI includes, as there are naming conflicts (coppermine and smf have identical function names defined): without some editing, you can not use SMF's ssi functions on coppermine pages (and that's what it takes to use smf_welcome). This has been fixed in cpg1.4.x, which is scheduled to be released soon. If you can't/won't wait, you have to use another approach. Don't include the tokens in curly braces from within a heredoc syntax, but call the functions directly.

Joachim
Logged

nukeworker

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Visit NukeWorker.com
    • Nuclear Jobs
Re: includes in theme.php NOT template.html
« Reply #2 on: March 04, 2005, 02:41:34 pm »

with cpg1.3.x, you can not use the SMF_SSI includes, as there are naming conflicts (coppermine and smf have identical function names defined): without some editing, you can not use SMF's ssi functions on coppermine pages (and that's what it takes to use smf_welcome). This has been fixed in cpg1.4.x, which is scheduled to be released soon. If you can't/won't wait, you have to use another approach. Don't include the tokens in curly braces from within a heredoc syntax, but call the functions directly.

Joachim

Joachim,

I appreciate you taking the time to reply to me.

I'm running SMF v 1.0.2 (Their latest public release), I was under the impression that they also renamed their functins to "smf_*" so that they don't interfeer with coppermine.  -- I guess that impression was wrong, because you wold know if it was already fixed.

I did try $smf_welcome, which is parsed in herehoc syntax.  The odd thing is that it displayed nothing.  However this prints fine in the template with the brackets, so I know it SHOULD work.

So smf functions can work in the template, but not in the theme.php.  Hmmm...  Well, If the changes need to be made to the SSI.php in smf, I can do that.  Is that the file I would need to change, or does it go further than that?

Again, your help is appreciated.  I just want to make a "really cool" template that looks more like SMF than the curent SMF theme.  I'll post what I get when I'm done.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: includes in theme.php NOT template.html
« Reply #3 on: March 04, 2005, 02:53:54 pm »

I'm running SMF v 1.0.2 (Their latest public release), I was under the impression that they also renamed their functins to "smf_*" so that they don't interfeer with coppermine.  -- I guess that impression was wrong, because you wold know if it was already fixed.
no, I haven't checked if they have renamed their functions yet. It might well be possible.

So smf functions can work in the template, but not in the theme.php.
Yes, they're meant to be inserted into template.html. However, it should be possible to use them somewhere else as well; you probably need some functions to be global. Again, I must confess I haven't looked into it in detail.

I just want to make a "really cool" template that looks more like SMF than the curent SMF theme.  I'll post what I get when I'm done.
Good to hear, sounds very nice. I'm looking forward to your contrib.

Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.