Gossamer Forum
Home : Products : DBMan : Customization :

Renaming Dir Names (and Force Add)

Quote Reply
Renaming Dir Names (and Force Add)
Hi, I've had my db_key as ID (with the counter), and I need to change it to Userid to do the "force add" mod. I have JPD's multifile upload mod installed, so I would have to change all the directory names (ID#s) to Userids. Does anyone have a converter that will do this (pull the Userid of each ID#, and rename the directory to the Userid) or can someone please come up with a script? After I clean my db a little, I should only have 1 ID to 1 Userid. Or maybe I can get the force add to work without changing the db_key. I've had a look at every thread about Force Adds, and have tried every bit of different code, and none seem to work without using Userid as the db_key. My current code is:

my ($status, @hits) = &query("view");
if ($status ne "ok") {
print "Location: $db_script_url?db=default&uid=$db_uid&add_form=1\n\n";

which works for some people who have already added and some who have not, but it seems like it does a partial match - so, if user "Jim" tries to add, it will think he already has a record because a "Jimmy" already has a record. Any ideas? At least this is what I *think* is happening. Thanks for your help.

Quote Reply
Re: Renaming Dir Names (and Force Add) In reply to



$in{'ww'} = 1;

and just to be sure that someone hasn't added the same username using different letter cases, add

$in{'cs'} = 1;

This is much easier than changing your database. Smile