adding new page adding new page
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

adding new page

Started by stock, August 21, 2005, 01:34:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stock

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

Joachim Müller

Standalone pages that are meant to have the coppermine header, footer and navigation should look like this:
<?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

stock

thanks, Joachim.

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

Stock

Snitz

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?

Joachim Müller

Quote from: Snitz 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
yes
Quote from: Snitz on August 22, 2005, 06:51:52 PMand 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

jaed

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)

artistsinhawaii

#6
Quote from: jaed 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)

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();

?>
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

locked this thread, as it's a sticky that explains the general concept. For individual support questions related, start your own thread.