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: adding new page  (Read 16950 times)

0 Members and 1 Guest are viewing this topic.

stock

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
adding new page
« on: August 21, 2005, 01:34:30 pm »

I'm about to enter a minefield by adding new pages to my site (About Us, etc). I know this has been done befoe and, coppermine devs, ,do move me on if so - I have searched. So sorry if I haven't done it properly.

Is it best to create these from an anycontent page then add the functionality in there or copy theme.php, rename and delete stuff?  I need to put in the header and footer and buttons and miss out the bits in between such as the albums, etc. In theory this sounds uncomplicated but then this is php and I'm only just learning!

Is this too big a subject without more knowledge for me to handle? Oneword of caution or advice (even just where you put a link so the page is picked up) would be much appreciated before I try this.

thanks
Stock
« Last Edit: August 26, 2005, 09:12:13 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: adding new page
« Reply #1 on: August 21, 2005, 02:00:11 pm »

Standalone pages that are meant to have the coppermine header, footer and navigation should look like this:
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
pageheader('Your page title goes here');
// your actual page content starts here
    
starttable("100%"'Content block title'1);
    
?>

    <tr>
    <td class="tableb" valign="top" align="center">
    Hello World
    </td>
    </tr>
    <?php
    endtable
();
// your actual page content ends here
pagefooter();
ob_end_flush();
?>
They will have to reside inside the coppermine folder, or the subsequent includes will fail to work. HTH

Joachim
Logged

stock

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
Re: adding new page
« Reply #2 on: August 21, 2005, 02:24:30 pm »

thanks, Joachim.

Succinct, helpful and the right answer as usual! This works perfectly. Thanks v much. You can call this sorted now.

Stock
Logged

Snitz

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: adding new page
« Reply #3 on: August 22, 2005, 06:51:52 pm »

so all I have to do is create a file let's say "music.php" put this code in it and customize my html and just upload it to the main directory and that's it?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: adding new page
« Reply #4 on: August 22, 2005, 07:06:51 pm »

so all I have to do is create a file let's say "music.php" put this code in it and customize my html
yes
and just upload it to the main directory
into to directory coppermine is installed in. If this is your webroot, then fine. If you have installed coppermine into a subfolder, then the file "music.php" would have to go into that folder as well.
Just give it a try, it's dead easy.

Joachim
Logged

jaed

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: adding new page
« Reply #5 on: November 21, 2005, 06:13:55 am »

But, what if I were trying to make a seperate table for different areas of the existing page.

When I try to use starttable and endtable to create two different maintables, the code following gets munted (ie the tables in the template)
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: adding new page
« Reply #6 on: November 21, 2005, 08:53:02 am »

But, what if I were trying to make a seperate table for different areas of the existing page.

When I try to use starttable and endtable to create two different maintables, the code following gets munted (ie the tables in the template)

What you could try is something like this (this is the only way I could make it sit right in all themes that come with coppermine):

Quote
<?php
define('IN_COPPERMINE', true);
define('INDEX_PHP', true);
require('include/init.inc.php');
pageheader('Your page title goes here');

// your actual page content starts here
starttable();
?>
<td width ="100%">
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
 <td align="center" valign="middle" class="tableb">
<?PHP
echo <<<EOT

        <table width="100%" align="center" valign="center" >
             <tr>
                    <td>
                             This is your first table. <br />
                             1<br />
                             2<br />
                             3<br />
                             4<br />
                    </td>
             </tr>
         </table>

EOT;
?>
 </td>
</table>
</td>
<?php
endtable();

starttable();
?>
<td width ="100%">
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
 <td align="center" valign="middle" class="tableb">
<?PHP
echo <<<EOT

        <table width="100%" align="center" valign="center" >
             <tr>
                    <td>
                             This is your second table. <br />
                             5<br />
                             6<br />
                             7<br />
                             8<br />
                    </td>
             </tr>
         </table>

EOT;
?>
 </td>
</table>
</td>
<?php
endtable();

// your actual page content ends here
pagefooter();
ob_end_flush();

?>
« Last Edit: November 21, 2005, 09:06:44 am by madeinhawaii »
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: adding new page
« Reply #7 on: November 21, 2005, 10:00:50 am »

locked this thread, as it's a sticky that explains the general concept. For individual support questions related, start your own thread.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 21 queries.