Cms_config_vars


Subject: 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.

Subject: 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.

Profile PM  
Subject: 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.

Subject: 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.

Subject: 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

Subject: 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.


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.2676s (PHP: 6% SQL: 94%)
SQL queries: 10 - Debug Off - GZIP Enabled