Advanced search  

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

Pages: [1]   Go Down

Author Topic: customizing menus and php files  (Read 6011 times)

0 Members and 1 Guest are viewing this topic.

pcp20us

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
  • Go the open sources
    • noosaimages.com.au
customizing menus and php files
« on: December 02, 2006, 06:41:47 am »

Hi all

I am using the classic theme.

I am adding menu buttons in the theme.php file as described.
So i have the link, this points to a contact.php ( as example).
My question how do i format the php file with correct text layout, so heading and spacing, is this done in the contact.php file or in the style sheets.?? I think i am not understanding how these pages all intergrate to form you webpage ??

Thanks

Pete
« Last Edit: December 07, 2006, 06:37:49 am by GauGau »
Logged

pcp20us

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
  • Go the open sources
    • noosaimages.com.au
Re: customizing menus and php files
« Reply #1 on: December 02, 2006, 06:47:40 am »

Hi again. I have modified a existing php file and create dcontact.php file. I am not sure if i have done this correct or got the right code i need in this file, as i don't really understand php ?? and i did it a long time ago and have forgotton what i did

cheers
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: customizing menus and php files
« Reply #2 on: December 02, 2006, 07:10:51 am »

So you actually have the link right I guess - the thread's subject is a bit misleading. Your actual question seems to be "how can I create a custom page that matches the rest of my gallery's layout?". This is what you need:
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
pageheader('Your custom page title here');
?>

Your custom content (contact form or whatever) here. Can be HTML or PHP.
<?php
pagefooter
();
ob_end_flush();
?>

Save the file into the gallery root and you're done. Please reply if this is what you have been looking for.
Logged

pcp20us

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
  • Go the open sources
    • noosaimages.com.au
Re: customizing menus and php files
« Reply #3 on: December 02, 2006, 11:34:04 am »

Yep its was a bit miss leading. To many hours at the computer !!

Re the links: yes i do have the links working (for my own theme) ( i was just wonder how to do the custom links on a overall scale so it takes effect on all themes. I am just wanting to do it the correct way so when it comes to upgrading CPG in the future it will be easy.
This code you gave me is pretty similar to what i had.

 I suppose i am after how to  format the page with headings and to do layout, what is the best way. To do it with html or through style sheets. Cause currently it is just a blob of text on a page. I think it would be best to use the existing style sheet for that theme ( is this correct) though i am not to good on the style sheets. I was unaware you could use html in php, so that would be the easiest i guess.


Thank for the help
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: customizing menus and php files
« Reply #4 on: December 02, 2006, 01:47:58 pm »

Quote
I suppose i am after how to  format the page with headings and to do layout, what is the best way. To do it with html or through style sheets. Cause currently it is just a blob of text on a page. I think it would be best to use the existing style sheet for that theme ( is this correct) though i am not to good on the style sheets.

Using the method that GauGau gave you, whatever you replace "Your custom content (contact form or whatever) here. Can be HTML or PHP." with will be placed in the main body of your gallery. It will use the same header, footer and menus as your gallery. Best way to see it in action is to try it. Put some text in and set up the custom link according to the documentation - http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_theme. If you have multiple themes you want to use, it's best if you use css to style the custom page since any html styling will be used for all themes. Of course you'll need to make sure the css properties are present in all themes.
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

pcp20us

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
  • Go the open sources
    • noosaimages.com.au
Re: customizing menus and php files
« Reply #5 on: December 03, 2006, 01:27:09 am »

Morning

Ok
The link and menu i have working fine

I have modified the faq.php file in the classic theme to make my new pages. see services.php below. This works but the spacing etc is not correct. If i play in frontpage to get what i want then grap the html and put it in the php file t the page doesn't display ?


The test.php file is using the above php file, that gau gau gave me, but there is no ouline around the text.


I have played with these files but have not really got anywhere. I don't really understand css that well so i will stick with html for the present.


Cheers

Pete
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: customizing menus and php files
« Reply #6 on: December 03, 2006, 11:11:35 am »

If i play in frontpage to get what i want then grap the html and put it in the php file t the page doesn't display ?
Are you refering to the software "MS Frontpage"? Don't use it, it's crap. Use a plain text editor.

I have modified the faq.php file in the classic theme to make my new pages. see services.php below.
There's no such thing as a file named "faq" inside the classic theme. The faq apply for all themes. I hope that you haven't modified a core file that comes with Coppermine, but just worded this wrongly. You're not suppossed to edit existing links, but add your own ones.

I'm not sure what you did, but I think you're mixing up several issues.

Taking a quick glance at the content of your zip file I noticed that you aren't doing what we told you to do: test.php contains some print commands before the pageheader function call.
Do exactly as I suggested.

Looking at the file you posted it appears that you're using a very outdated version of coppermine. Upgrade!
Logged

pcp20us

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
  • Go the open sources
    • noosaimages.com.au
Re: customizing menus and php files
« Reply #7 on: December 03, 2006, 12:15:18 pm »

Yes i did modify the faq.php  as a template to  create my own pages in cpg1.3. though i am running 1.4.9.
I meant the faq.php file in the main root directory ( wrong wording on my part)

Attached is  my php file with your php code that u post for making a new php file.
 There is no box around the type so it doesn't quite fit with the classic theme. there seems to be someting missing as it just displays on a white background?? as an example if you visit my profile page it has your profile info in a box with a differnet coloured background.

I use fromt page to desgin in wysiwyg and then grap the HTML code and place this in to the the page, as i cannot code in html.



Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: customizing menus and php files
« Reply #8 on: December 04, 2006, 03:40:24 am »

Upgrade, it's mandatory.

Here's a sample of your file, with proper nesting and without the superfluous waste.
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
pageheader('Company Services');
starttable('100%','Company Services');
print <<< EOT
  <tr>
    <td class="tableb">
      <h3>Event Photography.</h3>
      <p>- Be it social corporate or sporting. We photography the event the people and catch the vibe. We can deliver a package for the event or display and sell photos at the event or via our website.</p>
      <h3>People Portraits</h3>
      <p>&nbsp;I shoot professional, individual and family portraits. Natural outdoors in beautiful Noosa.</p>
      <h3>Freelance </h3>
      <p>I am a freelance photographer. If you have any photographic needs please <a href="mailto:pcphoto@tpg.com.au">contact me.</a></p>
      <h3>Stock Images</h3>
      <p>Visit the stock image library for stock photo images. If you have a stock photo requirement please <a href="mailto:pcphoto@tpg.com.au">contact me.</a></p>
      <h3>Photograph Restoration</h3>
      <p>I restore old or damaged photographs and give you the digital file.</p>
    </td>
  </tr>
EOT;
endtable();
print 
'<br />&nbsp;<br />';
print 
'<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />';
pagefooter();

ob_end_flush();
?>
Logged

pcp20us

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
  • Go the open sources
    • noosaimages.com.au
Re: customizing menus and php files
« Reply #9 on: December 07, 2006, 02:54:30 am »

thanks very much for that. It will help me in builing my other pages in the correct manner. and a guilde to removing not needed html.

Thanks

Pete
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.