OK guys, here's what i did. I create a file, named it cpgtitler.php and put this inside.
<?php
$usr = "'s Gallery";
if($album==lastup) $ttrail="| Last Uploads";
elseif($album==lastcom) $ttrail="| Last Comments";
elseif($album==topn) $ttrail="| Top Viewed";
elseif($album==toprated) $ttrail="| Top Rated";
elseif($album==search) $ttrail="| Search Results";
elseif($album==random) $ttrail="| Random Picture";
if($file==thumbnails) { //filename thumbnail
if(is_numeric($album)) {
$sql = "SELECT title FROM cpg_albums WHERE aid='$album'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row[title];
$pagetitle = "| Gallery | View Album | $albumname";
} else { //meta album
if($cat) { //have category
if($cat<0) {
$sql = "SELECT title FROM cpg_albums WHERE aid='".(-$cat)."'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row[title];
} elseif($cat<10000) {
$sql = "SELECT namee FROM cpg_categories WHERE cid='$cat'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row[namee];
} else {
$sql = "SELECT username FROM ".$prefix."_users WHERE user_id='".($cat-10000)."'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row['username'];
$albumname = "$albumname$usr";
}
$pagetitle = "| Gallery | $albumname $ttrail";
} else { //no category
$pagetitle = "| Gallery $ttrail";
if($search) $pagetitle = "| Gallery $ttrail: $search";
}
} // end album selection
} elseif($file==displayimage) { //filename displayimage
if(is_numeric($album)) {
$sql = "SELECT title FROM cpg_albums WHERE aid='$album'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row[title];
if($slideshow) {
$pagetitle = "| Gallery | $albumname | Viewing Slideshow";
} else {
$pagetitle = "| Gallery | $albumname | Viewing Picture";
}
} else { //meta album
if($pos<0) {
$sql = "SELECT filename, title FROM cpg_pictures WHERE pid='".(-$pos)."'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$pictitle = $row[title];
$picfilename = $row[filename];
if(!$pictitle) {
$pagetitle = "| Gallery $ttrail | $picfilename";
} else {
$pagetitle = "| Gallery $ttrail | $pictitle";
}
} else { //positive pos
if($cat) {
if($cat<0) {
$sql = "SELECT title FROM cpg_albums WHERE aid='".(-$cat)."'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row[title];
$pagetitle = "| Gallery | $albumname $ttrail | Viewing Picture";
}
} else {
$pagetitle = "| Gallery $ttrail | Viewing Picture";
}
}
}
} elseif($file==search) {
$pagetitle = "| Gallery | Picture Search";
} elseif($file==upload) {
$pagetitle = "| Gallery | Picture Upload";
} else {
if($cat) { //have category
if($cat<0) {
$sql = "SELECT title FROM cpg_albums WHERE aid='".(-$cat)."'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row[title];
} elseif($cat<10000) {
$sql = "SELECT namee FROM cpg_categories WHERE cid='$cat'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row[namee];
} else {
$sql = "SELECT username FROM ".$prefix."_users WHERE user_id='".($cat-10000)."'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$albumname = $row['username'];
$albumname = "$albumname$usr";
}
$pagetitle = "| Gallery | $albumname $ttrail";
} else { //no category
$pagetitle = "| Picture Gallery";
}
}
?>
I upload it to my coppermine folder and then replace this line
$pagetitle = "- Coppermine";
with
include("modules/coppermine/cpgtitler.php");
inside some files such as index.php, upload.php, displayimage.php, search.php and thumbnails.php.
It works fine for me, but I think it needs lots of fixes and improvements.
For example the default/user sort prevented me to display the picture title/filename. My code can only display it if you click the image from the random page. I know the Dev. Team will solve this in a just a few seconds,.
So pleeeeeaaaase help me improve it and if possible put it in the future release. :oops:
Wow! I never thought my post could be this long. Sorry... :oops: