User_ID type

D

Dao Trung Thanh

Guest
I have download DaDaBIK Module for PHP-Nuke 6.0 (http://www.uwatau.de) and installed it successfully in my website powered by PHP Nuke 6.0 running on Windows 2000.
I created a table in which there is a User_ID type field. I want the User_ID type field contains nuke registered username who created records. What can I do? I only see the Windows 2000 account name in this field. How can I hack in get_user() function in business_logic.php file?
 
R

Richard

Guest
I also tried without success.

Theoretically one would use:

foreign_key_field (the name of the table)--> e.g. "nuke_users.username"

and

db_primary_key_field (the name of the database that contains the table) --> e.g. phpnuke_db


I always separate the phpnuke database from the rest, so this is the only solution for me, but it does not work:-(

In fact if this would work, then one would use this as a precondition for somebody to submit data. S/he would have to select the 'user name' from the list of registered users.

I would be interested for a solution.

 
D

Dao Trung Thanh

Guest
I tried to modify get_user() function in general_function as following:
Fortunately, It works!

function get_user()

// goal: get the current user
// input: nothing
// output: $user

{
global $cookie;
if (isset($cookie[1]))
{
$username = $cookie[1];
}else
{
$username = "anonymous";
}
// $user = get_current_user();
return $username;
} // end function get_ID_user
 
L

lux

Guest
If you want to add ID_user when you update a table, add the following in the update function of business logic between any of the cases:

case "ID_user":
$sql .= "".$quote."".$fields_labels_ar[$i]["name_field"]."".$quote." = "; // add the field name to the sql statement
$sql .= "'".$user."', "; // add the field name to the sql statement
break;
 
Top