Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Accessing complete user data in theme.php  (Read 2406 times)

0 Members and 1 Guest are viewing this topic.

Sonya*

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Accessing complete user data in theme.php
« 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

Code: [Select]
global $USER_DATA
But it is not enough for me hence it only contains user_id and user_name:

Code: [Select]
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:

Code: [Select]
    $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
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.