Custom Field - Album/Thumbnails Page Custom Field - Album/Thumbnails Page
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Custom Field - Album/Thumbnails Page

Started by dustyb, April 23, 2004, 07:35:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dustyb

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

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

dustyb

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.