my gallery version: Coppermine Photo Gallery 1.6.09 (stable)
https://www.thefantasiesattic.net/attic/cpg/index.phpI have not needed to search by name in such a long time that I did not notice it missing. But as you can see from the image it is not listed anymore. Now I did get it to show up but the rest of the files that needed the code changed just made it not search and I got an error.
1. Open search.php
FIND:
$customs
$ip
and above, ADD:
<tr>
<td><input type="checkbox" name="owner_name" id="owner_name" class="checkbox" /><label for="owner_name" class="clickable_option">Owner name</label></td>
<td> </td>
</tr>
adding the above code made it appear in the list but no more the following is the rest of the code that was all for version 1.5.48 (I loved that version). I have not updated any farther since it took someone coming in to make it behave (mainly a hosting issue it much later came out).
2. Open thumbnails.php
FIND
$allowed = array('title', 'caption', 'keywords', 'filename', 'pic_raw_ip', 'pic_hdr_ip', 'user1', 'user2', 'user3', 'user4', 'type');
REPLACE WITH
$allowed = array('title', 'caption', 'keywords', 'filename', 'pic_raw_ip', 'pic_hdr_ip', 'user1', 'user2', 'user3', 'user4', 'type', 'owner_name');
3. Open include/search.inc.php
FIND
$allowed = array('title', 'caption', 'keywords', 'filename', 'pic_raw_ip', 'pic_hdr_ip', 'user1', 'user2', 'user3', 'user4');
ADD BELOW
global $cpg_udb;
// Use actual column name for search by owner name
if ($USER['search']['params']['owner_name']) {
$USER['search']['params'][$cpg_udb->field['username']] = true;
$allowed[] = $cpg_udb->field['username'];
}
FIND
$query = "SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} AS p
WHERE $sql
AND ($sort_order)";
REPLACE
$query = "SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} AS p
LEFT JOIN {$cpg_udb->usertable} AS u ON p.owner_id = u.{$cpg_udb->field['user_id']}
WHERE $sql
AND ($sort_order)";
FIND
$query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE " . $sql;
$temp = str_replace('SELECT *', 'SELECT COUNT(*)', $query);
REPLACE
$query = "SELECT p.*, u.{$cpg_udb->field['username']} AS owner_name FROM {$CONFIG['TABLE_PICTURES']} AS p
LEFT JOIN {$cpg_udb->usertable} AS u ON p.owner_id = u.{$cpg_udb->field['user_id']}
WHERE " . $sql;
$temp = str_replace("SELECT p.*, u.{$cpg_udb->field['username']} AS owner_name", 'SELECT COUNT(*)', $query);
Can someone please give me the proper code to allow the username to show and be searched for? It is bridged but will not let me return to bridging to reset the password or anything else since the upgrade. If an admin password is needed then let me know.