coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Sonya* on December 11, 2007, 04:00:20 AM

Title: Accessing complete user data in theme.php
Post by: Sonya* on December 11, 2007, 04:00:20 AM
Hello,

I need the complete user data of logged user in my theme.php. So I tryed

global $USER_DATA

But it is not enough for me hence it only contains user_id and user_name:

Array
(
    [user_id] => 2
    [user_name] => test2
    [groups] => Array
        (
            [0] => 2
        )

    [disk_max] => 1024
    [disk_min] => 1024
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 0
    [ufc_min] => 0
    [custom_user_upload] => 0
    [num_file_upload] => 1
    [num_URI_upload] => 0
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 0
    [has_admin_access] => 0
    [pub_upl_need_approval] => 1
    [priv_upl_need_approval] => 0
    [group_name] => Registered
    [upload_form_config] => 0
    [group_quota] => 1024
    [can_see_all_albums] => 0
    [group_id] => 2
)


I also tryed to use global $USER without success.

And I tryed to load user from database in theme.php and get a blank page:

    $sql = "SELECT * " . "FROM {$CONFIG['TABLE_USERS']}, {$CONFIG['TABLE_USERGROUPS']} " . "WHERE user_group = group_id " . "AND user_id=".$USER_DATA['user_id'];
    $results = db_query($sql);
    if (mysql_num_rows($results)) {
        $test = mysql_fetch_array($results);
    }


I cannot figure out how I can get entire user info? It there perhaps a functions like cpg_get_user_infos() available in theme.php?

Thank you,
Sonya