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: template.php instead of template.html?  (Read 8276 times)

0 Members and 1 Guest are viewing this topic.

tactics

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
template.php instead of template.html?
« on: June 20, 2006, 10:42:14 pm »

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?

 
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: template.php instead of template.html?
« Reply #1 on: June 20, 2006, 10:53:38 pm »

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
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

tactics

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: template.php instead of template.html?
« Reply #3 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. 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
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: template.php instead of template.html?
« Reply #4 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
« Last Edit: June 20, 2006, 11:28:58 pm by bmossavari »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template.php instead of template.html?
« Reply #5 on: June 20, 2006, 11:25:32 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!
Logged

tactics

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: template.php instead of template.html?
« Reply #6 on: June 21, 2006, 02:08:21 am »

- 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: template.php instead of template.html?
« Reply #7 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
Logged

tactics

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: template.php instead of template.html?
« Reply #8 on: June 21, 2006, 08:46:01 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...
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: template.php instead of template.html?
« Reply #9 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
« Last Edit: June 21, 2006, 01:01:49 pm by bmossavari »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: template.php instead of template.html?
« Reply #10 on: June 21, 2006, 12:57:10 pm »

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

Second, why couldn't you just put sonething like this between your Coppermine <div> tags?
Code: [Select]
  <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.
« Last Edit: June 21, 2006, 01:07:28 pm by Gizmo »
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: template.php instead of template.html?
« Reply #11 on: June 21, 2006, 08:20:20 pm »

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 :)
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 20 queries.