template.php instead of template.html? template.php instead of 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

template.php instead of template.html?

Started by tactics, June 20, 2006, 10:42:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tactics

Hi folks,

This is my first experience with coppermine. I have a site done in php and I want my gallery to follow the same theme as the rest of my site. I duplicated one of the themes folders and renamed it. I can select it in the admin menu, and it shows up fine. Here's the problem...

I want to use a php file instead of an html file for the basis of my template. Reason is that I have a common header, footer, and navigation links in all my site pages. So my question is this:

Is it possible to use a template.php file instead of template.html as the basis for my theme? If so, where do I change the path?


Sami

No !
you can use theme.php for your coding
may be you want see the documentation first :
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#creating
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller


tactics

OK, I read the FAQ on the subject, but it doesn't really explain how to use a PHP file instead of an HTML file. I assumed (apparently incorrectly), that the way to do this was to:

1. paste all the code from your php page you want to use into the theme.php file for your selected template
2. copy all the code out of the template.html file and insert it into the theme.php file where you want the gallery to appear

When I do that, my theme.php code looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>UTILIKILTS : </title>
<style type="text/css" media="handheld, aural, braille, tv, print"><!--@import url("../../../global/css/mobile.css");--></style>
<style type="text/css" media="Screen, projector"><!--@import url("../../../global/css/global.css");--></style>
</head>

<body>

<!--Begin Outer Red Box-->
<div id="redBox">
<!--Begin Inner Container-->
<div id="container">

<!--Begin Header-->
<? include ("../../../global/boxes/header.txt"); ?>
<!--End Header-->

<!--Begin Side Navigation Bar-->
<? include ("../../../community/boxes/main.txt"); ?>
<!--End Side Navigation Bar-->

<!--Beginning of Content Area-->
<!--Maximum width of any item in content area is 550px including borders-->
<div id="content">
<h1>{GAL_NAME}</h1>
<table width="100%" border="0" cellpadding="20" cellspacing="20">
    <tr>
      <td valign="top" style="border: 1px solid #666666;background-color:#FFFFFF;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
              <a href="index.php"><img src="themes/uk/images/site_logo.png" border="0" alt="" /></a><br />
            </td>
            <td width="100%" align="center">
              <h3>{GAL_DESCRIPTION}</h3><br />
              {SYS_MENU} <br /> {SUB_MENU}
            </td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="center" valign="top">
              {LANGUAGE_SELECT_FLAGS}
            </td>
          </tr>
          <tr>
            <td align="center" valign="top">
              {THEME_SELECT_LIST}
              {LANGUAGE_SELECT_LIST}
            </td>
          </tr>
        </table>
        <img src="images/spacer.gif" width="1" height="15" alt="" />
        <br />
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="left" valign="top">
              {ADMIN_MENU}
              {GALLERY}
            </td>
          </tr>
        </table>
      </td>
    </tr>
</table>
</p>
</div>
<!--End of Content Area-->

<!--Begin Footer-->
<? include ("../../../global/boxes/footer.txt"); ?>
<!--End Footer-->

</div>
<!--End Inner Container-->
</div>
<!--End Outer Red Box-->

</body>
</html>

But here's how it looks in the browser:

http://216.69.130.253/gallery/index.php?cat=8

Sami

#4
- please use "#" button to enter code
- you can use header.php & footer.php
  add your custom style and your header includes to header.php (save it on gallery root folder) and your footer include to footer.php (save it on gallery root folder) and then goto:
admin mode=>config=>Themes settings =>Path to custom header include , and enter "header.php"
admin mode=>config=>Themes settings =>Path to custom footer include , and enter "footer.php"
- also if you want some coding between header and footer then you can use anycontent.php (it's on root of gallery folder)
and enable it by going :
admin mode=>config=>Themes settings =>Album list view=>The content of the main page , and adding "anycontent" to value
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

Quote from: tactics on June 20, 2006, 11:09:38 PM
OK, I read the FAQ on the subject, but it doesn't really explain how to use a PHP file instead of an HTML file.
It says you can't, doesn't it? Do as bmossavari suggested. You mustn't rename template.html to template.php, simply because Coppermine doesn't work that way!

tactics

Quote from: bmossavari on June 20, 2006, 11:22:53 PM
- please use "#" button to enter code
- you can use header.php & footer.php
  add your custom style and your header includes to header.php (save it on gallery root folder) and your footer include to footer.php (save it on gallery root folder) and then goto:
admin mode=>config=>Themes settings =>Path to custom header include , and enter "header.php"
admin mode=>config=>Themes settings =>Path to custom footer include , and enter "footer.php"
- also if you want some coding between header and footer then you can use anycontent.php (it's on root of gallery folder)
and enable it by going :
admin mode=>config=>Themes settings =>Album list view=>The content of the main page , and adding "anycontent" to value

Thanks for the detailed response. Unfortunately, I'm not sure this will work in my case. Reason is that all of my content (header, footer, and sidebar) are wrapped in a container div. To give you a visual idea of what I'm trying to accomplish, I posted this page:

http://216.69.130.253/community/gallery.php

So basically, coppermine just needs to be inserted into that white content box.

Joachim Müller

And what's the reason for wanting to have PHP inside template.html? Imo this could easily be accomplished by just creating a regular template.html file

tactics

Quote from: GauGau on June 21, 2006, 06:55:43 AM
And what's the reason for wanting to have PHP inside template.html? Imo this could easily be accomplished by just creating a regular template.html file

Yeah, it could. But the links in the header, footer, and sidebox are common throughout the site. Adding or changing them in one place reflects throughout the site. That's generally the point of using php or other dynamic content...

Sami

#9
I couldn't see your example (my isp block that ip!!!) but you can still use that method ,simply put your <div> tag on header
and </div> tag on footer
‍I don't answer to PM with support question
Please post your issue to related board

Gizmo

#10
First, you have a very nice site there!  ;D

Second, why couldn't you just put sonething like this between your Coppermine <div> tags?

  <div class="topmenu">
    <div align="right">{SYS_MENU}</div>
    <div align="center">{SUB_MENU}{ADMIN_MENU}</div>
  </div>

  <div>{GALLERY}</div>


You can do away with the {SYS_MENU} tag as long as you type in or bookmark your login.php address but leave the {ADMIN_MENU} as no one will see it unless logged in as an admin.

Third, check out CPMFetch mod here: http://forum.coppermine-gallery.net/index.php?board=57.0 as this may also offer you other avenues to put photos on your site.

Fourth, in your present layout, you haven't allowed enough width for Coppermine to display the intermediate photo. You will need to have a width of at least 600 pixels (and you have 550px allocated) or you'll need to do some heavy editing of the code.

Hope this helps,

Gizmo

[edit] To have your gallery directly in your page, it will have to reside within the Coppermine directory, hence CPMFetch may offer you some help here if this can't be the case.
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

tactics

Quote from: bmossavari on June 21, 2006, 10:32:35 AM
I couldn't see your example (my isp block that ip!!!) but you can still use that method ,simply put your <div> tag on header
and </div> tag on footer

It's strange that your isp would block that ip. It's just a dedicated ip that was assigned to the hosting account at godaddy until we can get the domain name transferred.

I did what you suggested and it worked great! If you can get on a machine where you can see how it looks the link is:

http://216.69.130.253/gallery/

I really appreciate all the help from you folks. And thanks for the compliment Gizmo :)