coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: sigepjedi on May 31, 2007, 09:19:05 PM

Title: Theme.php - insert html code ONLY for last lastcom
Post by: sigepjedi on May 31, 2007, 09:19:05 PM
Im trying to put some html code in which will ONLY be viewable on the lastcom segment. Looking through the sameple theme.php, there doesnt seem to be code for this section and this section only.

I also scoured the boards, unable to find this specific thing.

Thanks in advance!
Title: Re: Theme.php - insert html code ONLY for last lastcom
Post by: Joachim Müller on June 01, 2007, 08:02:12 AM
Doesn't reside in theme.php. You'll have to edit include/functions.inc.php to accomplish what you're up to.
Title: Re: Theme.php - insert html code ONLY for last lastcom
Post by: Sami on June 01, 2007, 08:16:04 AM
There is a simple way to do this by theme.php,
first check index.php line #821
you'll see how lastcom comes to life ;)

to achieve this you should mod theme_display_thumbnails function (copy & past it from sample theme.php to your theme.php) and add a new if statement for 'lastcom'
find this:

    if ($mode == 'thumb') {
         starttable('100%', $title, $thumbcols);


and change it to something like this

    if ($mode == 'thumb') {
         starttable('100%', $title, $thumbcols);     
         if($aid == 'lastcom'){//mod for custome html
              echo "<tr><td>your html code</td></tr>";//mod for custome html
          }//mod for custome html
       


Also you could try heredoc (http://us2.php.net/heredoc) for more complex html code
Hope this works for you
Title: Re: Theme.php - insert html code ONLY for last lastcom
Post by: sigepjedi on June 06, 2007, 03:59:31 PM
Quote from: GauGau on June 01, 2007, 08:02:12 AM
Doesn't reside in theme.php. You'll have to edit include/functions.inc.php to accomplish what you're up to.

hmmm, I thought best practices were to keep html out of such pages as functions.inc.php?
Is there a good spot perhapse, in theme.php, to place html above the output/display of the:

Quote
// Meta albums
switch($album){

created in functions.inc.php?