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: Gallery2 PGTheme Port and Page Specific Content  (Read 3464 times)

0 Members and 1 Guest are viewing this topic.

dereksurfs

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 29
Gallery2 PGTheme Port and Page Specific Content
« on: November 25, 2006, 12:21:44 am »

Hello,

I decided to attempt a Gallery2 port of their popular PGTheme.

I would say that I am about 80% finished.  You can see it here:
http://www.lightquestphoto.com/coppermine/?theme=derek

And here is the G2 version:
http://www.lightquestphoto.com/gallery2

The one thing I am not sure about is how to make page specific content which only shows up on one page type (i.e- Album, Thumbnail, Photo).

For example on the index page I have a welcome message which I don't want on the thumbnail or image pages.  The majority of work I have done has been to the template.html file.  I also added a theme.php to remove certain content (i.e.- stats, etc...) as well as CSS changes.  Is there a way to flag part of the template.html to only display content on one page or is there a better way to achieve this?

Thanks,
Derek
« Last Edit: November 26, 2006, 10:06:36 am by GauGau »
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: Gallery2 PGTheme Port and Page Specific Content
« Reply #1 on: November 25, 2006, 04:17:12 am »

Search for and use the anycontent.php. This will show only on the main page.
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

dereksurfs

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 29
Re: Gallery2 PGTheme Port and Page Specific Content
« Reply #2 on: November 25, 2006, 05:10:30 pm »

Gizmo,

Thanks for the reply.  I tried using anycontent.php. But it seems too tighly coupled with {GALLERY} to do any custom formatting with it.  I want to place the text too the left of the albums in a seperated table column.  You can see it here:
http://www.lightquestphoto.com/coppermine/?theme=derek

But that tip did lead to other threads discussing custom headers and footers which seem more flexible in terms of layout.  I just have to figure out how to only display that content on the page I want (i.e.- only main, thumbnail or photo).  I also want thumbnail page content only.  A logic switch may be best.  Is that done from the code inside the custom header/footer itself?  Such as this possibly:
Code: [Select]
<?php
if ( $_GET['album']='0') {
    
place content here;
}
?>


or
Code: [Select]
<?php
if (defined('INDEX_PHP') ){
    
place content here;
}
?>


Thanks,
-Derek
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: Gallery2 PGTheme Port and Page Specific Content
« Reply #3 on: November 25, 2006, 09:13:37 pm »

If you want to have a really different main (or index) page, think about using cpmFetch - http://forum.coppermine-gallery.net/index.php?board=87.0. You can create a separate index page using standard HTML and then use cpmFetch to fetch the image on the right. It can also be random if you wish!

As for the code you submitted, did it work when you tested it?
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

dereksurfs

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 29
Re: Gallery2 PGTheme Port and Page Specific Content
« Reply #4 on: November 26, 2006, 04:28:13 am »

I figured out how to use page specific content with a custom header.  This is the code I use to differentiate pages:

Code: [Select]
<?php
if($_SERVER['PHP_SELF'] == 'index.php'){
?>

Welcome message...
<?php
} elseif($_SERVER['PHP_SELF'] == 'thumbnails.php'){
?>

This album is a collection of ...
<?php

?>


This has pretty cool flexibility.  I don't know its limits yet as I am still experimenting with my layout.  But it seems like one could put alot of custom code in here for various pages (i.e. - index, thumbnails, displayimage, etc...).  I think it would be good to have more than 2 of these custom areas in future releases(i.e. - header, footer).  That way you could strategically place a number of them in different parts of the template and turn them on and off based on the context.

- Derek

Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 20 queries.