remove albums description from the index and add it to the album view? remove albums description from the index and add it to the album view?
 

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

remove albums description from the index and add it to the album view?

Started by oren99, April 30, 2007, 10:54:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

oren99

for every album i have a long description and i want it to show only when i view the actual album.
right now its the other way around: i can see the description in the index (the list of all albums) but when i click on an album the description is not showing.
i managed to remove the description from the index by removing the row: "<p>{ALB_DESC}</p>" from the template.
i cant find now how to add it to the album view.
can someone help please?
i'n using the tentacle template. my website is: http://www.show-car.net

thanks a lot

Gizmo

I've created a couple of themes that use a concatenated album description on the main category page and then use the full description when viewing the albums. You can check out this link to a demo theme to see what I mean - http://coppermine-gallery.net/demo/cpg14x/index.php?theme=chaoticsoul. Here's the link to the Chaoticsoul thread - http://forum.coppermine-gallery.net/index.php?topic=39753.0.

If you just want to have the description showing when viewing albums here are the instructions:

Add this line after the define section of your theme.php file
$album_desc = get_album_desc($_GET[album]);

Add {$album_desc} somewhere in $template_thumb_view_title_row such as:

// HTML template for title row of the thumbnail view (album title + sort options)
$template_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td width="100%" class="alblink"><h2>{ALBUM_NAME}</h2></td>

                        </tr>
                        <tr><td>
                        <p>{$album_desc}</p>
                        </td></tr>
                        </table>

EOT;


Now you will see the description under the album title.
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

oren99

thanks a lot!
only thing is i didnt understand where to add the first line. what is the define section?

Gizmo

In the Tentacle theme.php file after the below code. See where is says "define"?


  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.3
  $Source: /cvsroot/coppermine/stable/themes/fruity/theme.php,v $
  $Revision: 1.14 $
  $Author: gaugau $
  $Date: 2005/11/28 07:43:00 $
**********************************************/

// ------------------------------------------------------------------------- //
// The theme "Fruity" has been done by GauGau (http://gaugau.de/) based on   //
// the framed template of studicasa.nl (their website has gone down, so I    //
// guess no one will care). The usage of this theme is free for personal     //
// use, not for commercial use (according to the disclaimer of studiocasa)!  //
// ------------------------------------------------------------------------- //

define('THEME_HAS_RATING_GRAPHICS', 1);
define('THEME_HAS_NAVBAR_GRAPHICS', 1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);  // Remove this if you edit this template until
                                            // you have validated it. See docs/theme.htm.
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

oren99

i did it exactly as you said and my site stop working.
when i enter my site i got a white blank page.
when i removed this line the site was viewable again.

what do you think i should do?

Nibbler

You need to define get_album_desc() in theme.php


// Get the name of an album

function get_album_desc($aid)

{

    global $CONFIG;

    global $lang_errors;

    $result = cpg_db_query("SELECT description from {$CONFIG['TABLE_ALBUMS']} WHERE aid='$aid'");

    $count = mysql_num_rows($result);

    if ($count > 0) {

        $row = mysql_fetch_array($result);

        return $row['description'];

    } else {

        return "Album not found";

    }

}


Gizmo: You should cast $aid as an integer before you use it in the query for security.

$aid = (int) $aid;

oren99


Gizmo

Dang, sorry I forgot to add the function to the above post. Thanks for the input Nibbler, I'm still learning (and sometimes the hard way).
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