coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: dustyb on April 23, 2004, 07:35:22 PM

Title: Custom Field - Album/Thumbnails Page
Post by: dustyb on April 23, 2004, 07:35:22 PM
I'm weak on PHP and the way that functions and template extracts work, so please forgive. I've integrated Coppermine with vBulletin and I'm just finishing off the links between each Forum and its Coppermine Photo Gallery and vice versa. I want to have a link in thumbnails.php that says somethign like "Back to the Forum" The problem is that the aid and the forum ids are different.

I figured I'd just add a field to the albums table, forumid, and then do a query like:

if (is_numeric($album)) {
   $result = db_query("SELECT forumid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='$album'");
   if (mysql_num_rows($result) > 0) {
       >>$CURRENT_ALBUM_FORUM = mysql_fetch_array($result);
       >>$forumurl = "http://linktoforum?forum=$CURRENT_ALBUM_FORUM['forumid']";
       >> Do something with $forumurl to make it available in themes.php
     }
   }

I guess I'd like to have it available in this section:

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

Can anybody point me in the right direction, where to stick the query and how to pass $forumurl up to the $template_thumb_view_title_row template? I might have a real general concept, but past that I'm kind of lost. Many, many thanks.

Dusty
Title: Re: Custom Field - Album/Thumbnails Page
Post by: Casper on April 23, 2004, 08:13:57 PM
Why don't you just add a html link in your theme/yourtheme/theme.php.  That will show on every page as it will be in the standard menu.
There is plenty of advice how to in the docs and on the boards.
Title: Re: Custom Field - Album/Thumbnails Page
Post by: dustyb on April 23, 2004, 08:39:53 PM
Hi Casper. No, it's not static. Each Coppermine album id is mapped to a vBulletin forum id and the two ids are not the same. That's why I figured I needed a field in albums to store that forum id, which is unique to each album.