[Closed]: SSI - including site items in template.html [Closed]: SSI - including site items in template.html
 

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]

Main Menu

[Closed]: SSI - including site items in template.html

Started by Dodger57, January 09, 2010, 07:49:41 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Dodger57

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:

<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

<!--#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

Joachim Müller

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.

Quote from: Dodger57 on January 09, 2010, 07:49:41 AMI 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.

Dodger57

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!

Joachim Müller

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.

Dodger57

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.


phill104

#5
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.
It is a mistake to think you can solve any major problems just with potatoes.