Icy Phoenix

     
 

Cms_config_vars

Cms_config_vars

Article
Reply with quote    Download Post  
Post Cms_config_vars 
 
Why does this function return nothing? if I change $authdb=$cms_config_vars['rs_config_adb'][$block_id]; to $authdb="auth"; it returns auth and works perfectly... except I want to be able to change that via cms block edit, instead of modifying the file every time. This code I have placed in usercp_register.php (I am trying to add username\pass\email to another database during registration. everything works perfectly if I hard code the database name, but I want it pulled from cms_config_vars)

Code: [Download] [Hide] [Select]
            function get_authdb($authdb)
            {
                global $cms_config_vars, $block_id;
                $authdb=$cms_config_vars['rs_config_adb'][$block_id];
                return $authdb;
            }


Thanks.



 
LordPsyan - View user's profile Send private message  
LordPsyan [ Tue 06 Jan, 2015 16:12 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


Cms_config_vars

Comments
Reply with quote    Download Post  
Post Re: Cms_config_vars 
 
I'd suggest you try

Code: [Download] [Hide]
  1. $cms_config_vars = get_cms_config(); 


instead. Maybe the variable hasn't been "loaded", and get_cms_config() will cache it anyhow.



 
Informpro - View user's profile Send private message  
Informpro [ Fri 09 Jan, 2015 12:41 ]
Reply with quote    Download Post  
Post Re: Cms_config_vars 
 
Informpro wrote: [View Post]
I'd suggest you try

Code: [Download] [Hide]
  1. $cms_config_vars = get_cms_config(); 


instead. Maybe the variable hasn't been "loaded", and get_cms_config() will cache it anyhow.


Thanks for the reply. I tried that both inside and outside of the function, and neither did anything.

It doesn't make sense. I used $cms_config_vars  in a block, and it worked fine.



 
LordPsyan - View user's profile Send private message  
LordPsyan [ Fri 09 Jan, 2015 22:49 ]
Reply with quote    Download Post  
Post Re: Cms_config_vars 
 
Hi,
I have created a specific function for bridging Icy Phoenix with any other software and being able to keep track of user data changed (such as email and password).

The function is in class_users.php:
Code: [Download] [Hide] [Select]
    /*
    * User profile update: this function is called when username, email and password are changed in a user profile
    */
    function profile_update($target_profile_data)
    {
        global $db, $config, $user, $lang;

        /*
        $target_profile_data = array(
            'user_id' => '',
            'username' => '',
            'password' => '',
            'email' => ''
        );
        */
        //print_r($target_profile_data);

        return true;
    }


The work is still incomplete, because I should have coded a hook where customized files could be hooked, but didn't do that so far... anyway the function is still a great helper, since it is connected to any crucial data change in a user profile.

Regarding your issue, try to print the var just to make sure that the var has been properly "globalized".

Try to add this somewhere print_r($cms_config_vars);


Alternatively pass the DB throug a $_POST var.



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Sat 10 Jan, 2015 09:17 ]
Reply with quote    Download Post  
Post Re: Cms_config_vars 
 
I figured out an easier way to do this. Was so simple. I just added a few lines to config.php and pulled it from there. Wow how simple. I modified the installer to add those lines during install, so everything is working. This solves MY problem, but does not solve the problem of pulling data from that database, and why it doesn't work. Thanks for all the advice



 
LordPsyan - View user's profile Send private message  
LordPsyan [ Sat 10 Jan, 2015 19:20 ]
Reply with quote    Download Post  
Post Re: Cms_config_vars 
 
Usually for this kind of setup I only use different tables prefix on the same DB, so I minimize the problems and the necessity to declare a brand new DB class to connect on the other DB.

I don't know how are you trying to connect, but make sure that the other DB is accessible and that the DB object is instantiated correctly.



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Wed 21 Jan, 2015 12:57 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 1
 
 




 


 

  cron