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: [Closed]: SSI - including site items in template.html  (Read 3818 times)

0 Members and 1 Guest are viewing this topic.

Dodger57

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
[Closed]: SSI - including site items in template.html
« on: January 09, 2010, 07:49:41 am »

Hi all,

I just downloaded and installed cpg14x and everything went great~!  :D

For my custom theme I followed the instructions and copied an existing theme and modified it. I took one of my existing site pages and added the following where I wanted the gallery to appear:

Code: [Select]
<h1>{GAL_NAME}</h1>
      
      {SYS_MENU} <br /> {SUB_MENU}
      
      <div>
      
      {ADMIN_MENU}
      {GALLERY}

This works perfectly - and it looks just like my site.

Now the problem is this - since I can't rename the file to template.php I can't use my usual php includes to pull in the menus, footer ect... like I normally would. So I thought, since I already have Apache set to parse ssi as .html I would use the

Code: [Select]
<!--#include virtual=".../includes/rightcolumn.inc" -->
to bring them in. Funny thing tho - this is not working with the Coppermine themes. I tested it outside the theme directory and it works - but there is something preventing it from working within the theme system. Is this, in fact, the case here? The paths are correct, the server supports ssi and includes ... ???

Would someone be so kind as to explain how to get it working if possible? I can, if I have to, hard code the menus and what-not in but if possible would like to continue to use the global includes.

Thanks so much for any advise on this. :)

Dodge
« Last Edit: January 10, 2010, 09:26:58 pm by Phill Luckhurst »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: SSI - including site items in template.html
« Reply #1 on: January 10, 2010, 09:31:12 am »

You can't use SSI due to the nature of the template system. Use the custom header and footer feature instead to include your menus and navigation as outlined in the docs. You might also want to take a look at the more detailed section in the preliminary documentation about cpg1.5.x that applies to this feature as well.

I followed the instructions
Not really, no: read up Board rules / Forum policies: Post Links.

Joachim

P.S. Not related, but just a tip from someone who has been around on the PHP scene for long: never name your include "foobar.inc", as that will allow malevolent people to see your code. Instead, name your include "foobar.inc.php" to make sure that it get's parsed.
Logged

Dodger57

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: SSI - including site items in template.html
« Reply #2 on: January 10, 2010, 02:56:35 pm »

Hi - thanks for the reply.  :)

I did explore the custom header and footer feature - it's clumsy and requires that I create and maintain an addition instance of the standard menus, footer, etc.... in my particular case I might as well simply code the items in.

The whole template system seems rather clumsy, I mean this in the sense that php includes can't be used, I would love to see a more direct inject friendly system in the future? :)

I never direct source-unknown traffic to any of my sites unless absolutely necessary - in this case it was not necessary that you view my gallery - obviously you knew and addressed my issue without the visit. ;) Had this required a pair of eyes on the code it would have been different.

Thanks for the tip on the includes.

thanks again!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: SSI - including site items in template.html
« Reply #3 on: January 10, 2010, 06:08:40 pm »

The template system coppermine is using is loosely related to phpbb's template system: it was borrowed from phpBB when cpg1.0 was originally created. I agree that the overall template system would maybe be designed differently if coppermine would be designed from scratch today, but I doubt that allowing PHP includes would be an option if it was re-designed now. There is a reason why the template system was designed the way it is now, and we will discuss this with people who treat us with respect and who know their way around. And thanks for your nice words on clumisness and such, they go down well for developers, as do your personal thoughts on our board rules mean anything in this aspect. I'll give you another clue for possible future support calls on open source boards: it's not a bright idea to insult developers if you want them to look into your suggestions in the future. Usually, they are only human (the number of super-human beings among open source developers is over-estimated) and will do the opposite of what you're up to: they will not talk with you, nor will they bear your suggestions in mind when decisions are made in the design stage of an application. And BTW: SSI and PHP's include command are two different animals.
Logged

Dodger57

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: SSI - including site items in template.html
« Reply #4 on: January 10, 2010, 06:24:46 pm »

Oh good grief ... there is a difference between criticism and insulting comments - I suggest you learn that difference so that you don't come across so sensitive next time someone offers their honest opinion on something. Seriously. What was all that?

I believe that I have been respectfully polite in my question and comments but if you disagree I offer a sincere apology for the confusion. I think it is a fine gallery or I wouldn't be wasting my time with it. There are literally hundreds to choose from - I have shopped several dozens before deciding to give Coppermine a try. I am not displeased and only offered my opinion on the template system (clumsy is  a pretty mild adjective, if I were really contemptuous of the system I certainly could have come up with something with a little more bite!) - and I know understand more about it and can deal with it.

I understand the differences in the ssi and php includes. Was that an insult coming my way?  ;)

My aim was to suggest being able to inject include code into existing web template (php, html, whatever...) to pull the gallery functions into that page - instead of having to customize existing themes. That's all. :)

Thank you for your replies - have a good day.

 
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: SSI - including site items in template.html
« Reply #5 on: January 10, 2010, 09:26:47 pm »

You choice to ignore the board rules does tend to get our backs up. Due to a number of problems in the past and for various other reasons the Coppermine team have made the decision to require a link for anyone requesting support. A lot of water has gon under the bridge and decisions like this are not taken lightly. There are exceptions to this but in your case you were asked to supply a link, understood that request but chose to ignore it. That isn't the best way to act is it?


I'm closing this thread as I can only see it degrading from here.
« Last Edit: January 10, 2010, 09:38:35 pm by Phill Luckhurst »
Logged
It is a mistake to think you can solve any major problems just with potatoes.
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 21 queries.