Detailed changes that I would suggest - prefix each filepath with your cpg folder name.
All but one file are only one line changes.
include/init.inc.php
find:
define('FIRST_USER_CAT', 10000);
replace with:
define('FIRST_USER_CAT', 50000);
catmgr.php
(Other Dev's - not sure this needs to or should change... sets default pos in cpg_categories to 10000 - but tree rebuild is based on lft=0... Don't see what it would hurt changing... Please comment...)
find:
cpg_db_query("INSERT INTO {$CONFIG['TABLE_CATEGORIES']} (pos, parent, name, description) VALUES (10000, $parent, '$name', '$description')");
replace with:
cpg_db_query("INSERT INTO {$CONFIG['TABLE_CATEGORIES']} (pos, parent, name, description) VALUES (".FIRST_USER_CAT.", $parent, '$name', '$description')");
index.php
find:
$cat_owner_id = ($cat > 10000)?(10000 - $cat):(10001);
replace with:
$cat_owner_id = ($cat > FIRST_USER_CAT)?(FIRST_USER_CAT - $cat):(FIRST_USER_CAT + 1);
sidebar.php
find:
$sql = "SELECT DISTINCT user_id, user_name FROM {$CONFIG['TABLE_USERS']}, {$CONFIG['TABLE_ALBUMS']} WHERE 10000 + {$CONFIG['TABLE_USERS']}.user_id = {$CONFIG['TABLE_ALBUMS']}.category ORDER BY user_name ASC";
replace with:
$sql = "SELECT DISTINCT user_id, user_name FROM {$CONFIG['TABLE_USERS']}, {$CONFIG['TABLE_ALBUMS']} WHERE ".FIRST_USER_CAT." + {$CONFIG['TABLE_USERS']}.user_id = {$CONFIG['TABLE_ALBUMS']}.category ORDER BY user_name ASC";
bridge/udb_base.inc.php
find:
$sql = "SELECT category - 10000 AS user_id "
replace with:
$sql = "SELECT category - ".FIRST_USER_CAT." AS user_id "
(no semicolon as the SQL statement continues on next line...)
include/functions.inc.php
find:
function& cpg_get_system_thumb($filename, $user = 10001)
{
global $CONFIG;
// Correct user_id
if ($user < 10000) {
$user += 10000;
}
if ($user == 10000) {
$user = 10001;
}
replace with:
function& cpg_get_system_thumb($filename, $user = FIRST_USER_CAT)
{
global $CONFIG;
// Correct user_id
if ($user < FIRST_USER_CAT) {
$user += FIRST_USER_CAT;
}
if ($user == FIRST_USER_CAT) {
$user = FIRST_USER_CAT + 1;
}
('+ 1' not needed in function statement - second IF will add the one for us...)
plugins/usergal_alphatabs/codebase.php
find:
$sql = "SELECT category - 10000 as user_id ";
replace with:
$sql = "SELECT category - ".FIRST_USER_CAT." as user_id ";
(This one may look strange in your PHP editor as this is part of a parm to a PHP eval function...)
Run SQL (via phpMyAdmin or other tool):
* Change cpg_ to your defined cpg table prefix *
UPDATE `cpg_albums` SET `category` = `category` + '40000' WHERE `category` > '10000';
Disclaimer - I did not test this code... It may contain errors including typos - though I tried to catch them...
If this works - I would suggest inclusion in a future release... We should be using the defined constant and not hardcoding the 10000 value.
Edited to include change to function statement as found by kamad3 in reply 5... and reply 7