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: HTML comments in theme.php  (Read 4150 times)

0 Members and 1 Guest are viewing this topic.

francesca

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
    • Fotografie / An artworks collective
HTML comments in theme.php
« on: July 29, 2004, 04:33:01 pm »

Hello everyone  :)

I'm doing some changes in theme.php of the classic theme.
I'd like not to show the default HTML comments like

<!-- BEGIN header -->
<!-- END header -->
<!-- BEGIN thumb_cell -->


but if I delete them, I get errors like:

Failed to find block 'thumb_cell'(#(<!-- BEGIN thumb_cell -->)(.*?)(<!-- END thumb_cell -->)#s)

Is it possible to hide them in some way?

thanx.
Logged

poubao

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: la
  • Offline Offline
  • Gender: Male
  • Posts: 277
    • Collections du Laos
Re: HTML comments in theme.php
« Reply #1 on: July 29, 2004, 10:09:19 pm »

Bonjour,
you don't deléte in red
<!-- BEGIN album_list -->
                 <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                        <img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
<!-- END album_list -->

search in the board i have find it ,but i don't remenber where (may be in théme.php) :P
Logged
L'incohérence de ceux qui nous dirigent, l'incompétence de ceux qui nous commandent,sont un vibrant hommage pour ceux qui exécutent.
                                          **Général Patton**

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: HTML comments in theme.php
« Reply #2 on: July 30, 2004, 08:50:02 am »

don't delete the html comments, coppermine will need it. Instead, comment out the stuff that actually displays things. In above example, change it to
Code: [Select]
<!-- BEGIN album_list -->
                 <!--<a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                        <img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />-->
<!-- END album_list -->

GauGau
Logged

aaalexxx

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: HTML comments in theme.php
« Reply #3 on: August 11, 2004, 11:59:57 pm »

As far as I understand your post you want to get rid of the comments in the output. As you have experienced already this can't be done by removing the comments from the theme file, since Coppermine needs them. What I did in Coppermine 1-2 is, I edited the routine where the template is evaluated.

Open the file /include/functions.inc.php with an editor, look for

Code: [Select]
// Eval a template (substitute vars with values)
function template_eval(&$template, &$vars)

Below you'll find the following:

Code: [Select]
{
        return strtr($template, $vars);
}

Change it to:

Code: [Select]
{
return ereg_replace("<!--([^-]*([^-]|-([^-]|-[^>])))*-->", "", strtr($template, $vars));
}

HTH,
Aleks

PS. Just a suggestion for the developers: How about adding this to the package? Preferreably  with the option to turn it on/off for debugging?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: HTML comments in theme.php
« Reply #4 on: August 12, 2004, 05:51:58 am »

that's not what I was suggesting. The comment markers are used by the coppermine theme engine internally. The dev team recommends commenting out links to items the users don't want to appear on their pages (e.g. menu items). Replacing things when the theme get's parsed will even lead to more confusion.

GauGau
Logged

aaalexxx

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: HTML comments in theme.php
« Reply #5 on: August 13, 2004, 02:27:24 pm »

Quote
Replacing things when the theme get's parsed will even lead to more confusion.
That's why I thought of making it optional, but you're probably right anyway ;D

Aleks.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.