Typo3 Bridge for Frontend Users

Installation:
- Put "typo3.inc.php" into "bridge" folder, make executable
- Edit hardcoded paths in "typo3.inc.php" in lines 93 ff. or hide the Buttons by CSS

- Change the following in "bridge/udb_base_inc.php". 
  The naming convention in both cpg and typo3 use "pid", change to "p.pid" to disambiguate the queries.
  
Line 219:
       $sql = "SELECT {$f['user_id']} as user_id, {$f['username']} as user_name, {$f['email']} as user_email, {$f['regdate']} as user_regdate, {$f['lastvisi
               "COUNT(p.pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_name, group_quota ".
               "FROM {$this->usertable} AS u ".
               "INNER JOIN {$C['TABLE_USERGROUPS']} AS g ON u.{$f['usertbl_group_id']} = g.group_id ".
               "LEFT JOIN {$C['TABLE_PICTURES']} AS p ON p.owner_id = u.{$f['user_id']} ".
               $options['search'].
               "GROUP BY user_id " . "ORDER BY " . $sort_codes[$options['sort']] . " ".
               "LIMIT {$options['lower_limit']}, {$options['users_per_page']};";

Line 457:
                        $sql .= "COUNT(DISTINCT p.pid) as pic_count,"; // added p.
Line 458:    
                        $sql .= "MAX(p.pid) as thumb_pid, "; // added p.

Line 518:
$sql .= "COUNT(DISTINCT p.pid) as pic_count,";

Line 519:
$sql .= "MAX(p.pid) as thumb_pid, ";


- Add to "bridgemgr.php"

Line 544:

// POST groups are not implemented, log in/out, edit users via Typo3 components
$default_bridge_data['Typo3'] = array(
  'full_name' => 'typo3',
  'short_name' => 'typo3',
  'support_url' => 'http://www.typo3.org/',
  'full_forum_url_default' => 'http://localhost/typo3/',
  'full_forum_url_used' => 'mandatory,not_empty',
  'relative_path_to_config_file_default' => '../typo3conf/',
  'relative_path_to_config_file_used' => 'lookfor,localconf.php',
  'use_post_based_groups_default' => '0',
  'cookie_prefix_default' => 'fe_typo_user',
  'cookie_prefix_used' => 'cookie',

);

- Run Bridgemanager

Further Info:
- Typo3 db login ist taken from localconf.php
- Correct paths have to be set by yourself
- Some paths (login form, logout URI, admin group id) have to be hardcoded in typo3.inc.php
- BBS groups are not synchronized (no POST-based groups) (If you need this, adapt the code from mambo)

